listPartnerships method

Future<ListPartnershipsResponse> listPartnerships({
  1. int? maxResults,
  2. String? nextToken,
  3. String? profileId,
})

Lists the partnerships associated with your Amazon Web Services account for your current or specified region. A partnership represents the connection between you and your trading partner. It ties together a profile and one or more trading capabilities.

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

Parameter maxResults : Specifies the maximum number of capabilities to return.

Parameter nextToken : When additional results are obtained from the command, a NextToken parameter is returned in the output. You can then pass the NextToken parameter in a subsequent command to continue listing additional resources.

Parameter profileId : Specifies the unique, system-generated identifier for the profile connected to this partnership.

Implementation

Future<ListPartnershipsResponse> listPartnerships({
  int? maxResults,
  String? nextToken,
  String? profileId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'B2BI.ListPartnerships'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
      if (profileId != null) 'profileId': profileId,
    },
  );

  return ListPartnershipsResponse.fromJson(jsonResponse.body);
}