UpdateServiceChargePlanV2 module
- class q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2.ParamsObj(logger, hq_credentials, service_charge_plan_edit=None)[source]
Bases:
BackOfficeAuthenticatedParamsObjParameters definition for UpdateServiceChargePlanV2
See also
UpdateServiceChargePlanV2_modelsfor DataSet schemas and builder functions.- Parameters:
logger (
TypeAliasType) – Reference to calling request’s logger (self.logger in your extension)service_charge_plan_edit (
Optional[DataSetBuilder]) – DataSetBuilder instancehq_credentials (
BackOfficeHqCredentials) – Defaults to settings.HQ_CREDENTIALS
- async q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2.execute(params_obj, use_json=True, **kwargs)[source]
This is the default way to submit the request to HQ.
This endpoint uses DataSet parameters and defaults to the JSON (.ashx) transport. SOAP (.asmx) is not supported for DataSet serialization.
- Parameters:
params_obj (
ParamsObj) – Object containing everything necessary to call this HQ endpointuse_json – If True, will call HQ’s .ashx (json) endpoint instead of .asmx (soap)
- Return type:
- async q2_sdk.hq.hq_api.backoffice.UpdateServiceChargePlanV2.fetch_current(logger, hq_credentials, service_charge_plan_id)[source]
Fetch current state from GetServiceChargePlanV2 for optimistic concurrency.
Calls the GET operation and parses the response into typed model instances with
original_recordpre-populated. Modify the returned instances and pass them to the correspondingbuild_*_dataset()function.Workflow:
# 1. Fetch current state (pre-populates original_record on each instance) current = await UpdateServiceChargePlanV2.fetch_current(logger, hq_creds, ...) # 2. Modify the returned dataclass instances instance = current["ModelClassName"][0] instance.some_field = new_value # 3. Build dataset and execute (original_record produces the Unchanged row) dataset = build_*_dataset(instance) params = UpdateServiceChargePlanV2.ParamsObj(logger, hq_creds, param=dataset) await UpdateServiceChargePlanV2.execute(params)
See also
- Parameters:
logger (
TypeAliasType) – Calling request’s logger (self.logger in your extension)hq_credentials (
BackOfficeHqCredentials) – HQ credentials for the BackOffice sessionservice_charge_plan_id (
int) – Entity identifier for the GET call
- Return type:
- Returns:
Dict mapping model class names to lists of populated instances
- Raises:
RuntimeError – If the GET operation fails or returns no data