1// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
2
3package iotjobsdataplane
4
5import (
6	"github.com/aws/aws-sdk-go/aws"
7	"github.com/aws/aws-sdk-go/aws/awsutil"
8	"github.com/aws/aws-sdk-go/aws/request"
9)
10
11const opDescribeJobExecution = "DescribeJobExecution"
12
13// DescribeJobExecutionRequest generates a "aws/request.Request" representing the
14// client's request for the DescribeJobExecution operation. The "output" return
15// value will be populated with the request's response once the request completes
16// successfuly.
17//
18// Use "Send" method on the returned Request to send the API call to the service.
19// the "output" return value is not valid until after Send returns without error.
20//
21// See DescribeJobExecution for more information on using the DescribeJobExecution
22// API call, and error handling.
23//
24// This method is useful when you want to inject custom logic or configuration
25// into the SDK's request lifecycle. Such as custom headers, or retry logic.
26//
27//
28//    // Example sending a request using the DescribeJobExecutionRequest method.
29//    req, resp := client.DescribeJobExecutionRequest(params)
30//
31//    err := req.Send()
32//    if err == nil { // resp is now filled
33//        fmt.Println(resp)
34//    }
35//
36// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/DescribeJobExecution
37func (c *IoTJobsDataPlane) DescribeJobExecutionRequest(input *DescribeJobExecutionInput) (req *request.Request, output *DescribeJobExecutionOutput) {
38	op := &request.Operation{
39		Name:       opDescribeJobExecution,
40		HTTPMethod: "GET",
41		HTTPPath:   "/things/{thingName}/jobs/{jobId}",
42	}
43
44	if input == nil {
45		input = &DescribeJobExecutionInput{}
46	}
47
48	output = &DescribeJobExecutionOutput{}
49	req = c.newRequest(op, input, output)
50	return
51}
52
53// DescribeJobExecution API operation for AWS IoT Jobs Data Plane.
54//
55// Gets details of a job execution.
56//
57// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
58// with awserr.Error's Code and Message methods to get detailed information about
59// the error.
60//
61// See the AWS API reference guide for AWS IoT Jobs Data Plane's
62// API operation DescribeJobExecution for usage and error information.
63//
64// Returned Error Codes:
65//   * ErrCodeInvalidRequestException "InvalidRequestException"
66//   The contents of the request were invalid. For example, this code is returned
67//   when an UpdateJobExecution request contains invalid status details. The message
68//   contains details about the error.
69//
70//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
71//   The specified resource does not exist.
72//
73//   * ErrCodeThrottlingException "ThrottlingException"
74//   The rate exceeds the limit.
75//
76//   * ErrCodeServiceUnavailableException "ServiceUnavailableException"
77//   The service is temporarily unavailable.
78//
79//   * ErrCodeCertificateValidationException "CertificateValidationException"
80//   The certificate is invalid.
81//
82//   * ErrCodeTerminalStateException "TerminalStateException"
83//   The job is in a terminal state.
84//
85// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/DescribeJobExecution
86func (c *IoTJobsDataPlane) DescribeJobExecution(input *DescribeJobExecutionInput) (*DescribeJobExecutionOutput, error) {
87	req, out := c.DescribeJobExecutionRequest(input)
88	return out, req.Send()
89}
90
91// DescribeJobExecutionWithContext is the same as DescribeJobExecution with the addition of
92// the ability to pass a context and additional request options.
93//
94// See DescribeJobExecution 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 *IoTJobsDataPlane) DescribeJobExecutionWithContext(ctx aws.Context, input *DescribeJobExecutionInput, opts ...request.Option) (*DescribeJobExecutionOutput, error) {
101	req, out := c.DescribeJobExecutionRequest(input)
102	req.SetContext(ctx)
103	req.ApplyOptions(opts...)
104	return out, req.Send()
105}
106
107const opGetPendingJobExecutions = "GetPendingJobExecutions"
108
109// GetPendingJobExecutionsRequest generates a "aws/request.Request" representing the
110// client's request for the GetPendingJobExecutions operation. The "output" return
111// value will be populated with the request's response once the request completes
112// successfuly.
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 GetPendingJobExecutions for more information on using the GetPendingJobExecutions
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 GetPendingJobExecutionsRequest method.
125//    req, resp := client.GetPendingJobExecutionsRequest(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/iot-jobs-data-2017-09-29/GetPendingJobExecutions
133func (c *IoTJobsDataPlane) GetPendingJobExecutionsRequest(input *GetPendingJobExecutionsInput) (req *request.Request, output *GetPendingJobExecutionsOutput) {
134	op := &request.Operation{
135		Name:       opGetPendingJobExecutions,
136		HTTPMethod: "GET",
137		HTTPPath:   "/things/{thingName}/jobs",
138	}
139
140	if input == nil {
141		input = &GetPendingJobExecutionsInput{}
142	}
143
144	output = &GetPendingJobExecutionsOutput{}
145	req = c.newRequest(op, input, output)
146	return
147}
148
149// GetPendingJobExecutions API operation for AWS IoT Jobs Data Plane.
150//
151// Gets the list of all jobs for a thing that are not in a terminal status.
152//
153// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
154// with awserr.Error's Code and Message methods to get detailed information about
155// the error.
156//
157// See the AWS API reference guide for AWS IoT Jobs Data Plane's
158// API operation GetPendingJobExecutions for usage and error information.
159//
160// Returned Error Codes:
161//   * ErrCodeInvalidRequestException "InvalidRequestException"
162//   The contents of the request were invalid. For example, this code is returned
163//   when an UpdateJobExecution request contains invalid status details. The message
164//   contains details about the error.
165//
166//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
167//   The specified resource does not exist.
168//
169//   * ErrCodeThrottlingException "ThrottlingException"
170//   The rate exceeds the limit.
171//
172//   * ErrCodeServiceUnavailableException "ServiceUnavailableException"
173//   The service is temporarily unavailable.
174//
175//   * ErrCodeCertificateValidationException "CertificateValidationException"
176//   The certificate is invalid.
177//
178// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/GetPendingJobExecutions
179func (c *IoTJobsDataPlane) GetPendingJobExecutions(input *GetPendingJobExecutionsInput) (*GetPendingJobExecutionsOutput, error) {
180	req, out := c.GetPendingJobExecutionsRequest(input)
181	return out, req.Send()
182}
183
184// GetPendingJobExecutionsWithContext is the same as GetPendingJobExecutions with the addition of
185// the ability to pass a context and additional request options.
186//
187// See GetPendingJobExecutions for details on how to use this API operation.
188//
189// The context must be non-nil and will be used for request cancellation. If
190// the context is nil a panic will occur. In the future the SDK may create
191// sub-contexts for http.Requests. See https://golang.org/pkg/context/
192// for more information on using Contexts.
193func (c *IoTJobsDataPlane) GetPendingJobExecutionsWithContext(ctx aws.Context, input *GetPendingJobExecutionsInput, opts ...request.Option) (*GetPendingJobExecutionsOutput, error) {
194	req, out := c.GetPendingJobExecutionsRequest(input)
195	req.SetContext(ctx)
196	req.ApplyOptions(opts...)
197	return out, req.Send()
198}
199
200const opStartNextPendingJobExecution = "StartNextPendingJobExecution"
201
202// StartNextPendingJobExecutionRequest generates a "aws/request.Request" representing the
203// client's request for the StartNextPendingJobExecution operation. The "output" return
204// value will be populated with the request's response once the request completes
205// successfuly.
206//
207// Use "Send" method on the returned Request to send the API call to the service.
208// the "output" return value is not valid until after Send returns without error.
209//
210// See StartNextPendingJobExecution for more information on using the StartNextPendingJobExecution
211// API call, and error handling.
212//
213// This method is useful when you want to inject custom logic or configuration
214// into the SDK's request lifecycle. Such as custom headers, or retry logic.
215//
216//
217//    // Example sending a request using the StartNextPendingJobExecutionRequest method.
218//    req, resp := client.StartNextPendingJobExecutionRequest(params)
219//
220//    err := req.Send()
221//    if err == nil { // resp is now filled
222//        fmt.Println(resp)
223//    }
224//
225// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecution
226func (c *IoTJobsDataPlane) StartNextPendingJobExecutionRequest(input *StartNextPendingJobExecutionInput) (req *request.Request, output *StartNextPendingJobExecutionOutput) {
227	op := &request.Operation{
228		Name:       opStartNextPendingJobExecution,
229		HTTPMethod: "PUT",
230		HTTPPath:   "/things/{thingName}/jobs/$next",
231	}
232
233	if input == nil {
234		input = &StartNextPendingJobExecutionInput{}
235	}
236
237	output = &StartNextPendingJobExecutionOutput{}
238	req = c.newRequest(op, input, output)
239	return
240}
241
242// StartNextPendingJobExecution API operation for AWS IoT Jobs Data Plane.
243//
244// Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution
245// for a thing.
246//
247// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
248// with awserr.Error's Code and Message methods to get detailed information about
249// the error.
250//
251// See the AWS API reference guide for AWS IoT Jobs Data Plane's
252// API operation StartNextPendingJobExecution for usage and error information.
253//
254// Returned Error Codes:
255//   * ErrCodeInvalidRequestException "InvalidRequestException"
256//   The contents of the request were invalid. For example, this code is returned
257//   when an UpdateJobExecution request contains invalid status details. The message
258//   contains details about the error.
259//
260//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
261//   The specified resource does not exist.
262//
263//   * ErrCodeThrottlingException "ThrottlingException"
264//   The rate exceeds the limit.
265//
266//   * ErrCodeServiceUnavailableException "ServiceUnavailableException"
267//   The service is temporarily unavailable.
268//
269//   * ErrCodeCertificateValidationException "CertificateValidationException"
270//   The certificate is invalid.
271//
272// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecution
273func (c *IoTJobsDataPlane) StartNextPendingJobExecution(input *StartNextPendingJobExecutionInput) (*StartNextPendingJobExecutionOutput, error) {
274	req, out := c.StartNextPendingJobExecutionRequest(input)
275	return out, req.Send()
276}
277
278// StartNextPendingJobExecutionWithContext is the same as StartNextPendingJobExecution with the addition of
279// the ability to pass a context and additional request options.
280//
281// See StartNextPendingJobExecution for details on how to use this API operation.
282//
283// The context must be non-nil and will be used for request cancellation. If
284// the context is nil a panic will occur. In the future the SDK may create
285// sub-contexts for http.Requests. See https://golang.org/pkg/context/
286// for more information on using Contexts.
287func (c *IoTJobsDataPlane) StartNextPendingJobExecutionWithContext(ctx aws.Context, input *StartNextPendingJobExecutionInput, opts ...request.Option) (*StartNextPendingJobExecutionOutput, error) {
288	req, out := c.StartNextPendingJobExecutionRequest(input)
289	req.SetContext(ctx)
290	req.ApplyOptions(opts...)
291	return out, req.Send()
292}
293
294const opUpdateJobExecution = "UpdateJobExecution"
295
296// UpdateJobExecutionRequest generates a "aws/request.Request" representing the
297// client's request for the UpdateJobExecution operation. The "output" return
298// value will be populated with the request's response once the request completes
299// successfuly.
300//
301// Use "Send" method on the returned Request to send the API call to the service.
302// the "output" return value is not valid until after Send returns without error.
303//
304// See UpdateJobExecution for more information on using the UpdateJobExecution
305// API call, and error handling.
306//
307// This method is useful when you want to inject custom logic or configuration
308// into the SDK's request lifecycle. Such as custom headers, or retry logic.
309//
310//
311//    // Example sending a request using the UpdateJobExecutionRequest method.
312//    req, resp := client.UpdateJobExecutionRequest(params)
313//
314//    err := req.Send()
315//    if err == nil { // resp is now filled
316//        fmt.Println(resp)
317//    }
318//
319// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/UpdateJobExecution
320func (c *IoTJobsDataPlane) UpdateJobExecutionRequest(input *UpdateJobExecutionInput) (req *request.Request, output *UpdateJobExecutionOutput) {
321	op := &request.Operation{
322		Name:       opUpdateJobExecution,
323		HTTPMethod: "POST",
324		HTTPPath:   "/things/{thingName}/jobs/{jobId}",
325	}
326
327	if input == nil {
328		input = &UpdateJobExecutionInput{}
329	}
330
331	output = &UpdateJobExecutionOutput{}
332	req = c.newRequest(op, input, output)
333	return
334}
335
336// UpdateJobExecution API operation for AWS IoT Jobs Data Plane.
337//
338// Updates the status of a job execution.
339//
340// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
341// with awserr.Error's Code and Message methods to get detailed information about
342// the error.
343//
344// See the AWS API reference guide for AWS IoT Jobs Data Plane's
345// API operation UpdateJobExecution for usage and error information.
346//
347// Returned Error Codes:
348//   * ErrCodeInvalidRequestException "InvalidRequestException"
349//   The contents of the request were invalid. For example, this code is returned
350//   when an UpdateJobExecution request contains invalid status details. The message
351//   contains details about the error.
352//
353//   * ErrCodeResourceNotFoundException "ResourceNotFoundException"
354//   The specified resource does not exist.
355//
356//   * ErrCodeThrottlingException "ThrottlingException"
357//   The rate exceeds the limit.
358//
359//   * ErrCodeServiceUnavailableException "ServiceUnavailableException"
360//   The service is temporarily unavailable.
361//
362//   * ErrCodeCertificateValidationException "CertificateValidationException"
363//   The certificate is invalid.
364//
365//   * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException"
366//   An update attempted to change the job execution to a state that is invalid
367//   because of the job execution's current state (for example, an attempt to
368//   change a request in state SUCCESS to state IN_PROGRESS). In this case, the
369//   body of the error message also contains the executionState field.
370//
371// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/UpdateJobExecution
372func (c *IoTJobsDataPlane) UpdateJobExecution(input *UpdateJobExecutionInput) (*UpdateJobExecutionOutput, error) {
373	req, out := c.UpdateJobExecutionRequest(input)
374	return out, req.Send()
375}
376
377// UpdateJobExecutionWithContext is the same as UpdateJobExecution with the addition of
378// the ability to pass a context and additional request options.
379//
380// See UpdateJobExecution for details on how to use this API operation.
381//
382// The context must be non-nil and will be used for request cancellation. If
383// the context is nil a panic will occur. In the future the SDK may create
384// sub-contexts for http.Requests. See https://golang.org/pkg/context/
385// for more information on using Contexts.
386func (c *IoTJobsDataPlane) UpdateJobExecutionWithContext(ctx aws.Context, input *UpdateJobExecutionInput, opts ...request.Option) (*UpdateJobExecutionOutput, error) {
387	req, out := c.UpdateJobExecutionRequest(input)
388	req.SetContext(ctx)
389	req.ApplyOptions(opts...)
390	return out, req.Send()
391}
392
393type DescribeJobExecutionInput struct {
394	_ struct{} `type:"structure"`
395
396	// Optional. A number that identifies a particular job execution on a particular
397	// device. If not specified, the latest job execution is returned.
398	ExecutionNumber *int64 `location:"querystring" locationName:"executionNumber" type:"long"`
399
400	// Optional. When set to true, the response contains the job document. The default
401	// is false.
402	IncludeJobDocument *bool `location:"querystring" locationName:"includeJobDocument" type:"boolean"`
403
404	// The unique identifier assigned to this job when it was created.
405	//
406	// JobId is a required field
407	JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"`
408
409	// The thing name associated with the device the job execution is running on.
410	//
411	// ThingName is a required field
412	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
413}
414
415// String returns the string representation
416func (s DescribeJobExecutionInput) String() string {
417	return awsutil.Prettify(s)
418}
419
420// GoString returns the string representation
421func (s DescribeJobExecutionInput) GoString() string {
422	return s.String()
423}
424
425// Validate inspects the fields of the type to determine if they are valid.
426func (s *DescribeJobExecutionInput) Validate() error {
427	invalidParams := request.ErrInvalidParams{Context: "DescribeJobExecutionInput"}
428	if s.JobId == nil {
429		invalidParams.Add(request.NewErrParamRequired("JobId"))
430	}
431	if s.ThingName == nil {
432		invalidParams.Add(request.NewErrParamRequired("ThingName"))
433	}
434	if s.ThingName != nil && len(*s.ThingName) < 1 {
435		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
436	}
437
438	if invalidParams.Len() > 0 {
439		return invalidParams
440	}
441	return nil
442}
443
444// SetExecutionNumber sets the ExecutionNumber field's value.
445func (s *DescribeJobExecutionInput) SetExecutionNumber(v int64) *DescribeJobExecutionInput {
446	s.ExecutionNumber = &v
447	return s
448}
449
450// SetIncludeJobDocument sets the IncludeJobDocument field's value.
451func (s *DescribeJobExecutionInput) SetIncludeJobDocument(v bool) *DescribeJobExecutionInput {
452	s.IncludeJobDocument = &v
453	return s
454}
455
456// SetJobId sets the JobId field's value.
457func (s *DescribeJobExecutionInput) SetJobId(v string) *DescribeJobExecutionInput {
458	s.JobId = &v
459	return s
460}
461
462// SetThingName sets the ThingName field's value.
463func (s *DescribeJobExecutionInput) SetThingName(v string) *DescribeJobExecutionInput {
464	s.ThingName = &v
465	return s
466}
467
468type DescribeJobExecutionOutput struct {
469	_ struct{} `type:"structure"`
470
471	// Contains data about a job execution.
472	Execution *JobExecution `locationName:"execution" type:"structure"`
473}
474
475// String returns the string representation
476func (s DescribeJobExecutionOutput) String() string {
477	return awsutil.Prettify(s)
478}
479
480// GoString returns the string representation
481func (s DescribeJobExecutionOutput) GoString() string {
482	return s.String()
483}
484
485// SetExecution sets the Execution field's value.
486func (s *DescribeJobExecutionOutput) SetExecution(v *JobExecution) *DescribeJobExecutionOutput {
487	s.Execution = v
488	return s
489}
490
491type GetPendingJobExecutionsInput struct {
492	_ struct{} `type:"structure"`
493
494	// The name of the thing that is executing the job.
495	//
496	// ThingName is a required field
497	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
498}
499
500// String returns the string representation
501func (s GetPendingJobExecutionsInput) String() string {
502	return awsutil.Prettify(s)
503}
504
505// GoString returns the string representation
506func (s GetPendingJobExecutionsInput) GoString() string {
507	return s.String()
508}
509
510// Validate inspects the fields of the type to determine if they are valid.
511func (s *GetPendingJobExecutionsInput) Validate() error {
512	invalidParams := request.ErrInvalidParams{Context: "GetPendingJobExecutionsInput"}
513	if s.ThingName == nil {
514		invalidParams.Add(request.NewErrParamRequired("ThingName"))
515	}
516	if s.ThingName != nil && len(*s.ThingName) < 1 {
517		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
518	}
519
520	if invalidParams.Len() > 0 {
521		return invalidParams
522	}
523	return nil
524}
525
526// SetThingName sets the ThingName field's value.
527func (s *GetPendingJobExecutionsInput) SetThingName(v string) *GetPendingJobExecutionsInput {
528	s.ThingName = &v
529	return s
530}
531
532type GetPendingJobExecutionsOutput struct {
533	_ struct{} `type:"structure"`
534
535	// A list of JobExecutionSummary objects with status IN_PROGRESS.
536	InProgressJobs []*JobExecutionSummary `locationName:"inProgressJobs" type:"list"`
537
538	// A list of JobExecutionSummary objects with status QUEUED.
539	QueuedJobs []*JobExecutionSummary `locationName:"queuedJobs" type:"list"`
540}
541
542// String returns the string representation
543func (s GetPendingJobExecutionsOutput) String() string {
544	return awsutil.Prettify(s)
545}
546
547// GoString returns the string representation
548func (s GetPendingJobExecutionsOutput) GoString() string {
549	return s.String()
550}
551
552// SetInProgressJobs sets the InProgressJobs field's value.
553func (s *GetPendingJobExecutionsOutput) SetInProgressJobs(v []*JobExecutionSummary) *GetPendingJobExecutionsOutput {
554	s.InProgressJobs = v
555	return s
556}
557
558// SetQueuedJobs sets the QueuedJobs field's value.
559func (s *GetPendingJobExecutionsOutput) SetQueuedJobs(v []*JobExecutionSummary) *GetPendingJobExecutionsOutput {
560	s.QueuedJobs = v
561	return s
562}
563
564// Contains data about a job execution.
565type JobExecution struct {
566	_ struct{} `type:"structure"`
567
568	// A number that identifies a particular job execution on a particular device.
569	// It can be used later in commands that return or update job execution information.
570	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
571
572	// The content of the job document.
573	JobDocument *string `locationName:"jobDocument" type:"string"`
574
575	// The unique identifier you assigned to this job when it was created.
576	JobId *string `locationName:"jobId" min:"1" type:"string"`
577
578	// The time, in milliseconds since the epoch, when the job execution was last
579	// updated.
580	LastUpdatedAt *int64 `locationName:"lastUpdatedAt" type:"long"`
581
582	// The time, in milliseconds since the epoch, when the job execution was enqueued.
583	QueuedAt *int64 `locationName:"queuedAt" type:"long"`
584
585	// The time, in milliseconds since the epoch, when the job execution was started.
586	StartedAt *int64 `locationName:"startedAt" type:"long"`
587
588	// The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS",
589	// "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
590	Status *string `locationName:"status" type:"string" enum:"JobExecutionStatus"`
591
592	// A collection of name/value pairs that describe the status of the job execution.
593	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
594
595	// The name of the thing that is executing the job.
596	ThingName *string `locationName:"thingName" min:"1" type:"string"`
597
598	// The version of the job execution. Job execution versions are incremented
599	// each time they are updated by a device.
600	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
601}
602
603// String returns the string representation
604func (s JobExecution) String() string {
605	return awsutil.Prettify(s)
606}
607
608// GoString returns the string representation
609func (s JobExecution) GoString() string {
610	return s.String()
611}
612
613// SetExecutionNumber sets the ExecutionNumber field's value.
614func (s *JobExecution) SetExecutionNumber(v int64) *JobExecution {
615	s.ExecutionNumber = &v
616	return s
617}
618
619// SetJobDocument sets the JobDocument field's value.
620func (s *JobExecution) SetJobDocument(v string) *JobExecution {
621	s.JobDocument = &v
622	return s
623}
624
625// SetJobId sets the JobId field's value.
626func (s *JobExecution) SetJobId(v string) *JobExecution {
627	s.JobId = &v
628	return s
629}
630
631// SetLastUpdatedAt sets the LastUpdatedAt field's value.
632func (s *JobExecution) SetLastUpdatedAt(v int64) *JobExecution {
633	s.LastUpdatedAt = &v
634	return s
635}
636
637// SetQueuedAt sets the QueuedAt field's value.
638func (s *JobExecution) SetQueuedAt(v int64) *JobExecution {
639	s.QueuedAt = &v
640	return s
641}
642
643// SetStartedAt sets the StartedAt field's value.
644func (s *JobExecution) SetStartedAt(v int64) *JobExecution {
645	s.StartedAt = &v
646	return s
647}
648
649// SetStatus sets the Status field's value.
650func (s *JobExecution) SetStatus(v string) *JobExecution {
651	s.Status = &v
652	return s
653}
654
655// SetStatusDetails sets the StatusDetails field's value.
656func (s *JobExecution) SetStatusDetails(v map[string]*string) *JobExecution {
657	s.StatusDetails = v
658	return s
659}
660
661// SetThingName sets the ThingName field's value.
662func (s *JobExecution) SetThingName(v string) *JobExecution {
663	s.ThingName = &v
664	return s
665}
666
667// SetVersionNumber sets the VersionNumber field's value.
668func (s *JobExecution) SetVersionNumber(v int64) *JobExecution {
669	s.VersionNumber = &v
670	return s
671}
672
673// Contains data about the state of a job execution.
674type JobExecutionState struct {
675	_ struct{} `type:"structure"`
676
677	// The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS",
678	// "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
679	Status *string `locationName:"status" type:"string" enum:"JobExecutionStatus"`
680
681	// A collection of name/value pairs that describe the status of the job execution.
682	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
683
684	// The version of the job execution. Job execution versions are incremented
685	// each time they are updated by a device.
686	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
687}
688
689// String returns the string representation
690func (s JobExecutionState) String() string {
691	return awsutil.Prettify(s)
692}
693
694// GoString returns the string representation
695func (s JobExecutionState) GoString() string {
696	return s.String()
697}
698
699// SetStatus sets the Status field's value.
700func (s *JobExecutionState) SetStatus(v string) *JobExecutionState {
701	s.Status = &v
702	return s
703}
704
705// SetStatusDetails sets the StatusDetails field's value.
706func (s *JobExecutionState) SetStatusDetails(v map[string]*string) *JobExecutionState {
707	s.StatusDetails = v
708	return s
709}
710
711// SetVersionNumber sets the VersionNumber field's value.
712func (s *JobExecutionState) SetVersionNumber(v int64) *JobExecutionState {
713	s.VersionNumber = &v
714	return s
715}
716
717// Contains a subset of information about a job execution.
718type JobExecutionSummary struct {
719	_ struct{} `type:"structure"`
720
721	// A number that identifies a particular job execution on a particular device.
722	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
723
724	// The unique identifier you assigned to this job when it was created.
725	JobId *string `locationName:"jobId" min:"1" type:"string"`
726
727	// The time, in milliseconds since the epoch, when the job execution was last
728	// updated.
729	LastUpdatedAt *int64 `locationName:"lastUpdatedAt" type:"long"`
730
731	// The time, in milliseconds since the epoch, when the job execution was enqueued.
732	QueuedAt *int64 `locationName:"queuedAt" type:"long"`
733
734	// The time, in milliseconds since the epoch, when the job execution started.
735	StartedAt *int64 `locationName:"startedAt" type:"long"`
736
737	// The version of the job execution. Job execution versions are incremented
738	// each time AWS IoT Jobs receives an update from a device.
739	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
740}
741
742// String returns the string representation
743func (s JobExecutionSummary) String() string {
744	return awsutil.Prettify(s)
745}
746
747// GoString returns the string representation
748func (s JobExecutionSummary) GoString() string {
749	return s.String()
750}
751
752// SetExecutionNumber sets the ExecutionNumber field's value.
753func (s *JobExecutionSummary) SetExecutionNumber(v int64) *JobExecutionSummary {
754	s.ExecutionNumber = &v
755	return s
756}
757
758// SetJobId sets the JobId field's value.
759func (s *JobExecutionSummary) SetJobId(v string) *JobExecutionSummary {
760	s.JobId = &v
761	return s
762}
763
764// SetLastUpdatedAt sets the LastUpdatedAt field's value.
765func (s *JobExecutionSummary) SetLastUpdatedAt(v int64) *JobExecutionSummary {
766	s.LastUpdatedAt = &v
767	return s
768}
769
770// SetQueuedAt sets the QueuedAt field's value.
771func (s *JobExecutionSummary) SetQueuedAt(v int64) *JobExecutionSummary {
772	s.QueuedAt = &v
773	return s
774}
775
776// SetStartedAt sets the StartedAt field's value.
777func (s *JobExecutionSummary) SetStartedAt(v int64) *JobExecutionSummary {
778	s.StartedAt = &v
779	return s
780}
781
782// SetVersionNumber sets the VersionNumber field's value.
783func (s *JobExecutionSummary) SetVersionNumber(v int64) *JobExecutionSummary {
784	s.VersionNumber = &v
785	return s
786}
787
788type StartNextPendingJobExecutionInput struct {
789	_ struct{} `type:"structure"`
790
791	// A collection of name/value pairs that describe the status of the job execution.
792	// If not specified, the statusDetails are unchanged.
793	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
794
795	// The name of the thing associated with the device.
796	//
797	// ThingName is a required field
798	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
799}
800
801// String returns the string representation
802func (s StartNextPendingJobExecutionInput) String() string {
803	return awsutil.Prettify(s)
804}
805
806// GoString returns the string representation
807func (s StartNextPendingJobExecutionInput) GoString() string {
808	return s.String()
809}
810
811// Validate inspects the fields of the type to determine if they are valid.
812func (s *StartNextPendingJobExecutionInput) Validate() error {
813	invalidParams := request.ErrInvalidParams{Context: "StartNextPendingJobExecutionInput"}
814	if s.ThingName == nil {
815		invalidParams.Add(request.NewErrParamRequired("ThingName"))
816	}
817	if s.ThingName != nil && len(*s.ThingName) < 1 {
818		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
819	}
820
821	if invalidParams.Len() > 0 {
822		return invalidParams
823	}
824	return nil
825}
826
827// SetStatusDetails sets the StatusDetails field's value.
828func (s *StartNextPendingJobExecutionInput) SetStatusDetails(v map[string]*string) *StartNextPendingJobExecutionInput {
829	s.StatusDetails = v
830	return s
831}
832
833// SetThingName sets the ThingName field's value.
834func (s *StartNextPendingJobExecutionInput) SetThingName(v string) *StartNextPendingJobExecutionInput {
835	s.ThingName = &v
836	return s
837}
838
839type StartNextPendingJobExecutionOutput struct {
840	_ struct{} `type:"structure"`
841
842	// A JobExecution object.
843	Execution *JobExecution `locationName:"execution" type:"structure"`
844}
845
846// String returns the string representation
847func (s StartNextPendingJobExecutionOutput) String() string {
848	return awsutil.Prettify(s)
849}
850
851// GoString returns the string representation
852func (s StartNextPendingJobExecutionOutput) GoString() string {
853	return s.String()
854}
855
856// SetExecution sets the Execution field's value.
857func (s *StartNextPendingJobExecutionOutput) SetExecution(v *JobExecution) *StartNextPendingJobExecutionOutput {
858	s.Execution = v
859	return s
860}
861
862type UpdateJobExecutionInput struct {
863	_ struct{} `type:"structure"`
864
865	// Optional. A number that identifies a particular job execution on a particular
866	// device.
867	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
868
869	// Optional. The expected current version of the job execution. Each time you
870	// update the job execution, its version is incremented. If the version of the
871	// job execution stored in Jobs does not match, the update is rejected with
872	// a VersionMismatch error, and an ErrorResponse that contains the current job
873	// execution status data is returned. (This makes it unnecessary to perform
874	// a separate DescribeJobExecution request in order to obtain the job execution
875	// status data.)
876	ExpectedVersion *int64 `locationName:"expectedVersion" type:"long"`
877
878	// Optional. When set to true, the response contains the job document. The default
879	// is false.
880	IncludeJobDocument *bool `locationName:"includeJobDocument" type:"boolean"`
881
882	// Optional. When included and set to true, the response contains the JobExecutionState
883	// data. The default is false.
884	IncludeJobExecutionState *bool `locationName:"includeJobExecutionState" type:"boolean"`
885
886	// The unique identifier assigned to this job when it was created.
887	//
888	// JobId is a required field
889	JobId *string `location:"uri" locationName:"jobId" min:"1" type:"string" required:"true"`
890
891	// The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED).
892	// This must be specified on every update.
893	//
894	// Status is a required field
895	Status *string `locationName:"status" type:"string" required:"true" enum:"JobExecutionStatus"`
896
897	// Optional. A collection of name/value pairs that describe the status of the
898	// job execution. If not specified, the statusDetails are unchanged.
899	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
900
901	// The name of the thing associated with the device.
902	//
903	// ThingName is a required field
904	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
905}
906
907// String returns the string representation
908func (s UpdateJobExecutionInput) String() string {
909	return awsutil.Prettify(s)
910}
911
912// GoString returns the string representation
913func (s UpdateJobExecutionInput) GoString() string {
914	return s.String()
915}
916
917// Validate inspects the fields of the type to determine if they are valid.
918func (s *UpdateJobExecutionInput) Validate() error {
919	invalidParams := request.ErrInvalidParams{Context: "UpdateJobExecutionInput"}
920	if s.JobId == nil {
921		invalidParams.Add(request.NewErrParamRequired("JobId"))
922	}
923	if s.JobId != nil && len(*s.JobId) < 1 {
924		invalidParams.Add(request.NewErrParamMinLen("JobId", 1))
925	}
926	if s.Status == nil {
927		invalidParams.Add(request.NewErrParamRequired("Status"))
928	}
929	if s.ThingName == nil {
930		invalidParams.Add(request.NewErrParamRequired("ThingName"))
931	}
932	if s.ThingName != nil && len(*s.ThingName) < 1 {
933		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
934	}
935
936	if invalidParams.Len() > 0 {
937		return invalidParams
938	}
939	return nil
940}
941
942// SetExecutionNumber sets the ExecutionNumber field's value.
943func (s *UpdateJobExecutionInput) SetExecutionNumber(v int64) *UpdateJobExecutionInput {
944	s.ExecutionNumber = &v
945	return s
946}
947
948// SetExpectedVersion sets the ExpectedVersion field's value.
949func (s *UpdateJobExecutionInput) SetExpectedVersion(v int64) *UpdateJobExecutionInput {
950	s.ExpectedVersion = &v
951	return s
952}
953
954// SetIncludeJobDocument sets the IncludeJobDocument field's value.
955func (s *UpdateJobExecutionInput) SetIncludeJobDocument(v bool) *UpdateJobExecutionInput {
956	s.IncludeJobDocument = &v
957	return s
958}
959
960// SetIncludeJobExecutionState sets the IncludeJobExecutionState field's value.
961func (s *UpdateJobExecutionInput) SetIncludeJobExecutionState(v bool) *UpdateJobExecutionInput {
962	s.IncludeJobExecutionState = &v
963	return s
964}
965
966// SetJobId sets the JobId field's value.
967func (s *UpdateJobExecutionInput) SetJobId(v string) *UpdateJobExecutionInput {
968	s.JobId = &v
969	return s
970}
971
972// SetStatus sets the Status field's value.
973func (s *UpdateJobExecutionInput) SetStatus(v string) *UpdateJobExecutionInput {
974	s.Status = &v
975	return s
976}
977
978// SetStatusDetails sets the StatusDetails field's value.
979func (s *UpdateJobExecutionInput) SetStatusDetails(v map[string]*string) *UpdateJobExecutionInput {
980	s.StatusDetails = v
981	return s
982}
983
984// SetThingName sets the ThingName field's value.
985func (s *UpdateJobExecutionInput) SetThingName(v string) *UpdateJobExecutionInput {
986	s.ThingName = &v
987	return s
988}
989
990type UpdateJobExecutionOutput struct {
991	_ struct{} `type:"structure"`
992
993	// A JobExecutionState object.
994	ExecutionState *JobExecutionState `locationName:"executionState" type:"structure"`
995
996	// The contents of the Job Documents.
997	JobDocument *string `locationName:"jobDocument" type:"string"`
998}
999
1000// String returns the string representation
1001func (s UpdateJobExecutionOutput) String() string {
1002	return awsutil.Prettify(s)
1003}
1004
1005// GoString returns the string representation
1006func (s UpdateJobExecutionOutput) GoString() string {
1007	return s.String()
1008}
1009
1010// SetExecutionState sets the ExecutionState field's value.
1011func (s *UpdateJobExecutionOutput) SetExecutionState(v *JobExecutionState) *UpdateJobExecutionOutput {
1012	s.ExecutionState = v
1013	return s
1014}
1015
1016// SetJobDocument sets the JobDocument field's value.
1017func (s *UpdateJobExecutionOutput) SetJobDocument(v string) *UpdateJobExecutionOutput {
1018	s.JobDocument = &v
1019	return s
1020}
1021
1022const (
1023	// JobExecutionStatusQueued is a JobExecutionStatus enum value
1024	JobExecutionStatusQueued = "QUEUED"
1025
1026	// JobExecutionStatusInProgress is a JobExecutionStatus enum value
1027	JobExecutionStatusInProgress = "IN_PROGRESS"
1028
1029	// JobExecutionStatusSucceeded is a JobExecutionStatus enum value
1030	JobExecutionStatusSucceeded = "SUCCEEDED"
1031
1032	// JobExecutionStatusFailed is a JobExecutionStatus enum value
1033	JobExecutionStatusFailed = "FAILED"
1034
1035	// JobExecutionStatusRejected is a JobExecutionStatus enum value
1036	JobExecutionStatusRejected = "REJECTED"
1037
1038	// JobExecutionStatusRemoved is a JobExecutionStatus enum value
1039	JobExecutionStatusRemoved = "REMOVED"
1040
1041	// JobExecutionStatusCanceled is a JobExecutionStatus enum value
1042	JobExecutionStatusCanceled = "CANCELED"
1043)
1044