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 complets
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 complets
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 complets
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 complets
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
393// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/DescribeJobExecutionRequest
394type DescribeJobExecutionInput struct {
395	_ struct{} `type:"structure"`
396
397	// Optional. A number that identifies a particular job execution on a particular
398	// device. If not specified, the latest job execution is returned.
399	ExecutionNumber *int64 `location:"querystring" locationName:"executionNumber" type:"long"`
400
401	// Optional. When set to true, the response contains the job document. The default
402	// is false.
403	IncludeJobDocument *bool `location:"querystring" locationName:"includeJobDocument" type:"boolean"`
404
405	// The unique identifier assigned to this job when it was created.
406	//
407	// JobId is a required field
408	JobId *string `location:"uri" locationName:"jobId" type:"string" required:"true"`
409
410	// The thing name associated with the device the job execution is running on.
411	//
412	// ThingName is a required field
413	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
414}
415
416// String returns the string representation
417func (s DescribeJobExecutionInput) String() string {
418	return awsutil.Prettify(s)
419}
420
421// GoString returns the string representation
422func (s DescribeJobExecutionInput) GoString() string {
423	return s.String()
424}
425
426// Validate inspects the fields of the type to determine if they are valid.
427func (s *DescribeJobExecutionInput) Validate() error {
428	invalidParams := request.ErrInvalidParams{Context: "DescribeJobExecutionInput"}
429	if s.JobId == nil {
430		invalidParams.Add(request.NewErrParamRequired("JobId"))
431	}
432	if s.ThingName == nil {
433		invalidParams.Add(request.NewErrParamRequired("ThingName"))
434	}
435	if s.ThingName != nil && len(*s.ThingName) < 1 {
436		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
437	}
438
439	if invalidParams.Len() > 0 {
440		return invalidParams
441	}
442	return nil
443}
444
445// SetExecutionNumber sets the ExecutionNumber field's value.
446func (s *DescribeJobExecutionInput) SetExecutionNumber(v int64) *DescribeJobExecutionInput {
447	s.ExecutionNumber = &v
448	return s
449}
450
451// SetIncludeJobDocument sets the IncludeJobDocument field's value.
452func (s *DescribeJobExecutionInput) SetIncludeJobDocument(v bool) *DescribeJobExecutionInput {
453	s.IncludeJobDocument = &v
454	return s
455}
456
457// SetJobId sets the JobId field's value.
458func (s *DescribeJobExecutionInput) SetJobId(v string) *DescribeJobExecutionInput {
459	s.JobId = &v
460	return s
461}
462
463// SetThingName sets the ThingName field's value.
464func (s *DescribeJobExecutionInput) SetThingName(v string) *DescribeJobExecutionInput {
465	s.ThingName = &v
466	return s
467}
468
469// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/DescribeJobExecutionResponse
470type DescribeJobExecutionOutput struct {
471	_ struct{} `type:"structure"`
472
473	// Contains data about a job execution.
474	Execution *JobExecution `locationName:"execution" type:"structure"`
475}
476
477// String returns the string representation
478func (s DescribeJobExecutionOutput) String() string {
479	return awsutil.Prettify(s)
480}
481
482// GoString returns the string representation
483func (s DescribeJobExecutionOutput) GoString() string {
484	return s.String()
485}
486
487// SetExecution sets the Execution field's value.
488func (s *DescribeJobExecutionOutput) SetExecution(v *JobExecution) *DescribeJobExecutionOutput {
489	s.Execution = v
490	return s
491}
492
493// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/GetPendingJobExecutionsRequest
494type GetPendingJobExecutionsInput struct {
495	_ struct{} `type:"structure"`
496
497	// The name of the thing that is executing the job.
498	//
499	// ThingName is a required field
500	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
501}
502
503// String returns the string representation
504func (s GetPendingJobExecutionsInput) String() string {
505	return awsutil.Prettify(s)
506}
507
508// GoString returns the string representation
509func (s GetPendingJobExecutionsInput) GoString() string {
510	return s.String()
511}
512
513// Validate inspects the fields of the type to determine if they are valid.
514func (s *GetPendingJobExecutionsInput) Validate() error {
515	invalidParams := request.ErrInvalidParams{Context: "GetPendingJobExecutionsInput"}
516	if s.ThingName == nil {
517		invalidParams.Add(request.NewErrParamRequired("ThingName"))
518	}
519	if s.ThingName != nil && len(*s.ThingName) < 1 {
520		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
521	}
522
523	if invalidParams.Len() > 0 {
524		return invalidParams
525	}
526	return nil
527}
528
529// SetThingName sets the ThingName field's value.
530func (s *GetPendingJobExecutionsInput) SetThingName(v string) *GetPendingJobExecutionsInput {
531	s.ThingName = &v
532	return s
533}
534
535// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/GetPendingJobExecutionsResponse
536type GetPendingJobExecutionsOutput struct {
537	_ struct{} `type:"structure"`
538
539	// A list of JobExecutionSummary objects with status IN_PROGRESS.
540	InProgressJobs []*JobExecutionSummary `locationName:"inProgressJobs" type:"list"`
541
542	// A list of JobExecutionSummary objects with status QUEUED.
543	QueuedJobs []*JobExecutionSummary `locationName:"queuedJobs" type:"list"`
544}
545
546// String returns the string representation
547func (s GetPendingJobExecutionsOutput) String() string {
548	return awsutil.Prettify(s)
549}
550
551// GoString returns the string representation
552func (s GetPendingJobExecutionsOutput) GoString() string {
553	return s.String()
554}
555
556// SetInProgressJobs sets the InProgressJobs field's value.
557func (s *GetPendingJobExecutionsOutput) SetInProgressJobs(v []*JobExecutionSummary) *GetPendingJobExecutionsOutput {
558	s.InProgressJobs = v
559	return s
560}
561
562// SetQueuedJobs sets the QueuedJobs field's value.
563func (s *GetPendingJobExecutionsOutput) SetQueuedJobs(v []*JobExecutionSummary) *GetPendingJobExecutionsOutput {
564	s.QueuedJobs = v
565	return s
566}
567
568// Contains data about a job execution.
569// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/JobExecution
570type JobExecution struct {
571	_ struct{} `type:"structure"`
572
573	// A number that identifies a particular job execution on a particular device.
574	// It can be used later in commands that return or update job execution information.
575	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
576
577	// The content of the job document.
578	JobDocument *string `locationName:"jobDocument" type:"string"`
579
580	// The unique identifier you assigned to this job when it was created.
581	JobId *string `locationName:"jobId" min:"1" type:"string"`
582
583	// The time, in milliseconds since the epoch, when the job execution was last
584	// updated.
585	LastUpdatedAt *int64 `locationName:"lastUpdatedAt" type:"long"`
586
587	// The time, in milliseconds since the epoch, when the job execution was enqueued.
588	QueuedAt *int64 `locationName:"queuedAt" type:"long"`
589
590	// The time, in milliseconds since the epoch, when the job execution was started.
591	StartedAt *int64 `locationName:"startedAt" type:"long"`
592
593	// The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS",
594	// "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
595	Status *string `locationName:"status" type:"string" enum:"JobExecutionStatus"`
596
597	// A collection of name/value pairs that describe the status of the job execution.
598	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
599
600	// The name of the thing that is executing the job.
601	ThingName *string `locationName:"thingName" min:"1" type:"string"`
602
603	// The version of the job execution. Job execution versions are incremented
604	// each time they are updated by a device.
605	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
606}
607
608// String returns the string representation
609func (s JobExecution) String() string {
610	return awsutil.Prettify(s)
611}
612
613// GoString returns the string representation
614func (s JobExecution) GoString() string {
615	return s.String()
616}
617
618// SetExecutionNumber sets the ExecutionNumber field's value.
619func (s *JobExecution) SetExecutionNumber(v int64) *JobExecution {
620	s.ExecutionNumber = &v
621	return s
622}
623
624// SetJobDocument sets the JobDocument field's value.
625func (s *JobExecution) SetJobDocument(v string) *JobExecution {
626	s.JobDocument = &v
627	return s
628}
629
630// SetJobId sets the JobId field's value.
631func (s *JobExecution) SetJobId(v string) *JobExecution {
632	s.JobId = &v
633	return s
634}
635
636// SetLastUpdatedAt sets the LastUpdatedAt field's value.
637func (s *JobExecution) SetLastUpdatedAt(v int64) *JobExecution {
638	s.LastUpdatedAt = &v
639	return s
640}
641
642// SetQueuedAt sets the QueuedAt field's value.
643func (s *JobExecution) SetQueuedAt(v int64) *JobExecution {
644	s.QueuedAt = &v
645	return s
646}
647
648// SetStartedAt sets the StartedAt field's value.
649func (s *JobExecution) SetStartedAt(v int64) *JobExecution {
650	s.StartedAt = &v
651	return s
652}
653
654// SetStatus sets the Status field's value.
655func (s *JobExecution) SetStatus(v string) *JobExecution {
656	s.Status = &v
657	return s
658}
659
660// SetStatusDetails sets the StatusDetails field's value.
661func (s *JobExecution) SetStatusDetails(v map[string]*string) *JobExecution {
662	s.StatusDetails = v
663	return s
664}
665
666// SetThingName sets the ThingName field's value.
667func (s *JobExecution) SetThingName(v string) *JobExecution {
668	s.ThingName = &v
669	return s
670}
671
672// SetVersionNumber sets the VersionNumber field's value.
673func (s *JobExecution) SetVersionNumber(v int64) *JobExecution {
674	s.VersionNumber = &v
675	return s
676}
677
678// Contains data about the state of a job execution.
679// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/JobExecutionState
680type JobExecutionState struct {
681	_ struct{} `type:"structure"`
682
683	// The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS",
684	// "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED".
685	Status *string `locationName:"status" type:"string" enum:"JobExecutionStatus"`
686
687	// A collection of name/value pairs that describe the status of the job execution.
688	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
689
690	// The version of the job execution. Job execution versions are incremented
691	// each time they are updated by a device.
692	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
693}
694
695// String returns the string representation
696func (s JobExecutionState) String() string {
697	return awsutil.Prettify(s)
698}
699
700// GoString returns the string representation
701func (s JobExecutionState) GoString() string {
702	return s.String()
703}
704
705// SetStatus sets the Status field's value.
706func (s *JobExecutionState) SetStatus(v string) *JobExecutionState {
707	s.Status = &v
708	return s
709}
710
711// SetStatusDetails sets the StatusDetails field's value.
712func (s *JobExecutionState) SetStatusDetails(v map[string]*string) *JobExecutionState {
713	s.StatusDetails = v
714	return s
715}
716
717// SetVersionNumber sets the VersionNumber field's value.
718func (s *JobExecutionState) SetVersionNumber(v int64) *JobExecutionState {
719	s.VersionNumber = &v
720	return s
721}
722
723// Contains a subset of information about a job execution.
724// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/JobExecutionSummary
725type JobExecutionSummary struct {
726	_ struct{} `type:"structure"`
727
728	// A number that identifies a particular job execution on a particular device.
729	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
730
731	// The unique identifier you assigned to this job when it was created.
732	JobId *string `locationName:"jobId" min:"1" type:"string"`
733
734	// The time, in milliseconds since the epoch, when the job execution was last
735	// updated.
736	LastUpdatedAt *int64 `locationName:"lastUpdatedAt" type:"long"`
737
738	// The time, in milliseconds since the epoch, when the job execution was enqueued.
739	QueuedAt *int64 `locationName:"queuedAt" type:"long"`
740
741	// The time, in milliseconds since the epoch, when the job execution started.
742	StartedAt *int64 `locationName:"startedAt" type:"long"`
743
744	// The version of the job execution. Job execution versions are incremented
745	// each time AWS IoT Jobs receives an update from a device.
746	VersionNumber *int64 `locationName:"versionNumber" type:"long"`
747}
748
749// String returns the string representation
750func (s JobExecutionSummary) String() string {
751	return awsutil.Prettify(s)
752}
753
754// GoString returns the string representation
755func (s JobExecutionSummary) GoString() string {
756	return s.String()
757}
758
759// SetExecutionNumber sets the ExecutionNumber field's value.
760func (s *JobExecutionSummary) SetExecutionNumber(v int64) *JobExecutionSummary {
761	s.ExecutionNumber = &v
762	return s
763}
764
765// SetJobId sets the JobId field's value.
766func (s *JobExecutionSummary) SetJobId(v string) *JobExecutionSummary {
767	s.JobId = &v
768	return s
769}
770
771// SetLastUpdatedAt sets the LastUpdatedAt field's value.
772func (s *JobExecutionSummary) SetLastUpdatedAt(v int64) *JobExecutionSummary {
773	s.LastUpdatedAt = &v
774	return s
775}
776
777// SetQueuedAt sets the QueuedAt field's value.
778func (s *JobExecutionSummary) SetQueuedAt(v int64) *JobExecutionSummary {
779	s.QueuedAt = &v
780	return s
781}
782
783// SetStartedAt sets the StartedAt field's value.
784func (s *JobExecutionSummary) SetStartedAt(v int64) *JobExecutionSummary {
785	s.StartedAt = &v
786	return s
787}
788
789// SetVersionNumber sets the VersionNumber field's value.
790func (s *JobExecutionSummary) SetVersionNumber(v int64) *JobExecutionSummary {
791	s.VersionNumber = &v
792	return s
793}
794
795// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecutionRequest
796type StartNextPendingJobExecutionInput struct {
797	_ struct{} `type:"structure"`
798
799	// A collection of name/value pairs that describe the status of the job execution.
800	// If not specified, the statusDetails are unchanged.
801	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
802
803	// The name of the thing associated with the device.
804	//
805	// ThingName is a required field
806	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
807}
808
809// String returns the string representation
810func (s StartNextPendingJobExecutionInput) String() string {
811	return awsutil.Prettify(s)
812}
813
814// GoString returns the string representation
815func (s StartNextPendingJobExecutionInput) GoString() string {
816	return s.String()
817}
818
819// Validate inspects the fields of the type to determine if they are valid.
820func (s *StartNextPendingJobExecutionInput) Validate() error {
821	invalidParams := request.ErrInvalidParams{Context: "StartNextPendingJobExecutionInput"}
822	if s.ThingName == nil {
823		invalidParams.Add(request.NewErrParamRequired("ThingName"))
824	}
825	if s.ThingName != nil && len(*s.ThingName) < 1 {
826		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
827	}
828
829	if invalidParams.Len() > 0 {
830		return invalidParams
831	}
832	return nil
833}
834
835// SetStatusDetails sets the StatusDetails field's value.
836func (s *StartNextPendingJobExecutionInput) SetStatusDetails(v map[string]*string) *StartNextPendingJobExecutionInput {
837	s.StatusDetails = v
838	return s
839}
840
841// SetThingName sets the ThingName field's value.
842func (s *StartNextPendingJobExecutionInput) SetThingName(v string) *StartNextPendingJobExecutionInput {
843	s.ThingName = &v
844	return s
845}
846
847// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/StartNextPendingJobExecutionResponse
848type StartNextPendingJobExecutionOutput struct {
849	_ struct{} `type:"structure"`
850
851	// A JobExecution object.
852	Execution *JobExecution `locationName:"execution" type:"structure"`
853}
854
855// String returns the string representation
856func (s StartNextPendingJobExecutionOutput) String() string {
857	return awsutil.Prettify(s)
858}
859
860// GoString returns the string representation
861func (s StartNextPendingJobExecutionOutput) GoString() string {
862	return s.String()
863}
864
865// SetExecution sets the Execution field's value.
866func (s *StartNextPendingJobExecutionOutput) SetExecution(v *JobExecution) *StartNextPendingJobExecutionOutput {
867	s.Execution = v
868	return s
869}
870
871// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/UpdateJobExecutionRequest
872type UpdateJobExecutionInput struct {
873	_ struct{} `type:"structure"`
874
875	// Optional. A number that identifies a particular job execution on a particular
876	// device.
877	ExecutionNumber *int64 `locationName:"executionNumber" type:"long"`
878
879	// Optional. The expected current version of the job execution. Each time you
880	// update the job execution, its version is incremented. If the version of the
881	// job execution stored in Jobs does not match, the update is rejected with
882	// a VersionMismatch error, and an ErrorResponse that contains the current job
883	// execution status data is returned. (This makes it unnecessary to perform
884	// a separate DescribeJobExecution request in order to obtain the job execution
885	// status data.)
886	ExpectedVersion *int64 `locationName:"expectedVersion" type:"long"`
887
888	// Optional. When set to true, the response contains the job document. The default
889	// is false.
890	IncludeJobDocument *bool `locationName:"includeJobDocument" type:"boolean"`
891
892	// Optional. When included and set to true, the response contains the JobExecutionState
893	// data. The default is false.
894	IncludeJobExecutionState *bool `locationName:"includeJobExecutionState" type:"boolean"`
895
896	// The unique identifier assigned to this job when it was created.
897	//
898	// JobId is a required field
899	JobId *string `location:"uri" locationName:"jobId" min:"1" type:"string" required:"true"`
900
901	// The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED).
902	// This must be specified on every update.
903	//
904	// Status is a required field
905	Status *string `locationName:"status" type:"string" required:"true" enum:"JobExecutionStatus"`
906
907	// Optional. A collection of name/value pairs that describe the status of the
908	// job execution. If not specified, the statusDetails are unchanged.
909	StatusDetails map[string]*string `locationName:"statusDetails" type:"map"`
910
911	// The name of the thing associated with the device.
912	//
913	// ThingName is a required field
914	ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
915}
916
917// String returns the string representation
918func (s UpdateJobExecutionInput) String() string {
919	return awsutil.Prettify(s)
920}
921
922// GoString returns the string representation
923func (s UpdateJobExecutionInput) GoString() string {
924	return s.String()
925}
926
927// Validate inspects the fields of the type to determine if they are valid.
928func (s *UpdateJobExecutionInput) Validate() error {
929	invalidParams := request.ErrInvalidParams{Context: "UpdateJobExecutionInput"}
930	if s.JobId == nil {
931		invalidParams.Add(request.NewErrParamRequired("JobId"))
932	}
933	if s.JobId != nil && len(*s.JobId) < 1 {
934		invalidParams.Add(request.NewErrParamMinLen("JobId", 1))
935	}
936	if s.Status == nil {
937		invalidParams.Add(request.NewErrParamRequired("Status"))
938	}
939	if s.ThingName == nil {
940		invalidParams.Add(request.NewErrParamRequired("ThingName"))
941	}
942	if s.ThingName != nil && len(*s.ThingName) < 1 {
943		invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
944	}
945
946	if invalidParams.Len() > 0 {
947		return invalidParams
948	}
949	return nil
950}
951
952// SetExecutionNumber sets the ExecutionNumber field's value.
953func (s *UpdateJobExecutionInput) SetExecutionNumber(v int64) *UpdateJobExecutionInput {
954	s.ExecutionNumber = &v
955	return s
956}
957
958// SetExpectedVersion sets the ExpectedVersion field's value.
959func (s *UpdateJobExecutionInput) SetExpectedVersion(v int64) *UpdateJobExecutionInput {
960	s.ExpectedVersion = &v
961	return s
962}
963
964// SetIncludeJobDocument sets the IncludeJobDocument field's value.
965func (s *UpdateJobExecutionInput) SetIncludeJobDocument(v bool) *UpdateJobExecutionInput {
966	s.IncludeJobDocument = &v
967	return s
968}
969
970// SetIncludeJobExecutionState sets the IncludeJobExecutionState field's value.
971func (s *UpdateJobExecutionInput) SetIncludeJobExecutionState(v bool) *UpdateJobExecutionInput {
972	s.IncludeJobExecutionState = &v
973	return s
974}
975
976// SetJobId sets the JobId field's value.
977func (s *UpdateJobExecutionInput) SetJobId(v string) *UpdateJobExecutionInput {
978	s.JobId = &v
979	return s
980}
981
982// SetStatus sets the Status field's value.
983func (s *UpdateJobExecutionInput) SetStatus(v string) *UpdateJobExecutionInput {
984	s.Status = &v
985	return s
986}
987
988// SetStatusDetails sets the StatusDetails field's value.
989func (s *UpdateJobExecutionInput) SetStatusDetails(v map[string]*string) *UpdateJobExecutionInput {
990	s.StatusDetails = v
991	return s
992}
993
994// SetThingName sets the ThingName field's value.
995func (s *UpdateJobExecutionInput) SetThingName(v string) *UpdateJobExecutionInput {
996	s.ThingName = &v
997	return s
998}
999
1000// See also, https://docs.aws.amazon.com/goto/WebAPI/iot-jobs-data-2017-09-29/UpdateJobExecutionResponse
1001type UpdateJobExecutionOutput struct {
1002	_ struct{} `type:"structure"`
1003
1004	// A JobExecutionState object.
1005	ExecutionState *JobExecutionState `locationName:"executionState" type:"structure"`
1006
1007	// The contents of the Job Documents.
1008	JobDocument *string `locationName:"jobDocument" type:"string"`
1009}
1010
1011// String returns the string representation
1012func (s UpdateJobExecutionOutput) String() string {
1013	return awsutil.Prettify(s)
1014}
1015
1016// GoString returns the string representation
1017func (s UpdateJobExecutionOutput) GoString() string {
1018	return s.String()
1019}
1020
1021// SetExecutionState sets the ExecutionState field's value.
1022func (s *UpdateJobExecutionOutput) SetExecutionState(v *JobExecutionState) *UpdateJobExecutionOutput {
1023	s.ExecutionState = v
1024	return s
1025}
1026
1027// SetJobDocument sets the JobDocument field's value.
1028func (s *UpdateJobExecutionOutput) SetJobDocument(v string) *UpdateJobExecutionOutput {
1029	s.JobDocument = &v
1030	return s
1031}
1032
1033const (
1034	// JobExecutionStatusQueued is a JobExecutionStatus enum value
1035	JobExecutionStatusQueued = "QUEUED"
1036
1037	// JobExecutionStatusInProgress is a JobExecutionStatus enum value
1038	JobExecutionStatusInProgress = "IN_PROGRESS"
1039
1040	// JobExecutionStatusSucceeded is a JobExecutionStatus enum value
1041	JobExecutionStatusSucceeded = "SUCCEEDED"
1042
1043	// JobExecutionStatusFailed is a JobExecutionStatus enum value
1044	JobExecutionStatusFailed = "FAILED"
1045
1046	// JobExecutionStatusRejected is a JobExecutionStatus enum value
1047	JobExecutionStatusRejected = "REJECTED"
1048
1049	// JobExecutionStatusRemoved is a JobExecutionStatus enum value
1050	JobExecutionStatusRemoved = "REMOVED"
1051
1052	// JobExecutionStatusCanceled is a JobExecutionStatus enum value
1053	JobExecutionStatusCanceled = "CANCELED"
1054)
1055