api.go 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757
  1. // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
  2. package iot1clickdevicesservice
  3. import (
  4. "time"
  5. "github.com/aws/aws-sdk-go/aws"
  6. "github.com/aws/aws-sdk-go/aws/awsutil"
  7. "github.com/aws/aws-sdk-go/aws/request"
  8. "github.com/aws/aws-sdk-go/private/protocol"
  9. "github.com/aws/aws-sdk-go/private/protocol/restjson"
  10. )
  11. const opClaimDevicesByClaimCode = "ClaimDevicesByClaimCode"
  12. // ClaimDevicesByClaimCodeRequest generates a "aws/request.Request" representing the
  13. // client's request for the ClaimDevicesByClaimCode operation. The "output" return
  14. // value will be populated with the request's response once the request completes
  15. // successfully.
  16. //
  17. // Use "Send" method on the returned Request to send the API call to the service.
  18. // the "output" return value is not valid until after Send returns without error.
  19. //
  20. // See ClaimDevicesByClaimCode for more information on using the ClaimDevicesByClaimCode
  21. // API call, and error handling.
  22. //
  23. // This method is useful when you want to inject custom logic or configuration
  24. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  25. //
  26. //
  27. // // Example sending a request using the ClaimDevicesByClaimCodeRequest method.
  28. // req, resp := client.ClaimDevicesByClaimCodeRequest(params)
  29. //
  30. // err := req.Send()
  31. // if err == nil { // resp is now filled
  32. // fmt.Println(resp)
  33. // }
  34. //
  35. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode
  36. func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCodeRequest(input *ClaimDevicesByClaimCodeInput) (req *request.Request, output *ClaimDevicesByClaimCodeOutput) {
  37. op := &request.Operation{
  38. Name: opClaimDevicesByClaimCode,
  39. HTTPMethod: "PUT",
  40. HTTPPath: "/claims/{claimCode}",
  41. }
  42. if input == nil {
  43. input = &ClaimDevicesByClaimCodeInput{}
  44. }
  45. output = &ClaimDevicesByClaimCodeOutput{}
  46. req = c.newRequest(op, input, output)
  47. return
  48. }
  49. // ClaimDevicesByClaimCode API operation for AWS IoT 1-Click Devices Service.
  50. //
  51. // Adds device(s) to your account (i.e., claim one or more devices) if and only
  52. // if you received a claim code with the device(s).
  53. //
  54. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  55. // with awserr.Error's Code and Message methods to get detailed information about
  56. // the error.
  57. //
  58. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  59. // API operation ClaimDevicesByClaimCode for usage and error information.
  60. //
  61. // Returned Error Codes:
  62. // * ErrCodeInvalidRequestException "InvalidRequestException"
  63. //
  64. // * ErrCodeInternalFailureException "InternalFailureException"
  65. //
  66. // * ErrCodeForbiddenException "ForbiddenException"
  67. //
  68. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode
  69. func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCode(input *ClaimDevicesByClaimCodeInput) (*ClaimDevicesByClaimCodeOutput, error) {
  70. req, out := c.ClaimDevicesByClaimCodeRequest(input)
  71. return out, req.Send()
  72. }
  73. // ClaimDevicesByClaimCodeWithContext is the same as ClaimDevicesByClaimCode with the addition of
  74. // the ability to pass a context and additional request options.
  75. //
  76. // See ClaimDevicesByClaimCode for details on how to use this API operation.
  77. //
  78. // The context must be non-nil and will be used for request cancellation. If
  79. // the context is nil a panic will occur. In the future the SDK may create
  80. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  81. // for more information on using Contexts.
  82. func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCodeWithContext(ctx aws.Context, input *ClaimDevicesByClaimCodeInput, opts ...request.Option) (*ClaimDevicesByClaimCodeOutput, error) {
  83. req, out := c.ClaimDevicesByClaimCodeRequest(input)
  84. req.SetContext(ctx)
  85. req.ApplyOptions(opts...)
  86. return out, req.Send()
  87. }
  88. const opDescribeDevice = "DescribeDevice"
  89. // DescribeDeviceRequest generates a "aws/request.Request" representing the
  90. // client's request for the DescribeDevice operation. The "output" return
  91. // value will be populated with the request's response once the request completes
  92. // successfully.
  93. //
  94. // Use "Send" method on the returned Request to send the API call to the service.
  95. // the "output" return value is not valid until after Send returns without error.
  96. //
  97. // See DescribeDevice for more information on using the DescribeDevice
  98. // API call, and error handling.
  99. //
  100. // This method is useful when you want to inject custom logic or configuration
  101. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  102. //
  103. //
  104. // // Example sending a request using the DescribeDeviceRequest method.
  105. // req, resp := client.DescribeDeviceRequest(params)
  106. //
  107. // err := req.Send()
  108. // if err == nil { // resp is now filled
  109. // fmt.Println(resp)
  110. // }
  111. //
  112. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice
  113. func (c *IoT1ClickDevicesService) DescribeDeviceRequest(input *DescribeDeviceInput) (req *request.Request, output *DescribeDeviceOutput) {
  114. op := &request.Operation{
  115. Name: opDescribeDevice,
  116. HTTPMethod: "GET",
  117. HTTPPath: "/devices/{deviceId}",
  118. }
  119. if input == nil {
  120. input = &DescribeDeviceInput{}
  121. }
  122. output = &DescribeDeviceOutput{}
  123. req = c.newRequest(op, input, output)
  124. return
  125. }
  126. // DescribeDevice API operation for AWS IoT 1-Click Devices Service.
  127. //
  128. // Given a device ID, returns a DescribeDeviceResponse object describing the
  129. // details of the device.
  130. //
  131. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  132. // with awserr.Error's Code and Message methods to get detailed information about
  133. // the error.
  134. //
  135. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  136. // API operation DescribeDevice for usage and error information.
  137. //
  138. // Returned Error Codes:
  139. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  140. //
  141. // * ErrCodeInvalidRequestException "InvalidRequestException"
  142. //
  143. // * ErrCodeInternalFailureException "InternalFailureException"
  144. //
  145. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice
  146. func (c *IoT1ClickDevicesService) DescribeDevice(input *DescribeDeviceInput) (*DescribeDeviceOutput, error) {
  147. req, out := c.DescribeDeviceRequest(input)
  148. return out, req.Send()
  149. }
  150. // DescribeDeviceWithContext is the same as DescribeDevice with the addition of
  151. // the ability to pass a context and additional request options.
  152. //
  153. // See DescribeDevice for details on how to use this API operation.
  154. //
  155. // The context must be non-nil and will be used for request cancellation. If
  156. // the context is nil a panic will occur. In the future the SDK may create
  157. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  158. // for more information on using Contexts.
  159. func (c *IoT1ClickDevicesService) DescribeDeviceWithContext(ctx aws.Context, input *DescribeDeviceInput, opts ...request.Option) (*DescribeDeviceOutput, error) {
  160. req, out := c.DescribeDeviceRequest(input)
  161. req.SetContext(ctx)
  162. req.ApplyOptions(opts...)
  163. return out, req.Send()
  164. }
  165. const opFinalizeDeviceClaim = "FinalizeDeviceClaim"
  166. // FinalizeDeviceClaimRequest generates a "aws/request.Request" representing the
  167. // client's request for the FinalizeDeviceClaim operation. The "output" return
  168. // value will be populated with the request's response once the request completes
  169. // successfully.
  170. //
  171. // Use "Send" method on the returned Request to send the API call to the service.
  172. // the "output" return value is not valid until after Send returns without error.
  173. //
  174. // See FinalizeDeviceClaim for more information on using the FinalizeDeviceClaim
  175. // API call, and error handling.
  176. //
  177. // This method is useful when you want to inject custom logic or configuration
  178. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  179. //
  180. //
  181. // // Example sending a request using the FinalizeDeviceClaimRequest method.
  182. // req, resp := client.FinalizeDeviceClaimRequest(params)
  183. //
  184. // err := req.Send()
  185. // if err == nil { // resp is now filled
  186. // fmt.Println(resp)
  187. // }
  188. //
  189. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim
  190. func (c *IoT1ClickDevicesService) FinalizeDeviceClaimRequest(input *FinalizeDeviceClaimInput) (req *request.Request, output *FinalizeDeviceClaimOutput) {
  191. op := &request.Operation{
  192. Name: opFinalizeDeviceClaim,
  193. HTTPMethod: "PUT",
  194. HTTPPath: "/devices/{deviceId}/finalize-claim",
  195. }
  196. if input == nil {
  197. input = &FinalizeDeviceClaimInput{}
  198. }
  199. output = &FinalizeDeviceClaimOutput{}
  200. req = c.newRequest(op, input, output)
  201. return
  202. }
  203. // FinalizeDeviceClaim API operation for AWS IoT 1-Click Devices Service.
  204. //
  205. // Given a device ID, finalizes the claim request for the associated device.
  206. //
  207. // Claiming a device consists of initiating a claim, then publishing a device
  208. // event, and finalizing the claim. For a device of type button, a device event
  209. // can be published by simply clicking the device.
  210. //
  211. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  212. // with awserr.Error's Code and Message methods to get detailed information about
  213. // the error.
  214. //
  215. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  216. // API operation FinalizeDeviceClaim for usage and error information.
  217. //
  218. // Returned Error Codes:
  219. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  220. //
  221. // * ErrCodeInvalidRequestException "InvalidRequestException"
  222. //
  223. // * ErrCodeInternalFailureException "InternalFailureException"
  224. //
  225. // * ErrCodePreconditionFailedException "PreconditionFailedException"
  226. //
  227. // * ErrCodeResourceConflictException "ResourceConflictException"
  228. //
  229. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim
  230. func (c *IoT1ClickDevicesService) FinalizeDeviceClaim(input *FinalizeDeviceClaimInput) (*FinalizeDeviceClaimOutput, error) {
  231. req, out := c.FinalizeDeviceClaimRequest(input)
  232. return out, req.Send()
  233. }
  234. // FinalizeDeviceClaimWithContext is the same as FinalizeDeviceClaim with the addition of
  235. // the ability to pass a context and additional request options.
  236. //
  237. // See FinalizeDeviceClaim for details on how to use this API operation.
  238. //
  239. // The context must be non-nil and will be used for request cancellation. If
  240. // the context is nil a panic will occur. In the future the SDK may create
  241. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  242. // for more information on using Contexts.
  243. func (c *IoT1ClickDevicesService) FinalizeDeviceClaimWithContext(ctx aws.Context, input *FinalizeDeviceClaimInput, opts ...request.Option) (*FinalizeDeviceClaimOutput, error) {
  244. req, out := c.FinalizeDeviceClaimRequest(input)
  245. req.SetContext(ctx)
  246. req.ApplyOptions(opts...)
  247. return out, req.Send()
  248. }
  249. const opGetDeviceMethods = "GetDeviceMethods"
  250. // GetDeviceMethodsRequest generates a "aws/request.Request" representing the
  251. // client's request for the GetDeviceMethods operation. The "output" return
  252. // value will be populated with the request's response once the request completes
  253. // successfully.
  254. //
  255. // Use "Send" method on the returned Request to send the API call to the service.
  256. // the "output" return value is not valid until after Send returns without error.
  257. //
  258. // See GetDeviceMethods for more information on using the GetDeviceMethods
  259. // API call, and error handling.
  260. //
  261. // This method is useful when you want to inject custom logic or configuration
  262. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  263. //
  264. //
  265. // // Example sending a request using the GetDeviceMethodsRequest method.
  266. // req, resp := client.GetDeviceMethodsRequest(params)
  267. //
  268. // err := req.Send()
  269. // if err == nil { // resp is now filled
  270. // fmt.Println(resp)
  271. // }
  272. //
  273. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods
  274. func (c *IoT1ClickDevicesService) GetDeviceMethodsRequest(input *GetDeviceMethodsInput) (req *request.Request, output *GetDeviceMethodsOutput) {
  275. op := &request.Operation{
  276. Name: opGetDeviceMethods,
  277. HTTPMethod: "GET",
  278. HTTPPath: "/devices/{deviceId}/methods",
  279. }
  280. if input == nil {
  281. input = &GetDeviceMethodsInput{}
  282. }
  283. output = &GetDeviceMethodsOutput{}
  284. req = c.newRequest(op, input, output)
  285. return
  286. }
  287. // GetDeviceMethods API operation for AWS IoT 1-Click Devices Service.
  288. //
  289. // Given a device ID, returns the invokable methods associated with the device.
  290. //
  291. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  292. // with awserr.Error's Code and Message methods to get detailed information about
  293. // the error.
  294. //
  295. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  296. // API operation GetDeviceMethods for usage and error information.
  297. //
  298. // Returned Error Codes:
  299. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  300. //
  301. // * ErrCodeInvalidRequestException "InvalidRequestException"
  302. //
  303. // * ErrCodeInternalFailureException "InternalFailureException"
  304. //
  305. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods
  306. func (c *IoT1ClickDevicesService) GetDeviceMethods(input *GetDeviceMethodsInput) (*GetDeviceMethodsOutput, error) {
  307. req, out := c.GetDeviceMethodsRequest(input)
  308. return out, req.Send()
  309. }
  310. // GetDeviceMethodsWithContext is the same as GetDeviceMethods with the addition of
  311. // the ability to pass a context and additional request options.
  312. //
  313. // See GetDeviceMethods for details on how to use this API operation.
  314. //
  315. // The context must be non-nil and will be used for request cancellation. If
  316. // the context is nil a panic will occur. In the future the SDK may create
  317. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  318. // for more information on using Contexts.
  319. func (c *IoT1ClickDevicesService) GetDeviceMethodsWithContext(ctx aws.Context, input *GetDeviceMethodsInput, opts ...request.Option) (*GetDeviceMethodsOutput, error) {
  320. req, out := c.GetDeviceMethodsRequest(input)
  321. req.SetContext(ctx)
  322. req.ApplyOptions(opts...)
  323. return out, req.Send()
  324. }
  325. const opInitiateDeviceClaim = "InitiateDeviceClaim"
  326. // InitiateDeviceClaimRequest generates a "aws/request.Request" representing the
  327. // client's request for the InitiateDeviceClaim operation. The "output" return
  328. // value will be populated with the request's response once the request completes
  329. // successfully.
  330. //
  331. // Use "Send" method on the returned Request to send the API call to the service.
  332. // the "output" return value is not valid until after Send returns without error.
  333. //
  334. // See InitiateDeviceClaim for more information on using the InitiateDeviceClaim
  335. // API call, and error handling.
  336. //
  337. // This method is useful when you want to inject custom logic or configuration
  338. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  339. //
  340. //
  341. // // Example sending a request using the InitiateDeviceClaimRequest method.
  342. // req, resp := client.InitiateDeviceClaimRequest(params)
  343. //
  344. // err := req.Send()
  345. // if err == nil { // resp is now filled
  346. // fmt.Println(resp)
  347. // }
  348. //
  349. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim
  350. func (c *IoT1ClickDevicesService) InitiateDeviceClaimRequest(input *InitiateDeviceClaimInput) (req *request.Request, output *InitiateDeviceClaimOutput) {
  351. op := &request.Operation{
  352. Name: opInitiateDeviceClaim,
  353. HTTPMethod: "PUT",
  354. HTTPPath: "/devices/{deviceId}/initiate-claim",
  355. }
  356. if input == nil {
  357. input = &InitiateDeviceClaimInput{}
  358. }
  359. output = &InitiateDeviceClaimOutput{}
  360. req = c.newRequest(op, input, output)
  361. return
  362. }
  363. // InitiateDeviceClaim API operation for AWS IoT 1-Click Devices Service.
  364. //
  365. // Given a device ID, initiates a claim request for the associated device.
  366. //
  367. // Claiming a device consists of initiating a claim, then publishing a device
  368. // event, and finalizing the claim. For a device of type button, a device event
  369. // can be published by simply clicking the device.
  370. //
  371. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  372. // with awserr.Error's Code and Message methods to get detailed information about
  373. // the error.
  374. //
  375. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  376. // API operation InitiateDeviceClaim for usage and error information.
  377. //
  378. // Returned Error Codes:
  379. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  380. //
  381. // * ErrCodeInvalidRequestException "InvalidRequestException"
  382. //
  383. // * ErrCodeInternalFailureException "InternalFailureException"
  384. //
  385. // * ErrCodeResourceConflictException "ResourceConflictException"
  386. //
  387. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim
  388. func (c *IoT1ClickDevicesService) InitiateDeviceClaim(input *InitiateDeviceClaimInput) (*InitiateDeviceClaimOutput, error) {
  389. req, out := c.InitiateDeviceClaimRequest(input)
  390. return out, req.Send()
  391. }
  392. // InitiateDeviceClaimWithContext is the same as InitiateDeviceClaim with the addition of
  393. // the ability to pass a context and additional request options.
  394. //
  395. // See InitiateDeviceClaim for details on how to use this API operation.
  396. //
  397. // The context must be non-nil and will be used for request cancellation. If
  398. // the context is nil a panic will occur. In the future the SDK may create
  399. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  400. // for more information on using Contexts.
  401. func (c *IoT1ClickDevicesService) InitiateDeviceClaimWithContext(ctx aws.Context, input *InitiateDeviceClaimInput, opts ...request.Option) (*InitiateDeviceClaimOutput, error) {
  402. req, out := c.InitiateDeviceClaimRequest(input)
  403. req.SetContext(ctx)
  404. req.ApplyOptions(opts...)
  405. return out, req.Send()
  406. }
  407. const opInvokeDeviceMethod = "InvokeDeviceMethod"
  408. // InvokeDeviceMethodRequest generates a "aws/request.Request" representing the
  409. // client's request for the InvokeDeviceMethod operation. The "output" return
  410. // value will be populated with the request's response once the request completes
  411. // successfully.
  412. //
  413. // Use "Send" method on the returned Request to send the API call to the service.
  414. // the "output" return value is not valid until after Send returns without error.
  415. //
  416. // See InvokeDeviceMethod for more information on using the InvokeDeviceMethod
  417. // API call, and error handling.
  418. //
  419. // This method is useful when you want to inject custom logic or configuration
  420. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  421. //
  422. //
  423. // // Example sending a request using the InvokeDeviceMethodRequest method.
  424. // req, resp := client.InvokeDeviceMethodRequest(params)
  425. //
  426. // err := req.Send()
  427. // if err == nil { // resp is now filled
  428. // fmt.Println(resp)
  429. // }
  430. //
  431. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod
  432. func (c *IoT1ClickDevicesService) InvokeDeviceMethodRequest(input *InvokeDeviceMethodInput) (req *request.Request, output *InvokeDeviceMethodOutput) {
  433. op := &request.Operation{
  434. Name: opInvokeDeviceMethod,
  435. HTTPMethod: "POST",
  436. HTTPPath: "/devices/{deviceId}/methods",
  437. }
  438. if input == nil {
  439. input = &InvokeDeviceMethodInput{}
  440. }
  441. output = &InvokeDeviceMethodOutput{}
  442. req = c.newRequest(op, input, output)
  443. return
  444. }
  445. // InvokeDeviceMethod API operation for AWS IoT 1-Click Devices Service.
  446. //
  447. // Given a device ID, issues a request to invoke a named device method (with
  448. // possible parameters). See the "Example POST" code snippet below.
  449. //
  450. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  451. // with awserr.Error's Code and Message methods to get detailed information about
  452. // the error.
  453. //
  454. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  455. // API operation InvokeDeviceMethod for usage and error information.
  456. //
  457. // Returned Error Codes:
  458. // * ErrCodeInvalidRequestException "InvalidRequestException"
  459. //
  460. // * ErrCodePreconditionFailedException "PreconditionFailedException"
  461. //
  462. // * ErrCodeInternalFailureException "InternalFailureException"
  463. //
  464. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  465. //
  466. // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
  467. //
  468. // * ErrCodeResourceConflictException "ResourceConflictException"
  469. //
  470. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod
  471. func (c *IoT1ClickDevicesService) InvokeDeviceMethod(input *InvokeDeviceMethodInput) (*InvokeDeviceMethodOutput, error) {
  472. req, out := c.InvokeDeviceMethodRequest(input)
  473. return out, req.Send()
  474. }
  475. // InvokeDeviceMethodWithContext is the same as InvokeDeviceMethod with the addition of
  476. // the ability to pass a context and additional request options.
  477. //
  478. // See InvokeDeviceMethod for details on how to use this API operation.
  479. //
  480. // The context must be non-nil and will be used for request cancellation. If
  481. // the context is nil a panic will occur. In the future the SDK may create
  482. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  483. // for more information on using Contexts.
  484. func (c *IoT1ClickDevicesService) InvokeDeviceMethodWithContext(ctx aws.Context, input *InvokeDeviceMethodInput, opts ...request.Option) (*InvokeDeviceMethodOutput, error) {
  485. req, out := c.InvokeDeviceMethodRequest(input)
  486. req.SetContext(ctx)
  487. req.ApplyOptions(opts...)
  488. return out, req.Send()
  489. }
  490. const opListDeviceEvents = "ListDeviceEvents"
  491. // ListDeviceEventsRequest generates a "aws/request.Request" representing the
  492. // client's request for the ListDeviceEvents operation. The "output" return
  493. // value will be populated with the request's response once the request completes
  494. // successfully.
  495. //
  496. // Use "Send" method on the returned Request to send the API call to the service.
  497. // the "output" return value is not valid until after Send returns without error.
  498. //
  499. // See ListDeviceEvents for more information on using the ListDeviceEvents
  500. // API call, and error handling.
  501. //
  502. // This method is useful when you want to inject custom logic or configuration
  503. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  504. //
  505. //
  506. // // Example sending a request using the ListDeviceEventsRequest method.
  507. // req, resp := client.ListDeviceEventsRequest(params)
  508. //
  509. // err := req.Send()
  510. // if err == nil { // resp is now filled
  511. // fmt.Println(resp)
  512. // }
  513. //
  514. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents
  515. func (c *IoT1ClickDevicesService) ListDeviceEventsRequest(input *ListDeviceEventsInput) (req *request.Request, output *ListDeviceEventsOutput) {
  516. op := &request.Operation{
  517. Name: opListDeviceEvents,
  518. HTTPMethod: "GET",
  519. HTTPPath: "/devices/{deviceId}/events",
  520. }
  521. if input == nil {
  522. input = &ListDeviceEventsInput{}
  523. }
  524. output = &ListDeviceEventsOutput{}
  525. req = c.newRequest(op, input, output)
  526. return
  527. }
  528. // ListDeviceEvents API operation for AWS IoT 1-Click Devices Service.
  529. //
  530. // Using a device ID, returns a DeviceEventsResponse object containing an array
  531. // of events for the device.
  532. //
  533. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  534. // with awserr.Error's Code and Message methods to get detailed information about
  535. // the error.
  536. //
  537. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  538. // API operation ListDeviceEvents for usage and error information.
  539. //
  540. // Returned Error Codes:
  541. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  542. //
  543. // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
  544. //
  545. // * ErrCodeInvalidRequestException "InvalidRequestException"
  546. //
  547. // * ErrCodeInternalFailureException "InternalFailureException"
  548. //
  549. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents
  550. func (c *IoT1ClickDevicesService) ListDeviceEvents(input *ListDeviceEventsInput) (*ListDeviceEventsOutput, error) {
  551. req, out := c.ListDeviceEventsRequest(input)
  552. return out, req.Send()
  553. }
  554. // ListDeviceEventsWithContext is the same as ListDeviceEvents with the addition of
  555. // the ability to pass a context and additional request options.
  556. //
  557. // See ListDeviceEvents for details on how to use this API operation.
  558. //
  559. // The context must be non-nil and will be used for request cancellation. If
  560. // the context is nil a panic will occur. In the future the SDK may create
  561. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  562. // for more information on using Contexts.
  563. func (c *IoT1ClickDevicesService) ListDeviceEventsWithContext(ctx aws.Context, input *ListDeviceEventsInput, opts ...request.Option) (*ListDeviceEventsOutput, error) {
  564. req, out := c.ListDeviceEventsRequest(input)
  565. req.SetContext(ctx)
  566. req.ApplyOptions(opts...)
  567. return out, req.Send()
  568. }
  569. const opListDevices = "ListDevices"
  570. // ListDevicesRequest generates a "aws/request.Request" representing the
  571. // client's request for the ListDevices operation. The "output" return
  572. // value will be populated with the request's response once the request completes
  573. // successfully.
  574. //
  575. // Use "Send" method on the returned Request to send the API call to the service.
  576. // the "output" return value is not valid until after Send returns without error.
  577. //
  578. // See ListDevices for more information on using the ListDevices
  579. // API call, and error handling.
  580. //
  581. // This method is useful when you want to inject custom logic or configuration
  582. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  583. //
  584. //
  585. // // Example sending a request using the ListDevicesRequest method.
  586. // req, resp := client.ListDevicesRequest(params)
  587. //
  588. // err := req.Send()
  589. // if err == nil { // resp is now filled
  590. // fmt.Println(resp)
  591. // }
  592. //
  593. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices
  594. func (c *IoT1ClickDevicesService) ListDevicesRequest(input *ListDevicesInput) (req *request.Request, output *ListDevicesOutput) {
  595. op := &request.Operation{
  596. Name: opListDevices,
  597. HTTPMethod: "GET",
  598. HTTPPath: "/devices",
  599. }
  600. if input == nil {
  601. input = &ListDevicesInput{}
  602. }
  603. output = &ListDevicesOutput{}
  604. req = c.newRequest(op, input, output)
  605. return
  606. }
  607. // ListDevices API operation for AWS IoT 1-Click Devices Service.
  608. //
  609. // Lists the 1-Click compatible devices associated with your AWS account.
  610. //
  611. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  612. // with awserr.Error's Code and Message methods to get detailed information about
  613. // the error.
  614. //
  615. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  616. // API operation ListDevices for usage and error information.
  617. //
  618. // Returned Error Codes:
  619. // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
  620. //
  621. // * ErrCodeInvalidRequestException "InvalidRequestException"
  622. //
  623. // * ErrCodeInternalFailureException "InternalFailureException"
  624. //
  625. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices
  626. func (c *IoT1ClickDevicesService) ListDevices(input *ListDevicesInput) (*ListDevicesOutput, error) {
  627. req, out := c.ListDevicesRequest(input)
  628. return out, req.Send()
  629. }
  630. // ListDevicesWithContext is the same as ListDevices with the addition of
  631. // the ability to pass a context and additional request options.
  632. //
  633. // See ListDevices for details on how to use this API operation.
  634. //
  635. // The context must be non-nil and will be used for request cancellation. If
  636. // the context is nil a panic will occur. In the future the SDK may create
  637. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  638. // for more information on using Contexts.
  639. func (c *IoT1ClickDevicesService) ListDevicesWithContext(ctx aws.Context, input *ListDevicesInput, opts ...request.Option) (*ListDevicesOutput, error) {
  640. req, out := c.ListDevicesRequest(input)
  641. req.SetContext(ctx)
  642. req.ApplyOptions(opts...)
  643. return out, req.Send()
  644. }
  645. const opUnclaimDevice = "UnclaimDevice"
  646. // UnclaimDeviceRequest generates a "aws/request.Request" representing the
  647. // client's request for the UnclaimDevice operation. The "output" return
  648. // value will be populated with the request's response once the request completes
  649. // successfully.
  650. //
  651. // Use "Send" method on the returned Request to send the API call to the service.
  652. // the "output" return value is not valid until after Send returns without error.
  653. //
  654. // See UnclaimDevice for more information on using the UnclaimDevice
  655. // API call, and error handling.
  656. //
  657. // This method is useful when you want to inject custom logic or configuration
  658. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  659. //
  660. //
  661. // // Example sending a request using the UnclaimDeviceRequest method.
  662. // req, resp := client.UnclaimDeviceRequest(params)
  663. //
  664. // err := req.Send()
  665. // if err == nil { // resp is now filled
  666. // fmt.Println(resp)
  667. // }
  668. //
  669. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice
  670. func (c *IoT1ClickDevicesService) UnclaimDeviceRequest(input *UnclaimDeviceInput) (req *request.Request, output *UnclaimDeviceOutput) {
  671. op := &request.Operation{
  672. Name: opUnclaimDevice,
  673. HTTPMethod: "PUT",
  674. HTTPPath: "/devices/{deviceId}/unclaim",
  675. }
  676. if input == nil {
  677. input = &UnclaimDeviceInput{}
  678. }
  679. output = &UnclaimDeviceOutput{}
  680. req = c.newRequest(op, input, output)
  681. return
  682. }
  683. // UnclaimDevice API operation for AWS IoT 1-Click Devices Service.
  684. //
  685. // Disassociates a device from your AWS account using its device ID.
  686. //
  687. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  688. // with awserr.Error's Code and Message methods to get detailed information about
  689. // the error.
  690. //
  691. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  692. // API operation UnclaimDevice for usage and error information.
  693. //
  694. // Returned Error Codes:
  695. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  696. //
  697. // * ErrCodeInvalidRequestException "InvalidRequestException"
  698. //
  699. // * ErrCodeInternalFailureException "InternalFailureException"
  700. //
  701. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice
  702. func (c *IoT1ClickDevicesService) UnclaimDevice(input *UnclaimDeviceInput) (*UnclaimDeviceOutput, error) {
  703. req, out := c.UnclaimDeviceRequest(input)
  704. return out, req.Send()
  705. }
  706. // UnclaimDeviceWithContext is the same as UnclaimDevice with the addition of
  707. // the ability to pass a context and additional request options.
  708. //
  709. // See UnclaimDevice for details on how to use this API operation.
  710. //
  711. // The context must be non-nil and will be used for request cancellation. If
  712. // the context is nil a panic will occur. In the future the SDK may create
  713. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  714. // for more information on using Contexts.
  715. func (c *IoT1ClickDevicesService) UnclaimDeviceWithContext(ctx aws.Context, input *UnclaimDeviceInput, opts ...request.Option) (*UnclaimDeviceOutput, error) {
  716. req, out := c.UnclaimDeviceRequest(input)
  717. req.SetContext(ctx)
  718. req.ApplyOptions(opts...)
  719. return out, req.Send()
  720. }
  721. const opUpdateDeviceState = "UpdateDeviceState"
  722. // UpdateDeviceStateRequest generates a "aws/request.Request" representing the
  723. // client's request for the UpdateDeviceState operation. The "output" return
  724. // value will be populated with the request's response once the request completes
  725. // successfully.
  726. //
  727. // Use "Send" method on the returned Request to send the API call to the service.
  728. // the "output" return value is not valid until after Send returns without error.
  729. //
  730. // See UpdateDeviceState for more information on using the UpdateDeviceState
  731. // API call, and error handling.
  732. //
  733. // This method is useful when you want to inject custom logic or configuration
  734. // into the SDK's request lifecycle. Such as custom headers, or retry logic.
  735. //
  736. //
  737. // // Example sending a request using the UpdateDeviceStateRequest method.
  738. // req, resp := client.UpdateDeviceStateRequest(params)
  739. //
  740. // err := req.Send()
  741. // if err == nil { // resp is now filled
  742. // fmt.Println(resp)
  743. // }
  744. //
  745. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState
  746. func (c *IoT1ClickDevicesService) UpdateDeviceStateRequest(input *UpdateDeviceStateInput) (req *request.Request, output *UpdateDeviceStateOutput) {
  747. op := &request.Operation{
  748. Name: opUpdateDeviceState,
  749. HTTPMethod: "PUT",
  750. HTTPPath: "/devices/{deviceId}/state",
  751. }
  752. if input == nil {
  753. input = &UpdateDeviceStateInput{}
  754. }
  755. output = &UpdateDeviceStateOutput{}
  756. req = c.newRequest(op, input, output)
  757. req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
  758. return
  759. }
  760. // UpdateDeviceState API operation for AWS IoT 1-Click Devices Service.
  761. //
  762. // Using a Boolean value (true or false), this operation enables or disables
  763. // the device given a device ID.
  764. //
  765. // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
  766. // with awserr.Error's Code and Message methods to get detailed information about
  767. // the error.
  768. //
  769. // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
  770. // API operation UpdateDeviceState for usage and error information.
  771. //
  772. // Returned Error Codes:
  773. // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
  774. //
  775. // * ErrCodeInvalidRequestException "InvalidRequestException"
  776. //
  777. // * ErrCodeInternalFailureException "InternalFailureException"
  778. //
  779. // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState
  780. func (c *IoT1ClickDevicesService) UpdateDeviceState(input *UpdateDeviceStateInput) (*UpdateDeviceStateOutput, error) {
  781. req, out := c.UpdateDeviceStateRequest(input)
  782. return out, req.Send()
  783. }
  784. // UpdateDeviceStateWithContext is the same as UpdateDeviceState with the addition of
  785. // the ability to pass a context and additional request options.
  786. //
  787. // See UpdateDeviceState for details on how to use this API operation.
  788. //
  789. // The context must be non-nil and will be used for request cancellation. If
  790. // the context is nil a panic will occur. In the future the SDK may create
  791. // sub-contexts for http.Requests. See https://golang.org/pkg/context/
  792. // for more information on using Contexts.
  793. func (c *IoT1ClickDevicesService) UpdateDeviceStateWithContext(ctx aws.Context, input *UpdateDeviceStateInput, opts ...request.Option) (*UpdateDeviceStateOutput, error) {
  794. req, out := c.UpdateDeviceStateRequest(input)
  795. req.SetContext(ctx)
  796. req.ApplyOptions(opts...)
  797. return out, req.Send()
  798. }
  799. type Attributes struct {
  800. _ struct{} `type:"structure"`
  801. }
  802. // String returns the string representation
  803. func (s Attributes) String() string {
  804. return awsutil.Prettify(s)
  805. }
  806. // GoString returns the string representation
  807. func (s Attributes) GoString() string {
  808. return s.String()
  809. }
  810. type ClaimDevicesByClaimCodeInput struct {
  811. _ struct{} `type:"structure"`
  812. // ClaimCode is a required field
  813. ClaimCode *string `location:"uri" locationName:"claimCode" type:"string" required:"true"`
  814. }
  815. // String returns the string representation
  816. func (s ClaimDevicesByClaimCodeInput) String() string {
  817. return awsutil.Prettify(s)
  818. }
  819. // GoString returns the string representation
  820. func (s ClaimDevicesByClaimCodeInput) GoString() string {
  821. return s.String()
  822. }
  823. // Validate inspects the fields of the type to determine if they are valid.
  824. func (s *ClaimDevicesByClaimCodeInput) Validate() error {
  825. invalidParams := request.ErrInvalidParams{Context: "ClaimDevicesByClaimCodeInput"}
  826. if s.ClaimCode == nil {
  827. invalidParams.Add(request.NewErrParamRequired("ClaimCode"))
  828. }
  829. if s.ClaimCode != nil && len(*s.ClaimCode) < 1 {
  830. invalidParams.Add(request.NewErrParamMinLen("ClaimCode", 1))
  831. }
  832. if invalidParams.Len() > 0 {
  833. return invalidParams
  834. }
  835. return nil
  836. }
  837. // SetClaimCode sets the ClaimCode field's value.
  838. func (s *ClaimDevicesByClaimCodeInput) SetClaimCode(v string) *ClaimDevicesByClaimCodeInput {
  839. s.ClaimCode = &v
  840. return s
  841. }
  842. type ClaimDevicesByClaimCodeOutput struct {
  843. _ struct{} `type:"structure"`
  844. // The claim code provided by the device manufacturer.
  845. ClaimCode *string `locationName:"claimCode" min:"12" type:"string"`
  846. // The total number of devices associated with the claim code that has been
  847. // processed in the claim request.
  848. Total *int64 `locationName:"total" type:"integer"`
  849. }
  850. // String returns the string representation
  851. func (s ClaimDevicesByClaimCodeOutput) String() string {
  852. return awsutil.Prettify(s)
  853. }
  854. // GoString returns the string representation
  855. func (s ClaimDevicesByClaimCodeOutput) GoString() string {
  856. return s.String()
  857. }
  858. // SetClaimCode sets the ClaimCode field's value.
  859. func (s *ClaimDevicesByClaimCodeOutput) SetClaimCode(v string) *ClaimDevicesByClaimCodeOutput {
  860. s.ClaimCode = &v
  861. return s
  862. }
  863. // SetTotal sets the Total field's value.
  864. func (s *ClaimDevicesByClaimCodeOutput) SetTotal(v int64) *ClaimDevicesByClaimCodeOutput {
  865. s.Total = &v
  866. return s
  867. }
  868. type DescribeDeviceInput struct {
  869. _ struct{} `type:"structure"`
  870. // DeviceId is a required field
  871. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  872. }
  873. // String returns the string representation
  874. func (s DescribeDeviceInput) String() string {
  875. return awsutil.Prettify(s)
  876. }
  877. // GoString returns the string representation
  878. func (s DescribeDeviceInput) GoString() string {
  879. return s.String()
  880. }
  881. // Validate inspects the fields of the type to determine if they are valid.
  882. func (s *DescribeDeviceInput) Validate() error {
  883. invalidParams := request.ErrInvalidParams{Context: "DescribeDeviceInput"}
  884. if s.DeviceId == nil {
  885. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  886. }
  887. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  888. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  889. }
  890. if invalidParams.Len() > 0 {
  891. return invalidParams
  892. }
  893. return nil
  894. }
  895. // SetDeviceId sets the DeviceId field's value.
  896. func (s *DescribeDeviceInput) SetDeviceId(v string) *DescribeDeviceInput {
  897. s.DeviceId = &v
  898. return s
  899. }
  900. type DescribeDeviceOutput struct {
  901. _ struct{} `type:"structure"`
  902. // Device details.
  903. DeviceDescription *DeviceDescription `locationName:"deviceDescription" type:"structure"`
  904. }
  905. // String returns the string representation
  906. func (s DescribeDeviceOutput) String() string {
  907. return awsutil.Prettify(s)
  908. }
  909. // GoString returns the string representation
  910. func (s DescribeDeviceOutput) GoString() string {
  911. return s.String()
  912. }
  913. // SetDeviceDescription sets the DeviceDescription field's value.
  914. func (s *DescribeDeviceOutput) SetDeviceDescription(v *DeviceDescription) *DescribeDeviceOutput {
  915. s.DeviceDescription = v
  916. return s
  917. }
  918. type Device struct {
  919. _ struct{} `type:"structure"`
  920. // The user specified attributes associated with the device for an event.
  921. Attributes *Attributes `locationName:"attributes" type:"structure"`
  922. // The unique identifier of the device.
  923. DeviceId *string `locationName:"deviceId" type:"string"`
  924. // The device type, such as "button".
  925. Type *string `locationName:"type" type:"string"`
  926. }
  927. // String returns the string representation
  928. func (s Device) String() string {
  929. return awsutil.Prettify(s)
  930. }
  931. // GoString returns the string representation
  932. func (s Device) GoString() string {
  933. return s.String()
  934. }
  935. // SetAttributes sets the Attributes field's value.
  936. func (s *Device) SetAttributes(v *Attributes) *Device {
  937. s.Attributes = v
  938. return s
  939. }
  940. // SetDeviceId sets the DeviceId field's value.
  941. func (s *Device) SetDeviceId(v string) *Device {
  942. s.DeviceId = &v
  943. return s
  944. }
  945. // SetType sets the Type field's value.
  946. func (s *Device) SetType(v string) *Device {
  947. s.Type = &v
  948. return s
  949. }
  950. type DeviceDescription struct {
  951. _ struct{} `type:"structure"`
  952. // An array of zero or more elements of DeviceAttribute objects providing user
  953. // specified device attributes.
  954. Attributes map[string]*string `locationName:"attributes" type:"map"`
  955. // The unique identifier of the device.
  956. DeviceId *string `locationName:"deviceId" type:"string"`
  957. // A Boolean value indicating whether or not the device is enabled.
  958. Enabled *bool `locationName:"enabled" type:"boolean"`
  959. // A value between 0 and 1 inclusive, representing the fraction of life remaining
  960. // for the device.
  961. RemainingLife *float64 `locationName:"remainingLife" type:"double"`
  962. // The type of the device, such as "button".
  963. Type *string `locationName:"type" type:"string"`
  964. }
  965. // String returns the string representation
  966. func (s DeviceDescription) String() string {
  967. return awsutil.Prettify(s)
  968. }
  969. // GoString returns the string representation
  970. func (s DeviceDescription) GoString() string {
  971. return s.String()
  972. }
  973. // SetAttributes sets the Attributes field's value.
  974. func (s *DeviceDescription) SetAttributes(v map[string]*string) *DeviceDescription {
  975. s.Attributes = v
  976. return s
  977. }
  978. // SetDeviceId sets the DeviceId field's value.
  979. func (s *DeviceDescription) SetDeviceId(v string) *DeviceDescription {
  980. s.DeviceId = &v
  981. return s
  982. }
  983. // SetEnabled sets the Enabled field's value.
  984. func (s *DeviceDescription) SetEnabled(v bool) *DeviceDescription {
  985. s.Enabled = &v
  986. return s
  987. }
  988. // SetRemainingLife sets the RemainingLife field's value.
  989. func (s *DeviceDescription) SetRemainingLife(v float64) *DeviceDescription {
  990. s.RemainingLife = &v
  991. return s
  992. }
  993. // SetType sets the Type field's value.
  994. func (s *DeviceDescription) SetType(v string) *DeviceDescription {
  995. s.Type = &v
  996. return s
  997. }
  998. type DeviceEvent struct {
  999. _ struct{} `type:"structure"`
  1000. // An object representing the device associated with the event.
  1001. Device *Device `locationName:"device" type:"structure"`
  1002. // A serialized JSON object representing the device-type specific event.
  1003. StdEvent *string `locationName:"stdEvent" type:"string"`
  1004. }
  1005. // String returns the string representation
  1006. func (s DeviceEvent) String() string {
  1007. return awsutil.Prettify(s)
  1008. }
  1009. // GoString returns the string representation
  1010. func (s DeviceEvent) GoString() string {
  1011. return s.String()
  1012. }
  1013. // SetDevice sets the Device field's value.
  1014. func (s *DeviceEvent) SetDevice(v *Device) *DeviceEvent {
  1015. s.Device = v
  1016. return s
  1017. }
  1018. // SetStdEvent sets the StdEvent field's value.
  1019. func (s *DeviceEvent) SetStdEvent(v string) *DeviceEvent {
  1020. s.StdEvent = &v
  1021. return s
  1022. }
  1023. type DeviceMethod struct {
  1024. _ struct{} `type:"structure"`
  1025. // The type of the device, such as "button".
  1026. DeviceType *string `locationName:"deviceType" type:"string"`
  1027. // The name of the method applicable to the deviceType.
  1028. MethodName *string `locationName:"methodName" type:"string"`
  1029. }
  1030. // String returns the string representation
  1031. func (s DeviceMethod) String() string {
  1032. return awsutil.Prettify(s)
  1033. }
  1034. // GoString returns the string representation
  1035. func (s DeviceMethod) GoString() string {
  1036. return s.String()
  1037. }
  1038. // SetDeviceType sets the DeviceType field's value.
  1039. func (s *DeviceMethod) SetDeviceType(v string) *DeviceMethod {
  1040. s.DeviceType = &v
  1041. return s
  1042. }
  1043. // SetMethodName sets the MethodName field's value.
  1044. func (s *DeviceMethod) SetMethodName(v string) *DeviceMethod {
  1045. s.MethodName = &v
  1046. return s
  1047. }
  1048. type FinalizeDeviceClaimInput struct {
  1049. _ struct{} `type:"structure"`
  1050. // DeviceId is a required field
  1051. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1052. }
  1053. // String returns the string representation
  1054. func (s FinalizeDeviceClaimInput) String() string {
  1055. return awsutil.Prettify(s)
  1056. }
  1057. // GoString returns the string representation
  1058. func (s FinalizeDeviceClaimInput) GoString() string {
  1059. return s.String()
  1060. }
  1061. // Validate inspects the fields of the type to determine if they are valid.
  1062. func (s *FinalizeDeviceClaimInput) Validate() error {
  1063. invalidParams := request.ErrInvalidParams{Context: "FinalizeDeviceClaimInput"}
  1064. if s.DeviceId == nil {
  1065. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1066. }
  1067. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1068. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1069. }
  1070. if invalidParams.Len() > 0 {
  1071. return invalidParams
  1072. }
  1073. return nil
  1074. }
  1075. // SetDeviceId sets the DeviceId field's value.
  1076. func (s *FinalizeDeviceClaimInput) SetDeviceId(v string) *FinalizeDeviceClaimInput {
  1077. s.DeviceId = &v
  1078. return s
  1079. }
  1080. type FinalizeDeviceClaimOutput struct {
  1081. _ struct{} `type:"structure"`
  1082. State *string `locationName:"state" type:"string"`
  1083. }
  1084. // String returns the string representation
  1085. func (s FinalizeDeviceClaimOutput) String() string {
  1086. return awsutil.Prettify(s)
  1087. }
  1088. // GoString returns the string representation
  1089. func (s FinalizeDeviceClaimOutput) GoString() string {
  1090. return s.String()
  1091. }
  1092. // SetState sets the State field's value.
  1093. func (s *FinalizeDeviceClaimOutput) SetState(v string) *FinalizeDeviceClaimOutput {
  1094. s.State = &v
  1095. return s
  1096. }
  1097. type GetDeviceMethodsInput struct {
  1098. _ struct{} `type:"structure"`
  1099. // DeviceId is a required field
  1100. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1101. }
  1102. // String returns the string representation
  1103. func (s GetDeviceMethodsInput) String() string {
  1104. return awsutil.Prettify(s)
  1105. }
  1106. // GoString returns the string representation
  1107. func (s GetDeviceMethodsInput) GoString() string {
  1108. return s.String()
  1109. }
  1110. // Validate inspects the fields of the type to determine if they are valid.
  1111. func (s *GetDeviceMethodsInput) Validate() error {
  1112. invalidParams := request.ErrInvalidParams{Context: "GetDeviceMethodsInput"}
  1113. if s.DeviceId == nil {
  1114. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1115. }
  1116. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1117. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1118. }
  1119. if invalidParams.Len() > 0 {
  1120. return invalidParams
  1121. }
  1122. return nil
  1123. }
  1124. // SetDeviceId sets the DeviceId field's value.
  1125. func (s *GetDeviceMethodsInput) SetDeviceId(v string) *GetDeviceMethodsInput {
  1126. s.DeviceId = &v
  1127. return s
  1128. }
  1129. type GetDeviceMethodsOutput struct {
  1130. _ struct{} `type:"structure"`
  1131. // List of available device APIs.
  1132. DeviceMethods []*DeviceMethod `locationName:"deviceMethods" type:"list"`
  1133. }
  1134. // String returns the string representation
  1135. func (s GetDeviceMethodsOutput) String() string {
  1136. return awsutil.Prettify(s)
  1137. }
  1138. // GoString returns the string representation
  1139. func (s GetDeviceMethodsOutput) GoString() string {
  1140. return s.String()
  1141. }
  1142. // SetDeviceMethods sets the DeviceMethods field's value.
  1143. func (s *GetDeviceMethodsOutput) SetDeviceMethods(v []*DeviceMethod) *GetDeviceMethodsOutput {
  1144. s.DeviceMethods = v
  1145. return s
  1146. }
  1147. type InitiateDeviceClaimInput struct {
  1148. _ struct{} `type:"structure"`
  1149. // DeviceId is a required field
  1150. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1151. }
  1152. // String returns the string representation
  1153. func (s InitiateDeviceClaimInput) String() string {
  1154. return awsutil.Prettify(s)
  1155. }
  1156. // GoString returns the string representation
  1157. func (s InitiateDeviceClaimInput) GoString() string {
  1158. return s.String()
  1159. }
  1160. // Validate inspects the fields of the type to determine if they are valid.
  1161. func (s *InitiateDeviceClaimInput) Validate() error {
  1162. invalidParams := request.ErrInvalidParams{Context: "InitiateDeviceClaimInput"}
  1163. if s.DeviceId == nil {
  1164. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1165. }
  1166. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1167. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1168. }
  1169. if invalidParams.Len() > 0 {
  1170. return invalidParams
  1171. }
  1172. return nil
  1173. }
  1174. // SetDeviceId sets the DeviceId field's value.
  1175. func (s *InitiateDeviceClaimInput) SetDeviceId(v string) *InitiateDeviceClaimInput {
  1176. s.DeviceId = &v
  1177. return s
  1178. }
  1179. type InitiateDeviceClaimOutput struct {
  1180. _ struct{} `type:"structure"`
  1181. State *string `locationName:"state" type:"string"`
  1182. }
  1183. // String returns the string representation
  1184. func (s InitiateDeviceClaimOutput) String() string {
  1185. return awsutil.Prettify(s)
  1186. }
  1187. // GoString returns the string representation
  1188. func (s InitiateDeviceClaimOutput) GoString() string {
  1189. return s.String()
  1190. }
  1191. // SetState sets the State field's value.
  1192. func (s *InitiateDeviceClaimOutput) SetState(v string) *InitiateDeviceClaimOutput {
  1193. s.State = &v
  1194. return s
  1195. }
  1196. type InvokeDeviceMethodInput struct {
  1197. _ struct{} `type:"structure"`
  1198. // DeviceId is a required field
  1199. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1200. // The device method to invoke.
  1201. DeviceMethod *DeviceMethod `locationName:"deviceMethod" type:"structure"`
  1202. // A JSON encoded string containing the device method request parameters.
  1203. DeviceMethodParameters *string `locationName:"deviceMethodParameters" type:"string"`
  1204. }
  1205. // String returns the string representation
  1206. func (s InvokeDeviceMethodInput) String() string {
  1207. return awsutil.Prettify(s)
  1208. }
  1209. // GoString returns the string representation
  1210. func (s InvokeDeviceMethodInput) GoString() string {
  1211. return s.String()
  1212. }
  1213. // Validate inspects the fields of the type to determine if they are valid.
  1214. func (s *InvokeDeviceMethodInput) Validate() error {
  1215. invalidParams := request.ErrInvalidParams{Context: "InvokeDeviceMethodInput"}
  1216. if s.DeviceId == nil {
  1217. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1218. }
  1219. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1220. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1221. }
  1222. if invalidParams.Len() > 0 {
  1223. return invalidParams
  1224. }
  1225. return nil
  1226. }
  1227. // SetDeviceId sets the DeviceId field's value.
  1228. func (s *InvokeDeviceMethodInput) SetDeviceId(v string) *InvokeDeviceMethodInput {
  1229. s.DeviceId = &v
  1230. return s
  1231. }
  1232. // SetDeviceMethod sets the DeviceMethod field's value.
  1233. func (s *InvokeDeviceMethodInput) SetDeviceMethod(v *DeviceMethod) *InvokeDeviceMethodInput {
  1234. s.DeviceMethod = v
  1235. return s
  1236. }
  1237. // SetDeviceMethodParameters sets the DeviceMethodParameters field's value.
  1238. func (s *InvokeDeviceMethodInput) SetDeviceMethodParameters(v string) *InvokeDeviceMethodInput {
  1239. s.DeviceMethodParameters = &v
  1240. return s
  1241. }
  1242. type InvokeDeviceMethodOutput struct {
  1243. _ struct{} `type:"structure"`
  1244. // A JSON encoded string containing the device method response.
  1245. DeviceMethodResponse *string `locationName:"deviceMethodResponse" type:"string"`
  1246. }
  1247. // String returns the string representation
  1248. func (s InvokeDeviceMethodOutput) String() string {
  1249. return awsutil.Prettify(s)
  1250. }
  1251. // GoString returns the string representation
  1252. func (s InvokeDeviceMethodOutput) GoString() string {
  1253. return s.String()
  1254. }
  1255. // SetDeviceMethodResponse sets the DeviceMethodResponse field's value.
  1256. func (s *InvokeDeviceMethodOutput) SetDeviceMethodResponse(v string) *InvokeDeviceMethodOutput {
  1257. s.DeviceMethodResponse = &v
  1258. return s
  1259. }
  1260. type ListDeviceEventsInput struct {
  1261. _ struct{} `type:"structure"`
  1262. // DeviceId is a required field
  1263. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1264. // FromTimeStamp is a required field
  1265. FromTimeStamp *time.Time `location:"querystring" locationName:"fromTimeStamp" type:"timestamp" timestampFormat:"iso8601" required:"true"`
  1266. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
  1267. NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
  1268. // ToTimeStamp is a required field
  1269. ToTimeStamp *time.Time `location:"querystring" locationName:"toTimeStamp" type:"timestamp" timestampFormat:"iso8601" required:"true"`
  1270. }
  1271. // String returns the string representation
  1272. func (s ListDeviceEventsInput) String() string {
  1273. return awsutil.Prettify(s)
  1274. }
  1275. // GoString returns the string representation
  1276. func (s ListDeviceEventsInput) GoString() string {
  1277. return s.String()
  1278. }
  1279. // Validate inspects the fields of the type to determine if they are valid.
  1280. func (s *ListDeviceEventsInput) Validate() error {
  1281. invalidParams := request.ErrInvalidParams{Context: "ListDeviceEventsInput"}
  1282. if s.DeviceId == nil {
  1283. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1284. }
  1285. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1286. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1287. }
  1288. if s.FromTimeStamp == nil {
  1289. invalidParams.Add(request.NewErrParamRequired("FromTimeStamp"))
  1290. }
  1291. if s.MaxResults != nil && *s.MaxResults < 1 {
  1292. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  1293. }
  1294. if s.ToTimeStamp == nil {
  1295. invalidParams.Add(request.NewErrParamRequired("ToTimeStamp"))
  1296. }
  1297. if invalidParams.Len() > 0 {
  1298. return invalidParams
  1299. }
  1300. return nil
  1301. }
  1302. // SetDeviceId sets the DeviceId field's value.
  1303. func (s *ListDeviceEventsInput) SetDeviceId(v string) *ListDeviceEventsInput {
  1304. s.DeviceId = &v
  1305. return s
  1306. }
  1307. // SetFromTimeStamp sets the FromTimeStamp field's value.
  1308. func (s *ListDeviceEventsInput) SetFromTimeStamp(v time.Time) *ListDeviceEventsInput {
  1309. s.FromTimeStamp = &v
  1310. return s
  1311. }
  1312. // SetMaxResults sets the MaxResults field's value.
  1313. func (s *ListDeviceEventsInput) SetMaxResults(v int64) *ListDeviceEventsInput {
  1314. s.MaxResults = &v
  1315. return s
  1316. }
  1317. // SetNextToken sets the NextToken field's value.
  1318. func (s *ListDeviceEventsInput) SetNextToken(v string) *ListDeviceEventsInput {
  1319. s.NextToken = &v
  1320. return s
  1321. }
  1322. // SetToTimeStamp sets the ToTimeStamp field's value.
  1323. func (s *ListDeviceEventsInput) SetToTimeStamp(v time.Time) *ListDeviceEventsInput {
  1324. s.ToTimeStamp = &v
  1325. return s
  1326. }
  1327. type ListDeviceEventsOutput struct {
  1328. _ struct{} `type:"structure"`
  1329. Events []*DeviceEvent `locationName:"events" type:"list"`
  1330. NextToken *string `locationName:"nextToken" type:"string"`
  1331. }
  1332. // String returns the string representation
  1333. func (s ListDeviceEventsOutput) String() string {
  1334. return awsutil.Prettify(s)
  1335. }
  1336. // GoString returns the string representation
  1337. func (s ListDeviceEventsOutput) GoString() string {
  1338. return s.String()
  1339. }
  1340. // SetEvents sets the Events field's value.
  1341. func (s *ListDeviceEventsOutput) SetEvents(v []*DeviceEvent) *ListDeviceEventsOutput {
  1342. s.Events = v
  1343. return s
  1344. }
  1345. // SetNextToken sets the NextToken field's value.
  1346. func (s *ListDeviceEventsOutput) SetNextToken(v string) *ListDeviceEventsOutput {
  1347. s.NextToken = &v
  1348. return s
  1349. }
  1350. type ListDevicesInput struct {
  1351. _ struct{} `type:"structure"`
  1352. DeviceType *string `location:"querystring" locationName:"deviceType" type:"string"`
  1353. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
  1354. NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
  1355. }
  1356. // String returns the string representation
  1357. func (s ListDevicesInput) String() string {
  1358. return awsutil.Prettify(s)
  1359. }
  1360. // GoString returns the string representation
  1361. func (s ListDevicesInput) GoString() string {
  1362. return s.String()
  1363. }
  1364. // Validate inspects the fields of the type to determine if they are valid.
  1365. func (s *ListDevicesInput) Validate() error {
  1366. invalidParams := request.ErrInvalidParams{Context: "ListDevicesInput"}
  1367. if s.MaxResults != nil && *s.MaxResults < 1 {
  1368. invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
  1369. }
  1370. if invalidParams.Len() > 0 {
  1371. return invalidParams
  1372. }
  1373. return nil
  1374. }
  1375. // SetDeviceType sets the DeviceType field's value.
  1376. func (s *ListDevicesInput) SetDeviceType(v string) *ListDevicesInput {
  1377. s.DeviceType = &v
  1378. return s
  1379. }
  1380. // SetMaxResults sets the MaxResults field's value.
  1381. func (s *ListDevicesInput) SetMaxResults(v int64) *ListDevicesInput {
  1382. s.MaxResults = &v
  1383. return s
  1384. }
  1385. // SetNextToken sets the NextToken field's value.
  1386. func (s *ListDevicesInput) SetNextToken(v string) *ListDevicesInput {
  1387. s.NextToken = &v
  1388. return s
  1389. }
  1390. type ListDevicesOutput struct {
  1391. _ struct{} `type:"structure"`
  1392. // A list of devices.
  1393. Devices []*DeviceDescription `locationName:"devices" type:"list"`
  1394. // The token to retrieve the next set of results.
  1395. NextToken *string `locationName:"nextToken" type:"string"`
  1396. }
  1397. // String returns the string representation
  1398. func (s ListDevicesOutput) String() string {
  1399. return awsutil.Prettify(s)
  1400. }
  1401. // GoString returns the string representation
  1402. func (s ListDevicesOutput) GoString() string {
  1403. return s.String()
  1404. }
  1405. // SetDevices sets the Devices field's value.
  1406. func (s *ListDevicesOutput) SetDevices(v []*DeviceDescription) *ListDevicesOutput {
  1407. s.Devices = v
  1408. return s
  1409. }
  1410. // SetNextToken sets the NextToken field's value.
  1411. func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput {
  1412. s.NextToken = &v
  1413. return s
  1414. }
  1415. type UnclaimDeviceInput struct {
  1416. _ struct{} `type:"structure"`
  1417. // DeviceId is a required field
  1418. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1419. }
  1420. // String returns the string representation
  1421. func (s UnclaimDeviceInput) String() string {
  1422. return awsutil.Prettify(s)
  1423. }
  1424. // GoString returns the string representation
  1425. func (s UnclaimDeviceInput) GoString() string {
  1426. return s.String()
  1427. }
  1428. // Validate inspects the fields of the type to determine if they are valid.
  1429. func (s *UnclaimDeviceInput) Validate() error {
  1430. invalidParams := request.ErrInvalidParams{Context: "UnclaimDeviceInput"}
  1431. if s.DeviceId == nil {
  1432. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1433. }
  1434. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1435. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1436. }
  1437. if invalidParams.Len() > 0 {
  1438. return invalidParams
  1439. }
  1440. return nil
  1441. }
  1442. // SetDeviceId sets the DeviceId field's value.
  1443. func (s *UnclaimDeviceInput) SetDeviceId(v string) *UnclaimDeviceInput {
  1444. s.DeviceId = &v
  1445. return s
  1446. }
  1447. type UnclaimDeviceOutput struct {
  1448. _ struct{} `type:"structure"`
  1449. State *string `locationName:"state" type:"string"`
  1450. }
  1451. // String returns the string representation
  1452. func (s UnclaimDeviceOutput) String() string {
  1453. return awsutil.Prettify(s)
  1454. }
  1455. // GoString returns the string representation
  1456. func (s UnclaimDeviceOutput) GoString() string {
  1457. return s.String()
  1458. }
  1459. // SetState sets the State field's value.
  1460. func (s *UnclaimDeviceOutput) SetState(v string) *UnclaimDeviceOutput {
  1461. s.State = &v
  1462. return s
  1463. }
  1464. type UpdateDeviceStateInput struct {
  1465. _ struct{} `type:"structure"`
  1466. // DeviceId is a required field
  1467. DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
  1468. // If true, the device is enabled. If false, the device is disabled.
  1469. Enabled *bool `locationName:"enabled" type:"boolean"`
  1470. }
  1471. // String returns the string representation
  1472. func (s UpdateDeviceStateInput) String() string {
  1473. return awsutil.Prettify(s)
  1474. }
  1475. // GoString returns the string representation
  1476. func (s UpdateDeviceStateInput) GoString() string {
  1477. return s.String()
  1478. }
  1479. // Validate inspects the fields of the type to determine if they are valid.
  1480. func (s *UpdateDeviceStateInput) Validate() error {
  1481. invalidParams := request.ErrInvalidParams{Context: "UpdateDeviceStateInput"}
  1482. if s.DeviceId == nil {
  1483. invalidParams.Add(request.NewErrParamRequired("DeviceId"))
  1484. }
  1485. if s.DeviceId != nil && len(*s.DeviceId) < 1 {
  1486. invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
  1487. }
  1488. if invalidParams.Len() > 0 {
  1489. return invalidParams
  1490. }
  1491. return nil
  1492. }
  1493. // SetDeviceId sets the DeviceId field's value.
  1494. func (s *UpdateDeviceStateInput) SetDeviceId(v string) *UpdateDeviceStateInput {
  1495. s.DeviceId = &v
  1496. return s
  1497. }
  1498. // SetEnabled sets the Enabled field's value.
  1499. func (s *UpdateDeviceStateInput) SetEnabled(v bool) *UpdateDeviceStateInput {
  1500. s.Enabled = &v
  1501. return s
  1502. }
  1503. type UpdateDeviceStateOutput struct {
  1504. _ struct{} `type:"structure"`
  1505. }
  1506. // String returns the string representation
  1507. func (s UpdateDeviceStateOutput) String() string {
  1508. return awsutil.Prettify(s)
  1509. }
  1510. // GoString returns the string representation
  1511. func (s UpdateDeviceStateOutput) GoString() string {
  1512. return s.String()
  1513. }