Skip to content

start_product_subscription

start_product_subscription(
    username: str,
    identity_provider: IdentityProvider,
    product: str,
    *,
    config_overrides: Optional[LicenseManagerUserSubscriptionsClientConfig] = None,
    domain: Optional[str] = None,
    tags: Optional[Tags] = None,
) -> StartProductSubscriptionResponse

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

Your estimated bill for charges on the number of users and related costs will take 48 hours to appear for billing periods that haven't closed (marked as Pending billing status) in Amazon Web Services Billing. For more information, see Viewing your monthly charges in the Amazon Web Services Billing User Guide.

Parameters:

  • username (str) –

    The user name from the identity provider of the user.

  • identity_provider (IdentityProvider) –

    An object that specifies details for the identity provider.

  • product (str) –

    The name of the user-based subscription product.

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

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

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

  • tags (Optional[Tags], default: None ) –

    The tags that apply to the product subscription.

Raises:

Source code in docs_src/capo_license_manager_user_subscriptions/_services/license_manager_user_subscriptions.py
def start_product_subscription(
    self,
    username: str,
    identity_provider: "capo_license_manager_user_subscriptions.types.identity_provider.IdentityProvider",
    product: str,
    *,
    config_overrides: Optional[LicenseManagerUserSubscriptionsClientConfig] = None,
    domain: Optional[str] = None,
    tags: Optional[
        "capo_license_manager_user_subscriptions.types.tags.Tags"
    ] = None,
) -> "capo_license_manager_user_subscriptions.types.start_product_subscription_response.StartProductSubscriptionResponse":
    """<p>Starts a product subscription for a user with the specified identity provider.</p> <note> <p>Your estimated bill for charges on the number of users and related costs will take 48 hours to appear for billing periods that haven't closed (marked as <b>Pending</b> billing status) in Amazon Web Services Billing. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/invoice.html">Viewing your monthly charges</a> in the <i>Amazon Web Services Billing User Guide</i>.</p> </note>

    Args:
        username: <p>The user name from the identity provider of 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>
        domain: <p>The domain name of the Active Directory that contains the user for whom to start the product subscription.</p>
        tags: <p>The tags that apply to 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.
    """

    def _handler(
        req: "OperationRequest[capo_license_manager_user_subscriptions.types.start_product_subscription_request.StartProductSubscriptionRequest]",
    ) -> OperationResponse[
        "capo_license_manager_user_subscriptions.types.start_product_subscription_response.StartProductSubscriptionResponse"
    ]:
        import capo_license_manager_user_subscriptions._operations.license_manager_user_subscriptions.start_product_subscription

        output, http_response = (
            capo_license_manager_user_subscriptions._operations.license_manager_user_subscriptions.start_product_subscription.start_product_subscription(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_license_manager_user_subscriptions.types.start_product_subscription_request.StartProductSubscriptionRequest",
    ) -> dict[str, Any]:
        import capo_license_manager_user_subscriptions.types.start_product_subscription_request

        return capo_license_manager_user_subscriptions.types.start_product_subscription_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("StartProductSubscription", redact_input=_redact_input),
    )
    input_: capo_license_manager_user_subscriptions.types.start_product_subscription_request.StartProductSubscriptionRequest = {
        "username": username,
        "identity_provider": identity_provider,
        "product": product,
    }
    if domain is not None:
        input_["domain"] = domain
    if tags is not None:
        input_["tags"] = tags

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output