Skip to content

stop_product_subscription async

stop_product_subscription(
    *,
    config_overrides: Optional[AsyncLicenseManagerUserSubscriptionsClientConfig] = None,
    username: Optional[str] = None,
    identity_provider: Optional[IdentityProvider] = None,
    product: Optional[str] = None,
    product_user_arn: Optional[Arn] = None,
    domain: Optional[str] = None,
) -> StopProductSubscriptionResponse

Stops a product subscription for a user with the specified identity provider.

Parameters:

  • username (Optional[str], default: None ) –

    The user name from the identity provider for the user.

  • identity_provider (Optional[IdentityProvider], default: None ) –

    An object that specifies details for the identity provider.

  • product (Optional[str], default: None ) –

    The name of the user-based subscription product.

    Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS | OFFICE_STANDARD | REMOTE_DESKTOP_SERVICES

  • product_user_arn (Optional[Arn], default: None ) –

    The Amazon Resource Name (ARN) of the product user.

  • domain (Optional[str], default: None ) –

    The domain name of the Active Directory that contains the user for whom to stop the product subscription.

Raises:

Source code in docs_src/capo_license_manager_user_subscriptions/_services/async_license_manager_user_subscriptions.py
async def stop_product_subscription(
    self,
    *,
    config_overrides: Optional[
        AsyncLicenseManagerUserSubscriptionsClientConfig
    ] = None,
    username: Optional[str] = None,
    identity_provider: Optional[
        "capo_license_manager_user_subscriptions.types.identity_provider.IdentityProvider"
    ] = None,
    product: Optional[str] = None,
    product_user_arn: Optional[
        "capo_license_manager_user_subscriptions.types.arn.Arn"
    ] = None,
    domain: Optional[str] = None,
) -> "capo_license_manager_user_subscriptions.types.stop_product_subscription_response.StopProductSubscriptionResponse":
    """<p>Stops a product subscription for a user with the specified identity provider.</p>

    Args:
        username: <p>The user name from the identity provider for the user.</p>
        identity_provider: <p>An object that specifies details for the identity provider.</p>
        product: <p>The name of the user-based subscription product.</p> <p>Valid values: <code>VISUAL_STUDIO_ENTERPRISE</code> | <code>VISUAL_STUDIO_PROFESSIONAL</code> | <code>OFFICE_PROFESSIONAL_PLUS</code> | <code>OFFICE_STANDARD</code> | <code>REMOTE_DESKTOP_SERVICES</code> </p>
        product_user_arn: <p>The Amazon Resource Name (ARN) of the product user.</p>
        domain: <p>The domain name of the Active Directory that contains the user for whom to stop the product subscription.</p>

    Raises:
        capo_license_manager_user_subscriptions.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient access to perform this action.</p>
        capo_license_manager_user_subscriptions.errors.conflict_exception.ConflictException: <p>The request couldn't be completed because it conflicted with the current state of the resource.</p>
        capo_license_manager_user_subscriptions.errors.internal_server_exception.InternalServerException: <p>An exception occurred with the service.</p>
        capo_license_manager_user_subscriptions.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource couldn't be found.</p>
        capo_license_manager_user_subscriptions.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request failed because a service quota is exceeded.</p>
        capo_license_manager_user_subscriptions.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling. Retry the request.</p>
        capo_license_manager_user_subscriptions.errors.validation_exception.ValidationException: <p>A parameter is not valid.</p>
        capo_license_manager_user_subscriptions.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_license_manager_user_subscriptions.types.stop_product_subscription_request.StopProductSubscriptionRequest]",
    ) -> AsyncOperationResponse[
        "capo_license_manager_user_subscriptions.types.stop_product_subscription_response.StopProductSubscriptionResponse"
    ]:
        import capo_license_manager_user_subscriptions._operations.license_manager_user_subscriptions.stop_product_subscription

        (
            output,
            http_response,
        ) = await capo_license_manager_user_subscriptions._operations.license_manager_user_subscriptions.stop_product_subscription.async_stop_product_subscription(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopProductSubscription")
    )
    input_: capo_license_manager_user_subscriptions.types.stop_product_subscription_request.StopProductSubscriptionRequest = {}
    if username is not None:
        input_["username"] = username
    if identity_provider is not None:
        input_["identity_provider"] = identity_provider
    if product is not None:
        input_["product"] = product
    if product_user_arn is not None:
        input_["product_user_arn"] = product_user_arn
    if domain is not None:
        input_["domain"] = domain

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output