updateCapability method

Future<UpdateCapabilityResponse> updateCapability({
  1. required String capabilityId,
  2. CapabilityConfiguration? configuration,
  3. List<S3Location>? instructionsDocuments,
  4. String? name,
})

Updates some of the parameters for a capability, based on the specified parameters. A trading capability contains the information required to transform incoming EDI documents into JSON or XML outputs.

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

Parameter capabilityId : Specifies a system-assigned unique identifier for the capability.

Parameter configuration : Specifies a structure that contains the details for a capability.

Parameter instructionsDocuments : Specifies one or more locations in Amazon S3, each specifying an EDI document that can be used with this capability. Each item contains the name of the bucket and the key, to identify the document's location.

Parameter name : Specifies a new name for the capability, to replace the existing name.

Implementation

Future<UpdateCapabilityResponse> updateCapability({
  required String capabilityId,
  CapabilityConfiguration? configuration,
  List<S3Location>? instructionsDocuments,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'B2BI.UpdateCapability'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'capabilityId': capabilityId,
      if (configuration != null) 'configuration': configuration,
      if (instructionsDocuments != null)
        'instructionsDocuments': instructionsDocuments,
      if (name != null) 'name': name,
    },
  );

  return UpdateCapabilityResponse.fromJson(jsonResponse.body);
}