createProgramManagementAccount method

Future<CreateProgramManagementAccountResponse> createProgramManagementAccount({
  1. required String accountId,
  2. required String catalog,
  3. required String displayName,
  4. required Program program,
  5. String? clientToken,
  6. List<Tag>? tags,
})

Creates a new program management account for managing partner relationships.

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

Parameter accountId : The AWS account ID to associate with the program management account.

Parameter catalog : The catalog identifier for the program management account.

Parameter displayName : A human-readable name for the program management account.

Parameter program : The program type for the management account.

Parameter clientToken : A unique, case-sensitive identifier to ensure idempotency of the request.

Parameter tags : Key-value pairs to associate with the program management account.

Implementation

Future<CreateProgramManagementAccountResponse>
    createProgramManagementAccount({
  required String accountId,
  required String catalog,
  required String displayName,
  required Program program,
  String? clientToken,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralChannel.CreateProgramManagementAccount'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'accountId': accountId,
      'catalog': catalog,
      'displayName': displayName,
      'program': program.value,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (tags != null) 'tags': tags,
    },
  );

  return CreateProgramManagementAccountResponse.fromJson(jsonResponse.body);
}