-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_UpdateContactAttributes.go
201 lines (168 loc) · 6.74 KB
/
api_op_UpdateContactAttributes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package connect
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type UpdateContactAttributesInput struct {
_ struct{} `type:"structure"`
// The Amazon Connect attributes. These attributes can be accessed in contact
// flows just like any other contact attributes.
//
// You can have up to 32,768 UTF-8 bytes across all attributes for a contact.
// Attribute keys can include only alphanumeric, dash, and underscore characters.
//
// Attributes is a required field
Attributes map[string]string `type:"map" required:"true"`
// The identifier of the contact. This is the identifier of the contact associated
// with the first interaction with the contact center.
//
// InitialContactId is a required field
InitialContactId *string `min:"1" type:"string" required:"true"`
// The identifier of the Amazon Connect instance.
//
// InstanceId is a required field
InstanceId *string `min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s UpdateContactAttributesInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *UpdateContactAttributesInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "UpdateContactAttributesInput"}
if s.Attributes == nil {
invalidParams.Add(aws.NewErrParamRequired("Attributes"))
}
if s.InitialContactId == nil {
invalidParams.Add(aws.NewErrParamRequired("InitialContactId"))
}
if s.InitialContactId != nil && len(*s.InitialContactId) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("InitialContactId", 1))
}
if s.InstanceId == nil {
invalidParams.Add(aws.NewErrParamRequired("InstanceId"))
}
if s.InstanceId != nil && len(*s.InstanceId) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("InstanceId", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s UpdateContactAttributesInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})
if s.Attributes != nil {
v := s.Attributes
metadata := protocol.Metadata{}
ms0 := e.Map(protocol.BodyTarget, "Attributes", metadata)
ms0.Start()
for k1, v1 := range v {
ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ms0.End()
}
if s.InitialContactId != nil {
v := *s.InitialContactId
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "InitialContactId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.InstanceId != nil {
v := *s.InstanceId
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "InstanceId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
type UpdateContactAttributesOutput struct {
_ struct{} `type:"structure"`
}
// String returns the string representation
func (s UpdateContactAttributesOutput) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s UpdateContactAttributesOutput) MarshalFields(e protocol.FieldEncoder) error {
return nil
}
const opUpdateContactAttributes = "UpdateContactAttributes"
// UpdateContactAttributesRequest returns a request value for making API operation for
// Amazon Connect Service.
//
// Creates or updates the contact attributes associated with the specified contact.
//
// You can add or update attributes for both ongoing and completed contacts.
// For example, you can update the customer's name or the reason the customer
// called while the call is active, or add notes about steps that the agent
// took during the call that are displayed to the next agent that takes the
// call. You can also update attributes for a contact using data from your CRM
// application and save the data with the contact in Amazon Connect. You could
// also flag calls for additional analysis, such as legal review or identifying
// abusive callers.
//
// Contact attributes are available in Amazon Connect for 24 months, and are
// then deleted.
//
// Important: You cannot use the operation to update attributes for contacts
// that occurred prior to the release of the API, September 12, 2018. You can
// update attributes only for contacts that started after the release of the
// API. If you attempt to update attributes for a contact that occurred prior
// to the release of the API, a 400 error is returned. This applies also to
// queued callbacks that were initiated prior to the release of the API but
// are still active in your instance.
//
// // Example sending a request using UpdateContactAttributesRequest.
// req := client.UpdateContactAttributesRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/UpdateContactAttributes
func (c *Client) UpdateContactAttributesRequest(input *UpdateContactAttributesInput) UpdateContactAttributesRequest {
op := &aws.Operation{
Name: opUpdateContactAttributes,
HTTPMethod: "POST",
HTTPPath: "/contact/attributes",
}
if input == nil {
input = &UpdateContactAttributesInput{}
}
req := c.newRequest(op, input, &UpdateContactAttributesOutput{})
return UpdateContactAttributesRequest{Request: req, Input: input, Copy: c.UpdateContactAttributesRequest}
}
// UpdateContactAttributesRequest is the request type for the
// UpdateContactAttributes API operation.
type UpdateContactAttributesRequest struct {
*aws.Request
Input *UpdateContactAttributesInput
Copy func(*UpdateContactAttributesInput) UpdateContactAttributesRequest
}
// Send marshals and sends the UpdateContactAttributes API request.
func (r UpdateContactAttributesRequest) Send(ctx context.Context) (*UpdateContactAttributesResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &UpdateContactAttributesResponse{
UpdateContactAttributesOutput: r.Request.Data.(*UpdateContactAttributesOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// UpdateContactAttributesResponse is the response type for the
// UpdateContactAttributes API operation.
type UpdateContactAttributesResponse struct {
*UpdateContactAttributesOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// UpdateContactAttributes request.
func (r *UpdateContactAttributesResponse) SDKResponseMetdata() *aws.Response {
return r.response
}