updateEndpoint method

Future<UpdateEndpointResponse> updateEndpoint({
  1. required String applicationId,
  2. required String endpointId,
  3. required EndpointRequest endpointRequest,
})

Creates a new endpoint for an application or updates the settings and attributes of an existing endpoint for an application. You can also use this operation to define custom attributes for an endpoint. If an update includes one or more values for a custom attribute, Amazon Pinpoint replaces (overwrites) any existing values with the new values.

May throw BadRequestException. May throw InternalServerErrorException. May throw PayloadTooLargeException. May throw ForbiddenException. May throw NotFoundException. May throw MethodNotAllowedException. May throw TooManyRequestsException.

Parameter applicationId : The unique identifier for the application. This identifier is displayed as the Project ID on the Amazon Pinpoint console.

Parameter endpointId : The unique identifier for the endpoint.

Implementation

Future<UpdateEndpointResponse> updateEndpoint({
  required String applicationId,
  required String endpointId,
  required EndpointRequest endpointRequest,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(endpointId, 'endpointId');
  ArgumentError.checkNotNull(endpointRequest, 'endpointRequest');
  final response = await _protocol.sendRaw(
    payload: endpointRequest,
    method: 'PUT',
    requestUri:
        '/v1/apps/${Uri.encodeComponent(applicationId)}/endpoints/${Uri.encodeComponent(endpointId)}',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return UpdateEndpointResponse(
    messageBody: MessageBody.fromJson($json),
  );
}