1// Code generated by smithy-go-codegen DO NOT EDIT.
2
3package customerprofiles
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/customerprofiles/types"
10	"github.com/aws/smithy-go/middleware"
11	smithyhttp "github.com/aws/smithy-go/transport/http"
12)
13
14// Updates the properties of a profile. The ProfileId is required for updating a
15// customer profile. When calling the UpdateProfile API, specifying an empty string
16// value means that any existing value will be removed. Not specifying a string
17// value means that any value already there will be kept.
18func (c *Client) UpdateProfile(ctx context.Context, params *UpdateProfileInput, optFns ...func(*Options)) (*UpdateProfileOutput, error) {
19	if params == nil {
20		params = &UpdateProfileInput{}
21	}
22
23	result, metadata, err := c.invokeOperation(ctx, "UpdateProfile", params, optFns, addOperationUpdateProfileMiddlewares)
24	if err != nil {
25		return nil, err
26	}
27
28	out := result.(*UpdateProfileOutput)
29	out.ResultMetadata = metadata
30	return out, nil
31}
32
33type UpdateProfileInput struct {
34
35	// The unique name of the domain.
36	//
37	// This member is required.
38	DomainName *string
39
40	// The unique identifier of a customer profile.
41	//
42	// This member is required.
43	ProfileId *string
44
45	// A unique account number that you have given to the customer.
46	AccountNumber *string
47
48	// Any additional information relevant to the customer's profile.
49	AdditionalInformation *string
50
51	// A generic address associated with the customer that is not mailing, shipping, or
52	// billing.
53	Address *types.UpdateAddress
54
55	// A key value pair of attributes of a customer profile.
56	Attributes map[string]string
57
58	// The customer’s billing address.
59	BillingAddress *types.UpdateAddress
60
61	// The customer’s birth date.
62	BirthDate *string
63
64	// The customer’s business email address.
65	BusinessEmailAddress *string
66
67	// The name of the customer’s business.
68	BusinessName *string
69
70	// The customer’s business phone number.
71	BusinessPhoneNumber *string
72
73	// The customer's email address, which has not been specified as a personal or
74	// business address.
75	EmailAddress *string
76
77	// The customer’s first name.
78	FirstName *string
79
80	// The gender with which the customer identifies.
81	Gender types.Gender
82
83	// The customer’s home phone number.
84	HomePhoneNumber *string
85
86	// The customer’s last name.
87	LastName *string
88
89	// The customer’s mailing address.
90	MailingAddress *types.UpdateAddress
91
92	// The customer’s middle name.
93	MiddleName *string
94
95	// The customer’s mobile phone number.
96	MobilePhoneNumber *string
97
98	// The type of profile used to describe the customer.
99	PartyType types.PartyType
100
101	// The customer’s personal email address.
102	PersonalEmailAddress *string
103
104	// The customer's phone number, which has not been specified as a mobile, home, or
105	// business number.
106	PhoneNumber *string
107
108	// The customer’s shipping address.
109	ShippingAddress *types.UpdateAddress
110}
111
112type UpdateProfileOutput struct {
113
114	// The unique identifier of a customer profile.
115	//
116	// This member is required.
117	ProfileId *string
118
119	// Metadata pertaining to the operation's result.
120	ResultMetadata middleware.Metadata
121}
122
123func addOperationUpdateProfileMiddlewares(stack *middleware.Stack, options Options) (err error) {
124	err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProfile{}, middleware.After)
125	if err != nil {
126		return err
127	}
128	err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProfile{}, middleware.After)
129	if err != nil {
130		return err
131	}
132	if err = addSetLoggerMiddleware(stack, options); err != nil {
133		return err
134	}
135	if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
136		return err
137	}
138	if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
139		return err
140	}
141	if err = addResolveEndpointMiddleware(stack, options); err != nil {
142		return err
143	}
144	if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
145		return err
146	}
147	if err = addRetryMiddlewares(stack, options); err != nil {
148		return err
149	}
150	if err = addHTTPSignerV4Middleware(stack, options); err != nil {
151		return err
152	}
153	if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
154		return err
155	}
156	if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
157		return err
158	}
159	if err = addClientUserAgent(stack); err != nil {
160		return err
161	}
162	if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
163		return err
164	}
165	if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
166		return err
167	}
168	if err = addOpUpdateProfileValidationMiddleware(stack); err != nil {
169		return err
170	}
171	if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProfile(options.Region), middleware.Before); err != nil {
172		return err
173	}
174	if err = addRequestIDRetrieverMiddleware(stack); err != nil {
175		return err
176	}
177	if err = addResponseErrorMiddleware(stack); err != nil {
178		return err
179	}
180	if err = addRequestResponseLogging(stack, options); err != nil {
181		return err
182	}
183	return nil
184}
185
186func newServiceMetadataMiddleware_opUpdateProfile(region string) *awsmiddleware.RegisterServiceMetadata {
187	return &awsmiddleware.RegisterServiceMetadata{
188		Region:        region,
189		ServiceID:     ServiceID,
190		SigningName:   "profile",
191		OperationName: "UpdateProfile",
192	}
193}
194