removeAttributes method

Future<RemoveAttributesResponse> removeAttributes({
  1. required String applicationId,
  2. required String attributeType,
  3. required UpdateAttributesRequest updateAttributesRequest,
})

Removes one or more attributes, of the same attribute type, from all the endpoints that are associated with an application.

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 attributeType : The type of attribute or attributes to remove. Valid values are:

  • endpoint-custom-attributes - Custom attributes that describe endpoints, such as the date when an associated user opted in or out of receiving communications from you through a specific type of channel.
  • endpoint-metric-attributes - Custom metrics that your app reports to Amazon Pinpoint for endpoints, such as the number of app sessions or the number of items left in a cart.
  • endpoint-user-attributes - Custom attributes that describe users, such as first name, last name, and age.

Implementation

Future<RemoveAttributesResponse> removeAttributes({
  required String applicationId,
  required String attributeType,
  required UpdateAttributesRequest updateAttributesRequest,
}) async {
  ArgumentError.checkNotNull(applicationId, 'applicationId');
  ArgumentError.checkNotNull(attributeType, 'attributeType');
  ArgumentError.checkNotNull(
      updateAttributesRequest, 'updateAttributesRequest');
  final response = await _protocol.sendRaw(
    payload: updateAttributesRequest,
    method: 'PUT',
    requestUri:
        '/v1/apps/${Uri.encodeComponent(applicationId)}/attributes/${Uri.encodeComponent(attributeType)}',
    exceptionFnMap: _exceptionFns,
  );
  final $json = await _s.jsonFromResponse(response);
  return RemoveAttributesResponse(
    attributesResource: AttributesResource.fromJson($json),
  );
}