github.com/aavshr/aws-sdk-go@v1.41.3/service/iotdataplane/api.go (about) 1 // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. 2 3 package iotdataplane 4 5 import ( 6 "fmt" 7 8 "github.com/aavshr/aws-sdk-go/aws" 9 "github.com/aavshr/aws-sdk-go/aws/awsutil" 10 "github.com/aavshr/aws-sdk-go/aws/request" 11 "github.com/aavshr/aws-sdk-go/private/protocol" 12 "github.com/aavshr/aws-sdk-go/private/protocol/restjson" 13 ) 14 15 const opDeleteThingShadow = "DeleteThingShadow" 16 17 // DeleteThingShadowRequest generates a "aws/request.Request" representing the 18 // client's request for the DeleteThingShadow operation. The "output" return 19 // value will be populated with the request's response once the request completes 20 // successfully. 21 // 22 // Use "Send" method on the returned Request to send the API call to the service. 23 // the "output" return value is not valid until after Send returns without error. 24 // 25 // See DeleteThingShadow for more information on using the DeleteThingShadow 26 // API call, and error handling. 27 // 28 // This method is useful when you want to inject custom logic or configuration 29 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 30 // 31 // 32 // // Example sending a request using the DeleteThingShadowRequest method. 33 // req, resp := client.DeleteThingShadowRequest(params) 34 // 35 // err := req.Send() 36 // if err == nil { // resp is now filled 37 // fmt.Println(resp) 38 // } 39 func (c *IoTDataPlane) DeleteThingShadowRequest(input *DeleteThingShadowInput) (req *request.Request, output *DeleteThingShadowOutput) { 40 op := &request.Operation{ 41 Name: opDeleteThingShadow, 42 HTTPMethod: "DELETE", 43 HTTPPath: "/things/{thingName}/shadow", 44 } 45 46 if input == nil { 47 input = &DeleteThingShadowInput{} 48 } 49 50 output = &DeleteThingShadowOutput{} 51 req = c.newRequest(op, input, output) 52 return 53 } 54 55 // DeleteThingShadow API operation for AWS IoT Data Plane. 56 // 57 // Deletes the shadow for the specified thing. 58 // 59 // Requires permission to access the DeleteThingShadow (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) 60 // action. 61 // 62 // For more information, see DeleteThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_DeleteThingShadow.html) 63 // in the IoT Developer Guide. 64 // 65 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 66 // with awserr.Error's Code and Message methods to get detailed information about 67 // the error. 68 // 69 // See the AWS API reference guide for AWS IoT Data Plane's 70 // API operation DeleteThingShadow for usage and error information. 71 // 72 // Returned Error Types: 73 // * ResourceNotFoundException 74 // The specified resource does not exist. 75 // 76 // * InvalidRequestException 77 // The request is not valid. 78 // 79 // * ThrottlingException 80 // The rate exceeds the limit. 81 // 82 // * UnauthorizedException 83 // You are not authorized to perform this operation. 84 // 85 // * ServiceUnavailableException 86 // The service is temporarily unavailable. 87 // 88 // * InternalFailureException 89 // An unexpected error has occurred. 90 // 91 // * MethodNotAllowedException 92 // The specified combination of HTTP verb and URI is not supported. 93 // 94 // * UnsupportedDocumentEncodingException 95 // The document encoding is not supported. 96 // 97 func (c *IoTDataPlane) DeleteThingShadow(input *DeleteThingShadowInput) (*DeleteThingShadowOutput, error) { 98 req, out := c.DeleteThingShadowRequest(input) 99 return out, req.Send() 100 } 101 102 // DeleteThingShadowWithContext is the same as DeleteThingShadow with the addition of 103 // the ability to pass a context and additional request options. 104 // 105 // See DeleteThingShadow for details on how to use this API operation. 106 // 107 // The context must be non-nil and will be used for request cancellation. If 108 // the context is nil a panic will occur. In the future the SDK may create 109 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 110 // for more information on using Contexts. 111 func (c *IoTDataPlane) DeleteThingShadowWithContext(ctx aws.Context, input *DeleteThingShadowInput, opts ...request.Option) (*DeleteThingShadowOutput, error) { 112 req, out := c.DeleteThingShadowRequest(input) 113 req.SetContext(ctx) 114 req.ApplyOptions(opts...) 115 return out, req.Send() 116 } 117 118 const opGetRetainedMessage = "GetRetainedMessage" 119 120 // GetRetainedMessageRequest generates a "aws/request.Request" representing the 121 // client's request for the GetRetainedMessage operation. The "output" return 122 // value will be populated with the request's response once the request completes 123 // successfully. 124 // 125 // Use "Send" method on the returned Request to send the API call to the service. 126 // the "output" return value is not valid until after Send returns without error. 127 // 128 // See GetRetainedMessage for more information on using the GetRetainedMessage 129 // API call, and error handling. 130 // 131 // This method is useful when you want to inject custom logic or configuration 132 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 133 // 134 // 135 // // Example sending a request using the GetRetainedMessageRequest method. 136 // req, resp := client.GetRetainedMessageRequest(params) 137 // 138 // err := req.Send() 139 // if err == nil { // resp is now filled 140 // fmt.Println(resp) 141 // } 142 func (c *IoTDataPlane) GetRetainedMessageRequest(input *GetRetainedMessageInput) (req *request.Request, output *GetRetainedMessageOutput) { 143 op := &request.Operation{ 144 Name: opGetRetainedMessage, 145 HTTPMethod: "GET", 146 HTTPPath: "/retainedMessage/{topic}", 147 } 148 149 if input == nil { 150 input = &GetRetainedMessageInput{} 151 } 152 153 output = &GetRetainedMessageOutput{} 154 req = c.newRequest(op, input, output) 155 return 156 } 157 158 // GetRetainedMessage API operation for AWS IoT Data Plane. 159 // 160 // Gets the details of a single retained message for the specified topic. 161 // 162 // This action returns the message payload of the retained message, which can 163 // incur messaging costs. To list only the topic names of the retained messages, 164 // call ListRetainedMessages (/iot/latest/developerguide/API_iotdata_ListRetainedMessages.html). 165 // 166 // Requires permission to access the GetRetainedMessage (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotfleethubfordevicemanagement.html#awsiotfleethubfordevicemanagement-actions-as-permissions) 167 // action. 168 // 169 // For more information about messaging costs, see IoT Core pricing - Messaging 170 // (http://aws.amazon.com/iot-core/pricing/#Messaging). 171 // 172 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 173 // with awserr.Error's Code and Message methods to get detailed information about 174 // the error. 175 // 176 // See the AWS API reference guide for AWS IoT Data Plane's 177 // API operation GetRetainedMessage for usage and error information. 178 // 179 // Returned Error Types: 180 // * InvalidRequestException 181 // The request is not valid. 182 // 183 // * ResourceNotFoundException 184 // The specified resource does not exist. 185 // 186 // * ThrottlingException 187 // The rate exceeds the limit. 188 // 189 // * UnauthorizedException 190 // You are not authorized to perform this operation. 191 // 192 // * ServiceUnavailableException 193 // The service is temporarily unavailable. 194 // 195 // * InternalFailureException 196 // An unexpected error has occurred. 197 // 198 // * MethodNotAllowedException 199 // The specified combination of HTTP verb and URI is not supported. 200 // 201 func (c *IoTDataPlane) GetRetainedMessage(input *GetRetainedMessageInput) (*GetRetainedMessageOutput, error) { 202 req, out := c.GetRetainedMessageRequest(input) 203 return out, req.Send() 204 } 205 206 // GetRetainedMessageWithContext is the same as GetRetainedMessage with the addition of 207 // the ability to pass a context and additional request options. 208 // 209 // See GetRetainedMessage for details on how to use this API operation. 210 // 211 // The context must be non-nil and will be used for request cancellation. If 212 // the context is nil a panic will occur. In the future the SDK may create 213 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 214 // for more information on using Contexts. 215 func (c *IoTDataPlane) GetRetainedMessageWithContext(ctx aws.Context, input *GetRetainedMessageInput, opts ...request.Option) (*GetRetainedMessageOutput, error) { 216 req, out := c.GetRetainedMessageRequest(input) 217 req.SetContext(ctx) 218 req.ApplyOptions(opts...) 219 return out, req.Send() 220 } 221 222 const opGetThingShadow = "GetThingShadow" 223 224 // GetThingShadowRequest generates a "aws/request.Request" representing the 225 // client's request for the GetThingShadow operation. The "output" return 226 // value will be populated with the request's response once the request completes 227 // successfully. 228 // 229 // Use "Send" method on the returned Request to send the API call to the service. 230 // the "output" return value is not valid until after Send returns without error. 231 // 232 // See GetThingShadow for more information on using the GetThingShadow 233 // API call, and error handling. 234 // 235 // This method is useful when you want to inject custom logic or configuration 236 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 237 // 238 // 239 // // Example sending a request using the GetThingShadowRequest method. 240 // req, resp := client.GetThingShadowRequest(params) 241 // 242 // err := req.Send() 243 // if err == nil { // resp is now filled 244 // fmt.Println(resp) 245 // } 246 func (c *IoTDataPlane) GetThingShadowRequest(input *GetThingShadowInput) (req *request.Request, output *GetThingShadowOutput) { 247 op := &request.Operation{ 248 Name: opGetThingShadow, 249 HTTPMethod: "GET", 250 HTTPPath: "/things/{thingName}/shadow", 251 } 252 253 if input == nil { 254 input = &GetThingShadowInput{} 255 } 256 257 output = &GetThingShadowOutput{} 258 req = c.newRequest(op, input, output) 259 return 260 } 261 262 // GetThingShadow API operation for AWS IoT Data Plane. 263 // 264 // Gets the shadow for the specified thing. 265 // 266 // Requires permission to access the GetThingShadow (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) 267 // action. 268 // 269 // For more information, see GetThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_GetThingShadow.html) 270 // in the IoT Developer Guide. 271 // 272 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 273 // with awserr.Error's Code and Message methods to get detailed information about 274 // the error. 275 // 276 // See the AWS API reference guide for AWS IoT Data Plane's 277 // API operation GetThingShadow for usage and error information. 278 // 279 // Returned Error Types: 280 // * InvalidRequestException 281 // The request is not valid. 282 // 283 // * ResourceNotFoundException 284 // The specified resource does not exist. 285 // 286 // * ThrottlingException 287 // The rate exceeds the limit. 288 // 289 // * UnauthorizedException 290 // You are not authorized to perform this operation. 291 // 292 // * ServiceUnavailableException 293 // The service is temporarily unavailable. 294 // 295 // * InternalFailureException 296 // An unexpected error has occurred. 297 // 298 // * MethodNotAllowedException 299 // The specified combination of HTTP verb and URI is not supported. 300 // 301 // * UnsupportedDocumentEncodingException 302 // The document encoding is not supported. 303 // 304 func (c *IoTDataPlane) GetThingShadow(input *GetThingShadowInput) (*GetThingShadowOutput, error) { 305 req, out := c.GetThingShadowRequest(input) 306 return out, req.Send() 307 } 308 309 // GetThingShadowWithContext is the same as GetThingShadow with the addition of 310 // the ability to pass a context and additional request options. 311 // 312 // See GetThingShadow for details on how to use this API operation. 313 // 314 // The context must be non-nil and will be used for request cancellation. If 315 // the context is nil a panic will occur. In the future the SDK may create 316 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 317 // for more information on using Contexts. 318 func (c *IoTDataPlane) GetThingShadowWithContext(ctx aws.Context, input *GetThingShadowInput, opts ...request.Option) (*GetThingShadowOutput, error) { 319 req, out := c.GetThingShadowRequest(input) 320 req.SetContext(ctx) 321 req.ApplyOptions(opts...) 322 return out, req.Send() 323 } 324 325 const opListNamedShadowsForThing = "ListNamedShadowsForThing" 326 327 // ListNamedShadowsForThingRequest generates a "aws/request.Request" representing the 328 // client's request for the ListNamedShadowsForThing operation. The "output" return 329 // value will be populated with the request's response once the request completes 330 // successfully. 331 // 332 // Use "Send" method on the returned Request to send the API call to the service. 333 // the "output" return value is not valid until after Send returns without error. 334 // 335 // See ListNamedShadowsForThing for more information on using the ListNamedShadowsForThing 336 // API call, and error handling. 337 // 338 // This method is useful when you want to inject custom logic or configuration 339 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 340 // 341 // 342 // // Example sending a request using the ListNamedShadowsForThingRequest method. 343 // req, resp := client.ListNamedShadowsForThingRequest(params) 344 // 345 // err := req.Send() 346 // if err == nil { // resp is now filled 347 // fmt.Println(resp) 348 // } 349 func (c *IoTDataPlane) ListNamedShadowsForThingRequest(input *ListNamedShadowsForThingInput) (req *request.Request, output *ListNamedShadowsForThingOutput) { 350 op := &request.Operation{ 351 Name: opListNamedShadowsForThing, 352 HTTPMethod: "GET", 353 HTTPPath: "/api/things/shadow/ListNamedShadowsForThing/{thingName}", 354 } 355 356 if input == nil { 357 input = &ListNamedShadowsForThingInput{} 358 } 359 360 output = &ListNamedShadowsForThingOutput{} 361 req = c.newRequest(op, input, output) 362 return 363 } 364 365 // ListNamedShadowsForThing API operation for AWS IoT Data Plane. 366 // 367 // Lists the shadows for the specified thing. 368 // 369 // Requires permission to access the ListNamedShadowsForThing (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) 370 // action. 371 // 372 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 373 // with awserr.Error's Code and Message methods to get detailed information about 374 // the error. 375 // 376 // See the AWS API reference guide for AWS IoT Data Plane's 377 // API operation ListNamedShadowsForThing for usage and error information. 378 // 379 // Returned Error Types: 380 // * ResourceNotFoundException 381 // The specified resource does not exist. 382 // 383 // * InvalidRequestException 384 // The request is not valid. 385 // 386 // * ThrottlingException 387 // The rate exceeds the limit. 388 // 389 // * UnauthorizedException 390 // You are not authorized to perform this operation. 391 // 392 // * ServiceUnavailableException 393 // The service is temporarily unavailable. 394 // 395 // * InternalFailureException 396 // An unexpected error has occurred. 397 // 398 // * MethodNotAllowedException 399 // The specified combination of HTTP verb and URI is not supported. 400 // 401 func (c *IoTDataPlane) ListNamedShadowsForThing(input *ListNamedShadowsForThingInput) (*ListNamedShadowsForThingOutput, error) { 402 req, out := c.ListNamedShadowsForThingRequest(input) 403 return out, req.Send() 404 } 405 406 // ListNamedShadowsForThingWithContext is the same as ListNamedShadowsForThing with the addition of 407 // the ability to pass a context and additional request options. 408 // 409 // See ListNamedShadowsForThing for details on how to use this API operation. 410 // 411 // The context must be non-nil and will be used for request cancellation. If 412 // the context is nil a panic will occur. In the future the SDK may create 413 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 414 // for more information on using Contexts. 415 func (c *IoTDataPlane) ListNamedShadowsForThingWithContext(ctx aws.Context, input *ListNamedShadowsForThingInput, opts ...request.Option) (*ListNamedShadowsForThingOutput, error) { 416 req, out := c.ListNamedShadowsForThingRequest(input) 417 req.SetContext(ctx) 418 req.ApplyOptions(opts...) 419 return out, req.Send() 420 } 421 422 const opListRetainedMessages = "ListRetainedMessages" 423 424 // ListRetainedMessagesRequest generates a "aws/request.Request" representing the 425 // client's request for the ListRetainedMessages operation. The "output" return 426 // value will be populated with the request's response once the request completes 427 // successfully. 428 // 429 // Use "Send" method on the returned Request to send the API call to the service. 430 // the "output" return value is not valid until after Send returns without error. 431 // 432 // See ListRetainedMessages for more information on using the ListRetainedMessages 433 // API call, and error handling. 434 // 435 // This method is useful when you want to inject custom logic or configuration 436 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 437 // 438 // 439 // // Example sending a request using the ListRetainedMessagesRequest method. 440 // req, resp := client.ListRetainedMessagesRequest(params) 441 // 442 // err := req.Send() 443 // if err == nil { // resp is now filled 444 // fmt.Println(resp) 445 // } 446 func (c *IoTDataPlane) ListRetainedMessagesRequest(input *ListRetainedMessagesInput) (req *request.Request, output *ListRetainedMessagesOutput) { 447 op := &request.Operation{ 448 Name: opListRetainedMessages, 449 HTTPMethod: "GET", 450 HTTPPath: "/retainedMessage", 451 Paginator: &request.Paginator{ 452 InputTokens: []string{"nextToken"}, 453 OutputTokens: []string{"nextToken"}, 454 LimitToken: "maxResults", 455 TruncationToken: "", 456 }, 457 } 458 459 if input == nil { 460 input = &ListRetainedMessagesInput{} 461 } 462 463 output = &ListRetainedMessagesOutput{} 464 req = c.newRequest(op, input, output) 465 return 466 } 467 468 // ListRetainedMessages API operation for AWS IoT Data Plane. 469 // 470 // Lists summary information about the retained messages stored for the account. 471 // 472 // This action returns only the topic names of the retained messages. It doesn't 473 // return any message payloads. Although this action doesn't return a message 474 // payload, it can still incur messaging costs. 475 // 476 // To get the message payload of a retained message, call GetRetainedMessage 477 // (https://docs.aws.amazon.com/iot/latest/developerguide/API_iotdata_GetRetainedMessage.html) 478 // with the topic name of the retained message. 479 // 480 // Requires permission to access the ListRetainedMessages (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotfleethubfordevicemanagement.html#awsiotfleethubfordevicemanagement-actions-as-permissions) 481 // action. 482 // 483 // For more information about messaging costs, see IoT Core pricing - Messaging 484 // (http://aws.amazon.com/iot-core/pricing/#Messaging). 485 // 486 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 487 // with awserr.Error's Code and Message methods to get detailed information about 488 // the error. 489 // 490 // See the AWS API reference guide for AWS IoT Data Plane's 491 // API operation ListRetainedMessages for usage and error information. 492 // 493 // Returned Error Types: 494 // * InvalidRequestException 495 // The request is not valid. 496 // 497 // * ThrottlingException 498 // The rate exceeds the limit. 499 // 500 // * UnauthorizedException 501 // You are not authorized to perform this operation. 502 // 503 // * ServiceUnavailableException 504 // The service is temporarily unavailable. 505 // 506 // * InternalFailureException 507 // An unexpected error has occurred. 508 // 509 // * MethodNotAllowedException 510 // The specified combination of HTTP verb and URI is not supported. 511 // 512 func (c *IoTDataPlane) ListRetainedMessages(input *ListRetainedMessagesInput) (*ListRetainedMessagesOutput, error) { 513 req, out := c.ListRetainedMessagesRequest(input) 514 return out, req.Send() 515 } 516 517 // ListRetainedMessagesWithContext is the same as ListRetainedMessages with the addition of 518 // the ability to pass a context and additional request options. 519 // 520 // See ListRetainedMessages for details on how to use this API operation. 521 // 522 // The context must be non-nil and will be used for request cancellation. If 523 // the context is nil a panic will occur. In the future the SDK may create 524 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 525 // for more information on using Contexts. 526 func (c *IoTDataPlane) ListRetainedMessagesWithContext(ctx aws.Context, input *ListRetainedMessagesInput, opts ...request.Option) (*ListRetainedMessagesOutput, error) { 527 req, out := c.ListRetainedMessagesRequest(input) 528 req.SetContext(ctx) 529 req.ApplyOptions(opts...) 530 return out, req.Send() 531 } 532 533 // ListRetainedMessagesPages iterates over the pages of a ListRetainedMessages operation, 534 // calling the "fn" function with the response data for each page. To stop 535 // iterating, return false from the fn function. 536 // 537 // See ListRetainedMessages method for more information on how to use this operation. 538 // 539 // Note: This operation can generate multiple requests to a service. 540 // 541 // // Example iterating over at most 3 pages of a ListRetainedMessages operation. 542 // pageNum := 0 543 // err := client.ListRetainedMessagesPages(params, 544 // func(page *iotdataplane.ListRetainedMessagesOutput, lastPage bool) bool { 545 // pageNum++ 546 // fmt.Println(page) 547 // return pageNum <= 3 548 // }) 549 // 550 func (c *IoTDataPlane) ListRetainedMessagesPages(input *ListRetainedMessagesInput, fn func(*ListRetainedMessagesOutput, bool) bool) error { 551 return c.ListRetainedMessagesPagesWithContext(aws.BackgroundContext(), input, fn) 552 } 553 554 // ListRetainedMessagesPagesWithContext same as ListRetainedMessagesPages except 555 // it takes a Context and allows setting request options on the pages. 556 // 557 // The context must be non-nil and will be used for request cancellation. If 558 // the context is nil a panic will occur. In the future the SDK may create 559 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 560 // for more information on using Contexts. 561 func (c *IoTDataPlane) ListRetainedMessagesPagesWithContext(ctx aws.Context, input *ListRetainedMessagesInput, fn func(*ListRetainedMessagesOutput, bool) bool, opts ...request.Option) error { 562 p := request.Pagination{ 563 NewRequest: func() (*request.Request, error) { 564 var inCpy *ListRetainedMessagesInput 565 if input != nil { 566 tmp := *input 567 inCpy = &tmp 568 } 569 req, _ := c.ListRetainedMessagesRequest(inCpy) 570 req.SetContext(ctx) 571 req.ApplyOptions(opts...) 572 return req, nil 573 }, 574 } 575 576 for p.Next() { 577 if !fn(p.Page().(*ListRetainedMessagesOutput), !p.HasNextPage()) { 578 break 579 } 580 } 581 582 return p.Err() 583 } 584 585 const opPublish = "Publish" 586 587 // PublishRequest generates a "aws/request.Request" representing the 588 // client's request for the Publish operation. The "output" return 589 // value will be populated with the request's response once the request completes 590 // successfully. 591 // 592 // Use "Send" method on the returned Request to send the API call to the service. 593 // the "output" return value is not valid until after Send returns without error. 594 // 595 // See Publish for more information on using the Publish 596 // API call, and error handling. 597 // 598 // This method is useful when you want to inject custom logic or configuration 599 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 600 // 601 // 602 // // Example sending a request using the PublishRequest method. 603 // req, resp := client.PublishRequest(params) 604 // 605 // err := req.Send() 606 // if err == nil { // resp is now filled 607 // fmt.Println(resp) 608 // } 609 func (c *IoTDataPlane) PublishRequest(input *PublishInput) (req *request.Request, output *PublishOutput) { 610 op := &request.Operation{ 611 Name: opPublish, 612 HTTPMethod: "POST", 613 HTTPPath: "/topics/{topic}", 614 } 615 616 if input == nil { 617 input = &PublishInput{} 618 } 619 620 output = &PublishOutput{} 621 req = c.newRequest(op, input, output) 622 req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 623 return 624 } 625 626 // Publish API operation for AWS IoT Data Plane. 627 // 628 // Publishes an MQTT message. 629 // 630 // Requires permission to access the Publish (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) 631 // action. 632 // 633 // For more information about MQTT messages, see MQTT Protocol (http://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html) 634 // in the IoT Developer Guide. 635 // 636 // For more information about messaging costs, see IoT Core pricing - Messaging 637 // (http://aws.amazon.com/iot-core/pricing/#Messaging). 638 // 639 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 640 // with awserr.Error's Code and Message methods to get detailed information about 641 // the error. 642 // 643 // See the AWS API reference guide for AWS IoT Data Plane's 644 // API operation Publish for usage and error information. 645 // 646 // Returned Error Types: 647 // * InternalFailureException 648 // An unexpected error has occurred. 649 // 650 // * InvalidRequestException 651 // The request is not valid. 652 // 653 // * UnauthorizedException 654 // You are not authorized to perform this operation. 655 // 656 // * MethodNotAllowedException 657 // The specified combination of HTTP verb and URI is not supported. 658 // 659 func (c *IoTDataPlane) Publish(input *PublishInput) (*PublishOutput, error) { 660 req, out := c.PublishRequest(input) 661 return out, req.Send() 662 } 663 664 // PublishWithContext is the same as Publish with the addition of 665 // the ability to pass a context and additional request options. 666 // 667 // See Publish for details on how to use this API operation. 668 // 669 // The context must be non-nil and will be used for request cancellation. If 670 // the context is nil a panic will occur. In the future the SDK may create 671 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 672 // for more information on using Contexts. 673 func (c *IoTDataPlane) PublishWithContext(ctx aws.Context, input *PublishInput, opts ...request.Option) (*PublishOutput, error) { 674 req, out := c.PublishRequest(input) 675 req.SetContext(ctx) 676 req.ApplyOptions(opts...) 677 return out, req.Send() 678 } 679 680 const opUpdateThingShadow = "UpdateThingShadow" 681 682 // UpdateThingShadowRequest generates a "aws/request.Request" representing the 683 // client's request for the UpdateThingShadow operation. The "output" return 684 // value will be populated with the request's response once the request completes 685 // successfully. 686 // 687 // Use "Send" method on the returned Request to send the API call to the service. 688 // the "output" return value is not valid until after Send returns without error. 689 // 690 // See UpdateThingShadow for more information on using the UpdateThingShadow 691 // API call, and error handling. 692 // 693 // This method is useful when you want to inject custom logic or configuration 694 // into the SDK's request lifecycle. Such as custom headers, or retry logic. 695 // 696 // 697 // // Example sending a request using the UpdateThingShadowRequest method. 698 // req, resp := client.UpdateThingShadowRequest(params) 699 // 700 // err := req.Send() 701 // if err == nil { // resp is now filled 702 // fmt.Println(resp) 703 // } 704 func (c *IoTDataPlane) UpdateThingShadowRequest(input *UpdateThingShadowInput) (req *request.Request, output *UpdateThingShadowOutput) { 705 op := &request.Operation{ 706 Name: opUpdateThingShadow, 707 HTTPMethod: "POST", 708 HTTPPath: "/things/{thingName}/shadow", 709 } 710 711 if input == nil { 712 input = &UpdateThingShadowInput{} 713 } 714 715 output = &UpdateThingShadowOutput{} 716 req = c.newRequest(op, input, output) 717 return 718 } 719 720 // UpdateThingShadow API operation for AWS IoT Data Plane. 721 // 722 // Updates the shadow for the specified thing. 723 // 724 // Requires permission to access the UpdateThingShadow (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) 725 // action. 726 // 727 // For more information, see UpdateThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_UpdateThingShadow.html) 728 // in the IoT Developer Guide. 729 // 730 // Returns awserr.Error for service API and SDK errors. Use runtime type assertions 731 // with awserr.Error's Code and Message methods to get detailed information about 732 // the error. 733 // 734 // See the AWS API reference guide for AWS IoT Data Plane's 735 // API operation UpdateThingShadow for usage and error information. 736 // 737 // Returned Error Types: 738 // * ConflictException 739 // The specified version does not match the version of the document. 740 // 741 // * RequestEntityTooLargeException 742 // The payload exceeds the maximum size allowed. 743 // 744 // * InvalidRequestException 745 // The request is not valid. 746 // 747 // * ThrottlingException 748 // The rate exceeds the limit. 749 // 750 // * UnauthorizedException 751 // You are not authorized to perform this operation. 752 // 753 // * ServiceUnavailableException 754 // The service is temporarily unavailable. 755 // 756 // * InternalFailureException 757 // An unexpected error has occurred. 758 // 759 // * MethodNotAllowedException 760 // The specified combination of HTTP verb and URI is not supported. 761 // 762 // * UnsupportedDocumentEncodingException 763 // The document encoding is not supported. 764 // 765 func (c *IoTDataPlane) UpdateThingShadow(input *UpdateThingShadowInput) (*UpdateThingShadowOutput, error) { 766 req, out := c.UpdateThingShadowRequest(input) 767 return out, req.Send() 768 } 769 770 // UpdateThingShadowWithContext is the same as UpdateThingShadow with the addition of 771 // the ability to pass a context and additional request options. 772 // 773 // See UpdateThingShadow for details on how to use this API operation. 774 // 775 // The context must be non-nil and will be used for request cancellation. If 776 // the context is nil a panic will occur. In the future the SDK may create 777 // sub-contexts for http.Requests. See https://golang.org/pkg/context/ 778 // for more information on using Contexts. 779 func (c *IoTDataPlane) UpdateThingShadowWithContext(ctx aws.Context, input *UpdateThingShadowInput, opts ...request.Option) (*UpdateThingShadowOutput, error) { 780 req, out := c.UpdateThingShadowRequest(input) 781 req.SetContext(ctx) 782 req.ApplyOptions(opts...) 783 return out, req.Send() 784 } 785 786 // The specified version does not match the version of the document. 787 type ConflictException struct { 788 _ struct{} `type:"structure"` 789 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 790 791 // The message for the exception. 792 Message_ *string `locationName:"message" type:"string"` 793 } 794 795 // String returns the string representation. 796 // 797 // API parameter values that are decorated as "sensitive" in the API will not 798 // be included in the string output. The member name will be present, but the 799 // value will be replaced with "sensitive". 800 func (s ConflictException) String() string { 801 return awsutil.Prettify(s) 802 } 803 804 // GoString returns the string representation. 805 // 806 // API parameter values that are decorated as "sensitive" in the API will not 807 // be included in the string output. The member name will be present, but the 808 // value will be replaced with "sensitive". 809 func (s ConflictException) GoString() string { 810 return s.String() 811 } 812 813 func newErrorConflictException(v protocol.ResponseMetadata) error { 814 return &ConflictException{ 815 RespMetadata: v, 816 } 817 } 818 819 // Code returns the exception type name. 820 func (s *ConflictException) Code() string { 821 return "ConflictException" 822 } 823 824 // Message returns the exception's message. 825 func (s *ConflictException) Message() string { 826 if s.Message_ != nil { 827 return *s.Message_ 828 } 829 return "" 830 } 831 832 // OrigErr always returns nil, satisfies awserr.Error interface. 833 func (s *ConflictException) OrigErr() error { 834 return nil 835 } 836 837 func (s *ConflictException) Error() string { 838 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 839 } 840 841 // Status code returns the HTTP status code for the request's response error. 842 func (s *ConflictException) StatusCode() int { 843 return s.RespMetadata.StatusCode 844 } 845 846 // RequestID returns the service's response RequestID for request. 847 func (s *ConflictException) RequestID() string { 848 return s.RespMetadata.RequestID 849 } 850 851 // The input for the DeleteThingShadow operation. 852 type DeleteThingShadowInput struct { 853 _ struct{} `type:"structure" nopayload:"true"` 854 855 // The name of the shadow. 856 ShadowName *string `location:"querystring" locationName:"name" min:"1" type:"string"` 857 858 // The name of the thing. 859 // 860 // ThingName is a required field 861 ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` 862 } 863 864 // String returns the string representation. 865 // 866 // API parameter values that are decorated as "sensitive" in the API will not 867 // be included in the string output. The member name will be present, but the 868 // value will be replaced with "sensitive". 869 func (s DeleteThingShadowInput) String() string { 870 return awsutil.Prettify(s) 871 } 872 873 // GoString returns the string representation. 874 // 875 // API parameter values that are decorated as "sensitive" in the API will not 876 // be included in the string output. The member name will be present, but the 877 // value will be replaced with "sensitive". 878 func (s DeleteThingShadowInput) GoString() string { 879 return s.String() 880 } 881 882 // Validate inspects the fields of the type to determine if they are valid. 883 func (s *DeleteThingShadowInput) Validate() error { 884 invalidParams := request.ErrInvalidParams{Context: "DeleteThingShadowInput"} 885 if s.ShadowName != nil && len(*s.ShadowName) < 1 { 886 invalidParams.Add(request.NewErrParamMinLen("ShadowName", 1)) 887 } 888 if s.ThingName == nil { 889 invalidParams.Add(request.NewErrParamRequired("ThingName")) 890 } 891 if s.ThingName != nil && len(*s.ThingName) < 1 { 892 invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) 893 } 894 895 if invalidParams.Len() > 0 { 896 return invalidParams 897 } 898 return nil 899 } 900 901 // SetShadowName sets the ShadowName field's value. 902 func (s *DeleteThingShadowInput) SetShadowName(v string) *DeleteThingShadowInput { 903 s.ShadowName = &v 904 return s 905 } 906 907 // SetThingName sets the ThingName field's value. 908 func (s *DeleteThingShadowInput) SetThingName(v string) *DeleteThingShadowInput { 909 s.ThingName = &v 910 return s 911 } 912 913 // The output from the DeleteThingShadow operation. 914 type DeleteThingShadowOutput struct { 915 _ struct{} `type:"structure" payload:"Payload"` 916 917 // The state information, in JSON format. 918 // 919 // Payload is a required field 920 Payload []byte `locationName:"payload" type:"blob" required:"true"` 921 } 922 923 // String returns the string representation. 924 // 925 // API parameter values that are decorated as "sensitive" in the API will not 926 // be included in the string output. The member name will be present, but the 927 // value will be replaced with "sensitive". 928 func (s DeleteThingShadowOutput) String() string { 929 return awsutil.Prettify(s) 930 } 931 932 // GoString returns the string representation. 933 // 934 // API parameter values that are decorated as "sensitive" in the API will not 935 // be included in the string output. The member name will be present, but the 936 // value will be replaced with "sensitive". 937 func (s DeleteThingShadowOutput) GoString() string { 938 return s.String() 939 } 940 941 // SetPayload sets the Payload field's value. 942 func (s *DeleteThingShadowOutput) SetPayload(v []byte) *DeleteThingShadowOutput { 943 s.Payload = v 944 return s 945 } 946 947 // The input for the GetRetainedMessage operation. 948 type GetRetainedMessageInput struct { 949 _ struct{} `type:"structure" nopayload:"true"` 950 951 // The topic name of the retained message to retrieve. 952 // 953 // Topic is a required field 954 Topic *string `location:"uri" locationName:"topic" type:"string" required:"true"` 955 } 956 957 // String returns the string representation. 958 // 959 // API parameter values that are decorated as "sensitive" in the API will not 960 // be included in the string output. The member name will be present, but the 961 // value will be replaced with "sensitive". 962 func (s GetRetainedMessageInput) String() string { 963 return awsutil.Prettify(s) 964 } 965 966 // GoString returns the string representation. 967 // 968 // API parameter values that are decorated as "sensitive" in the API will not 969 // be included in the string output. The member name will be present, but the 970 // value will be replaced with "sensitive". 971 func (s GetRetainedMessageInput) GoString() string { 972 return s.String() 973 } 974 975 // Validate inspects the fields of the type to determine if they are valid. 976 func (s *GetRetainedMessageInput) Validate() error { 977 invalidParams := request.ErrInvalidParams{Context: "GetRetainedMessageInput"} 978 if s.Topic == nil { 979 invalidParams.Add(request.NewErrParamRequired("Topic")) 980 } 981 if s.Topic != nil && len(*s.Topic) < 1 { 982 invalidParams.Add(request.NewErrParamMinLen("Topic", 1)) 983 } 984 985 if invalidParams.Len() > 0 { 986 return invalidParams 987 } 988 return nil 989 } 990 991 // SetTopic sets the Topic field's value. 992 func (s *GetRetainedMessageInput) SetTopic(v string) *GetRetainedMessageInput { 993 s.Topic = &v 994 return s 995 } 996 997 // The output from the GetRetainedMessage operation. 998 type GetRetainedMessageOutput struct { 999 _ struct{} `type:"structure"` 1000 1001 // The Epoch date and time, in milliseconds, when the retained message was stored 1002 // by IoT. 1003 LastModifiedTime *int64 `locationName:"lastModifiedTime" type:"long"` 1004 1005 // The Base64-encoded message payload of the retained message body. 1006 // Payload is automatically base64 encoded/decoded by the SDK. 1007 Payload []byte `locationName:"payload" type:"blob"` 1008 1009 // The quality of service (QoS) level used to publish the retained message. 1010 Qos *int64 `locationName:"qos" type:"integer"` 1011 1012 // The topic name to which the retained message was published. 1013 Topic *string `locationName:"topic" type:"string"` 1014 } 1015 1016 // String returns the string representation. 1017 // 1018 // API parameter values that are decorated as "sensitive" in the API will not 1019 // be included in the string output. The member name will be present, but the 1020 // value will be replaced with "sensitive". 1021 func (s GetRetainedMessageOutput) String() string { 1022 return awsutil.Prettify(s) 1023 } 1024 1025 // GoString returns the string representation. 1026 // 1027 // API parameter values that are decorated as "sensitive" in the API will not 1028 // be included in the string output. The member name will be present, but the 1029 // value will be replaced with "sensitive". 1030 func (s GetRetainedMessageOutput) GoString() string { 1031 return s.String() 1032 } 1033 1034 // SetLastModifiedTime sets the LastModifiedTime field's value. 1035 func (s *GetRetainedMessageOutput) SetLastModifiedTime(v int64) *GetRetainedMessageOutput { 1036 s.LastModifiedTime = &v 1037 return s 1038 } 1039 1040 // SetPayload sets the Payload field's value. 1041 func (s *GetRetainedMessageOutput) SetPayload(v []byte) *GetRetainedMessageOutput { 1042 s.Payload = v 1043 return s 1044 } 1045 1046 // SetQos sets the Qos field's value. 1047 func (s *GetRetainedMessageOutput) SetQos(v int64) *GetRetainedMessageOutput { 1048 s.Qos = &v 1049 return s 1050 } 1051 1052 // SetTopic sets the Topic field's value. 1053 func (s *GetRetainedMessageOutput) SetTopic(v string) *GetRetainedMessageOutput { 1054 s.Topic = &v 1055 return s 1056 } 1057 1058 // The input for the GetThingShadow operation. 1059 type GetThingShadowInput struct { 1060 _ struct{} `type:"structure" nopayload:"true"` 1061 1062 // The name of the shadow. 1063 ShadowName *string `location:"querystring" locationName:"name" min:"1" type:"string"` 1064 1065 // The name of the thing. 1066 // 1067 // ThingName is a required field 1068 ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` 1069 } 1070 1071 // String returns the string representation. 1072 // 1073 // API parameter values that are decorated as "sensitive" in the API will not 1074 // be included in the string output. The member name will be present, but the 1075 // value will be replaced with "sensitive". 1076 func (s GetThingShadowInput) String() string { 1077 return awsutil.Prettify(s) 1078 } 1079 1080 // GoString returns the string representation. 1081 // 1082 // API parameter values that are decorated as "sensitive" in the API will not 1083 // be included in the string output. The member name will be present, but the 1084 // value will be replaced with "sensitive". 1085 func (s GetThingShadowInput) GoString() string { 1086 return s.String() 1087 } 1088 1089 // Validate inspects the fields of the type to determine if they are valid. 1090 func (s *GetThingShadowInput) Validate() error { 1091 invalidParams := request.ErrInvalidParams{Context: "GetThingShadowInput"} 1092 if s.ShadowName != nil && len(*s.ShadowName) < 1 { 1093 invalidParams.Add(request.NewErrParamMinLen("ShadowName", 1)) 1094 } 1095 if s.ThingName == nil { 1096 invalidParams.Add(request.NewErrParamRequired("ThingName")) 1097 } 1098 if s.ThingName != nil && len(*s.ThingName) < 1 { 1099 invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) 1100 } 1101 1102 if invalidParams.Len() > 0 { 1103 return invalidParams 1104 } 1105 return nil 1106 } 1107 1108 // SetShadowName sets the ShadowName field's value. 1109 func (s *GetThingShadowInput) SetShadowName(v string) *GetThingShadowInput { 1110 s.ShadowName = &v 1111 return s 1112 } 1113 1114 // SetThingName sets the ThingName field's value. 1115 func (s *GetThingShadowInput) SetThingName(v string) *GetThingShadowInput { 1116 s.ThingName = &v 1117 return s 1118 } 1119 1120 // The output from the GetThingShadow operation. 1121 type GetThingShadowOutput struct { 1122 _ struct{} `type:"structure" payload:"Payload"` 1123 1124 // The state information, in JSON format. 1125 Payload []byte `locationName:"payload" type:"blob"` 1126 } 1127 1128 // String returns the string representation. 1129 // 1130 // API parameter values that are decorated as "sensitive" in the API will not 1131 // be included in the string output. The member name will be present, but the 1132 // value will be replaced with "sensitive". 1133 func (s GetThingShadowOutput) String() string { 1134 return awsutil.Prettify(s) 1135 } 1136 1137 // GoString returns the string representation. 1138 // 1139 // API parameter values that are decorated as "sensitive" in the API will not 1140 // be included in the string output. The member name will be present, but the 1141 // value will be replaced with "sensitive". 1142 func (s GetThingShadowOutput) GoString() string { 1143 return s.String() 1144 } 1145 1146 // SetPayload sets the Payload field's value. 1147 func (s *GetThingShadowOutput) SetPayload(v []byte) *GetThingShadowOutput { 1148 s.Payload = v 1149 return s 1150 } 1151 1152 // An unexpected error has occurred. 1153 type InternalFailureException struct { 1154 _ struct{} `type:"structure"` 1155 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1156 1157 // The message for the exception. 1158 Message_ *string `locationName:"message" type:"string"` 1159 } 1160 1161 // String returns the string representation. 1162 // 1163 // API parameter values that are decorated as "sensitive" in the API will not 1164 // be included in the string output. The member name will be present, but the 1165 // value will be replaced with "sensitive". 1166 func (s InternalFailureException) String() string { 1167 return awsutil.Prettify(s) 1168 } 1169 1170 // GoString returns the string representation. 1171 // 1172 // API parameter values that are decorated as "sensitive" in the API will not 1173 // be included in the string output. The member name will be present, but the 1174 // value will be replaced with "sensitive". 1175 func (s InternalFailureException) GoString() string { 1176 return s.String() 1177 } 1178 1179 func newErrorInternalFailureException(v protocol.ResponseMetadata) error { 1180 return &InternalFailureException{ 1181 RespMetadata: v, 1182 } 1183 } 1184 1185 // Code returns the exception type name. 1186 func (s *InternalFailureException) Code() string { 1187 return "InternalFailureException" 1188 } 1189 1190 // Message returns the exception's message. 1191 func (s *InternalFailureException) Message() string { 1192 if s.Message_ != nil { 1193 return *s.Message_ 1194 } 1195 return "" 1196 } 1197 1198 // OrigErr always returns nil, satisfies awserr.Error interface. 1199 func (s *InternalFailureException) OrigErr() error { 1200 return nil 1201 } 1202 1203 func (s *InternalFailureException) Error() string { 1204 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1205 } 1206 1207 // Status code returns the HTTP status code for the request's response error. 1208 func (s *InternalFailureException) StatusCode() int { 1209 return s.RespMetadata.StatusCode 1210 } 1211 1212 // RequestID returns the service's response RequestID for request. 1213 func (s *InternalFailureException) RequestID() string { 1214 return s.RespMetadata.RequestID 1215 } 1216 1217 // The request is not valid. 1218 type InvalidRequestException struct { 1219 _ struct{} `type:"structure"` 1220 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1221 1222 // The message for the exception. 1223 Message_ *string `locationName:"message" type:"string"` 1224 } 1225 1226 // String returns the string representation. 1227 // 1228 // API parameter values that are decorated as "sensitive" in the API will not 1229 // be included in the string output. The member name will be present, but the 1230 // value will be replaced with "sensitive". 1231 func (s InvalidRequestException) String() string { 1232 return awsutil.Prettify(s) 1233 } 1234 1235 // GoString returns the string representation. 1236 // 1237 // API parameter values that are decorated as "sensitive" in the API will not 1238 // be included in the string output. The member name will be present, but the 1239 // value will be replaced with "sensitive". 1240 func (s InvalidRequestException) GoString() string { 1241 return s.String() 1242 } 1243 1244 func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { 1245 return &InvalidRequestException{ 1246 RespMetadata: v, 1247 } 1248 } 1249 1250 // Code returns the exception type name. 1251 func (s *InvalidRequestException) Code() string { 1252 return "InvalidRequestException" 1253 } 1254 1255 // Message returns the exception's message. 1256 func (s *InvalidRequestException) Message() string { 1257 if s.Message_ != nil { 1258 return *s.Message_ 1259 } 1260 return "" 1261 } 1262 1263 // OrigErr always returns nil, satisfies awserr.Error interface. 1264 func (s *InvalidRequestException) OrigErr() error { 1265 return nil 1266 } 1267 1268 func (s *InvalidRequestException) Error() string { 1269 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1270 } 1271 1272 // Status code returns the HTTP status code for the request's response error. 1273 func (s *InvalidRequestException) StatusCode() int { 1274 return s.RespMetadata.StatusCode 1275 } 1276 1277 // RequestID returns the service's response RequestID for request. 1278 func (s *InvalidRequestException) RequestID() string { 1279 return s.RespMetadata.RequestID 1280 } 1281 1282 type ListNamedShadowsForThingInput struct { 1283 _ struct{} `type:"structure" nopayload:"true"` 1284 1285 // The token to retrieve the next set of results. 1286 NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` 1287 1288 // The result page size. 1289 PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` 1290 1291 // The name of the thing. 1292 // 1293 // ThingName is a required field 1294 ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` 1295 } 1296 1297 // String returns the string representation. 1298 // 1299 // API parameter values that are decorated as "sensitive" in the API will not 1300 // be included in the string output. The member name will be present, but the 1301 // value will be replaced with "sensitive". 1302 func (s ListNamedShadowsForThingInput) String() string { 1303 return awsutil.Prettify(s) 1304 } 1305 1306 // GoString returns the string representation. 1307 // 1308 // API parameter values that are decorated as "sensitive" in the API will not 1309 // be included in the string output. The member name will be present, but the 1310 // value will be replaced with "sensitive". 1311 func (s ListNamedShadowsForThingInput) GoString() string { 1312 return s.String() 1313 } 1314 1315 // Validate inspects the fields of the type to determine if they are valid. 1316 func (s *ListNamedShadowsForThingInput) Validate() error { 1317 invalidParams := request.ErrInvalidParams{Context: "ListNamedShadowsForThingInput"} 1318 if s.PageSize != nil && *s.PageSize < 1 { 1319 invalidParams.Add(request.NewErrParamMinValue("PageSize", 1)) 1320 } 1321 if s.ThingName == nil { 1322 invalidParams.Add(request.NewErrParamRequired("ThingName")) 1323 } 1324 if s.ThingName != nil && len(*s.ThingName) < 1 { 1325 invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) 1326 } 1327 1328 if invalidParams.Len() > 0 { 1329 return invalidParams 1330 } 1331 return nil 1332 } 1333 1334 // SetNextToken sets the NextToken field's value. 1335 func (s *ListNamedShadowsForThingInput) SetNextToken(v string) *ListNamedShadowsForThingInput { 1336 s.NextToken = &v 1337 return s 1338 } 1339 1340 // SetPageSize sets the PageSize field's value. 1341 func (s *ListNamedShadowsForThingInput) SetPageSize(v int64) *ListNamedShadowsForThingInput { 1342 s.PageSize = &v 1343 return s 1344 } 1345 1346 // SetThingName sets the ThingName field's value. 1347 func (s *ListNamedShadowsForThingInput) SetThingName(v string) *ListNamedShadowsForThingInput { 1348 s.ThingName = &v 1349 return s 1350 } 1351 1352 type ListNamedShadowsForThingOutput struct { 1353 _ struct{} `type:"structure"` 1354 1355 // The token to use to get the next set of results, or null if there are no 1356 // additional results. 1357 NextToken *string `locationName:"nextToken" type:"string"` 1358 1359 // The list of shadows for the specified thing. 1360 Results []*string `locationName:"results" type:"list"` 1361 1362 // The Epoch date and time the response was generated by IoT. 1363 Timestamp *int64 `locationName:"timestamp" type:"long"` 1364 } 1365 1366 // String returns the string representation. 1367 // 1368 // API parameter values that are decorated as "sensitive" in the API will not 1369 // be included in the string output. The member name will be present, but the 1370 // value will be replaced with "sensitive". 1371 func (s ListNamedShadowsForThingOutput) String() string { 1372 return awsutil.Prettify(s) 1373 } 1374 1375 // GoString returns the string representation. 1376 // 1377 // API parameter values that are decorated as "sensitive" in the API will not 1378 // be included in the string output. The member name will be present, but the 1379 // value will be replaced with "sensitive". 1380 func (s ListNamedShadowsForThingOutput) GoString() string { 1381 return s.String() 1382 } 1383 1384 // SetNextToken sets the NextToken field's value. 1385 func (s *ListNamedShadowsForThingOutput) SetNextToken(v string) *ListNamedShadowsForThingOutput { 1386 s.NextToken = &v 1387 return s 1388 } 1389 1390 // SetResults sets the Results field's value. 1391 func (s *ListNamedShadowsForThingOutput) SetResults(v []*string) *ListNamedShadowsForThingOutput { 1392 s.Results = v 1393 return s 1394 } 1395 1396 // SetTimestamp sets the Timestamp field's value. 1397 func (s *ListNamedShadowsForThingOutput) SetTimestamp(v int64) *ListNamedShadowsForThingOutput { 1398 s.Timestamp = &v 1399 return s 1400 } 1401 1402 type ListRetainedMessagesInput struct { 1403 _ struct{} `type:"structure" nopayload:"true"` 1404 1405 // The maximum number of results to return at one time. 1406 MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` 1407 1408 // To retrieve the next set of results, the nextToken value from a previous 1409 // response; otherwise null to receive the first set of results. 1410 NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` 1411 } 1412 1413 // String returns the string representation. 1414 // 1415 // API parameter values that are decorated as "sensitive" in the API will not 1416 // be included in the string output. The member name will be present, but the 1417 // value will be replaced with "sensitive". 1418 func (s ListRetainedMessagesInput) String() string { 1419 return awsutil.Prettify(s) 1420 } 1421 1422 // GoString returns the string representation. 1423 // 1424 // API parameter values that are decorated as "sensitive" in the API will not 1425 // be included in the string output. The member name will be present, but the 1426 // value will be replaced with "sensitive". 1427 func (s ListRetainedMessagesInput) GoString() string { 1428 return s.String() 1429 } 1430 1431 // Validate inspects the fields of the type to determine if they are valid. 1432 func (s *ListRetainedMessagesInput) Validate() error { 1433 invalidParams := request.ErrInvalidParams{Context: "ListRetainedMessagesInput"} 1434 if s.MaxResults != nil && *s.MaxResults < 1 { 1435 invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) 1436 } 1437 1438 if invalidParams.Len() > 0 { 1439 return invalidParams 1440 } 1441 return nil 1442 } 1443 1444 // SetMaxResults sets the MaxResults field's value. 1445 func (s *ListRetainedMessagesInput) SetMaxResults(v int64) *ListRetainedMessagesInput { 1446 s.MaxResults = &v 1447 return s 1448 } 1449 1450 // SetNextToken sets the NextToken field's value. 1451 func (s *ListRetainedMessagesInput) SetNextToken(v string) *ListRetainedMessagesInput { 1452 s.NextToken = &v 1453 return s 1454 } 1455 1456 type ListRetainedMessagesOutput struct { 1457 _ struct{} `type:"structure"` 1458 1459 // The token for the next set of results, or null if there are no additional 1460 // results. 1461 NextToken *string `locationName:"nextToken" type:"string"` 1462 1463 // A summary list the account's retained messages. The information returned 1464 // doesn't include the message payloads of the retained messages. 1465 RetainedTopics []*RetainedMessageSummary `locationName:"retainedTopics" type:"list"` 1466 } 1467 1468 // String returns the string representation. 1469 // 1470 // API parameter values that are decorated as "sensitive" in the API will not 1471 // be included in the string output. The member name will be present, but the 1472 // value will be replaced with "sensitive". 1473 func (s ListRetainedMessagesOutput) String() string { 1474 return awsutil.Prettify(s) 1475 } 1476 1477 // GoString returns the string representation. 1478 // 1479 // API parameter values that are decorated as "sensitive" in the API will not 1480 // be included in the string output. The member name will be present, but the 1481 // value will be replaced with "sensitive". 1482 func (s ListRetainedMessagesOutput) GoString() string { 1483 return s.String() 1484 } 1485 1486 // SetNextToken sets the NextToken field's value. 1487 func (s *ListRetainedMessagesOutput) SetNextToken(v string) *ListRetainedMessagesOutput { 1488 s.NextToken = &v 1489 return s 1490 } 1491 1492 // SetRetainedTopics sets the RetainedTopics field's value. 1493 func (s *ListRetainedMessagesOutput) SetRetainedTopics(v []*RetainedMessageSummary) *ListRetainedMessagesOutput { 1494 s.RetainedTopics = v 1495 return s 1496 } 1497 1498 // The specified combination of HTTP verb and URI is not supported. 1499 type MethodNotAllowedException struct { 1500 _ struct{} `type:"structure"` 1501 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1502 1503 // The message for the exception. 1504 Message_ *string `locationName:"message" type:"string"` 1505 } 1506 1507 // String returns the string representation. 1508 // 1509 // API parameter values that are decorated as "sensitive" in the API will not 1510 // be included in the string output. The member name will be present, but the 1511 // value will be replaced with "sensitive". 1512 func (s MethodNotAllowedException) String() string { 1513 return awsutil.Prettify(s) 1514 } 1515 1516 // GoString returns the string representation. 1517 // 1518 // API parameter values that are decorated as "sensitive" in the API will not 1519 // be included in the string output. The member name will be present, but the 1520 // value will be replaced with "sensitive". 1521 func (s MethodNotAllowedException) GoString() string { 1522 return s.String() 1523 } 1524 1525 func newErrorMethodNotAllowedException(v protocol.ResponseMetadata) error { 1526 return &MethodNotAllowedException{ 1527 RespMetadata: v, 1528 } 1529 } 1530 1531 // Code returns the exception type name. 1532 func (s *MethodNotAllowedException) Code() string { 1533 return "MethodNotAllowedException" 1534 } 1535 1536 // Message returns the exception's message. 1537 func (s *MethodNotAllowedException) Message() string { 1538 if s.Message_ != nil { 1539 return *s.Message_ 1540 } 1541 return "" 1542 } 1543 1544 // OrigErr always returns nil, satisfies awserr.Error interface. 1545 func (s *MethodNotAllowedException) OrigErr() error { 1546 return nil 1547 } 1548 1549 func (s *MethodNotAllowedException) Error() string { 1550 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1551 } 1552 1553 // Status code returns the HTTP status code for the request's response error. 1554 func (s *MethodNotAllowedException) StatusCode() int { 1555 return s.RespMetadata.StatusCode 1556 } 1557 1558 // RequestID returns the service's response RequestID for request. 1559 func (s *MethodNotAllowedException) RequestID() string { 1560 return s.RespMetadata.RequestID 1561 } 1562 1563 // The input for the Publish operation. 1564 type PublishInput struct { 1565 _ struct{} `type:"structure" payload:"Payload"` 1566 1567 // The message body. MQTT accepts text, binary, and empty (null) message payloads. 1568 // 1569 // Publishing an empty (null) payload with retain = true deletes the retained 1570 // message identified by topic from IoT Core. 1571 Payload []byte `locationName:"payload" type:"blob"` 1572 1573 // The Quality of Service (QoS) level. 1574 Qos *int64 `location:"querystring" locationName:"qos" type:"integer"` 1575 1576 // A Boolean value that determines whether to set the RETAIN flag when the message 1577 // is published. 1578 // 1579 // Setting the RETAIN flag causes the message to be retained and sent to new 1580 // subscribers to the topic. 1581 // 1582 // Valid values: true | false 1583 // 1584 // Default value: false 1585 Retain *bool `location:"querystring" locationName:"retain" type:"boolean"` 1586 1587 // The name of the MQTT topic. 1588 // 1589 // Topic is a required field 1590 Topic *string `location:"uri" locationName:"topic" type:"string" required:"true"` 1591 } 1592 1593 // String returns the string representation. 1594 // 1595 // API parameter values that are decorated as "sensitive" in the API will not 1596 // be included in the string output. The member name will be present, but the 1597 // value will be replaced with "sensitive". 1598 func (s PublishInput) String() string { 1599 return awsutil.Prettify(s) 1600 } 1601 1602 // GoString returns the string representation. 1603 // 1604 // API parameter values that are decorated as "sensitive" in the API will not 1605 // be included in the string output. The member name will be present, but the 1606 // value will be replaced with "sensitive". 1607 func (s PublishInput) GoString() string { 1608 return s.String() 1609 } 1610 1611 // Validate inspects the fields of the type to determine if they are valid. 1612 func (s *PublishInput) Validate() error { 1613 invalidParams := request.ErrInvalidParams{Context: "PublishInput"} 1614 if s.Topic == nil { 1615 invalidParams.Add(request.NewErrParamRequired("Topic")) 1616 } 1617 if s.Topic != nil && len(*s.Topic) < 1 { 1618 invalidParams.Add(request.NewErrParamMinLen("Topic", 1)) 1619 } 1620 1621 if invalidParams.Len() > 0 { 1622 return invalidParams 1623 } 1624 return nil 1625 } 1626 1627 // SetPayload sets the Payload field's value. 1628 func (s *PublishInput) SetPayload(v []byte) *PublishInput { 1629 s.Payload = v 1630 return s 1631 } 1632 1633 // SetQos sets the Qos field's value. 1634 func (s *PublishInput) SetQos(v int64) *PublishInput { 1635 s.Qos = &v 1636 return s 1637 } 1638 1639 // SetRetain sets the Retain field's value. 1640 func (s *PublishInput) SetRetain(v bool) *PublishInput { 1641 s.Retain = &v 1642 return s 1643 } 1644 1645 // SetTopic sets the Topic field's value. 1646 func (s *PublishInput) SetTopic(v string) *PublishInput { 1647 s.Topic = &v 1648 return s 1649 } 1650 1651 type PublishOutput struct { 1652 _ struct{} `type:"structure" nopayload:"true"` 1653 } 1654 1655 // String returns the string representation. 1656 // 1657 // API parameter values that are decorated as "sensitive" in the API will not 1658 // be included in the string output. The member name will be present, but the 1659 // value will be replaced with "sensitive". 1660 func (s PublishOutput) String() string { 1661 return awsutil.Prettify(s) 1662 } 1663 1664 // GoString returns the string representation. 1665 // 1666 // API parameter values that are decorated as "sensitive" in the API will not 1667 // be included in the string output. The member name will be present, but the 1668 // value will be replaced with "sensitive". 1669 func (s PublishOutput) GoString() string { 1670 return s.String() 1671 } 1672 1673 // The payload exceeds the maximum size allowed. 1674 type RequestEntityTooLargeException struct { 1675 _ struct{} `type:"structure"` 1676 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1677 1678 // The message for the exception. 1679 Message_ *string `locationName:"message" type:"string"` 1680 } 1681 1682 // String returns the string representation. 1683 // 1684 // API parameter values that are decorated as "sensitive" in the API will not 1685 // be included in the string output. The member name will be present, but the 1686 // value will be replaced with "sensitive". 1687 func (s RequestEntityTooLargeException) String() string { 1688 return awsutil.Prettify(s) 1689 } 1690 1691 // GoString returns the string representation. 1692 // 1693 // API parameter values that are decorated as "sensitive" in the API will not 1694 // be included in the string output. The member name will be present, but the 1695 // value will be replaced with "sensitive". 1696 func (s RequestEntityTooLargeException) GoString() string { 1697 return s.String() 1698 } 1699 1700 func newErrorRequestEntityTooLargeException(v protocol.ResponseMetadata) error { 1701 return &RequestEntityTooLargeException{ 1702 RespMetadata: v, 1703 } 1704 } 1705 1706 // Code returns the exception type name. 1707 func (s *RequestEntityTooLargeException) Code() string { 1708 return "RequestEntityTooLargeException" 1709 } 1710 1711 // Message returns the exception's message. 1712 func (s *RequestEntityTooLargeException) Message() string { 1713 if s.Message_ != nil { 1714 return *s.Message_ 1715 } 1716 return "" 1717 } 1718 1719 // OrigErr always returns nil, satisfies awserr.Error interface. 1720 func (s *RequestEntityTooLargeException) OrigErr() error { 1721 return nil 1722 } 1723 1724 func (s *RequestEntityTooLargeException) Error() string { 1725 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1726 } 1727 1728 // Status code returns the HTTP status code for the request's response error. 1729 func (s *RequestEntityTooLargeException) StatusCode() int { 1730 return s.RespMetadata.StatusCode 1731 } 1732 1733 // RequestID returns the service's response RequestID for request. 1734 func (s *RequestEntityTooLargeException) RequestID() string { 1735 return s.RespMetadata.RequestID 1736 } 1737 1738 // The specified resource does not exist. 1739 type ResourceNotFoundException struct { 1740 _ struct{} `type:"structure"` 1741 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1742 1743 // The message for the exception. 1744 Message_ *string `locationName:"message" type:"string"` 1745 } 1746 1747 // String returns the string representation. 1748 // 1749 // API parameter values that are decorated as "sensitive" in the API will not 1750 // be included in the string output. The member name will be present, but the 1751 // value will be replaced with "sensitive". 1752 func (s ResourceNotFoundException) String() string { 1753 return awsutil.Prettify(s) 1754 } 1755 1756 // GoString returns the string representation. 1757 // 1758 // API parameter values that are decorated as "sensitive" in the API will not 1759 // be included in the string output. The member name will be present, but the 1760 // value will be replaced with "sensitive". 1761 func (s ResourceNotFoundException) GoString() string { 1762 return s.String() 1763 } 1764 1765 func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { 1766 return &ResourceNotFoundException{ 1767 RespMetadata: v, 1768 } 1769 } 1770 1771 // Code returns the exception type name. 1772 func (s *ResourceNotFoundException) Code() string { 1773 return "ResourceNotFoundException" 1774 } 1775 1776 // Message returns the exception's message. 1777 func (s *ResourceNotFoundException) Message() string { 1778 if s.Message_ != nil { 1779 return *s.Message_ 1780 } 1781 return "" 1782 } 1783 1784 // OrigErr always returns nil, satisfies awserr.Error interface. 1785 func (s *ResourceNotFoundException) OrigErr() error { 1786 return nil 1787 } 1788 1789 func (s *ResourceNotFoundException) Error() string { 1790 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1791 } 1792 1793 // Status code returns the HTTP status code for the request's response error. 1794 func (s *ResourceNotFoundException) StatusCode() int { 1795 return s.RespMetadata.StatusCode 1796 } 1797 1798 // RequestID returns the service's response RequestID for request. 1799 func (s *ResourceNotFoundException) RequestID() string { 1800 return s.RespMetadata.RequestID 1801 } 1802 1803 // Information about a single retained message. 1804 type RetainedMessageSummary struct { 1805 _ struct{} `type:"structure"` 1806 1807 // The Epoch date and time, in milliseconds, when the retained message was stored 1808 // by IoT. 1809 LastModifiedTime *int64 `locationName:"lastModifiedTime" type:"long"` 1810 1811 // The size of the retained message's payload in bytes. 1812 PayloadSize *int64 `locationName:"payloadSize" type:"long"` 1813 1814 // The quality of service (QoS) level used to publish the retained message. 1815 Qos *int64 `locationName:"qos" type:"integer"` 1816 1817 // The topic name to which the retained message was published. 1818 Topic *string `locationName:"topic" type:"string"` 1819 } 1820 1821 // String returns the string representation. 1822 // 1823 // API parameter values that are decorated as "sensitive" in the API will not 1824 // be included in the string output. The member name will be present, but the 1825 // value will be replaced with "sensitive". 1826 func (s RetainedMessageSummary) String() string { 1827 return awsutil.Prettify(s) 1828 } 1829 1830 // GoString returns the string representation. 1831 // 1832 // API parameter values that are decorated as "sensitive" in the API will not 1833 // be included in the string output. The member name will be present, but the 1834 // value will be replaced with "sensitive". 1835 func (s RetainedMessageSummary) GoString() string { 1836 return s.String() 1837 } 1838 1839 // SetLastModifiedTime sets the LastModifiedTime field's value. 1840 func (s *RetainedMessageSummary) SetLastModifiedTime(v int64) *RetainedMessageSummary { 1841 s.LastModifiedTime = &v 1842 return s 1843 } 1844 1845 // SetPayloadSize sets the PayloadSize field's value. 1846 func (s *RetainedMessageSummary) SetPayloadSize(v int64) *RetainedMessageSummary { 1847 s.PayloadSize = &v 1848 return s 1849 } 1850 1851 // SetQos sets the Qos field's value. 1852 func (s *RetainedMessageSummary) SetQos(v int64) *RetainedMessageSummary { 1853 s.Qos = &v 1854 return s 1855 } 1856 1857 // SetTopic sets the Topic field's value. 1858 func (s *RetainedMessageSummary) SetTopic(v string) *RetainedMessageSummary { 1859 s.Topic = &v 1860 return s 1861 } 1862 1863 // The service is temporarily unavailable. 1864 type ServiceUnavailableException struct { 1865 _ struct{} `type:"structure"` 1866 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1867 1868 // The message for the exception. 1869 Message_ *string `locationName:"message" type:"string"` 1870 } 1871 1872 // String returns the string representation. 1873 // 1874 // API parameter values that are decorated as "sensitive" in the API will not 1875 // be included in the string output. The member name will be present, but the 1876 // value will be replaced with "sensitive". 1877 func (s ServiceUnavailableException) String() string { 1878 return awsutil.Prettify(s) 1879 } 1880 1881 // GoString returns the string representation. 1882 // 1883 // API parameter values that are decorated as "sensitive" in the API will not 1884 // be included in the string output. The member name will be present, but the 1885 // value will be replaced with "sensitive". 1886 func (s ServiceUnavailableException) GoString() string { 1887 return s.String() 1888 } 1889 1890 func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { 1891 return &ServiceUnavailableException{ 1892 RespMetadata: v, 1893 } 1894 } 1895 1896 // Code returns the exception type name. 1897 func (s *ServiceUnavailableException) Code() string { 1898 return "ServiceUnavailableException" 1899 } 1900 1901 // Message returns the exception's message. 1902 func (s *ServiceUnavailableException) Message() string { 1903 if s.Message_ != nil { 1904 return *s.Message_ 1905 } 1906 return "" 1907 } 1908 1909 // OrigErr always returns nil, satisfies awserr.Error interface. 1910 func (s *ServiceUnavailableException) OrigErr() error { 1911 return nil 1912 } 1913 1914 func (s *ServiceUnavailableException) Error() string { 1915 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1916 } 1917 1918 // Status code returns the HTTP status code for the request's response error. 1919 func (s *ServiceUnavailableException) StatusCode() int { 1920 return s.RespMetadata.StatusCode 1921 } 1922 1923 // RequestID returns the service's response RequestID for request. 1924 func (s *ServiceUnavailableException) RequestID() string { 1925 return s.RespMetadata.RequestID 1926 } 1927 1928 // The rate exceeds the limit. 1929 type ThrottlingException struct { 1930 _ struct{} `type:"structure"` 1931 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1932 1933 // The message for the exception. 1934 Message_ *string `locationName:"message" type:"string"` 1935 } 1936 1937 // String returns the string representation. 1938 // 1939 // API parameter values that are decorated as "sensitive" in the API will not 1940 // be included in the string output. The member name will be present, but the 1941 // value will be replaced with "sensitive". 1942 func (s ThrottlingException) String() string { 1943 return awsutil.Prettify(s) 1944 } 1945 1946 // GoString returns the string representation. 1947 // 1948 // API parameter values that are decorated as "sensitive" in the API will not 1949 // be included in the string output. The member name will be present, but the 1950 // value will be replaced with "sensitive". 1951 func (s ThrottlingException) GoString() string { 1952 return s.String() 1953 } 1954 1955 func newErrorThrottlingException(v protocol.ResponseMetadata) error { 1956 return &ThrottlingException{ 1957 RespMetadata: v, 1958 } 1959 } 1960 1961 // Code returns the exception type name. 1962 func (s *ThrottlingException) Code() string { 1963 return "ThrottlingException" 1964 } 1965 1966 // Message returns the exception's message. 1967 func (s *ThrottlingException) Message() string { 1968 if s.Message_ != nil { 1969 return *s.Message_ 1970 } 1971 return "" 1972 } 1973 1974 // OrigErr always returns nil, satisfies awserr.Error interface. 1975 func (s *ThrottlingException) OrigErr() error { 1976 return nil 1977 } 1978 1979 func (s *ThrottlingException) Error() string { 1980 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 1981 } 1982 1983 // Status code returns the HTTP status code for the request's response error. 1984 func (s *ThrottlingException) StatusCode() int { 1985 return s.RespMetadata.StatusCode 1986 } 1987 1988 // RequestID returns the service's response RequestID for request. 1989 func (s *ThrottlingException) RequestID() string { 1990 return s.RespMetadata.RequestID 1991 } 1992 1993 // You are not authorized to perform this operation. 1994 type UnauthorizedException struct { 1995 _ struct{} `type:"structure"` 1996 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 1997 1998 // The message for the exception. 1999 Message_ *string `locationName:"message" type:"string"` 2000 } 2001 2002 // String returns the string representation. 2003 // 2004 // API parameter values that are decorated as "sensitive" in the API will not 2005 // be included in the string output. The member name will be present, but the 2006 // value will be replaced with "sensitive". 2007 func (s UnauthorizedException) String() string { 2008 return awsutil.Prettify(s) 2009 } 2010 2011 // GoString returns the string representation. 2012 // 2013 // API parameter values that are decorated as "sensitive" in the API will not 2014 // be included in the string output. The member name will be present, but the 2015 // value will be replaced with "sensitive". 2016 func (s UnauthorizedException) GoString() string { 2017 return s.String() 2018 } 2019 2020 func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { 2021 return &UnauthorizedException{ 2022 RespMetadata: v, 2023 } 2024 } 2025 2026 // Code returns the exception type name. 2027 func (s *UnauthorizedException) Code() string { 2028 return "UnauthorizedException" 2029 } 2030 2031 // Message returns the exception's message. 2032 func (s *UnauthorizedException) Message() string { 2033 if s.Message_ != nil { 2034 return *s.Message_ 2035 } 2036 return "" 2037 } 2038 2039 // OrigErr always returns nil, satisfies awserr.Error interface. 2040 func (s *UnauthorizedException) OrigErr() error { 2041 return nil 2042 } 2043 2044 func (s *UnauthorizedException) Error() string { 2045 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2046 } 2047 2048 // Status code returns the HTTP status code for the request's response error. 2049 func (s *UnauthorizedException) StatusCode() int { 2050 return s.RespMetadata.StatusCode 2051 } 2052 2053 // RequestID returns the service's response RequestID for request. 2054 func (s *UnauthorizedException) RequestID() string { 2055 return s.RespMetadata.RequestID 2056 } 2057 2058 // The document encoding is not supported. 2059 type UnsupportedDocumentEncodingException struct { 2060 _ struct{} `type:"structure"` 2061 RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` 2062 2063 // The message for the exception. 2064 Message_ *string `locationName:"message" type:"string"` 2065 } 2066 2067 // String returns the string representation. 2068 // 2069 // API parameter values that are decorated as "sensitive" in the API will not 2070 // be included in the string output. The member name will be present, but the 2071 // value will be replaced with "sensitive". 2072 func (s UnsupportedDocumentEncodingException) String() string { 2073 return awsutil.Prettify(s) 2074 } 2075 2076 // GoString returns the string representation. 2077 // 2078 // API parameter values that are decorated as "sensitive" in the API will not 2079 // be included in the string output. The member name will be present, but the 2080 // value will be replaced with "sensitive". 2081 func (s UnsupportedDocumentEncodingException) GoString() string { 2082 return s.String() 2083 } 2084 2085 func newErrorUnsupportedDocumentEncodingException(v protocol.ResponseMetadata) error { 2086 return &UnsupportedDocumentEncodingException{ 2087 RespMetadata: v, 2088 } 2089 } 2090 2091 // Code returns the exception type name. 2092 func (s *UnsupportedDocumentEncodingException) Code() string { 2093 return "UnsupportedDocumentEncodingException" 2094 } 2095 2096 // Message returns the exception's message. 2097 func (s *UnsupportedDocumentEncodingException) Message() string { 2098 if s.Message_ != nil { 2099 return *s.Message_ 2100 } 2101 return "" 2102 } 2103 2104 // OrigErr always returns nil, satisfies awserr.Error interface. 2105 func (s *UnsupportedDocumentEncodingException) OrigErr() error { 2106 return nil 2107 } 2108 2109 func (s *UnsupportedDocumentEncodingException) Error() string { 2110 return fmt.Sprintf("%s: %s", s.Code(), s.Message()) 2111 } 2112 2113 // Status code returns the HTTP status code for the request's response error. 2114 func (s *UnsupportedDocumentEncodingException) StatusCode() int { 2115 return s.RespMetadata.StatusCode 2116 } 2117 2118 // RequestID returns the service's response RequestID for request. 2119 func (s *UnsupportedDocumentEncodingException) RequestID() string { 2120 return s.RespMetadata.RequestID 2121 } 2122 2123 // The input for the UpdateThingShadow operation. 2124 type UpdateThingShadowInput struct { 2125 _ struct{} `type:"structure" payload:"Payload"` 2126 2127 // The state information, in JSON format. 2128 // 2129 // Payload is a required field 2130 Payload []byte `locationName:"payload" type:"blob" required:"true"` 2131 2132 // The name of the shadow. 2133 ShadowName *string `location:"querystring" locationName:"name" min:"1" type:"string"` 2134 2135 // The name of the thing. 2136 // 2137 // ThingName is a required field 2138 ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"` 2139 } 2140 2141 // String returns the string representation. 2142 // 2143 // API parameter values that are decorated as "sensitive" in the API will not 2144 // be included in the string output. The member name will be present, but the 2145 // value will be replaced with "sensitive". 2146 func (s UpdateThingShadowInput) String() string { 2147 return awsutil.Prettify(s) 2148 } 2149 2150 // GoString returns the string representation. 2151 // 2152 // API parameter values that are decorated as "sensitive" in the API will not 2153 // be included in the string output. The member name will be present, but the 2154 // value will be replaced with "sensitive". 2155 func (s UpdateThingShadowInput) GoString() string { 2156 return s.String() 2157 } 2158 2159 // Validate inspects the fields of the type to determine if they are valid. 2160 func (s *UpdateThingShadowInput) Validate() error { 2161 invalidParams := request.ErrInvalidParams{Context: "UpdateThingShadowInput"} 2162 if s.Payload == nil { 2163 invalidParams.Add(request.NewErrParamRequired("Payload")) 2164 } 2165 if s.ShadowName != nil && len(*s.ShadowName) < 1 { 2166 invalidParams.Add(request.NewErrParamMinLen("ShadowName", 1)) 2167 } 2168 if s.ThingName == nil { 2169 invalidParams.Add(request.NewErrParamRequired("ThingName")) 2170 } 2171 if s.ThingName != nil && len(*s.ThingName) < 1 { 2172 invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) 2173 } 2174 2175 if invalidParams.Len() > 0 { 2176 return invalidParams 2177 } 2178 return nil 2179 } 2180 2181 // SetPayload sets the Payload field's value. 2182 func (s *UpdateThingShadowInput) SetPayload(v []byte) *UpdateThingShadowInput { 2183 s.Payload = v 2184 return s 2185 } 2186 2187 // SetShadowName sets the ShadowName field's value. 2188 func (s *UpdateThingShadowInput) SetShadowName(v string) *UpdateThingShadowInput { 2189 s.ShadowName = &v 2190 return s 2191 } 2192 2193 // SetThingName sets the ThingName field's value. 2194 func (s *UpdateThingShadowInput) SetThingName(v string) *UpdateThingShadowInput { 2195 s.ThingName = &v 2196 return s 2197 } 2198 2199 // The output from the UpdateThingShadow operation. 2200 type UpdateThingShadowOutput struct { 2201 _ struct{} `type:"structure" payload:"Payload"` 2202 2203 // The state information, in JSON format. 2204 Payload []byte `locationName:"payload" type:"blob"` 2205 } 2206 2207 // String returns the string representation. 2208 // 2209 // API parameter values that are decorated as "sensitive" in the API will not 2210 // be included in the string output. The member name will be present, but the 2211 // value will be replaced with "sensitive". 2212 func (s UpdateThingShadowOutput) String() string { 2213 return awsutil.Prettify(s) 2214 } 2215 2216 // GoString returns the string representation. 2217 // 2218 // API parameter values that are decorated as "sensitive" in the API will not 2219 // be included in the string output. The member name will be present, but the 2220 // value will be replaced with "sensitive". 2221 func (s UpdateThingShadowOutput) GoString() string { 2222 return s.String() 2223 } 2224 2225 // SetPayload sets the Payload field's value. 2226 func (s *UpdateThingShadowOutput) SetPayload(v []byte) *UpdateThingShadowOutput { 2227 s.Payload = v 2228 return s 2229 }