1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package pinpoint
4
5import (
6	"context"
7	awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
8	"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
9	"github.com/aws/aws-sdk-go-v2/service/pinpoint/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Removes one or more attributes, of the same attribute type, from all the
15// endpoints that are associated with an application.
16func (c *Client) RemoveAttributes(ctx context.Context, params *RemoveAttributesInput, optFns ...func(*Options)) (*RemoveAttributesOutput, error) {
17	if params == nil {
18		params = &RemoveAttributesInput{}
19	}
20
21	result, metadata, err := c.invokeOperation(ctx, "RemoveAttributes", params, optFns, addOperationRemoveAttributesMiddlewares)
22	if err != nil {
23		return nil, err
24	}
25
26	out := result.(*RemoveAttributesOutput)
27	out.ResultMetadata = metadata
28	return out, nil
29}
30
31type RemoveAttributesInput struct {
32
33	// The unique identifier for the application. This identifier is displayed as the
34	// Project ID on the Amazon Pinpoint console.
35	//
36	// This member is required.
37	ApplicationId *string
38
39	// The type of attribute or attributes to remove. Valid values are:
40	//
41	// *
42	// endpoint-custom-attributes - Custom attributes that describe endpoints, such as
43	// the date when an associated user opted in or out of receiving communications
44	// from you through a specific type of channel.
45	//
46	// * endpoint-metric-attributes -
47	// Custom metrics that your app reports to Amazon Pinpoint for endpoints, such as
48	// the number of app sessions or the number of items left in a cart.
49	//
50	// *
51	// endpoint-user-attributes - Custom attributes that describe users, such as first
52	// name, last name, and age.
53	//
54	// This member is required.
55	AttributeType *string
56
57	// Specifies one or more attributes to remove from all the endpoints that are
58	// associated with an application.
59	//
60	// This member is required.
61	UpdateAttributesRequest *types.UpdateAttributesRequest
62}
63
64type RemoveAttributesOutput struct {
65
66	// Provides information about the type and the names of attributes that were
67	// removed from all the endpoints that are associated with an application.
68	//
69	// This member is required.
70	AttributesResource *types.AttributesResource
71
72	// Metadata pertaining to the operation's result.
73	ResultMetadata middleware.Metadata
74}
75
76func addOperationRemoveAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
77	err = stack.Serialize.Add(&awsRestjson1_serializeOpRemoveAttributes{}, middleware.After)
78	if err != nil {
79		return err
80	}
81	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRemoveAttributes{}, middleware.After)
82	if err != nil {
83		return err
84	}
85	if err = addSetLoggerMiddleware(stack, options); err != nil {
86		return err
87	}
88	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
89		return err
90	}
91	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
92		return err
93	}
94	if err = addResolveEndpointMiddleware(stack, options); err != nil {
95		return err
96	}
97	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
98		return err
99	}
100	if err = addRetryMiddlewares(stack, options); err != nil {
101		return err
102	}
103	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
104		return err
105	}
106	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
107		return err
108	}
109	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
110		return err
111	}
112	if err = addClientUserAgent(stack); err != nil {
113		return err
114	}
115	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
116		return err
117	}
118	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
119		return err
120	}
121	if err = addOpRemoveAttributesValidationMiddleware(stack); err != nil {
122		return err
123	}
124	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAttributes(options.Region), middleware.Before); err != nil {
125		return err
126	}
127	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
128		return err
129	}
130	if err = addResponseErrorMiddleware(stack); err != nil {
131		return err
132	}
133	if err = addRequestResponseLogging(stack, options); err != nil {
134		return err
135	}
136	return nil
137}
138
139func newServiceMetadataMiddleware_opRemoveAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
140	return &awsmiddleware.RegisterServiceMetadata{
141		Region:        region,
142		ServiceID:     ServiceID,
143		SigningName:   "mobiletargeting",
144		OperationName: "RemoveAttributes",
145	}
146}
147