createPartner method

Future<CreatePartnerResponse> createPartner({
  1. required AllianceLeadContact allianceLeadContact,
  2. required String catalog,
  3. required String emailVerificationCode,
  4. required String legalName,
  5. required PrimarySolutionType primarySolutionType,
  6. String? clientToken,
  7. List<Tag>? tags,
})

Creates a new partner account in the AWS Partner Network with the specified details and configuration.

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

Parameter allianceLeadContact : The primary contact person for alliance and partnership matters.

Parameter catalog : The catalog identifier where the partner account will be created.

Parameter emailVerificationCode : The verification code sent to the alliance lead contact's email to confirm account creation.

Parameter legalName : The legal name of the organization becoming a partner.

Parameter primarySolutionType : The primary type of solution or service the partner provides (e.g., consulting, software, managed services).

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

Parameter tags : A list of tags to associate with the partner account for organization and billing purposes.

Implementation

Future<CreatePartnerResponse> createPartner({
  required AllianceLeadContact allianceLeadContact,
  required String catalog,
  required String emailVerificationCode,
  required String legalName,
  required PrimarySolutionType primarySolutionType,
  String? clientToken,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralAccount.CreatePartner'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AllianceLeadContact': allianceLeadContact,
      'Catalog': catalog,
      'EmailVerificationCode': emailVerificationCode,
      'LegalName': legalName,
      'PrimarySolutionType': primarySolutionType.value,
      'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (tags != null) 'Tags': tags,
    },
  );

  return CreatePartnerResponse.fromJson(jsonResponse.body);
}