api.go 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package iotdataplane
  3. import (
  4. "github.com/aws/aws-sdk-go/aws"
  5. "github.com/aws/aws-sdk-go/aws/awsutil"
  6. "github.com/aws/aws-sdk-go/aws/request"
  7. "github.com/aws/aws-sdk-go/private/protocol"
  8. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  9. )
  10. const opDeleteThingShadow = "DeleteThingShadow"
  11. // DeleteThingShadowRequest generates a "aws/request.Request" representing the
  12. // client's request for the DeleteThingShadow operation. The "output" return
  13. // value will be populated with the request's response once the request completes
  14. // successfully.
  15. //
  16. // Use "Send" method on the returned Request to send the API call to the service.
  17. // the "output" return value is not valid until after Send returns without error.
  18. //
  19. // See DeleteThingShadow for more information on using the DeleteThingShadow
  20. // API call, and error handling.
  21. //
  22. // This method is useful when you want to inject custom logic or configuration
  23. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  24. //
  25. //
  26. // // Example sending a request using the DeleteThingShadowRequest method.
  27. // req, resp := client.DeleteThingShadowRequest(params)
  28. //
  29. // err := req.Send()
  30. // if err == nil { // resp is now filled
  31. // fmt.Println(resp)
  32. // }
  33. func (c *IoTDataPlane) DeleteThingShadowRequest(input *DeleteThingShadowInput) (req *request.Request, output *DeleteThingShadowOutput) {
  34. op := &request.Operation{
  35. Name: opDeleteThingShadow,
  36. HTTPMethod: "DELETE",
  37. HTTPPath: "/things/{thingName}/shadow",
  38. }
  39. if input == nil {
  40. input = &DeleteThingShadowInput{}
  41. }
  42. output = &DeleteThingShadowOutput{}
  43. req = c.newRequest(op, input, output)
  44. return
  45. }
  46. // DeleteThingShadow API operation for AWS IoT Data Plane.
  47. //
  48. // Deletes the thing shadow for the specified thing.
  49. //
  50. // For more information, see DeleteThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_DeleteThingShadow.html)
  51. // in the AWS IoT Developer Guide.
  52. //
  53. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  54. // with awserr.Error's Code and Message methods to get detailed information about
  55. // the error.
  56. //
  57. // See the AWS API reference guide for AWS IoT Data Plane's
  58. // API operation DeleteThingShadow for usage and error information.
  59. //
  60. // Returned Error Codes:
  61. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  62. // The specified resource does not exist.
  63. //
  64. // * ErrCodeInvalidRequestException "InvalidRequestException"
  65. // The request is not valid.
  66. //
  67. // * ErrCodeThrottlingException "ThrottlingException"
  68. // The rate exceeds the limit.
  69. //
  70. // * ErrCodeUnauthorizedException "UnauthorizedException"
  71. // You are not authorized to perform this operation.
  72. //
  73. // * ErrCodeServiceUnavailableException "ServiceUnavailableException"
  74. // The service is temporarily unavailable.
  75. //
  76. // * ErrCodeInternalFailureException "InternalFailureException"
  77. // An unexpected error has occurred.
  78. //
  79. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  80. // The specified combination of HTTP verb and URI is not supported.
  81. //
  82. // * ErrCodeUnsupportedDocumentEncodingException "UnsupportedDocumentEncodingException"
  83. // The document encoding is not supported.
  84. //
  85. func (c *IoTDataPlane) DeleteThingShadow(input *DeleteThingShadowInput) (*DeleteThingShadowOutput, error) {
  86. req, out := c.DeleteThingShadowRequest(input)
  87. return out, req.Send()
  88. }
  89. // DeleteThingShadowWithContext is the same as DeleteThingShadow with the addition of
  90. // the ability to pass a context and additional request options.
  91. //
  92. // See DeleteThingShadow for details on how to use this API operation.
  93. //
  94. // The context must be non-nil and will be used for request cancellation. If
  95. // the context is nil a panic will occur. In the future the SDK may create
  96. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  97. // for more information on using Contexts.
  98. func (c *IoTDataPlane) DeleteThingShadowWithContext(ctx aws.Context, input *DeleteThingShadowInput, opts ...request.Option) (*DeleteThingShadowOutput, error) {
  99. req, out := c.DeleteThingShadowRequest(input)
  100. req.SetContext(ctx)
  101. req.ApplyOptions(opts...)
  102. return out, req.Send()
  103. }
  104. const opGetThingShadow = "GetThingShadow"
  105. // GetThingShadowRequest generates a "aws/request.Request" representing the
  106. // client's request for the GetThingShadow operation. The "output" return
  107. // value will be populated with the request's response once the request completes
  108. // successfully.
  109. //
  110. // Use "Send" method on the returned Request to send the API call to the service.
  111. // the "output" return value is not valid until after Send returns without error.
  112. //
  113. // See GetThingShadow for more information on using the GetThingShadow
  114. // API call, and error handling.
  115. //
  116. // This method is useful when you want to inject custom logic or configuration
  117. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  118. //
  119. //
  120. // // Example sending a request using the GetThingShadowRequest method.
  121. // req, resp := client.GetThingShadowRequest(params)
  122. //
  123. // err := req.Send()
  124. // if err == nil { // resp is now filled
  125. // fmt.Println(resp)
  126. // }
  127. func (c *IoTDataPlane) GetThingShadowRequest(input *GetThingShadowInput) (req *request.Request, output *GetThingShadowOutput) {
  128. op := &request.Operation{
  129. Name: opGetThingShadow,
  130. HTTPMethod: "GET",
  131. HTTPPath: "/things/{thingName}/shadow",
  132. }
  133. if input == nil {
  134. input = &GetThingShadowInput{}
  135. }
  136. output = &GetThingShadowOutput{}
  137. req = c.newRequest(op, input, output)
  138. return
  139. }
  140. // GetThingShadow API operation for AWS IoT Data Plane.
  141. //
  142. // Gets the thing shadow for the specified thing.
  143. //
  144. // For more information, see GetThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_GetThingShadow.html)
  145. // in the AWS IoT Developer Guide.
  146. //
  147. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  148. // with awserr.Error's Code and Message methods to get detailed information about
  149. // the error.
  150. //
  151. // See the AWS API reference guide for AWS IoT Data Plane's
  152. // API operation GetThingShadow for usage and error information.
  153. //
  154. // Returned Error Codes:
  155. // * ErrCodeInvalidRequestException "InvalidRequestException"
  156. // The request is not valid.
  157. //
  158. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  159. // The specified resource does not exist.
  160. //
  161. // * ErrCodeThrottlingException "ThrottlingException"
  162. // The rate exceeds the limit.
  163. //
  164. // * ErrCodeUnauthorizedException "UnauthorizedException"
  165. // You are not authorized to perform this operation.
  166. //
  167. // * ErrCodeServiceUnavailableException "ServiceUnavailableException"
  168. // The service is temporarily unavailable.
  169. //
  170. // * ErrCodeInternalFailureException "InternalFailureException"
  171. // An unexpected error has occurred.
  172. //
  173. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  174. // The specified combination of HTTP verb and URI is not supported.
  175. //
  176. // * ErrCodeUnsupportedDocumentEncodingException "UnsupportedDocumentEncodingException"
  177. // The document encoding is not supported.
  178. //
  179. func (c *IoTDataPlane) GetThingShadow(input *GetThingShadowInput) (*GetThingShadowOutput, error) {
  180. req, out := c.GetThingShadowRequest(input)
  181. return out, req.Send()
  182. }
  183. // GetThingShadowWithContext is the same as GetThingShadow with the addition of
  184. // the ability to pass a context and additional request options.
  185. //
  186. // See GetThingShadow for details on how to use this API operation.
  187. //
  188. // The context must be non-nil and will be used for request cancellation. If
  189. // the context is nil a panic will occur. In the future the SDK may create
  190. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  191. // for more information on using Contexts.
  192. func (c *IoTDataPlane) GetThingShadowWithContext(ctx aws.Context, input *GetThingShadowInput, opts ...request.Option) (*GetThingShadowOutput, error) {
  193. req, out := c.GetThingShadowRequest(input)
  194. req.SetContext(ctx)
  195. req.ApplyOptions(opts...)
  196. return out, req.Send()
  197. }
  198. const opPublish = "Publish"
  199. // PublishRequest generates a "aws/request.Request" representing the
  200. // client's request for the Publish operation. The "output" return
  201. // value will be populated with the request's response once the request completes
  202. // successfully.
  203. //
  204. // Use "Send" method on the returned Request to send the API call to the service.
  205. // the "output" return value is not valid until after Send returns without error.
  206. //
  207. // See Publish for more information on using the Publish
  208. // API call, and error handling.
  209. //
  210. // This method is useful when you want to inject custom logic or configuration
  211. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  212. //
  213. //
  214. // // Example sending a request using the PublishRequest method.
  215. // req, resp := client.PublishRequest(params)
  216. //
  217. // err := req.Send()
  218. // if err == nil { // resp is now filled
  219. // fmt.Println(resp)
  220. // }
  221. func (c *IoTDataPlane) PublishRequest(input *PublishInput) (req *request.Request, output *PublishOutput) {
  222. op := &request.Operation{
  223. Name: opPublish,
  224. HTTPMethod: "POST",
  225. HTTPPath: "/topics/{topic}",
  226. }
  227. if input == nil {
  228. input = &PublishInput{}
  229. }
  230. output = &PublishOutput{}
  231. req = c.newRequest(op, input, output)
  232. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  233. return
  234. }
  235. // Publish API operation for AWS IoT Data Plane.
  236. //
  237. // Publishes state information.
  238. //
  239. // For more information, see HTTP Protocol (http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html#http)
  240. // in the AWS IoT Developer Guide.
  241. //
  242. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  243. // with awserr.Error's Code and Message methods to get detailed information about
  244. // the error.
  245. //
  246. // See the AWS API reference guide for AWS IoT Data Plane's
  247. // API operation Publish for usage and error information.
  248. //
  249. // Returned Error Codes:
  250. // * ErrCodeInternalFailureException "InternalFailureException"
  251. // An unexpected error has occurred.
  252. //
  253. // * ErrCodeInvalidRequestException "InvalidRequestException"
  254. // The request is not valid.
  255. //
  256. // * ErrCodeUnauthorizedException "UnauthorizedException"
  257. // You are not authorized to perform this operation.
  258. //
  259. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  260. // The specified combination of HTTP verb and URI is not supported.
  261. //
  262. func (c *IoTDataPlane) Publish(input *PublishInput) (*PublishOutput, error) {
  263. req, out := c.PublishRequest(input)
  264. return out, req.Send()
  265. }
  266. // PublishWithContext is the same as Publish with the addition of
  267. // the ability to pass a context and additional request options.
  268. //
  269. // See Publish for details on how to use this API operation.
  270. //
  271. // The context must be non-nil and will be used for request cancellation. If
  272. // the context is nil a panic will occur. In the future the SDK may create
  273. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  274. // for more information on using Contexts.
  275. func (c *IoTDataPlane) PublishWithContext(ctx aws.Context, input *PublishInput, opts ...request.Option) (*PublishOutput, error) {
  276. req, out := c.PublishRequest(input)
  277. req.SetContext(ctx)
  278. req.ApplyOptions(opts...)
  279. return out, req.Send()
  280. }
  281. const opUpdateThingShadow = "UpdateThingShadow"
  282. // UpdateThingShadowRequest generates a "aws/request.Request" representing the
  283. // client's request for the UpdateThingShadow operation. The "output" return
  284. // value will be populated with the request's response once the request completes
  285. // successfully.
  286. //
  287. // Use "Send" method on the returned Request to send the API call to the service.
  288. // the "output" return value is not valid until after Send returns without error.
  289. //
  290. // See UpdateThingShadow for more information on using the UpdateThingShadow
  291. // API call, and error handling.
  292. //
  293. // This method is useful when you want to inject custom logic or configuration
  294. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  295. //
  296. //
  297. // // Example sending a request using the UpdateThingShadowRequest method.
  298. // req, resp := client.UpdateThingShadowRequest(params)
  299. //
  300. // err := req.Send()
  301. // if err == nil { // resp is now filled
  302. // fmt.Println(resp)
  303. // }
  304. func (c *IoTDataPlane) UpdateThingShadowRequest(input *UpdateThingShadowInput) (req *request.Request, output *UpdateThingShadowOutput) {
  305. op := &request.Operation{
  306. Name: opUpdateThingShadow,
  307. HTTPMethod: "POST",
  308. HTTPPath: "/things/{thingName}/shadow",
  309. }
  310. if input == nil {
  311. input = &UpdateThingShadowInput{}
  312. }
  313. output = &UpdateThingShadowOutput{}
  314. req = c.newRequest(op, input, output)
  315. return
  316. }
  317. // UpdateThingShadow API operation for AWS IoT Data Plane.
  318. //
  319. // Updates the thing shadow for the specified thing.
  320. //
  321. // For more information, see UpdateThingShadow (http://docs.aws.amazon.com/iot/latest/developerguide/API_UpdateThingShadow.html)
  322. // in the AWS IoT Developer Guide.
  323. //
  324. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  325. // with awserr.Error's Code and Message methods to get detailed information about
  326. // the error.
  327. //
  328. // See the AWS API reference guide for AWS IoT Data Plane's
  329. // API operation UpdateThingShadow for usage and error information.
  330. //
  331. // Returned Error Codes:
  332. // * ErrCodeConflictException "ConflictException"
  333. // The specified version does not match the version of the document.
  334. //
  335. // * ErrCodeRequestEntityTooLargeException "RequestEntityTooLargeException"
  336. // The payload exceeds the maximum size allowed.
  337. //
  338. // * ErrCodeInvalidRequestException "InvalidRequestException"
  339. // The request is not valid.
  340. //
  341. // * ErrCodeThrottlingException "ThrottlingException"
  342. // The rate exceeds the limit.
  343. //
  344. // * ErrCodeUnauthorizedException "UnauthorizedException"
  345. // You are not authorized to perform this operation.
  346. //
  347. // * ErrCodeServiceUnavailableException "ServiceUnavailableException"
  348. // The service is temporarily unavailable.
  349. //
  350. // * ErrCodeInternalFailureException "InternalFailureException"
  351. // An unexpected error has occurred.
  352. //
  353. // * ErrCodeMethodNotAllowedException "MethodNotAllowedException"
  354. // The specified combination of HTTP verb and URI is not supported.
  355. //
  356. // * ErrCodeUnsupportedDocumentEncodingException "UnsupportedDocumentEncodingException"
  357. // The document encoding is not supported.
  358. //
  359. func (c *IoTDataPlane) UpdateThingShadow(input *UpdateThingShadowInput) (*UpdateThingShadowOutput, error) {
  360. req, out := c.UpdateThingShadowRequest(input)
  361. return out, req.Send()
  362. }
  363. // UpdateThingShadowWithContext is the same as UpdateThingShadow with the addition of
  364. // the ability to pass a context and additional request options.
  365. //
  366. // See UpdateThingShadow for details on how to use this API operation.
  367. //
  368. // The context must be non-nil and will be used for request cancellation. If
  369. // the context is nil a panic will occur. In the future the SDK may create
  370. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  371. // for more information on using Contexts.
  372. func (c *IoTDataPlane) UpdateThingShadowWithContext(ctx aws.Context, input *UpdateThingShadowInput, opts ...request.Option) (*UpdateThingShadowOutput, error) {
  373. req, out := c.UpdateThingShadowRequest(input)
  374. req.SetContext(ctx)
  375. req.ApplyOptions(opts...)
  376. return out, req.Send()
  377. }
  378. // The input for the DeleteThingShadow operation.
  379. type DeleteThingShadowInput struct {
  380. _ struct{} `type:"structure"`
  381. // The name of the thing.
  382. //
  383. // ThingName is a required field
  384. ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
  385. }
  386. // String returns the string representation
  387. func (s DeleteThingShadowInput) String() string {
  388. return awsutil.Prettify(s)
  389. }
  390. // GoString returns the string representation
  391. func (s DeleteThingShadowInput) GoString() string {
  392. return s.String()
  393. }
  394. // Validate inspects the fields of the type to determine if they are valid.
  395. func (s *DeleteThingShadowInput) Validate() error {
  396. invalidParams := request.ErrInvalidParams{Context: "DeleteThingShadowInput"}
  397. if s.ThingName == nil {
  398. invalidParams.Add(request.NewErrParamRequired("ThingName"))
  399. }
  400. if s.ThingName != nil && len(*s.ThingName) < 1 {
  401. invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
  402. }
  403. if invalidParams.Len() > 0 {
  404. return invalidParams
  405. }
  406. return nil
  407. }
  408. // SetThingName sets the ThingName field's value.
  409. func (s *DeleteThingShadowInput) SetThingName(v string) *DeleteThingShadowInput {
  410. s.ThingName = &v
  411. return s
  412. }
  413. // The output from the DeleteThingShadow operation.
  414. type DeleteThingShadowOutput struct {
  415. _ struct{} `type:"structure" payload:"Payload"`
  416. // The state information, in JSON format.
  417. //
  418. // Payload is a required field
  419. Payload []byte `locationName:"payload" type:"blob" required:"true"`
  420. }
  421. // String returns the string representation
  422. func (s DeleteThingShadowOutput) String() string {
  423. return awsutil.Prettify(s)
  424. }
  425. // GoString returns the string representation
  426. func (s DeleteThingShadowOutput) GoString() string {
  427. return s.String()
  428. }
  429. // SetPayload sets the Payload field's value.
  430. func (s *DeleteThingShadowOutput) SetPayload(v []byte) *DeleteThingShadowOutput {
  431. s.Payload = v
  432. return s
  433. }
  434. // The input for the GetThingShadow operation.
  435. type GetThingShadowInput struct {
  436. _ struct{} `type:"structure"`
  437. // The name of the thing.
  438. //
  439. // ThingName is a required field
  440. ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
  441. }
  442. // String returns the string representation
  443. func (s GetThingShadowInput) String() string {
  444. return awsutil.Prettify(s)
  445. }
  446. // GoString returns the string representation
  447. func (s GetThingShadowInput) GoString() string {
  448. return s.String()
  449. }
  450. // Validate inspects the fields of the type to determine if they are valid.
  451. func (s *GetThingShadowInput) Validate() error {
  452. invalidParams := request.ErrInvalidParams{Context: "GetThingShadowInput"}
  453. if s.ThingName == nil {
  454. invalidParams.Add(request.NewErrParamRequired("ThingName"))
  455. }
  456. if s.ThingName != nil && len(*s.ThingName) < 1 {
  457. invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
  458. }
  459. if invalidParams.Len() > 0 {
  460. return invalidParams
  461. }
  462. return nil
  463. }
  464. // SetThingName sets the ThingName field's value.
  465. func (s *GetThingShadowInput) SetThingName(v string) *GetThingShadowInput {
  466. s.ThingName = &v
  467. return s
  468. }
  469. // The output from the GetThingShadow operation.
  470. type GetThingShadowOutput struct {
  471. _ struct{} `type:"structure" payload:"Payload"`
  472. // The state information, in JSON format.
  473. Payload []byte `locationName:"payload" type:"blob"`
  474. }
  475. // String returns the string representation
  476. func (s GetThingShadowOutput) String() string {
  477. return awsutil.Prettify(s)
  478. }
  479. // GoString returns the string representation
  480. func (s GetThingShadowOutput) GoString() string {
  481. return s.String()
  482. }
  483. // SetPayload sets the Payload field's value.
  484. func (s *GetThingShadowOutput) SetPayload(v []byte) *GetThingShadowOutput {
  485. s.Payload = v
  486. return s
  487. }
  488. // The input for the Publish operation.
  489. type PublishInput struct {
  490. _ struct{} `type:"structure" payload:"Payload"`
  491. // The state information, in JSON format.
  492. Payload []byte `locationName:"payload" type:"blob"`
  493. // The Quality of Service (QoS) level.
  494. Qos *int64 `location:"querystring" locationName:"qos" type:"integer"`
  495. // The name of the MQTT topic.
  496. //
  497. // Topic is a required field
  498. Topic *string `location:"uri" locationName:"topic" type:"string" required:"true"`
  499. }
  500. // String returns the string representation
  501. func (s PublishInput) String() string {
  502. return awsutil.Prettify(s)
  503. }
  504. // GoString returns the string representation
  505. func (s PublishInput) GoString() string {
  506. return s.String()
  507. }
  508. // Validate inspects the fields of the type to determine if they are valid.
  509. func (s *PublishInput) Validate() error {
  510. invalidParams := request.ErrInvalidParams{Context: "PublishInput"}
  511. if s.Topic == nil {
  512. invalidParams.Add(request.NewErrParamRequired("Topic"))
  513. }
  514. if s.Topic != nil && len(*s.Topic) < 1 {
  515. invalidParams.Add(request.NewErrParamMinLen("Topic", 1))
  516. }
  517. if invalidParams.Len() > 0 {
  518. return invalidParams
  519. }
  520. return nil
  521. }
  522. // SetPayload sets the Payload field's value.
  523. func (s *PublishInput) SetPayload(v []byte) *PublishInput {
  524. s.Payload = v
  525. return s
  526. }
  527. // SetQos sets the Qos field's value.
  528. func (s *PublishInput) SetQos(v int64) *PublishInput {
  529. s.Qos = &v
  530. return s
  531. }
  532. // SetTopic sets the Topic field's value.
  533. func (s *PublishInput) SetTopic(v string) *PublishInput {
  534. s.Topic = &v
  535. return s
  536. }
  537. type PublishOutput struct {
  538. _ struct{} `type:"structure"`
  539. }
  540. // String returns the string representation
  541. func (s PublishOutput) String() string {
  542. return awsutil.Prettify(s)
  543. }
  544. // GoString returns the string representation
  545. func (s PublishOutput) GoString() string {
  546. return s.String()
  547. }
  548. // The input for the UpdateThingShadow operation.
  549. type UpdateThingShadowInput struct {
  550. _ struct{} `type:"structure" payload:"Payload"`
  551. // The state information, in JSON format.
  552. //
  553. // Payload is a required field
  554. Payload []byte `locationName:"payload" type:"blob" required:"true"`
  555. // The name of the thing.
  556. //
  557. // ThingName is a required field
  558. ThingName *string `location:"uri" locationName:"thingName" min:"1" type:"string" required:"true"`
  559. }
  560. // String returns the string representation
  561. func (s UpdateThingShadowInput) String() string {
  562. return awsutil.Prettify(s)
  563. }
  564. // GoString returns the string representation
  565. func (s UpdateThingShadowInput) GoString() string {
  566. return s.String()
  567. }
  568. // Validate inspects the fields of the type to determine if they are valid.
  569. func (s *UpdateThingShadowInput) Validate() error {
  570. invalidParams := request.ErrInvalidParams{Context: "UpdateThingShadowInput"}
  571. if s.Payload == nil {
  572. invalidParams.Add(request.NewErrParamRequired("Payload"))
  573. }
  574. if s.ThingName == nil {
  575. invalidParams.Add(request.NewErrParamRequired("ThingName"))
  576. }
  577. if s.ThingName != nil && len(*s.ThingName) < 1 {
  578. invalidParams.Add(request.NewErrParamMinLen("ThingName", 1))
  579. }
  580. if invalidParams.Len() > 0 {
  581. return invalidParams
  582. }
  583. return nil
  584. }
  585. // SetPayload sets the Payload field's value.
  586. func (s *UpdateThingShadowInput) SetPayload(v []byte) *UpdateThingShadowInput {
  587. s.Payload = v
  588. return s
  589. }
  590. // SetThingName sets the ThingName field's value.
  591. func (s *UpdateThingShadowInput) SetThingName(v string) *UpdateThingShadowInput {
  592. s.ThingName = &v
  593. return s
  594. }
  595. // The output from the UpdateThingShadow operation.
  596. type UpdateThingShadowOutput struct {
  597. _ struct{} `type:"structure" payload:"Payload"`
  598. // The state information, in JSON format.
  599. Payload []byte `locationName:"payload" type:"blob"`
  600. }
  601. // String returns the string representation
  602. func (s UpdateThingShadowOutput) String() string {
  603. return awsutil.Prettify(s)
  604. }
  605. // GoString returns the string representation
  606. func (s UpdateThingShadowOutput) GoString() string {
  607. return s.String()
  608. }
  609. // SetPayload sets the Payload field's value.
  610. func (s *UpdateThingShadowOutput) SetPayload(v []byte) *UpdateThingShadowOutput {
  611. s.Payload = v
  612. return s
  613. }