Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def execute(cls, client: GraphqlClient, input: AddCustomerInput) -> AddCustomerMutationData.Customer:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddCustomerMutation", variables, network_time, decode_time)
return res.addCustomer
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddCustomerMutation",
variables,
)
def execute(cls, client: GraphqlClient, input: AddEquipmentPortTypeInput) -> AddEquipmentPortTypeMutationData.EquipmentPortType:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddEquipmentPortTypeMutation", variables, network_time, decode_time)
return res.addEquipmentPortType
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddEquipmentPortTypeMutation",
variables,
)
def execute(cls, client: GraphqlClient, entityType: ImageEntity, entityId: str, id: str) -> DeleteImageMutationData.File:
# fmt: off
variables: Dict[str, Any] = {"entityType": entityType, "entityId": entityId, "id": id}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("DeleteImageMutation", variables, network_time, decode_time)
return res.deleteImage
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"DeleteImageMutation",
variables,
)
def execute(cls, client: GraphqlClient, input: ServiceTypeEditData) -> EditServiceTypeMutationData.ServiceType:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("EditServiceTypeMutation", variables, network_time, decode_time)
return res.editServiceType
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"EditServiceTypeMutation",
variables,
)
def execute(cls, client: GraphqlClient, input: AddLocationTypeInput) -> AddLocationTypeMutationData.LocationType:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddLocationTypeMutation", variables, network_time, decode_time)
return res.addLocationType
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddLocationTypeMutation",
variables,
)
def execute(cls, client: GraphqlClient) -> Optional[LocationTypesQueryData.LocationTypeConnection]:
# fmt: off
variables: Dict[str, Any] = {}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("LocationTypesQuery", variables, network_time, decode_time)
return res.locationTypes
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"LocationTypesQuery",
variables,
)
def execute(cls, client: GraphqlClient, data: ServiceCreateData) -> AddServiceMutationData.Service:
# fmt: off
variables: Dict[str, Any] = {"data": data}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddServiceMutation", variables, network_time, decode_time)
return res.addService
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddServiceMutation",
variables,
)
def execute(cls, client: GraphqlClient, input: AddServiceEndpointInput) -> AddServiceEndpointMutationData.Service:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddServiceEndpointMutation", variables, network_time, decode_time)
return res.addServiceEndpoint
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddServiceEndpointMutation",
variables,
)
def execute(cls, client: GraphqlClient, after: Optional[str] = None, first: Optional[int] = None) -> Optional[GetLocationsQueryData.LocationConnection]:
# fmt: off
variables: Dict[str, Any] = {"after": after, "first": first}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("GetLocationsQuery", variables, network_time, decode_time)
return res.locations
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"GetLocationsQuery",
variables,
)
def execute(cls, client: GraphqlClient, input: AddWorkOrderInput) -> AddWorkOrderMutationData.WorkOrder:
# fmt: off
variables: Dict[str, Any] = {"input": input}
try:
network_start = perf_counter()
response_text = client.call(''.join(set(QUERY)), variables=variables)
decode_start = perf_counter()
res = cls.from_json(response_text).data
decode_time = perf_counter() - decode_start
network_time = decode_start - network_start
client.reporter.log_successful_operation("AddWorkOrderMutation", variables, network_time, decode_time)
return res.addWorkOrder
except OperationException as e:
raise FailedOperationException(
client.reporter,
e.err_msg,
e.err_id,
"AddWorkOrderMutation",
variables,
)