Activates a Subscription to enable billing for a user.
Parameters:
-
domain_id
(DomainId)
–
The unique identifier of the parent Domain.
-
subscription_id
(SubscriptionId)
–
The unique identifier of the Subscription.
Raises:
Source code in docs_src/capo_connecthealth/_services/connect_health.py
| def activate_subscription(
self,
domain_id: "capo_connecthealth.types.domain_id.DomainId",
subscription_id: "capo_connecthealth.types.subscription_id.SubscriptionId",
*,
config_overrides: Optional[ConnectHealthClientConfig] = None,
) -> "capo_connecthealth.types.activate_subscription_output.ActivateSubscriptionOutput":
"""<p>Activates a Subscription to enable billing for a user.</p>
Args:
domain_id: <p>The unique identifier of the parent Domain.</p>
subscription_id: <p>The unique identifier of the Subscription.</p>
Raises:
capo_connecthealth.errors.access_denied_exception.AccessDeniedException: <p>This error is thrown when the client does not supply proper credentials to the API.</p>
capo_connecthealth.errors.internal_server_exception.InternalServerException: <p>This error is thrown when a transient error causes our API to fail.</p>
capo_connecthealth.errors.resource_not_found_exception.ResourceNotFoundException: <p>This error is thrown when the requested resource is not found.</p>
capo_connecthealth.errors.validation_exception.ValidationException: <p>This error is thrown when the client supplies invalid input to the API.</p>
capo_connecthealth.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_connecthealth.types.activate_subscription_input.ActivateSubscriptionInput]",
) -> OperationResponse[
"capo_connecthealth.types.activate_subscription_output.ActivateSubscriptionOutput"
]:
import capo_connecthealth._operations.connect_health.activate_subscription
output, http_response = (
capo_connecthealth._operations.connect_health.activate_subscription.activate_subscription(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ActivateSubscription")
)
input_: capo_connecthealth.types.activate_subscription_input.ActivateSubscriptionInput = {
"domain_id": domain_id,
"subscription_id": subscription_id,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|