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