createRelationship method

Future<CreateRelationshipResponse> createRelationship({
  1. required String associatedAccountId,
  2. required AssociationType associationType,
  3. required String catalog,
  4. required String displayName,
  5. required String programManagementAccountIdentifier,
  6. required Sector sector,
  7. String? clientToken,
  8. SupportPlan? requestedSupportPlan,
  9. ResaleAccountModel? resaleAccountModel,
  10. List<Tag>? tags,
})

Creates a new partner relationship between accounts.

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

Parameter associatedAccountId : The AWS account ID to associate in this relationship.

Parameter associationType : The type of association for the relationship (e.g., reseller, distributor).

Parameter catalog : The catalog identifier for the relationship.

Parameter displayName : A human-readable name for the relationship.

Parameter programManagementAccountIdentifier : The identifier of the program management account for this relationship.

Parameter sector : The business sector for the relationship.

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

Parameter requestedSupportPlan : The support plan requested for this relationship.

Parameter resaleAccountModel : The resale account model for the relationship.

Parameter tags : Key-value pairs to associate with the relationship.

Implementation

Future<CreateRelationshipResponse> createRelationship({
  required String associatedAccountId,
  required AssociationType associationType,
  required String catalog,
  required String displayName,
  required String programManagementAccountIdentifier,
  required Sector sector,
  String? clientToken,
  SupportPlan? requestedSupportPlan,
  ResaleAccountModel? resaleAccountModel,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PartnerCentralChannel.CreateRelationship'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'associatedAccountId': associatedAccountId,
      'associationType': associationType.value,
      'catalog': catalog,
      'displayName': displayName,
      'programManagementAccountIdentifier':
          programManagementAccountIdentifier,
      'sector': sector.value,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
      if (requestedSupportPlan != null)
        'requestedSupportPlan': requestedSupportPlan,
      if (resaleAccountModel != null)
        'resaleAccountModel': resaleAccountModel.value,
      if (tags != null) 'tags': tags,
    },
  );

  return CreateRelationshipResponse.fromJson(jsonResponse.body);
}