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