1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package connect 4 5import ( 6 "github.com/aws/aws-sdk-go/aws" 7 "github.com/aws/aws-sdk-go/aws/awsutil" 8 "github.com/aws/aws-sdk-go/aws/request" 9) 10 11const opStartOutboundVoiceContact = "StartOutboundVoiceContact" 12 13// StartOutboundVoiceContactRequest generates a "aws/request.Request" representing the 14// client's request for the StartOutboundVoiceContact operation. The "output" return 15// value will be populated with the request's response once the request completes 16// successfuly. 17// 18// Use "Send" method on the returned Request to send the API call to the service. 19// the "output" return value is not valid until after Send returns without error. 20// 21// See StartOutboundVoiceContact for more information on using the StartOutboundVoiceContact 22// API call, and error handling. 23// 24// This method is useful when you want to inject custom logic or configuration 25// into the SDK's request lifecycle. Such as custom headers, or retry logic. 26// 27// 28// // Example sending a request using the StartOutboundVoiceContactRequest method. 29// req, resp := client.StartOutboundVoiceContactRequest(params) 30// 31// err := req.Send() 32// if err == nil { // resp is now filled 33// fmt.Println(resp) 34// } 35// 36// See also, https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StartOutboundVoiceContact 37func (c *Connect) StartOutboundVoiceContactRequest(input *StartOutboundVoiceContactInput) (req *request.Request, output *StartOutboundVoiceContactOutput) { 38 op := &request.Operation{ 39 Name: opStartOutboundVoiceContact, 40 HTTPMethod: "PUT", 41 HTTPPath: "/contact/outbound-voice", 42 } 43 44 if input == nil { 45 input = &StartOutboundVoiceContactInput{} 46 } 47 48 output = &StartOutboundVoiceContactOutput{} 49 req = c.newRequest(op, input, output) 50 return 51} 52 53// StartOutboundVoiceContact API operation for Amazon Connect Service. 54// 55// The StartOutboundVoiceContact operation initiates a contact flow to place 56// an outbound call to a customer. 57// 58// There is a throttling limit placed on usage of the API that includes a RateLimit 59// of 2 per second, and a BurstLimit of 5 per second. 60// 61// If you are using an IAM account, it must have permissions to the connect:StartOutboundVoiceContact 62// action. 63// 64// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 65// with awserr.Error's Code and Message methods to get detailed information about 66// the error. 67// 68// See the AWS API reference guide for Amazon Connect Service's 69// API operation StartOutboundVoiceContact for usage and error information. 70// 71// Returned Error Codes: 72// * ErrCodeInvalidRequestException "InvalidRequestException" 73// The request is not valid. 74// 75// * ErrCodeInvalidParameterException "InvalidParameterException" 76// One or more of the parameters provided to the operation are not valid. 77// 78// * ErrCodeResourceNotFoundException "ResourceNotFoundException" 79// The specified resource was not found. 80// 81// * ErrCodeInternalServiceException "InternalServiceException" 82// Request processing failed due to an error or failure with the service. 83// 84// * ErrCodeLimitExceededException "LimitExceededException" 85// The limit exceeded the maximum allowed active calls in a queue. 86// 87// * ErrCodeDestinationNotAllowedException "DestinationNotAllowedException" 88// Outbound calls to the destination number are not allowed for your instance. 89// You can request that the country be included in the allowed countries for 90// your instance by submitting a Service Limit Increase (https://console.aws.amazon.com/support/v1#/case/create?issueType=service-limit-increase). 91// 92// * ErrCodeOutboundContactNotPermittedException "OutboundContactNotPermittedException" 93// The contact is not permitted because outbound calling is not enabled for 94// the instance. 95// 96// See also, https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StartOutboundVoiceContact 97func (c *Connect) StartOutboundVoiceContact(input *StartOutboundVoiceContactInput) (*StartOutboundVoiceContactOutput, error) { 98 req, out := c.StartOutboundVoiceContactRequest(input) 99 return out, req.Send() 100} 101 102// StartOutboundVoiceContactWithContext is the same as StartOutboundVoiceContact with the addition of 103// the ability to pass a context and additional request options. 104// 105// See StartOutboundVoiceContact for details on how to use this API operation. 106// 107// The context must be non-nil and will be used for request cancellation. If 108// the context is nil a panic will occur. In the future the SDK may create 109// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 110// for more information on using Contexts. 111func (c *Connect) StartOutboundVoiceContactWithContext(ctx aws.Context, input *StartOutboundVoiceContactInput, opts ...request.Option) (*StartOutboundVoiceContactOutput, error) { 112 req, out := c.StartOutboundVoiceContactRequest(input) 113 req.SetContext(ctx) 114 req.ApplyOptions(opts...) 115 return out, req.Send() 116} 117 118const opStopContact = "StopContact" 119 120// StopContactRequest generates a "aws/request.Request" representing the 121// client's request for the StopContact operation. The "output" return 122// value will be populated with the request's response once the request completes 123// successfuly. 124// 125// Use "Send" method on the returned Request to send the API call to the service. 126// the "output" return value is not valid until after Send returns without error. 127// 128// See StopContact for more information on using the StopContact 129// API call, and error handling. 130// 131// This method is useful when you want to inject custom logic or configuration 132// into the SDK's request lifecycle. Such as custom headers, or retry logic. 133// 134// 135// // Example sending a request using the StopContactRequest method. 136// req, resp := client.StopContactRequest(params) 137// 138// err := req.Send() 139// if err == nil { // resp is now filled 140// fmt.Println(resp) 141// } 142// 143// See also, https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StopContact 144func (c *Connect) StopContactRequest(input *StopContactInput) (req *request.Request, output *StopContactOutput) { 145 op := &request.Operation{ 146 Name: opStopContact, 147 HTTPMethod: "POST", 148 HTTPPath: "/contact/stop", 149 } 150 151 if input == nil { 152 input = &StopContactInput{} 153 } 154 155 output = &StopContactOutput{} 156 req = c.newRequest(op, input, output) 157 return 158} 159 160// StopContact API operation for Amazon Connect Service. 161// 162// Ends the contact initiated by the StartOutboundVoiceContact operation. 163// 164// If you are using an IAM account, it must have permissions to the connect:StopContact 165// operation. 166// 167// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 168// with awserr.Error's Code and Message methods to get detailed information about 169// the error. 170// 171// See the AWS API reference guide for Amazon Connect Service's 172// API operation StopContact for usage and error information. 173// 174// Returned Error Codes: 175// * ErrCodeInvalidRequestException "InvalidRequestException" 176// The request is not valid. 177// 178// * ErrCodeContactNotFoundException "ContactNotFoundException" 179// The contact with the specified ID is not active or does not exist. 180// 181// * ErrCodeInvalidParameterException "InvalidParameterException" 182// One or more of the parameters provided to the operation are not valid. 183// 184// * ErrCodeResourceNotFoundException "ResourceNotFoundException" 185// The specified resource was not found. 186// 187// * ErrCodeInternalServiceException "InternalServiceException" 188// Request processing failed due to an error or failure with the service. 189// 190// See also, https://docs.aws.amazon.com/goto/WebAPI/connect-2017-08-08/StopContact 191func (c *Connect) StopContact(input *StopContactInput) (*StopContactOutput, error) { 192 req, out := c.StopContactRequest(input) 193 return out, req.Send() 194} 195 196// StopContactWithContext is the same as StopContact with the addition of 197// the ability to pass a context and additional request options. 198// 199// See StopContact for details on how to use this API operation. 200// 201// The context must be non-nil and will be used for request cancellation. If 202// the context is nil a panic will occur. In the future the SDK may create 203// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 204// for more information on using Contexts. 205func (c *Connect) StopContactWithContext(ctx aws.Context, input *StopContactInput, opts ...request.Option) (*StopContactOutput, error) { 206 req, out := c.StopContactRequest(input) 207 req.SetContext(ctx) 208 req.ApplyOptions(opts...) 209 return out, req.Send() 210} 211 212type StartOutboundVoiceContactInput struct { 213 _ struct{} `type:"structure"` 214 215 // Specify a custom key-value pair using an attribute map. The attributes are 216 // standard Amazon Connect attributes, and can be accessed in contact flows 217 // just like any other contact attributes. 218 // 219 // There can be up to 32,768 UTF-8 bytes across all key-value pairs. Attribute 220 // keys can include only alphanumeric, dash, and underscore characters. 221 // 222 // For example, to play a greeting when the customer answers the call, you can 223 // pass the customer name in attributes similar to the following: 224 Attributes map[string]*string `type:"map"` 225 226 // A unique, case-sensitive identifier that you provide to ensure the idempotency 227 // of the request. The token is valid for 7 days after creation. If a contact 228 // is already started, the contact ID is returned. If the contact is disconnected, 229 // a new contact is started. 230 ClientToken *string `type:"string" idempotencyToken:"true"` 231 232 // The identifier for the contact flow to execute for the outbound call. This 233 // is a GUID value only. Amazon Resource Name (ARN) values are not supported. 234 // 235 // To find the ContactFlowId, open the contact flow to use in the Amazon Connect 236 // contact flow designer. The ID for the contact flow is displayed in the address 237 // bar as part of the URL. For example, an address displayed when you open a 238 // contact flow is similar to the following: https://myconnectinstance.awsapps.com/connect/contact-flows/edit?id=arn:aws:connect:us-east-1:361814831152:instance/2fb42df9-78a2-4b99-b484-f5cf80dc300c/contact-flow/b0b8f2dd-ed1b-4c44-af36-ce189a178181. 239 // At the end of the URL, you see contact-flow/b0b8f2dd-ed1b-4c44-af36-ce189a178181. 240 // The ContactFlowID for this contact flow is b0b8f2dd-ed1b-4c44-af36-ce189a178181. 241 // Make sure to include only the GUID after the "contact-flow/" in your requests. 242 // 243 // ContactFlowId is a required field 244 ContactFlowId *string `type:"string" required:"true"` 245 246 // The phone number, in E.164 format, of the customer to call with the outbound 247 // contact. 248 // 249 // DestinationPhoneNumber is a required field 250 DestinationPhoneNumber *string `type:"string" required:"true"` 251 252 // The identifier for your Amazon Connect instance. To find the InstanceId value 253 // for your Amazon Connect instance, open the Amazon Connect console (https://console.aws.amazon.com/connect/). 254 // Select the instance alias of the instance and view the instance ID in the 255 // Overview section. For example, the instance ID is the set of characters at 256 // the end of the instance ARN, after "instance/", such as 10a4c4eb-f57e-4d4c-b602-bf39176ced07. 257 // 258 // InstanceId is a required field 259 InstanceId *string `type:"string" required:"true"` 260 261 // The queue to which to add the call. If you specify a queue, the phone displayed 262 // for caller ID is the phone number defined for the queue. If you do not specify 263 // a queue, the queue used is the queue defined in the contact flow specified 264 // by ContactFlowId. 265 // 266 // To find the QueueId, open the queue to use in the Amazon Connect queue editor. 267 // The ID for the queue is displayed in the address bar as part of the URL. 268 // For example, the QueueId value is the set of characters at the end of the 269 // URL, after "queue/", such as aeg40574-2d01-51c3-73d6-bf8624d2168c. 270 QueueId *string `type:"string"` 271 272 // The phone number, in E.164 format, associated with your Amazon Connect instance 273 // to use to place the outbound call. 274 SourcePhoneNumber *string `type:"string"` 275} 276 277// String returns the string representation 278func (s StartOutboundVoiceContactInput) String() string { 279 return awsutil.Prettify(s) 280} 281 282// GoString returns the string representation 283func (s StartOutboundVoiceContactInput) GoString() string { 284 return s.String() 285} 286 287// Validate inspects the fields of the type to determine if they are valid. 288func (s *StartOutboundVoiceContactInput) Validate() error { 289 invalidParams := request.ErrInvalidParams{Context: "StartOutboundVoiceContactInput"} 290 if s.ContactFlowId == nil { 291 invalidParams.Add(request.NewErrParamRequired("ContactFlowId")) 292 } 293 if s.DestinationPhoneNumber == nil { 294 invalidParams.Add(request.NewErrParamRequired("DestinationPhoneNumber")) 295 } 296 if s.InstanceId == nil { 297 invalidParams.Add(request.NewErrParamRequired("InstanceId")) 298 } 299 300 if invalidParams.Len() > 0 { 301 return invalidParams 302 } 303 return nil 304} 305 306// SetAttributes sets the Attributes field's value. 307func (s *StartOutboundVoiceContactInput) SetAttributes(v map[string]*string) *StartOutboundVoiceContactInput { 308 s.Attributes = v 309 return s 310} 311 312// SetClientToken sets the ClientToken field's value. 313func (s *StartOutboundVoiceContactInput) SetClientToken(v string) *StartOutboundVoiceContactInput { 314 s.ClientToken = &v 315 return s 316} 317 318// SetContactFlowId sets the ContactFlowId field's value. 319func (s *StartOutboundVoiceContactInput) SetContactFlowId(v string) *StartOutboundVoiceContactInput { 320 s.ContactFlowId = &v 321 return s 322} 323 324// SetDestinationPhoneNumber sets the DestinationPhoneNumber field's value. 325func (s *StartOutboundVoiceContactInput) SetDestinationPhoneNumber(v string) *StartOutboundVoiceContactInput { 326 s.DestinationPhoneNumber = &v 327 return s 328} 329 330// SetInstanceId sets the InstanceId field's value. 331func (s *StartOutboundVoiceContactInput) SetInstanceId(v string) *StartOutboundVoiceContactInput { 332 s.InstanceId = &v 333 return s 334} 335 336// SetQueueId sets the QueueId field's value. 337func (s *StartOutboundVoiceContactInput) SetQueueId(v string) *StartOutboundVoiceContactInput { 338 s.QueueId = &v 339 return s 340} 341 342// SetSourcePhoneNumber sets the SourcePhoneNumber field's value. 343func (s *StartOutboundVoiceContactInput) SetSourcePhoneNumber(v string) *StartOutboundVoiceContactInput { 344 s.SourcePhoneNumber = &v 345 return s 346} 347 348type StartOutboundVoiceContactOutput struct { 349 _ struct{} `type:"structure"` 350 351 // The unique identifier of this contact within your Amazon Connect instance. 352 ContactId *string `min:"1" type:"string"` 353} 354 355// String returns the string representation 356func (s StartOutboundVoiceContactOutput) String() string { 357 return awsutil.Prettify(s) 358} 359 360// GoString returns the string representation 361func (s StartOutboundVoiceContactOutput) GoString() string { 362 return s.String() 363} 364 365// SetContactId sets the ContactId field's value. 366func (s *StartOutboundVoiceContactOutput) SetContactId(v string) *StartOutboundVoiceContactOutput { 367 s.ContactId = &v 368 return s 369} 370 371type StopContactInput struct { 372 _ struct{} `type:"structure"` 373 374 // The unique identifier of the contact to end. This is the ContactId value 375 // returned from the StartOutboundVoiceContact operation. 376 // 377 // ContactId is a required field 378 ContactId *string `min:"1" type:"string" required:"true"` 379 380 // The identifier of the Amazon Connect instance in which the contact is active. 381 // 382 // InstanceId is a required field 383 InstanceId *string `type:"string" required:"true"` 384} 385 386// String returns the string representation 387func (s StopContactInput) String() string { 388 return awsutil.Prettify(s) 389} 390 391// GoString returns the string representation 392func (s StopContactInput) GoString() string { 393 return s.String() 394} 395 396// Validate inspects the fields of the type to determine if they are valid. 397func (s *StopContactInput) Validate() error { 398 invalidParams := request.ErrInvalidParams{Context: "StopContactInput"} 399 if s.ContactId == nil { 400 invalidParams.Add(request.NewErrParamRequired("ContactId")) 401 } 402 if s.ContactId != nil && len(*s.ContactId) < 1 { 403 invalidParams.Add(request.NewErrParamMinLen("ContactId", 1)) 404 } 405 if s.InstanceId == nil { 406 invalidParams.Add(request.NewErrParamRequired("InstanceId")) 407 } 408 409 if invalidParams.Len() > 0 { 410 return invalidParams 411 } 412 return nil 413} 414 415// SetContactId sets the ContactId field's value. 416func (s *StopContactInput) SetContactId(v string) *StopContactInput { 417 s.ContactId = &v 418 return s 419} 420 421// SetInstanceId sets the InstanceId field's value. 422func (s *StopContactInput) SetInstanceId(v string) *StopContactInput { 423 s.InstanceId = &v 424 return s 425} 426 427type StopContactOutput struct { 428 _ struct{} `type:"structure"` 429} 430 431// String returns the string representation 432func (s StopContactOutput) String() string { 433 return awsutil.Prettify(s) 434} 435 436// GoString returns the string representation 437func (s StopContactOutput) GoString() string { 438 return s.String() 439} 440