startProductSubscription method

Future<StartProductSubscriptionResponse> startProductSubscription({
  1. required IdentityProvider identityProvider,
  2. required String product,
  3. required String username,
  4. String? domain,
  5. Map<String, String>? tags,
})

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

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter identityProvider : An object that specifies details for the identity provider.

Parameter product : The name of the user-based subscription product.

Valid values: VISUAL_STUDIO_ENTERPRISE | VISUAL_STUDIO_PROFESSIONAL | OFFICE_PROFESSIONAL_PLUS | REMOTE_DESKTOP_SERVICES

Parameter username : The user name from the identity provider of the user.

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

Parameter tags : The tags that apply to the product subscription.

Implementation

Future<StartProductSubscriptionResponse> startProductSubscription({
  required IdentityProvider identityProvider,
  required String product,
  required String username,
  String? domain,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'IdentityProvider': identityProvider,
    'Product': product,
    'Username': username,
    if (domain != null) 'Domain': domain,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/user/StartProductSubscription',
    exceptionFnMap: _exceptionFns,
  );
  return StartProductSubscriptionResponse.fromJson(response);
}