1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3package ioteventsdata 4 5import ( 6 "fmt" 7 "time" 8 9 "github.com/aws/aws-sdk-go/aws" 10 "github.com/aws/aws-sdk-go/aws/awsutil" 11 "github.com/aws/aws-sdk-go/aws/request" 12) 13 14const opBatchPutMessage = "BatchPutMessage" 15 16// BatchPutMessageRequest generates a "aws/request.Request" representing the 17// client's request for the BatchPutMessage operation. The "output" return 18// value will be populated with the request's response once the request completes 19// successfully. 20// 21// Use "Send" method on the returned Request to send the API call to the service. 22// the "output" return value is not valid until after Send returns without error. 23// 24// See BatchPutMessage for more information on using the BatchPutMessage 25// API call, and error handling. 26// 27// This method is useful when you want to inject custom logic or configuration 28// into the SDK's request lifecycle. Such as custom headers, or retry logic. 29// 30// 31// // Example sending a request using the BatchPutMessageRequest method. 32// req, resp := client.BatchPutMessageRequest(params) 33// 34// err := req.Send() 35// if err == nil { // resp is now filled 36// fmt.Println(resp) 37// } 38// 39// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/BatchPutMessage 40func (c *IoTEventsData) BatchPutMessageRequest(input *BatchPutMessageInput) (req *request.Request, output *BatchPutMessageOutput) { 41 op := &request.Operation{ 42 Name: opBatchPutMessage, 43 HTTPMethod: "POST", 44 HTTPPath: "/inputs/messages", 45 } 46 47 if input == nil { 48 input = &BatchPutMessageInput{} 49 } 50 51 output = &BatchPutMessageOutput{} 52 req = c.newRequest(op, input, output) 53 return 54} 55 56// BatchPutMessage API operation for AWS IoT Events Data. 57// 58// Sends a set of messages to the AWS IoT Events system. Each message payload 59// is transformed into the input you specify ("inputName") and ingested into 60// any detectors that monitor that input. If multiple messages are sent, the 61// order in which the messages are processed isn't guaranteed. To guarantee 62// ordering, you must send messages one at a time and wait for a successful 63// response. 64// 65// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 66// with awserr.Error's Code and Message methods to get detailed information about 67// the error. 68// 69// See the AWS API reference guide for AWS IoT Events Data's 70// API operation BatchPutMessage for usage and error information. 71// 72// Returned Error Codes: 73// * ErrCodeInvalidRequestException "InvalidRequestException" 74// The request was invalid. 75// 76// * ErrCodeInternalFailureException "InternalFailureException" 77// An internal failure occured. 78// 79// * ErrCodeServiceUnavailableException "ServiceUnavailableException" 80// The service is currently unavailable. 81// 82// * ErrCodeThrottlingException "ThrottlingException" 83// The request could not be completed due to throttling. 84// 85// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/BatchPutMessage 86func (c *IoTEventsData) BatchPutMessage(input *BatchPutMessageInput) (*BatchPutMessageOutput, error) { 87 req, out := c.BatchPutMessageRequest(input) 88 return out, req.Send() 89} 90 91// BatchPutMessageWithContext is the same as BatchPutMessage with the addition of 92// the ability to pass a context and additional request options. 93// 94// See BatchPutMessage for details on how to use this API operation. 95// 96// The context must be non-nil and will be used for request cancellation. If 97// the context is nil a panic will occur. In the future the SDK may create 98// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 99// for more information on using Contexts. 100func (c *IoTEventsData) BatchPutMessageWithContext(ctx aws.Context, input *BatchPutMessageInput, opts ...request.Option) (*BatchPutMessageOutput, error) { 101 req, out := c.BatchPutMessageRequest(input) 102 req.SetContext(ctx) 103 req.ApplyOptions(opts...) 104 return out, req.Send() 105} 106 107const opBatchUpdateDetector = "BatchUpdateDetector" 108 109// BatchUpdateDetectorRequest generates a "aws/request.Request" representing the 110// client's request for the BatchUpdateDetector operation. The "output" return 111// value will be populated with the request's response once the request completes 112// successfully. 113// 114// Use "Send" method on the returned Request to send the API call to the service. 115// the "output" return value is not valid until after Send returns without error. 116// 117// See BatchUpdateDetector for more information on using the BatchUpdateDetector 118// API call, and error handling. 119// 120// This method is useful when you want to inject custom logic or configuration 121// into the SDK's request lifecycle. Such as custom headers, or retry logic. 122// 123// 124// // Example sending a request using the BatchUpdateDetectorRequest method. 125// req, resp := client.BatchUpdateDetectorRequest(params) 126// 127// err := req.Send() 128// if err == nil { // resp is now filled 129// fmt.Println(resp) 130// } 131// 132// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/BatchUpdateDetector 133func (c *IoTEventsData) BatchUpdateDetectorRequest(input *BatchUpdateDetectorInput) (req *request.Request, output *BatchUpdateDetectorOutput) { 134 op := &request.Operation{ 135 Name: opBatchUpdateDetector, 136 HTTPMethod: "POST", 137 HTTPPath: "/detectors", 138 } 139 140 if input == nil { 141 input = &BatchUpdateDetectorInput{} 142 } 143 144 output = &BatchUpdateDetectorOutput{} 145 req = c.newRequest(op, input, output) 146 return 147} 148 149// BatchUpdateDetector API operation for AWS IoT Events Data. 150// 151// Updates the state, variable values, and timer settings of one or more detectors 152// (instances) of a specified detector model. 153// 154// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 155// with awserr.Error's Code and Message methods to get detailed information about 156// the error. 157// 158// See the AWS API reference guide for AWS IoT Events Data's 159// API operation BatchUpdateDetector for usage and error information. 160// 161// Returned Error Codes: 162// * ErrCodeInvalidRequestException "InvalidRequestException" 163// The request was invalid. 164// 165// * ErrCodeInternalFailureException "InternalFailureException" 166// An internal failure occured. 167// 168// * ErrCodeServiceUnavailableException "ServiceUnavailableException" 169// The service is currently unavailable. 170// 171// * ErrCodeThrottlingException "ThrottlingException" 172// The request could not be completed due to throttling. 173// 174// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/BatchUpdateDetector 175func (c *IoTEventsData) BatchUpdateDetector(input *BatchUpdateDetectorInput) (*BatchUpdateDetectorOutput, error) { 176 req, out := c.BatchUpdateDetectorRequest(input) 177 return out, req.Send() 178} 179 180// BatchUpdateDetectorWithContext is the same as BatchUpdateDetector with the addition of 181// the ability to pass a context and additional request options. 182// 183// See BatchUpdateDetector for details on how to use this API operation. 184// 185// The context must be non-nil and will be used for request cancellation. If 186// the context is nil a panic will occur. In the future the SDK may create 187// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 188// for more information on using Contexts. 189func (c *IoTEventsData) BatchUpdateDetectorWithContext(ctx aws.Context, input *BatchUpdateDetectorInput, opts ...request.Option) (*BatchUpdateDetectorOutput, error) { 190 req, out := c.BatchUpdateDetectorRequest(input) 191 req.SetContext(ctx) 192 req.ApplyOptions(opts...) 193 return out, req.Send() 194} 195 196const opDescribeDetector = "DescribeDetector" 197 198// DescribeDetectorRequest generates a "aws/request.Request" representing the 199// client's request for the DescribeDetector operation. The "output" return 200// value will be populated with the request's response once the request completes 201// successfully. 202// 203// Use "Send" method on the returned Request to send the API call to the service. 204// the "output" return value is not valid until after Send returns without error. 205// 206// See DescribeDetector for more information on using the DescribeDetector 207// API call, and error handling. 208// 209// This method is useful when you want to inject custom logic or configuration 210// into the SDK's request lifecycle. Such as custom headers, or retry logic. 211// 212// 213// // Example sending a request using the DescribeDetectorRequest method. 214// req, resp := client.DescribeDetectorRequest(params) 215// 216// err := req.Send() 217// if err == nil { // resp is now filled 218// fmt.Println(resp) 219// } 220// 221// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/DescribeDetector 222func (c *IoTEventsData) DescribeDetectorRequest(input *DescribeDetectorInput) (req *request.Request, output *DescribeDetectorOutput) { 223 op := &request.Operation{ 224 Name: opDescribeDetector, 225 HTTPMethod: "GET", 226 HTTPPath: "/detectors/{detectorModelName}/keyValues/", 227 } 228 229 if input == nil { 230 input = &DescribeDetectorInput{} 231 } 232 233 output = &DescribeDetectorOutput{} 234 req = c.newRequest(op, input, output) 235 return 236} 237 238// DescribeDetector API operation for AWS IoT Events Data. 239// 240// Returns information about the specified detector (instance). 241// 242// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 243// with awserr.Error's Code and Message methods to get detailed information about 244// the error. 245// 246// See the AWS API reference guide for AWS IoT Events Data's 247// API operation DescribeDetector for usage and error information. 248// 249// Returned Error Codes: 250// * ErrCodeInvalidRequestException "InvalidRequestException" 251// The request was invalid. 252// 253// * ErrCodeResourceNotFoundException "ResourceNotFoundException" 254// The resource was not found. 255// 256// * ErrCodeThrottlingException "ThrottlingException" 257// The request could not be completed due to throttling. 258// 259// * ErrCodeInternalFailureException "InternalFailureException" 260// An internal failure occured. 261// 262// * ErrCodeServiceUnavailableException "ServiceUnavailableException" 263// The service is currently unavailable. 264// 265// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/DescribeDetector 266func (c *IoTEventsData) DescribeDetector(input *DescribeDetectorInput) (*DescribeDetectorOutput, error) { 267 req, out := c.DescribeDetectorRequest(input) 268 return out, req.Send() 269} 270 271// DescribeDetectorWithContext is the same as DescribeDetector with the addition of 272// the ability to pass a context and additional request options. 273// 274// See DescribeDetector for details on how to use this API operation. 275// 276// The context must be non-nil and will be used for request cancellation. If 277// the context is nil a panic will occur. In the future the SDK may create 278// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 279// for more information on using Contexts. 280func (c *IoTEventsData) DescribeDetectorWithContext(ctx aws.Context, input *DescribeDetectorInput, opts ...request.Option) (*DescribeDetectorOutput, error) { 281 req, out := c.DescribeDetectorRequest(input) 282 req.SetContext(ctx) 283 req.ApplyOptions(opts...) 284 return out, req.Send() 285} 286 287const opListDetectors = "ListDetectors" 288 289// ListDetectorsRequest generates a "aws/request.Request" representing the 290// client's request for the ListDetectors operation. The "output" return 291// value will be populated with the request's response once the request completes 292// successfully. 293// 294// Use "Send" method on the returned Request to send the API call to the service. 295// the "output" return value is not valid until after Send returns without error. 296// 297// See ListDetectors for more information on using the ListDetectors 298// API call, and error handling. 299// 300// This method is useful when you want to inject custom logic or configuration 301// into the SDK's request lifecycle. Such as custom headers, or retry logic. 302// 303// 304// // Example sending a request using the ListDetectorsRequest method. 305// req, resp := client.ListDetectorsRequest(params) 306// 307// err := req.Send() 308// if err == nil { // resp is now filled 309// fmt.Println(resp) 310// } 311// 312// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/ListDetectors 313func (c *IoTEventsData) ListDetectorsRequest(input *ListDetectorsInput) (req *request.Request, output *ListDetectorsOutput) { 314 op := &request.Operation{ 315 Name: opListDetectors, 316 HTTPMethod: "GET", 317 HTTPPath: "/detectors/{detectorModelName}", 318 } 319 320 if input == nil { 321 input = &ListDetectorsInput{} 322 } 323 324 output = &ListDetectorsOutput{} 325 req = c.newRequest(op, input, output) 326 return 327} 328 329// ListDetectors API operation for AWS IoT Events Data. 330// 331// Lists detectors (the instances of a detector model). 332// 333// Returns awserr.Error for service API and SDK errors. Use runtime type assertions 334// with awserr.Error's Code and Message methods to get detailed information about 335// the error. 336// 337// See the AWS API reference guide for AWS IoT Events Data's 338// API operation ListDetectors for usage and error information. 339// 340// Returned Error Codes: 341// * ErrCodeInvalidRequestException "InvalidRequestException" 342// The request was invalid. 343// 344// * ErrCodeResourceNotFoundException "ResourceNotFoundException" 345// The resource was not found. 346// 347// * ErrCodeThrottlingException "ThrottlingException" 348// The request could not be completed due to throttling. 349// 350// * ErrCodeInternalFailureException "InternalFailureException" 351// An internal failure occured. 352// 353// * ErrCodeServiceUnavailableException "ServiceUnavailableException" 354// The service is currently unavailable. 355// 356// See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/ListDetectors 357func (c *IoTEventsData) ListDetectors(input *ListDetectorsInput) (*ListDetectorsOutput, error) { 358 req, out := c.ListDetectorsRequest(input) 359 return out, req.Send() 360} 361 362// ListDetectorsWithContext is the same as ListDetectors with the addition of 363// the ability to pass a context and additional request options. 364// 365// See ListDetectors for details on how to use this API operation. 366// 367// The context must be non-nil and will be used for request cancellation. If 368// the context is nil a panic will occur. In the future the SDK may create 369// sub-contexts for http.Requests. See https://golang.org/pkg/context/ 370// for more information on using Contexts. 371func (c *IoTEventsData) ListDetectorsWithContext(ctx aws.Context, input *ListDetectorsInput, opts ...request.Option) (*ListDetectorsOutput, error) { 372 req, out := c.ListDetectorsRequest(input) 373 req.SetContext(ctx) 374 req.ApplyOptions(opts...) 375 return out, req.Send() 376} 377 378// Contains information about the errors encountered. 379type BatchPutMessageErrorEntry struct { 380 _ struct{} `type:"structure"` 381 382 // The code associated with the error. 383 ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` 384 385 // More information about the error. 386 ErrorMessage *string `locationName:"errorMessage" type:"string"` 387 388 // The ID of the message that caused the error. (See the value corresponding 389 // to the "messageId" key in the "message" object.) 390 MessageId *string `locationName:"messageId" min:"1" type:"string"` 391} 392 393// String returns the string representation 394func (s BatchPutMessageErrorEntry) String() string { 395 return awsutil.Prettify(s) 396} 397 398// GoString returns the string representation 399func (s BatchPutMessageErrorEntry) GoString() string { 400 return s.String() 401} 402 403// SetErrorCode sets the ErrorCode field's value. 404func (s *BatchPutMessageErrorEntry) SetErrorCode(v string) *BatchPutMessageErrorEntry { 405 s.ErrorCode = &v 406 return s 407} 408 409// SetErrorMessage sets the ErrorMessage field's value. 410func (s *BatchPutMessageErrorEntry) SetErrorMessage(v string) *BatchPutMessageErrorEntry { 411 s.ErrorMessage = &v 412 return s 413} 414 415// SetMessageId sets the MessageId field's value. 416func (s *BatchPutMessageErrorEntry) SetMessageId(v string) *BatchPutMessageErrorEntry { 417 s.MessageId = &v 418 return s 419} 420 421type BatchPutMessageInput struct { 422 _ struct{} `type:"structure"` 423 424 // The list of messages to send. Each message has the following format: '{ "messageId": 425 // "string", "inputName": "string", "payload": "string"}' 426 // 427 // Messages is a required field 428 Messages []*Message `locationName:"messages" min:"1" type:"list" required:"true"` 429} 430 431// String returns the string representation 432func (s BatchPutMessageInput) String() string { 433 return awsutil.Prettify(s) 434} 435 436// GoString returns the string representation 437func (s BatchPutMessageInput) GoString() string { 438 return s.String() 439} 440 441// Validate inspects the fields of the type to determine if they are valid. 442func (s *BatchPutMessageInput) Validate() error { 443 invalidParams := request.ErrInvalidParams{Context: "BatchPutMessageInput"} 444 if s.Messages == nil { 445 invalidParams.Add(request.NewErrParamRequired("Messages")) 446 } 447 if s.Messages != nil && len(s.Messages) < 1 { 448 invalidParams.Add(request.NewErrParamMinLen("Messages", 1)) 449 } 450 if s.Messages != nil { 451 for i, v := range s.Messages { 452 if v == nil { 453 continue 454 } 455 if err := v.Validate(); err != nil { 456 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Messages", i), err.(request.ErrInvalidParams)) 457 } 458 } 459 } 460 461 if invalidParams.Len() > 0 { 462 return invalidParams 463 } 464 return nil 465} 466 467// SetMessages sets the Messages field's value. 468func (s *BatchPutMessageInput) SetMessages(v []*Message) *BatchPutMessageInput { 469 s.Messages = v 470 return s 471} 472 473type BatchPutMessageOutput struct { 474 _ struct{} `type:"structure"` 475 476 // A list of any errors encountered when sending the messages. 477 BatchPutMessageErrorEntries []*BatchPutMessageErrorEntry `type:"list"` 478} 479 480// String returns the string representation 481func (s BatchPutMessageOutput) String() string { 482 return awsutil.Prettify(s) 483} 484 485// GoString returns the string representation 486func (s BatchPutMessageOutput) GoString() string { 487 return s.String() 488} 489 490// SetBatchPutMessageErrorEntries sets the BatchPutMessageErrorEntries field's value. 491func (s *BatchPutMessageOutput) SetBatchPutMessageErrorEntries(v []*BatchPutMessageErrorEntry) *BatchPutMessageOutput { 492 s.BatchPutMessageErrorEntries = v 493 return s 494} 495 496// Information about the error that occured when attempting to update a detector. 497type BatchUpdateDetectorErrorEntry struct { 498 _ struct{} `type:"structure"` 499 500 // The code of the error. 501 ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` 502 503 // A message describing the error. 504 ErrorMessage *string `locationName:"errorMessage" type:"string"` 505 506 // The "messageId" of the update request that caused the error. (The value of 507 // the "messageId" in the update request "Detector" object.) 508 MessageId *string `locationName:"messageId" min:"1" type:"string"` 509} 510 511// String returns the string representation 512func (s BatchUpdateDetectorErrorEntry) String() string { 513 return awsutil.Prettify(s) 514} 515 516// GoString returns the string representation 517func (s BatchUpdateDetectorErrorEntry) GoString() string { 518 return s.String() 519} 520 521// SetErrorCode sets the ErrorCode field's value. 522func (s *BatchUpdateDetectorErrorEntry) SetErrorCode(v string) *BatchUpdateDetectorErrorEntry { 523 s.ErrorCode = &v 524 return s 525} 526 527// SetErrorMessage sets the ErrorMessage field's value. 528func (s *BatchUpdateDetectorErrorEntry) SetErrorMessage(v string) *BatchUpdateDetectorErrorEntry { 529 s.ErrorMessage = &v 530 return s 531} 532 533// SetMessageId sets the MessageId field's value. 534func (s *BatchUpdateDetectorErrorEntry) SetMessageId(v string) *BatchUpdateDetectorErrorEntry { 535 s.MessageId = &v 536 return s 537} 538 539type BatchUpdateDetectorInput struct { 540 _ struct{} `type:"structure"` 541 542 // The list of detectors (instances) to update, along with the values to update. 543 // 544 // Detectors is a required field 545 Detectors []*UpdateDetectorRequest `locationName:"detectors" min:"1" type:"list" required:"true"` 546} 547 548// String returns the string representation 549func (s BatchUpdateDetectorInput) String() string { 550 return awsutil.Prettify(s) 551} 552 553// GoString returns the string representation 554func (s BatchUpdateDetectorInput) GoString() string { 555 return s.String() 556} 557 558// Validate inspects the fields of the type to determine if they are valid. 559func (s *BatchUpdateDetectorInput) Validate() error { 560 invalidParams := request.ErrInvalidParams{Context: "BatchUpdateDetectorInput"} 561 if s.Detectors == nil { 562 invalidParams.Add(request.NewErrParamRequired("Detectors")) 563 } 564 if s.Detectors != nil && len(s.Detectors) < 1 { 565 invalidParams.Add(request.NewErrParamMinLen("Detectors", 1)) 566 } 567 if s.Detectors != nil { 568 for i, v := range s.Detectors { 569 if v == nil { 570 continue 571 } 572 if err := v.Validate(); err != nil { 573 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Detectors", i), err.(request.ErrInvalidParams)) 574 } 575 } 576 } 577 578 if invalidParams.Len() > 0 { 579 return invalidParams 580 } 581 return nil 582} 583 584// SetDetectors sets the Detectors field's value. 585func (s *BatchUpdateDetectorInput) SetDetectors(v []*UpdateDetectorRequest) *BatchUpdateDetectorInput { 586 s.Detectors = v 587 return s 588} 589 590type BatchUpdateDetectorOutput struct { 591 _ struct{} `type:"structure"` 592 593 // A list of those detector updates that resulted in errors. (If an error is 594 // listed here, the specific update did not occur.) 595 BatchUpdateDetectorErrorEntries []*BatchUpdateDetectorErrorEntry `locationName:"batchUpdateDetectorErrorEntries" type:"list"` 596} 597 598// String returns the string representation 599func (s BatchUpdateDetectorOutput) String() string { 600 return awsutil.Prettify(s) 601} 602 603// GoString returns the string representation 604func (s BatchUpdateDetectorOutput) GoString() string { 605 return s.String() 606} 607 608// SetBatchUpdateDetectorErrorEntries sets the BatchUpdateDetectorErrorEntries field's value. 609func (s *BatchUpdateDetectorOutput) SetBatchUpdateDetectorErrorEntries(v []*BatchUpdateDetectorErrorEntry) *BatchUpdateDetectorOutput { 610 s.BatchUpdateDetectorErrorEntries = v 611 return s 612} 613 614type DescribeDetectorInput struct { 615 _ struct{} `type:"structure"` 616 617 // The name of the detector model whose detectors (instances) you want information 618 // about. 619 // 620 // DetectorModelName is a required field 621 DetectorModelName *string `location:"uri" locationName:"detectorModelName" min:"1" type:"string" required:"true"` 622 623 // A filter used to limit results to detectors (instances) created because of 624 // the given key ID. 625 KeyValue *string `location:"querystring" locationName:"keyValue" min:"1" type:"string"` 626} 627 628// String returns the string representation 629func (s DescribeDetectorInput) String() string { 630 return awsutil.Prettify(s) 631} 632 633// GoString returns the string representation 634func (s DescribeDetectorInput) GoString() string { 635 return s.String() 636} 637 638// Validate inspects the fields of the type to determine if they are valid. 639func (s *DescribeDetectorInput) Validate() error { 640 invalidParams := request.ErrInvalidParams{Context: "DescribeDetectorInput"} 641 if s.DetectorModelName == nil { 642 invalidParams.Add(request.NewErrParamRequired("DetectorModelName")) 643 } 644 if s.DetectorModelName != nil && len(*s.DetectorModelName) < 1 { 645 invalidParams.Add(request.NewErrParamMinLen("DetectorModelName", 1)) 646 } 647 if s.KeyValue != nil && len(*s.KeyValue) < 1 { 648 invalidParams.Add(request.NewErrParamMinLen("KeyValue", 1)) 649 } 650 651 if invalidParams.Len() > 0 { 652 return invalidParams 653 } 654 return nil 655} 656 657// SetDetectorModelName sets the DetectorModelName field's value. 658func (s *DescribeDetectorInput) SetDetectorModelName(v string) *DescribeDetectorInput { 659 s.DetectorModelName = &v 660 return s 661} 662 663// SetKeyValue sets the KeyValue field's value. 664func (s *DescribeDetectorInput) SetKeyValue(v string) *DescribeDetectorInput { 665 s.KeyValue = &v 666 return s 667} 668 669type DescribeDetectorOutput struct { 670 _ struct{} `type:"structure"` 671 672 // Information about the detector (instance). 673 Detector *Detector `locationName:"detector" type:"structure"` 674} 675 676// String returns the string representation 677func (s DescribeDetectorOutput) String() string { 678 return awsutil.Prettify(s) 679} 680 681// GoString returns the string representation 682func (s DescribeDetectorOutput) GoString() string { 683 return s.String() 684} 685 686// SetDetector sets the Detector field's value. 687func (s *DescribeDetectorOutput) SetDetector(v *Detector) *DescribeDetectorOutput { 688 s.Detector = v 689 return s 690} 691 692// Information about the detector (instance). 693type Detector struct { 694 _ struct{} `type:"structure"` 695 696 // The time the detector (instance) was created. 697 CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` 698 699 // The name of the detector model that created this detector (instance). 700 DetectorModelName *string `locationName:"detectorModelName" min:"1" type:"string"` 701 702 // The version of the detector model that created this detector (instance). 703 DetectorModelVersion *string `locationName:"detectorModelVersion" min:"1" type:"string"` 704 705 // The value of the key (identifying the device or system) that caused the creation 706 // of this detector (instance). 707 KeyValue *string `locationName:"keyValue" min:"1" type:"string"` 708 709 // The time the detector (instance) was last updated. 710 LastUpdateTime *time.Time `locationName:"lastUpdateTime" type:"timestamp"` 711 712 // The current state of the detector (instance). 713 State *DetectorState `locationName:"state" type:"structure"` 714} 715 716// String returns the string representation 717func (s Detector) String() string { 718 return awsutil.Prettify(s) 719} 720 721// GoString returns the string representation 722func (s Detector) GoString() string { 723 return s.String() 724} 725 726// SetCreationTime sets the CreationTime field's value. 727func (s *Detector) SetCreationTime(v time.Time) *Detector { 728 s.CreationTime = &v 729 return s 730} 731 732// SetDetectorModelName sets the DetectorModelName field's value. 733func (s *Detector) SetDetectorModelName(v string) *Detector { 734 s.DetectorModelName = &v 735 return s 736} 737 738// SetDetectorModelVersion sets the DetectorModelVersion field's value. 739func (s *Detector) SetDetectorModelVersion(v string) *Detector { 740 s.DetectorModelVersion = &v 741 return s 742} 743 744// SetKeyValue sets the KeyValue field's value. 745func (s *Detector) SetKeyValue(v string) *Detector { 746 s.KeyValue = &v 747 return s 748} 749 750// SetLastUpdateTime sets the LastUpdateTime field's value. 751func (s *Detector) SetLastUpdateTime(v time.Time) *Detector { 752 s.LastUpdateTime = &v 753 return s 754} 755 756// SetState sets the State field's value. 757func (s *Detector) SetState(v *DetectorState) *Detector { 758 s.State = v 759 return s 760} 761 762// Information about the current state of the detector instance. 763type DetectorState struct { 764 _ struct{} `type:"structure"` 765 766 // The name of the state. 767 // 768 // StateName is a required field 769 StateName *string `locationName:"stateName" min:"1" type:"string" required:"true"` 770 771 // The current state of the detector's timers. 772 // 773 // Timers is a required field 774 Timers []*Timer `locationName:"timers" type:"list" required:"true"` 775 776 // The current values of the detector's variables. 777 // 778 // Variables is a required field 779 Variables []*Variable `locationName:"variables" type:"list" required:"true"` 780} 781 782// String returns the string representation 783func (s DetectorState) String() string { 784 return awsutil.Prettify(s) 785} 786 787// GoString returns the string representation 788func (s DetectorState) GoString() string { 789 return s.String() 790} 791 792// SetStateName sets the StateName field's value. 793func (s *DetectorState) SetStateName(v string) *DetectorState { 794 s.StateName = &v 795 return s 796} 797 798// SetTimers sets the Timers field's value. 799func (s *DetectorState) SetTimers(v []*Timer) *DetectorState { 800 s.Timers = v 801 return s 802} 803 804// SetVariables sets the Variables field's value. 805func (s *DetectorState) SetVariables(v []*Variable) *DetectorState { 806 s.Variables = v 807 return s 808} 809 810// The new state, variable values, and timer settings of the detector (instance). 811type DetectorStateDefinition struct { 812 _ struct{} `type:"structure"` 813 814 // The name of the new state of the detector (instance). 815 // 816 // StateName is a required field 817 StateName *string `locationName:"stateName" min:"1" type:"string" required:"true"` 818 819 // The new values of the detector's timers. Any timer whose value isn't specified 820 // is cleared, and its timeout event won't occur. 821 // 822 // Timers is a required field 823 Timers []*TimerDefinition `locationName:"timers" type:"list" required:"true"` 824 825 // The new values of the detector's variables. Any variable whose value isn't 826 // specified is cleared. 827 // 828 // Variables is a required field 829 Variables []*VariableDefinition `locationName:"variables" type:"list" required:"true"` 830} 831 832// String returns the string representation 833func (s DetectorStateDefinition) String() string { 834 return awsutil.Prettify(s) 835} 836 837// GoString returns the string representation 838func (s DetectorStateDefinition) GoString() string { 839 return s.String() 840} 841 842// Validate inspects the fields of the type to determine if they are valid. 843func (s *DetectorStateDefinition) Validate() error { 844 invalidParams := request.ErrInvalidParams{Context: "DetectorStateDefinition"} 845 if s.StateName == nil { 846 invalidParams.Add(request.NewErrParamRequired("StateName")) 847 } 848 if s.StateName != nil && len(*s.StateName) < 1 { 849 invalidParams.Add(request.NewErrParamMinLen("StateName", 1)) 850 } 851 if s.Timers == nil { 852 invalidParams.Add(request.NewErrParamRequired("Timers")) 853 } 854 if s.Variables == nil { 855 invalidParams.Add(request.NewErrParamRequired("Variables")) 856 } 857 if s.Timers != nil { 858 for i, v := range s.Timers { 859 if v == nil { 860 continue 861 } 862 if err := v.Validate(); err != nil { 863 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Timers", i), err.(request.ErrInvalidParams)) 864 } 865 } 866 } 867 if s.Variables != nil { 868 for i, v := range s.Variables { 869 if v == nil { 870 continue 871 } 872 if err := v.Validate(); err != nil { 873 invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Variables", i), err.(request.ErrInvalidParams)) 874 } 875 } 876 } 877 878 if invalidParams.Len() > 0 { 879 return invalidParams 880 } 881 return nil 882} 883 884// SetStateName sets the StateName field's value. 885func (s *DetectorStateDefinition) SetStateName(v string) *DetectorStateDefinition { 886 s.StateName = &v 887 return s 888} 889 890// SetTimers sets the Timers field's value. 891func (s *DetectorStateDefinition) SetTimers(v []*TimerDefinition) *DetectorStateDefinition { 892 s.Timers = v 893 return s 894} 895 896// SetVariables sets the Variables field's value. 897func (s *DetectorStateDefinition) SetVariables(v []*VariableDefinition) *DetectorStateDefinition { 898 s.Variables = v 899 return s 900} 901 902// Information about the detector state. 903type DetectorStateSummary struct { 904 _ struct{} `type:"structure"` 905 906 // The name of the state. 907 StateName *string `locationName:"stateName" min:"1" type:"string"` 908} 909 910// String returns the string representation 911func (s DetectorStateSummary) String() string { 912 return awsutil.Prettify(s) 913} 914 915// GoString returns the string representation 916func (s DetectorStateSummary) GoString() string { 917 return s.String() 918} 919 920// SetStateName sets the StateName field's value. 921func (s *DetectorStateSummary) SetStateName(v string) *DetectorStateSummary { 922 s.StateName = &v 923 return s 924} 925 926// Information about the detector (instance). 927type DetectorSummary struct { 928 _ struct{} `type:"structure"` 929 930 // The time the detector (instance) was created. 931 CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` 932 933 // The name of the detector model that created this detector (instance). 934 DetectorModelName *string `locationName:"detectorModelName" min:"1" type:"string"` 935 936 // The version of the detector model that created this detector (instance). 937 DetectorModelVersion *string `locationName:"detectorModelVersion" min:"1" type:"string"` 938 939 // The value of the key (identifying the device or system) that caused the creation 940 // of this detector (instance). 941 KeyValue *string `locationName:"keyValue" min:"1" type:"string"` 942 943 // The time the detector (instance) was last updated. 944 LastUpdateTime *time.Time `locationName:"lastUpdateTime" type:"timestamp"` 945 946 // The current state of the detector (instance). 947 State *DetectorStateSummary `locationName:"state" type:"structure"` 948} 949 950// String returns the string representation 951func (s DetectorSummary) String() string { 952 return awsutil.Prettify(s) 953} 954 955// GoString returns the string representation 956func (s DetectorSummary) GoString() string { 957 return s.String() 958} 959 960// SetCreationTime sets the CreationTime field's value. 961func (s *DetectorSummary) SetCreationTime(v time.Time) *DetectorSummary { 962 s.CreationTime = &v 963 return s 964} 965 966// SetDetectorModelName sets the DetectorModelName field's value. 967func (s *DetectorSummary) SetDetectorModelName(v string) *DetectorSummary { 968 s.DetectorModelName = &v 969 return s 970} 971 972// SetDetectorModelVersion sets the DetectorModelVersion field's value. 973func (s *DetectorSummary) SetDetectorModelVersion(v string) *DetectorSummary { 974 s.DetectorModelVersion = &v 975 return s 976} 977 978// SetKeyValue sets the KeyValue field's value. 979func (s *DetectorSummary) SetKeyValue(v string) *DetectorSummary { 980 s.KeyValue = &v 981 return s 982} 983 984// SetLastUpdateTime sets the LastUpdateTime field's value. 985func (s *DetectorSummary) SetLastUpdateTime(v time.Time) *DetectorSummary { 986 s.LastUpdateTime = &v 987 return s 988} 989 990// SetState sets the State field's value. 991func (s *DetectorSummary) SetState(v *DetectorStateSummary) *DetectorSummary { 992 s.State = v 993 return s 994} 995 996type ListDetectorsInput struct { 997 _ struct{} `type:"structure"` 998 999 // The name of the detector model whose detectors (instances) are listed. 1000 // 1001 // DetectorModelName is a required field 1002 DetectorModelName *string `location:"uri" locationName:"detectorModelName" min:"1" type:"string" required:"true"` 1003 1004 // The maximum number of results to return at one time. 1005 MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` 1006 1007 // The token for the next set of results. 1008 NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` 1009 1010 // A filter that limits results to those detectors (instances) in the given 1011 // state. 1012 StateName *string `location:"querystring" locationName:"stateName" min:"1" type:"string"` 1013} 1014 1015// String returns the string representation 1016func (s ListDetectorsInput) String() string { 1017 return awsutil.Prettify(s) 1018} 1019 1020// GoString returns the string representation 1021func (s ListDetectorsInput) GoString() string { 1022 return s.String() 1023} 1024 1025// Validate inspects the fields of the type to determine if they are valid. 1026func (s *ListDetectorsInput) Validate() error { 1027 invalidParams := request.ErrInvalidParams{Context: "ListDetectorsInput"} 1028 if s.DetectorModelName == nil { 1029 invalidParams.Add(request.NewErrParamRequired("DetectorModelName")) 1030 } 1031 if s.DetectorModelName != nil && len(*s.DetectorModelName) < 1 { 1032 invalidParams.Add(request.NewErrParamMinLen("DetectorModelName", 1)) 1033 } 1034 if s.MaxResults != nil && *s.MaxResults < 1 { 1035 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1036 } 1037 if s.StateName != nil && len(*s.StateName) < 1 { 1038 invalidParams.Add(request.NewErrParamMinLen("StateName", 1)) 1039 } 1040 1041 if invalidParams.Len() > 0 { 1042 return invalidParams 1043 } 1044 return nil 1045} 1046 1047// SetDetectorModelName sets the DetectorModelName field's value. 1048func (s *ListDetectorsInput) SetDetectorModelName(v string) *ListDetectorsInput { 1049 s.DetectorModelName = &v 1050 return s 1051} 1052 1053// SetMaxResults sets the MaxResults field's value. 1054func (s *ListDetectorsInput) SetMaxResults(v int64) *ListDetectorsInput { 1055 s.MaxResults = &v 1056 return s 1057} 1058 1059// SetNextToken sets the NextToken field's value. 1060func (s *ListDetectorsInput) SetNextToken(v string) *ListDetectorsInput { 1061 s.NextToken = &v 1062 return s 1063} 1064 1065// SetStateName sets the StateName field's value. 1066func (s *ListDetectorsInput) SetStateName(v string) *ListDetectorsInput { 1067 s.StateName = &v 1068 return s 1069} 1070 1071type ListDetectorsOutput struct { 1072 _ struct{} `type:"structure"` 1073 1074 // A list of summary information about the detectors (instances). 1075 DetectorSummaries []*DetectorSummary `locationName:"detectorSummaries" type:"list"` 1076 1077 // A token to retrieve the next set of results, or null if there are no additional 1078 // results. 1079 NextToken *string `locationName:"nextToken" type:"string"` 1080} 1081 1082// String returns the string representation 1083func (s ListDetectorsOutput) String() string { 1084 return awsutil.Prettify(s) 1085} 1086 1087// GoString returns the string representation 1088func (s ListDetectorsOutput) GoString() string { 1089 return s.String() 1090} 1091 1092// SetDetectorSummaries sets the DetectorSummaries field's value. 1093func (s *ListDetectorsOutput) SetDetectorSummaries(v []*DetectorSummary) *ListDetectorsOutput { 1094 s.DetectorSummaries = v 1095 return s 1096} 1097 1098// SetNextToken sets the NextToken field's value. 1099func (s *ListDetectorsOutput) SetNextToken(v string) *ListDetectorsOutput { 1100 s.NextToken = &v 1101 return s 1102} 1103 1104// Information about a message. 1105type Message struct { 1106 _ struct{} `type:"structure"` 1107 1108 // The name of the input into which the message payload is transformed. 1109 // 1110 // InputName is a required field 1111 InputName *string `locationName:"inputName" min:"1" type:"string" required:"true"` 1112 1113 // The ID to assign to the message. Within each batch sent, each "messageId" 1114 // must be unique. 1115 // 1116 // MessageId is a required field 1117 MessageId *string `locationName:"messageId" min:"1" type:"string" required:"true"` 1118 1119 // The payload of the message. This can be a JSON string or a Base-64-encoded 1120 // string representing binary data (in which case you must decode it). 1121 // 1122 // Payload is automatically base64 encoded/decoded by the SDK. 1123 // 1124 // Payload is a required field 1125 Payload []byte `locationName:"payload" type:"blob" required:"true"` 1126} 1127 1128// String returns the string representation 1129func (s Message) String() string { 1130 return awsutil.Prettify(s) 1131} 1132 1133// GoString returns the string representation 1134func (s Message) GoString() string { 1135 return s.String() 1136} 1137 1138// Validate inspects the fields of the type to determine if they are valid. 1139func (s *Message) Validate() error { 1140 invalidParams := request.ErrInvalidParams{Context: "Message"} 1141 if s.InputName == nil { 1142 invalidParams.Add(request.NewErrParamRequired("InputName")) 1143 } 1144 if s.InputName != nil && len(*s.InputName) < 1 { 1145 invalidParams.Add(request.NewErrParamMinLen("InputName", 1)) 1146 } 1147 if s.MessageId == nil { 1148 invalidParams.Add(request.NewErrParamRequired("MessageId")) 1149 } 1150 if s.MessageId != nil && len(*s.MessageId) < 1 { 1151 invalidParams.Add(request.NewErrParamMinLen("MessageId", 1)) 1152 } 1153 if s.Payload == nil { 1154 invalidParams.Add(request.NewErrParamRequired("Payload")) 1155 } 1156 1157 if invalidParams.Len() > 0 { 1158 return invalidParams 1159 } 1160 return nil 1161} 1162 1163// SetInputName sets the InputName field's value. 1164func (s *Message) SetInputName(v string) *Message { 1165 s.InputName = &v 1166 return s 1167} 1168 1169// SetMessageId sets the MessageId field's value. 1170func (s *Message) SetMessageId(v string) *Message { 1171 s.MessageId = &v 1172 return s 1173} 1174 1175// SetPayload sets the Payload field's value. 1176func (s *Message) SetPayload(v []byte) *Message { 1177 s.Payload = v 1178 return s 1179} 1180 1181// The current state of a timer. 1182type Timer struct { 1183 _ struct{} `type:"structure"` 1184 1185 // The name of the timer. 1186 // 1187 // Name is a required field 1188 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 1189 1190 // The number of seconds which have elapsed on the timer. 1191 // 1192 // Timestamp is a required field 1193 Timestamp *time.Time `locationName:"timestamp" type:"timestamp" required:"true"` 1194} 1195 1196// String returns the string representation 1197func (s Timer) String() string { 1198 return awsutil.Prettify(s) 1199} 1200 1201// GoString returns the string representation 1202func (s Timer) GoString() string { 1203 return s.String() 1204} 1205 1206// SetName sets the Name field's value. 1207func (s *Timer) SetName(v string) *Timer { 1208 s.Name = &v 1209 return s 1210} 1211 1212// SetTimestamp sets the Timestamp field's value. 1213func (s *Timer) SetTimestamp(v time.Time) *Timer { 1214 s.Timestamp = &v 1215 return s 1216} 1217 1218// The new setting of a timer. 1219type TimerDefinition struct { 1220 _ struct{} `type:"structure"` 1221 1222 // The name of the timer. 1223 // 1224 // Name is a required field 1225 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 1226 1227 // The new setting of the timer (the number of seconds before the timer elapses). 1228 // 1229 // Seconds is a required field 1230 Seconds *int64 `locationName:"seconds" type:"integer" required:"true"` 1231} 1232 1233// String returns the string representation 1234func (s TimerDefinition) String() string { 1235 return awsutil.Prettify(s) 1236} 1237 1238// GoString returns the string representation 1239func (s TimerDefinition) GoString() string { 1240 return s.String() 1241} 1242 1243// Validate inspects the fields of the type to determine if they are valid. 1244func (s *TimerDefinition) Validate() error { 1245 invalidParams := request.ErrInvalidParams{Context: "TimerDefinition"} 1246 if s.Name == nil { 1247 invalidParams.Add(request.NewErrParamRequired("Name")) 1248 } 1249 if s.Name != nil && len(*s.Name) < 1 { 1250 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1251 } 1252 if s.Seconds == nil { 1253 invalidParams.Add(request.NewErrParamRequired("Seconds")) 1254 } 1255 1256 if invalidParams.Len() > 0 { 1257 return invalidParams 1258 } 1259 return nil 1260} 1261 1262// SetName sets the Name field's value. 1263func (s *TimerDefinition) SetName(v string) *TimerDefinition { 1264 s.Name = &v 1265 return s 1266} 1267 1268// SetSeconds sets the Seconds field's value. 1269func (s *TimerDefinition) SetSeconds(v int64) *TimerDefinition { 1270 s.Seconds = &v 1271 return s 1272} 1273 1274// Information used to update the detector (instance). 1275type UpdateDetectorRequest struct { 1276 _ struct{} `type:"structure"` 1277 1278 // The name of the detector model that created the detectors (instances). 1279 // 1280 // DetectorModelName is a required field 1281 DetectorModelName *string `locationName:"detectorModelName" min:"1" type:"string" required:"true"` 1282 1283 // The value of the input key attribute (identifying the device or system) that 1284 // caused the creation of this detector (instance). 1285 KeyValue *string `locationName:"keyValue" min:"1" type:"string"` 1286 1287 // The ID to assign to the detector update "message". Each "messageId" must 1288 // be unique within each batch sent. 1289 // 1290 // MessageId is a required field 1291 MessageId *string `locationName:"messageId" min:"1" type:"string" required:"true"` 1292 1293 // The new state, variable values, and timer settings of the detector (instance). 1294 // 1295 // State is a required field 1296 State *DetectorStateDefinition `locationName:"state" type:"structure" required:"true"` 1297} 1298 1299// String returns the string representation 1300func (s UpdateDetectorRequest) String() string { 1301 return awsutil.Prettify(s) 1302} 1303 1304// GoString returns the string representation 1305func (s UpdateDetectorRequest) GoString() string { 1306 return s.String() 1307} 1308 1309// Validate inspects the fields of the type to determine if they are valid. 1310func (s *UpdateDetectorRequest) Validate() error { 1311 invalidParams := request.ErrInvalidParams{Context: "UpdateDetectorRequest"} 1312 if s.DetectorModelName == nil { 1313 invalidParams.Add(request.NewErrParamRequired("DetectorModelName")) 1314 } 1315 if s.DetectorModelName != nil && len(*s.DetectorModelName) < 1 { 1316 invalidParams.Add(request.NewErrParamMinLen("DetectorModelName", 1)) 1317 } 1318 if s.KeyValue != nil && len(*s.KeyValue) < 1 { 1319 invalidParams.Add(request.NewErrParamMinLen("KeyValue", 1)) 1320 } 1321 if s.MessageId == nil { 1322 invalidParams.Add(request.NewErrParamRequired("MessageId")) 1323 } 1324 if s.MessageId != nil && len(*s.MessageId) < 1 { 1325 invalidParams.Add(request.NewErrParamMinLen("MessageId", 1)) 1326 } 1327 if s.State == nil { 1328 invalidParams.Add(request.NewErrParamRequired("State")) 1329 } 1330 if s.State != nil { 1331 if err := s.State.Validate(); err != nil { 1332 invalidParams.AddNested("State", err.(request.ErrInvalidParams)) 1333 } 1334 } 1335 1336 if invalidParams.Len() > 0 { 1337 return invalidParams 1338 } 1339 return nil 1340} 1341 1342// SetDetectorModelName sets the DetectorModelName field's value. 1343func (s *UpdateDetectorRequest) SetDetectorModelName(v string) *UpdateDetectorRequest { 1344 s.DetectorModelName = &v 1345 return s 1346} 1347 1348// SetKeyValue sets the KeyValue field's value. 1349func (s *UpdateDetectorRequest) SetKeyValue(v string) *UpdateDetectorRequest { 1350 s.KeyValue = &v 1351 return s 1352} 1353 1354// SetMessageId sets the MessageId field's value. 1355func (s *UpdateDetectorRequest) SetMessageId(v string) *UpdateDetectorRequest { 1356 s.MessageId = &v 1357 return s 1358} 1359 1360// SetState sets the State field's value. 1361func (s *UpdateDetectorRequest) SetState(v *DetectorStateDefinition) *UpdateDetectorRequest { 1362 s.State = v 1363 return s 1364} 1365 1366// The current state of the variable. 1367type Variable struct { 1368 _ struct{} `type:"structure"` 1369 1370 // The name of the variable. 1371 // 1372 // Name is a required field 1373 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 1374 1375 // The current value of the variable. 1376 // 1377 // Value is a required field 1378 Value *string `locationName:"value" min:"1" type:"string" required:"true"` 1379} 1380 1381// String returns the string representation 1382func (s Variable) String() string { 1383 return awsutil.Prettify(s) 1384} 1385 1386// GoString returns the string representation 1387func (s Variable) GoString() string { 1388 return s.String() 1389} 1390 1391// SetName sets the Name field's value. 1392func (s *Variable) SetName(v string) *Variable { 1393 s.Name = &v 1394 return s 1395} 1396 1397// SetValue sets the Value field's value. 1398func (s *Variable) SetValue(v string) *Variable { 1399 s.Value = &v 1400 return s 1401} 1402 1403// The new value of the variable. 1404type VariableDefinition struct { 1405 _ struct{} `type:"structure"` 1406 1407 // The name of the variable. 1408 // 1409 // Name is a required field 1410 Name *string `locationName:"name" min:"1" type:"string" required:"true"` 1411 1412 // The new value of the variable. 1413 // 1414 // Value is a required field 1415 Value *string `locationName:"value" min:"1" type:"string" required:"true"` 1416} 1417 1418// String returns the string representation 1419func (s VariableDefinition) String() string { 1420 return awsutil.Prettify(s) 1421} 1422 1423// GoString returns the string representation 1424func (s VariableDefinition) GoString() string { 1425 return s.String() 1426} 1427 1428// Validate inspects the fields of the type to determine if they are valid. 1429func (s *VariableDefinition) Validate() error { 1430 invalidParams := request.ErrInvalidParams{Context: "VariableDefinition"} 1431 if s.Name == nil { 1432 invalidParams.Add(request.NewErrParamRequired("Name")) 1433 } 1434 if s.Name != nil && len(*s.Name) < 1 { 1435 invalidParams.Add(request.NewErrParamMinLen("Name", 1)) 1436 } 1437 if s.Value == nil { 1438 invalidParams.Add(request.NewErrParamRequired("Value")) 1439 } 1440 if s.Value != nil && len(*s.Value) < 1 { 1441 invalidParams.Add(request.NewErrParamMinLen("Value", 1)) 1442 } 1443 1444 if invalidParams.Len() > 0 { 1445 return invalidParams 1446 } 1447 return nil 1448} 1449 1450// SetName sets the Name field's value. 1451func (s *VariableDefinition) SetName(v string) *VariableDefinition { 1452 s.Name = &v 1453 return s 1454} 1455 1456// SetValue sets the Value field's value. 1457func (s *VariableDefinition) SetValue(v string) *VariableDefinition { 1458 s.Value = &v 1459 return s 1460} 1461 1462const ( 1463 // ErrorCodeResourceNotFoundException is a ErrorCode enum value 1464 ErrorCodeResourceNotFoundException = "ResourceNotFoundException" 1465 1466 // ErrorCodeInvalidRequestException is a ErrorCode enum value 1467 ErrorCodeInvalidRequestException = "InvalidRequestException" 1468 1469 // ErrorCodeInternalFailureException is a ErrorCode enum value 1470 ErrorCodeInternalFailureException = "InternalFailureException" 1471 1472 // ErrorCodeServiceUnavailableException is a ErrorCode enum value 1473 ErrorCodeServiceUnavailableException = "ServiceUnavailableException" 1474 1475 // ErrorCodeThrottlingException is a ErrorCode enum value 1476 ErrorCodeThrottlingException = "ThrottlingException" 1477) 1478