createAccountAssociation method

Future<CreateAccountAssociationResponse> createAccountAssociation({
  1. required String connectorDestinationId,
  2. String? clientToken,
  3. String? description,
  4. GeneralAuthorizationName? generalAuthorization,
  5. String? name,
  6. Map<String, String>? tags,
})

Creates a new account association via the destination id.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw UnauthorizedException. May throw ValidationException.

Parameter connectorDestinationId : The identifier of the connector destination.

Parameter clientToken : An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.

Parameter description : A description of the account association request.

Parameter generalAuthorization : The General Authorization reference by authorization material name.

Parameter name : The name of the destination for the new account association.

Parameter tags : A set of key/value pairs that are used to manage the account association.

Implementation

Future<CreateAccountAssociationResponse> createAccountAssociation({
  required String connectorDestinationId,
  String? clientToken,
  String? description,
  GeneralAuthorizationName? generalAuthorization,
  String? name,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'ConnectorDestinationId': connectorDestinationId,
    'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'Description': description,
    if (generalAuthorization != null)
      'GeneralAuthorization': generalAuthorization,
    if (name != null) 'Name': name,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/account-associations',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAccountAssociationResponse.fromJson(response);
}