updateEngagementContext method

Future<UpdateEngagementContextResponse> updateEngagementContext({
  1. required String catalog,
  2. required String contextIdentifier,
  3. required String engagementIdentifier,
  4. required DateTime engagementLastModifiedAt,
  5. required UpdateEngagementContextPayload payload,
  6. required EngagementContextType type,
})

Updates the context information for an existing engagement with new or modified data.

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

Parameter catalog : Specifies the catalog associated with the engagement context update request. This field takes a string value from a predefined list: AWS or Sandbox. The catalog determines which environment the engagement context is updated in.

Parameter contextIdentifier : The unique identifier of the specific engagement context to be updated. This ensures that the correct context within the engagement is modified.

Parameter engagementIdentifier : The unique identifier of the Engagement containing the context to be updated. This parameter ensures the context update is applied to the correct engagement.

Parameter engagementLastModifiedAt : The timestamp when the engagement was last modified, used for optimistic concurrency control. This helps prevent conflicts when multiple users attempt to update the same engagement simultaneously.

Parameter payload : Contains the updated contextual information for the engagement. The structure of this payload varies based on the context type specified in the Type field.

Parameter type : Specifies the type of context being updated within the engagement. This field determines the structure and content of the context payload being modified.

Implementation

Future<UpdateEngagementContextResponse> updateEngagementContext({
  required String catalog,
  required String contextIdentifier,
  required String engagementIdentifier,
  required DateTime engagementLastModifiedAt,
  required UpdateEngagementContextPayload payload,
  required EngagementContextType type,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSPartnerCentralSelling.UpdateEngagementContext'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Catalog': catalog,
      'ContextIdentifier': contextIdentifier,
      'EngagementIdentifier': engagementIdentifier,
      'EngagementLastModifiedAt': iso8601ToJson(engagementLastModifiedAt),
      'Payload': payload,
      'Type': type.value,
    },
  );

  return UpdateEngagementContextResponse.fromJson(jsonResponse.body);
}