associateWebsiteAuthorizationProvider method

Future<AssociateWebsiteAuthorizationProviderResponse> associateWebsiteAuthorizationProvider({
  1. required AuthorizationProviderType authorizationProviderType,
  2. required String fleetArn,
  3. String? domainName,
})

Associates a website authorization provider with a specified fleet. This is used to authorize users against associated websites in the company network.

May throw UnauthorizedException. May throw InternalServerErrorException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ResourceAlreadyExistsException. May throw TooManyRequestsException.

Parameter authorizationProviderType : The authorization provider type.

Parameter fleetArn : The ARN of the fleet.

Parameter domainName : The domain name of the authorization provider. This applies only to SAML-based authorization providers.

Implementation

Future<AssociateWebsiteAuthorizationProviderResponse>
    associateWebsiteAuthorizationProvider({
  required AuthorizationProviderType authorizationProviderType,
  required String fleetArn,
  String? domainName,
}) async {
  ArgumentError.checkNotNull(
      authorizationProviderType, 'authorizationProviderType');
  ArgumentError.checkNotNull(fleetArn, 'fleetArn');
  _s.validateStringLength(
    'fleetArn',
    fleetArn,
    20,
    2048,
    isRequired: true,
  );
  _s.validateStringLength(
    'domainName',
    domainName,
    1,
    253,
  );
  final $payload = <String, dynamic>{
    'AuthorizationProviderType': authorizationProviderType.toValue(),
    'FleetArn': fleetArn,
    if (domainName != null) 'DomainName': domainName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/associateWebsiteAuthorizationProvider',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateWebsiteAuthorizationProviderResponse.fromJson(response);
}