| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757 |
- // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
- package iot1clickdevicesservice
- import (
- "time"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/awsutil"
- "github.com/aws/aws-sdk-go/aws/request"
- "github.com/aws/aws-sdk-go/private/protocol"
- "github.com/aws/aws-sdk-go/private/protocol/restjson"
- )
- const opClaimDevicesByClaimCode = "ClaimDevicesByClaimCode"
- // ClaimDevicesByClaimCodeRequest generates a "aws/request.Request" representing the
- // client's request for the ClaimDevicesByClaimCode operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See ClaimDevicesByClaimCode for more information on using the ClaimDevicesByClaimCode
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the ClaimDevicesByClaimCodeRequest method.
- // req, resp := client.ClaimDevicesByClaimCodeRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode
- func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCodeRequest(input *ClaimDevicesByClaimCodeInput) (req *request.Request, output *ClaimDevicesByClaimCodeOutput) {
- op := &request.Operation{
- Name: opClaimDevicesByClaimCode,
- HTTPMethod: "PUT",
- HTTPPath: "/claims/{claimCode}",
- }
- if input == nil {
- input = &ClaimDevicesByClaimCodeInput{}
- }
- output = &ClaimDevicesByClaimCodeOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // ClaimDevicesByClaimCode API operation for AWS IoT 1-Click Devices Service.
- //
- // Adds device(s) to your account (i.e., claim one or more devices) if and only
- // if you received a claim code with the device(s).
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation ClaimDevicesByClaimCode for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // * ErrCodeForbiddenException "ForbiddenException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ClaimDevicesByClaimCode
- func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCode(input *ClaimDevicesByClaimCodeInput) (*ClaimDevicesByClaimCodeOutput, error) {
- req, out := c.ClaimDevicesByClaimCodeRequest(input)
- return out, req.Send()
- }
- // ClaimDevicesByClaimCodeWithContext is the same as ClaimDevicesByClaimCode with the addition of
- // the ability to pass a context and additional request options.
- //
- // See ClaimDevicesByClaimCode for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) ClaimDevicesByClaimCodeWithContext(ctx aws.Context, input *ClaimDevicesByClaimCodeInput, opts ...request.Option) (*ClaimDevicesByClaimCodeOutput, error) {
- req, out := c.ClaimDevicesByClaimCodeRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opDescribeDevice = "DescribeDevice"
- // DescribeDeviceRequest generates a "aws/request.Request" representing the
- // client's request for the DescribeDevice operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See DescribeDevice for more information on using the DescribeDevice
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the DescribeDeviceRequest method.
- // req, resp := client.DescribeDeviceRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice
- func (c *IoT1ClickDevicesService) DescribeDeviceRequest(input *DescribeDeviceInput) (req *request.Request, output *DescribeDeviceOutput) {
- op := &request.Operation{
- Name: opDescribeDevice,
- HTTPMethod: "GET",
- HTTPPath: "/devices/{deviceId}",
- }
- if input == nil {
- input = &DescribeDeviceInput{}
- }
- output = &DescribeDeviceOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // DescribeDevice API operation for AWS IoT 1-Click Devices Service.
- //
- // Given a device ID, returns a DescribeDeviceResponse object describing the
- // details of the device.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation DescribeDevice for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/DescribeDevice
- func (c *IoT1ClickDevicesService) DescribeDevice(input *DescribeDeviceInput) (*DescribeDeviceOutput, error) {
- req, out := c.DescribeDeviceRequest(input)
- return out, req.Send()
- }
- // DescribeDeviceWithContext is the same as DescribeDevice with the addition of
- // the ability to pass a context and additional request options.
- //
- // See DescribeDevice for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) DescribeDeviceWithContext(ctx aws.Context, input *DescribeDeviceInput, opts ...request.Option) (*DescribeDeviceOutput, error) {
- req, out := c.DescribeDeviceRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opFinalizeDeviceClaim = "FinalizeDeviceClaim"
- // FinalizeDeviceClaimRequest generates a "aws/request.Request" representing the
- // client's request for the FinalizeDeviceClaim operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See FinalizeDeviceClaim for more information on using the FinalizeDeviceClaim
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the FinalizeDeviceClaimRequest method.
- // req, resp := client.FinalizeDeviceClaimRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim
- func (c *IoT1ClickDevicesService) FinalizeDeviceClaimRequest(input *FinalizeDeviceClaimInput) (req *request.Request, output *FinalizeDeviceClaimOutput) {
- op := &request.Operation{
- Name: opFinalizeDeviceClaim,
- HTTPMethod: "PUT",
- HTTPPath: "/devices/{deviceId}/finalize-claim",
- }
- if input == nil {
- input = &FinalizeDeviceClaimInput{}
- }
- output = &FinalizeDeviceClaimOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // FinalizeDeviceClaim API operation for AWS IoT 1-Click Devices Service.
- //
- // Given a device ID, finalizes the claim request for the associated device.
- //
- // Claiming a device consists of initiating a claim, then publishing a device
- // event, and finalizing the claim. For a device of type button, a device event
- // can be published by simply clicking the device.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation FinalizeDeviceClaim for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // * ErrCodePreconditionFailedException "PreconditionFailedException"
- //
- // * ErrCodeResourceConflictException "ResourceConflictException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/FinalizeDeviceClaim
- func (c *IoT1ClickDevicesService) FinalizeDeviceClaim(input *FinalizeDeviceClaimInput) (*FinalizeDeviceClaimOutput, error) {
- req, out := c.FinalizeDeviceClaimRequest(input)
- return out, req.Send()
- }
- // FinalizeDeviceClaimWithContext is the same as FinalizeDeviceClaim with the addition of
- // the ability to pass a context and additional request options.
- //
- // See FinalizeDeviceClaim for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) FinalizeDeviceClaimWithContext(ctx aws.Context, input *FinalizeDeviceClaimInput, opts ...request.Option) (*FinalizeDeviceClaimOutput, error) {
- req, out := c.FinalizeDeviceClaimRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opGetDeviceMethods = "GetDeviceMethods"
- // GetDeviceMethodsRequest generates a "aws/request.Request" representing the
- // client's request for the GetDeviceMethods operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See GetDeviceMethods for more information on using the GetDeviceMethods
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the GetDeviceMethodsRequest method.
- // req, resp := client.GetDeviceMethodsRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods
- func (c *IoT1ClickDevicesService) GetDeviceMethodsRequest(input *GetDeviceMethodsInput) (req *request.Request, output *GetDeviceMethodsOutput) {
- op := &request.Operation{
- Name: opGetDeviceMethods,
- HTTPMethod: "GET",
- HTTPPath: "/devices/{deviceId}/methods",
- }
- if input == nil {
- input = &GetDeviceMethodsInput{}
- }
- output = &GetDeviceMethodsOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // GetDeviceMethods API operation for AWS IoT 1-Click Devices Service.
- //
- // Given a device ID, returns the invokable methods associated with the device.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation GetDeviceMethods for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/GetDeviceMethods
- func (c *IoT1ClickDevicesService) GetDeviceMethods(input *GetDeviceMethodsInput) (*GetDeviceMethodsOutput, error) {
- req, out := c.GetDeviceMethodsRequest(input)
- return out, req.Send()
- }
- // GetDeviceMethodsWithContext is the same as GetDeviceMethods with the addition of
- // the ability to pass a context and additional request options.
- //
- // See GetDeviceMethods for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) GetDeviceMethodsWithContext(ctx aws.Context, input *GetDeviceMethodsInput, opts ...request.Option) (*GetDeviceMethodsOutput, error) {
- req, out := c.GetDeviceMethodsRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opInitiateDeviceClaim = "InitiateDeviceClaim"
- // InitiateDeviceClaimRequest generates a "aws/request.Request" representing the
- // client's request for the InitiateDeviceClaim operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See InitiateDeviceClaim for more information on using the InitiateDeviceClaim
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the InitiateDeviceClaimRequest method.
- // req, resp := client.InitiateDeviceClaimRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim
- func (c *IoT1ClickDevicesService) InitiateDeviceClaimRequest(input *InitiateDeviceClaimInput) (req *request.Request, output *InitiateDeviceClaimOutput) {
- op := &request.Operation{
- Name: opInitiateDeviceClaim,
- HTTPMethod: "PUT",
- HTTPPath: "/devices/{deviceId}/initiate-claim",
- }
- if input == nil {
- input = &InitiateDeviceClaimInput{}
- }
- output = &InitiateDeviceClaimOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // InitiateDeviceClaim API operation for AWS IoT 1-Click Devices Service.
- //
- // Given a device ID, initiates a claim request for the associated device.
- //
- // Claiming a device consists of initiating a claim, then publishing a device
- // event, and finalizing the claim. For a device of type button, a device event
- // can be published by simply clicking the device.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation InitiateDeviceClaim for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // * ErrCodeResourceConflictException "ResourceConflictException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InitiateDeviceClaim
- func (c *IoT1ClickDevicesService) InitiateDeviceClaim(input *InitiateDeviceClaimInput) (*InitiateDeviceClaimOutput, error) {
- req, out := c.InitiateDeviceClaimRequest(input)
- return out, req.Send()
- }
- // InitiateDeviceClaimWithContext is the same as InitiateDeviceClaim with the addition of
- // the ability to pass a context and additional request options.
- //
- // See InitiateDeviceClaim for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) InitiateDeviceClaimWithContext(ctx aws.Context, input *InitiateDeviceClaimInput, opts ...request.Option) (*InitiateDeviceClaimOutput, error) {
- req, out := c.InitiateDeviceClaimRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opInvokeDeviceMethod = "InvokeDeviceMethod"
- // InvokeDeviceMethodRequest generates a "aws/request.Request" representing the
- // client's request for the InvokeDeviceMethod operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See InvokeDeviceMethod for more information on using the InvokeDeviceMethod
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the InvokeDeviceMethodRequest method.
- // req, resp := client.InvokeDeviceMethodRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod
- func (c *IoT1ClickDevicesService) InvokeDeviceMethodRequest(input *InvokeDeviceMethodInput) (req *request.Request, output *InvokeDeviceMethodOutput) {
- op := &request.Operation{
- Name: opInvokeDeviceMethod,
- HTTPMethod: "POST",
- HTTPPath: "/devices/{deviceId}/methods",
- }
- if input == nil {
- input = &InvokeDeviceMethodInput{}
- }
- output = &InvokeDeviceMethodOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // InvokeDeviceMethod API operation for AWS IoT 1-Click Devices Service.
- //
- // Given a device ID, issues a request to invoke a named device method (with
- // possible parameters). See the "Example POST" code snippet below.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation InvokeDeviceMethod for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodePreconditionFailedException "PreconditionFailedException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
- //
- // * ErrCodeResourceConflictException "ResourceConflictException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/InvokeDeviceMethod
- func (c *IoT1ClickDevicesService) InvokeDeviceMethod(input *InvokeDeviceMethodInput) (*InvokeDeviceMethodOutput, error) {
- req, out := c.InvokeDeviceMethodRequest(input)
- return out, req.Send()
- }
- // InvokeDeviceMethodWithContext is the same as InvokeDeviceMethod with the addition of
- // the ability to pass a context and additional request options.
- //
- // See InvokeDeviceMethod for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) InvokeDeviceMethodWithContext(ctx aws.Context, input *InvokeDeviceMethodInput, opts ...request.Option) (*InvokeDeviceMethodOutput, error) {
- req, out := c.InvokeDeviceMethodRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opListDeviceEvents = "ListDeviceEvents"
- // ListDeviceEventsRequest generates a "aws/request.Request" representing the
- // client's request for the ListDeviceEvents operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See ListDeviceEvents for more information on using the ListDeviceEvents
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the ListDeviceEventsRequest method.
- // req, resp := client.ListDeviceEventsRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents
- func (c *IoT1ClickDevicesService) ListDeviceEventsRequest(input *ListDeviceEventsInput) (req *request.Request, output *ListDeviceEventsOutput) {
- op := &request.Operation{
- Name: opListDeviceEvents,
- HTTPMethod: "GET",
- HTTPPath: "/devices/{deviceId}/events",
- }
- if input == nil {
- input = &ListDeviceEventsInput{}
- }
- output = &ListDeviceEventsOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // ListDeviceEvents API operation for AWS IoT 1-Click Devices Service.
- //
- // Using a device ID, returns a DeviceEventsResponse object containing an array
- // of events for the device.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation ListDeviceEvents for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDeviceEvents
- func (c *IoT1ClickDevicesService) ListDeviceEvents(input *ListDeviceEventsInput) (*ListDeviceEventsOutput, error) {
- req, out := c.ListDeviceEventsRequest(input)
- return out, req.Send()
- }
- // ListDeviceEventsWithContext is the same as ListDeviceEvents with the addition of
- // the ability to pass a context and additional request options.
- //
- // See ListDeviceEvents for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) ListDeviceEventsWithContext(ctx aws.Context, input *ListDeviceEventsInput, opts ...request.Option) (*ListDeviceEventsOutput, error) {
- req, out := c.ListDeviceEventsRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opListDevices = "ListDevices"
- // ListDevicesRequest generates a "aws/request.Request" representing the
- // client's request for the ListDevices operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See ListDevices for more information on using the ListDevices
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the ListDevicesRequest method.
- // req, resp := client.ListDevicesRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices
- func (c *IoT1ClickDevicesService) ListDevicesRequest(input *ListDevicesInput) (req *request.Request, output *ListDevicesOutput) {
- op := &request.Operation{
- Name: opListDevices,
- HTTPMethod: "GET",
- HTTPPath: "/devices",
- }
- if input == nil {
- input = &ListDevicesInput{}
- }
- output = &ListDevicesOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // ListDevices API operation for AWS IoT 1-Click Devices Service.
- //
- // Lists the 1-Click compatible devices associated with your AWS account.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation ListDevices for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeRangeNotSatisfiableException "RangeNotSatisfiableException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/ListDevices
- func (c *IoT1ClickDevicesService) ListDevices(input *ListDevicesInput) (*ListDevicesOutput, error) {
- req, out := c.ListDevicesRequest(input)
- return out, req.Send()
- }
- // ListDevicesWithContext is the same as ListDevices with the addition of
- // the ability to pass a context and additional request options.
- //
- // See ListDevices for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) ListDevicesWithContext(ctx aws.Context, input *ListDevicesInput, opts ...request.Option) (*ListDevicesOutput, error) {
- req, out := c.ListDevicesRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opUnclaimDevice = "UnclaimDevice"
- // UnclaimDeviceRequest generates a "aws/request.Request" representing the
- // client's request for the UnclaimDevice operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See UnclaimDevice for more information on using the UnclaimDevice
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the UnclaimDeviceRequest method.
- // req, resp := client.UnclaimDeviceRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice
- func (c *IoT1ClickDevicesService) UnclaimDeviceRequest(input *UnclaimDeviceInput) (req *request.Request, output *UnclaimDeviceOutput) {
- op := &request.Operation{
- Name: opUnclaimDevice,
- HTTPMethod: "PUT",
- HTTPPath: "/devices/{deviceId}/unclaim",
- }
- if input == nil {
- input = &UnclaimDeviceInput{}
- }
- output = &UnclaimDeviceOutput{}
- req = c.newRequest(op, input, output)
- return
- }
- // UnclaimDevice API operation for AWS IoT 1-Click Devices Service.
- //
- // Disassociates a device from your AWS account using its device ID.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation UnclaimDevice for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UnclaimDevice
- func (c *IoT1ClickDevicesService) UnclaimDevice(input *UnclaimDeviceInput) (*UnclaimDeviceOutput, error) {
- req, out := c.UnclaimDeviceRequest(input)
- return out, req.Send()
- }
- // UnclaimDeviceWithContext is the same as UnclaimDevice with the addition of
- // the ability to pass a context and additional request options.
- //
- // See UnclaimDevice for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) UnclaimDeviceWithContext(ctx aws.Context, input *UnclaimDeviceInput, opts ...request.Option) (*UnclaimDeviceOutput, error) {
- req, out := c.UnclaimDeviceRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- const opUpdateDeviceState = "UpdateDeviceState"
- // UpdateDeviceStateRequest generates a "aws/request.Request" representing the
- // client's request for the UpdateDeviceState operation. The "output" return
- // value will be populated with the request's response once the request completes
- // successfully.
- //
- // Use "Send" method on the returned Request to send the API call to the service.
- // the "output" return value is not valid until after Send returns without error.
- //
- // See UpdateDeviceState for more information on using the UpdateDeviceState
- // API call, and error handling.
- //
- // This method is useful when you want to inject custom logic or configuration
- // into the SDK's request lifecycle. Such as custom headers, or retry logic.
- //
- //
- // // Example sending a request using the UpdateDeviceStateRequest method.
- // req, resp := client.UpdateDeviceStateRequest(params)
- //
- // err := req.Send()
- // if err == nil { // resp is now filled
- // fmt.Println(resp)
- // }
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState
- func (c *IoT1ClickDevicesService) UpdateDeviceStateRequest(input *UpdateDeviceStateInput) (req *request.Request, output *UpdateDeviceStateOutput) {
- op := &request.Operation{
- Name: opUpdateDeviceState,
- HTTPMethod: "PUT",
- HTTPPath: "/devices/{deviceId}/state",
- }
- if input == nil {
- input = &UpdateDeviceStateInput{}
- }
- output = &UpdateDeviceStateOutput{}
- req = c.newRequest(op, input, output)
- req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler)
- return
- }
- // UpdateDeviceState API operation for AWS IoT 1-Click Devices Service.
- //
- // Using a Boolean value (true or false), this operation enables or disables
- // the device given a device ID.
- //
- // Returns awserr.Error for service API and SDK errors. Use runtime type assertions
- // with awserr.Error's Code and Message methods to get detailed information about
- // the error.
- //
- // See the AWS API reference guide for AWS IoT 1-Click Devices Service's
- // API operation UpdateDeviceState for usage and error information.
- //
- // Returned Error Codes:
- // * ErrCodeResourceNotFoundException "ResourceNotFoundException"
- //
- // * ErrCodeInvalidRequestException "InvalidRequestException"
- //
- // * ErrCodeInternalFailureException "InternalFailureException"
- //
- // See also, https://docs.aws.amazon.com/goto/WebAPI/devices-2018-05-14/UpdateDeviceState
- func (c *IoT1ClickDevicesService) UpdateDeviceState(input *UpdateDeviceStateInput) (*UpdateDeviceStateOutput, error) {
- req, out := c.UpdateDeviceStateRequest(input)
- return out, req.Send()
- }
- // UpdateDeviceStateWithContext is the same as UpdateDeviceState with the addition of
- // the ability to pass a context and additional request options.
- //
- // See UpdateDeviceState for details on how to use this API operation.
- //
- // The context must be non-nil and will be used for request cancellation. If
- // the context is nil a panic will occur. In the future the SDK may create
- // sub-contexts for http.Requests. See https://golang.org/pkg/context/
- // for more information on using Contexts.
- func (c *IoT1ClickDevicesService) UpdateDeviceStateWithContext(ctx aws.Context, input *UpdateDeviceStateInput, opts ...request.Option) (*UpdateDeviceStateOutput, error) {
- req, out := c.UpdateDeviceStateRequest(input)
- req.SetContext(ctx)
- req.ApplyOptions(opts...)
- return out, req.Send()
- }
- type Attributes struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s Attributes) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Attributes) GoString() string {
- return s.String()
- }
- type ClaimDevicesByClaimCodeInput struct {
- _ struct{} `type:"structure"`
- // ClaimCode is a required field
- ClaimCode *string `location:"uri" locationName:"claimCode" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s ClaimDevicesByClaimCodeInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ClaimDevicesByClaimCodeInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *ClaimDevicesByClaimCodeInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "ClaimDevicesByClaimCodeInput"}
- if s.ClaimCode == nil {
- invalidParams.Add(request.NewErrParamRequired("ClaimCode"))
- }
- if s.ClaimCode != nil && len(*s.ClaimCode) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("ClaimCode", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetClaimCode sets the ClaimCode field's value.
- func (s *ClaimDevicesByClaimCodeInput) SetClaimCode(v string) *ClaimDevicesByClaimCodeInput {
- s.ClaimCode = &v
- return s
- }
- type ClaimDevicesByClaimCodeOutput struct {
- _ struct{} `type:"structure"`
- // The claim code provided by the device manufacturer.
- ClaimCode *string `locationName:"claimCode" min:"12" type:"string"`
- // The total number of devices associated with the claim code that has been
- // processed in the claim request.
- Total *int64 `locationName:"total" type:"integer"`
- }
- // String returns the string representation
- func (s ClaimDevicesByClaimCodeOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ClaimDevicesByClaimCodeOutput) GoString() string {
- return s.String()
- }
- // SetClaimCode sets the ClaimCode field's value.
- func (s *ClaimDevicesByClaimCodeOutput) SetClaimCode(v string) *ClaimDevicesByClaimCodeOutput {
- s.ClaimCode = &v
- return s
- }
- // SetTotal sets the Total field's value.
- func (s *ClaimDevicesByClaimCodeOutput) SetTotal(v int64) *ClaimDevicesByClaimCodeOutput {
- s.Total = &v
- return s
- }
- type DescribeDeviceInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s DescribeDeviceInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DescribeDeviceInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *DescribeDeviceInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "DescribeDeviceInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *DescribeDeviceInput) SetDeviceId(v string) *DescribeDeviceInput {
- s.DeviceId = &v
- return s
- }
- type DescribeDeviceOutput struct {
- _ struct{} `type:"structure"`
- // Device details.
- DeviceDescription *DeviceDescription `locationName:"deviceDescription" type:"structure"`
- }
- // String returns the string representation
- func (s DescribeDeviceOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DescribeDeviceOutput) GoString() string {
- return s.String()
- }
- // SetDeviceDescription sets the DeviceDescription field's value.
- func (s *DescribeDeviceOutput) SetDeviceDescription(v *DeviceDescription) *DescribeDeviceOutput {
- s.DeviceDescription = v
- return s
- }
- type Device struct {
- _ struct{} `type:"structure"`
- // The user specified attributes associated with the device for an event.
- Attributes *Attributes `locationName:"attributes" type:"structure"`
- // The unique identifier of the device.
- DeviceId *string `locationName:"deviceId" type:"string"`
- // The device type, such as "button".
- Type *string `locationName:"type" type:"string"`
- }
- // String returns the string representation
- func (s Device) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s Device) GoString() string {
- return s.String()
- }
- // SetAttributes sets the Attributes field's value.
- func (s *Device) SetAttributes(v *Attributes) *Device {
- s.Attributes = v
- return s
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *Device) SetDeviceId(v string) *Device {
- s.DeviceId = &v
- return s
- }
- // SetType sets the Type field's value.
- func (s *Device) SetType(v string) *Device {
- s.Type = &v
- return s
- }
- type DeviceDescription struct {
- _ struct{} `type:"structure"`
- // An array of zero or more elements of DeviceAttribute objects providing user
- // specified device attributes.
- Attributes map[string]*string `locationName:"attributes" type:"map"`
- // The unique identifier of the device.
- DeviceId *string `locationName:"deviceId" type:"string"`
- // A Boolean value indicating whether or not the device is enabled.
- Enabled *bool `locationName:"enabled" type:"boolean"`
- // A value between 0 and 1 inclusive, representing the fraction of life remaining
- // for the device.
- RemainingLife *float64 `locationName:"remainingLife" type:"double"`
- // The type of the device, such as "button".
- Type *string `locationName:"type" type:"string"`
- }
- // String returns the string representation
- func (s DeviceDescription) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DeviceDescription) GoString() string {
- return s.String()
- }
- // SetAttributes sets the Attributes field's value.
- func (s *DeviceDescription) SetAttributes(v map[string]*string) *DeviceDescription {
- s.Attributes = v
- return s
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *DeviceDescription) SetDeviceId(v string) *DeviceDescription {
- s.DeviceId = &v
- return s
- }
- // SetEnabled sets the Enabled field's value.
- func (s *DeviceDescription) SetEnabled(v bool) *DeviceDescription {
- s.Enabled = &v
- return s
- }
- // SetRemainingLife sets the RemainingLife field's value.
- func (s *DeviceDescription) SetRemainingLife(v float64) *DeviceDescription {
- s.RemainingLife = &v
- return s
- }
- // SetType sets the Type field's value.
- func (s *DeviceDescription) SetType(v string) *DeviceDescription {
- s.Type = &v
- return s
- }
- type DeviceEvent struct {
- _ struct{} `type:"structure"`
- // An object representing the device associated with the event.
- Device *Device `locationName:"device" type:"structure"`
- // A serialized JSON object representing the device-type specific event.
- StdEvent *string `locationName:"stdEvent" type:"string"`
- }
- // String returns the string representation
- func (s DeviceEvent) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DeviceEvent) GoString() string {
- return s.String()
- }
- // SetDevice sets the Device field's value.
- func (s *DeviceEvent) SetDevice(v *Device) *DeviceEvent {
- s.Device = v
- return s
- }
- // SetStdEvent sets the StdEvent field's value.
- func (s *DeviceEvent) SetStdEvent(v string) *DeviceEvent {
- s.StdEvent = &v
- return s
- }
- type DeviceMethod struct {
- _ struct{} `type:"structure"`
- // The type of the device, such as "button".
- DeviceType *string `locationName:"deviceType" type:"string"`
- // The name of the method applicable to the deviceType.
- MethodName *string `locationName:"methodName" type:"string"`
- }
- // String returns the string representation
- func (s DeviceMethod) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s DeviceMethod) GoString() string {
- return s.String()
- }
- // SetDeviceType sets the DeviceType field's value.
- func (s *DeviceMethod) SetDeviceType(v string) *DeviceMethod {
- s.DeviceType = &v
- return s
- }
- // SetMethodName sets the MethodName field's value.
- func (s *DeviceMethod) SetMethodName(v string) *DeviceMethod {
- s.MethodName = &v
- return s
- }
- type FinalizeDeviceClaimInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s FinalizeDeviceClaimInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s FinalizeDeviceClaimInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *FinalizeDeviceClaimInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "FinalizeDeviceClaimInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *FinalizeDeviceClaimInput) SetDeviceId(v string) *FinalizeDeviceClaimInput {
- s.DeviceId = &v
- return s
- }
- type FinalizeDeviceClaimOutput struct {
- _ struct{} `type:"structure"`
- State *string `locationName:"state" type:"string"`
- }
- // String returns the string representation
- func (s FinalizeDeviceClaimOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s FinalizeDeviceClaimOutput) GoString() string {
- return s.String()
- }
- // SetState sets the State field's value.
- func (s *FinalizeDeviceClaimOutput) SetState(v string) *FinalizeDeviceClaimOutput {
- s.State = &v
- return s
- }
- type GetDeviceMethodsInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s GetDeviceMethodsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s GetDeviceMethodsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *GetDeviceMethodsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "GetDeviceMethodsInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *GetDeviceMethodsInput) SetDeviceId(v string) *GetDeviceMethodsInput {
- s.DeviceId = &v
- return s
- }
- type GetDeviceMethodsOutput struct {
- _ struct{} `type:"structure"`
- // List of available device APIs.
- DeviceMethods []*DeviceMethod `locationName:"deviceMethods" type:"list"`
- }
- // String returns the string representation
- func (s GetDeviceMethodsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s GetDeviceMethodsOutput) GoString() string {
- return s.String()
- }
- // SetDeviceMethods sets the DeviceMethods field's value.
- func (s *GetDeviceMethodsOutput) SetDeviceMethods(v []*DeviceMethod) *GetDeviceMethodsOutput {
- s.DeviceMethods = v
- return s
- }
- type InitiateDeviceClaimInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s InitiateDeviceClaimInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s InitiateDeviceClaimInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *InitiateDeviceClaimInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "InitiateDeviceClaimInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *InitiateDeviceClaimInput) SetDeviceId(v string) *InitiateDeviceClaimInput {
- s.DeviceId = &v
- return s
- }
- type InitiateDeviceClaimOutput struct {
- _ struct{} `type:"structure"`
- State *string `locationName:"state" type:"string"`
- }
- // String returns the string representation
- func (s InitiateDeviceClaimOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s InitiateDeviceClaimOutput) GoString() string {
- return s.String()
- }
- // SetState sets the State field's value.
- func (s *InitiateDeviceClaimOutput) SetState(v string) *InitiateDeviceClaimOutput {
- s.State = &v
- return s
- }
- type InvokeDeviceMethodInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- // The device method to invoke.
- DeviceMethod *DeviceMethod `locationName:"deviceMethod" type:"structure"`
- // A JSON encoded string containing the device method request parameters.
- DeviceMethodParameters *string `locationName:"deviceMethodParameters" type:"string"`
- }
- // String returns the string representation
- func (s InvokeDeviceMethodInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s InvokeDeviceMethodInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *InvokeDeviceMethodInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "InvokeDeviceMethodInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *InvokeDeviceMethodInput) SetDeviceId(v string) *InvokeDeviceMethodInput {
- s.DeviceId = &v
- return s
- }
- // SetDeviceMethod sets the DeviceMethod field's value.
- func (s *InvokeDeviceMethodInput) SetDeviceMethod(v *DeviceMethod) *InvokeDeviceMethodInput {
- s.DeviceMethod = v
- return s
- }
- // SetDeviceMethodParameters sets the DeviceMethodParameters field's value.
- func (s *InvokeDeviceMethodInput) SetDeviceMethodParameters(v string) *InvokeDeviceMethodInput {
- s.DeviceMethodParameters = &v
- return s
- }
- type InvokeDeviceMethodOutput struct {
- _ struct{} `type:"structure"`
- // A JSON encoded string containing the device method response.
- DeviceMethodResponse *string `locationName:"deviceMethodResponse" type:"string"`
- }
- // String returns the string representation
- func (s InvokeDeviceMethodOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s InvokeDeviceMethodOutput) GoString() string {
- return s.String()
- }
- // SetDeviceMethodResponse sets the DeviceMethodResponse field's value.
- func (s *InvokeDeviceMethodOutput) SetDeviceMethodResponse(v string) *InvokeDeviceMethodOutput {
- s.DeviceMethodResponse = &v
- return s
- }
- type ListDeviceEventsInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- // FromTimeStamp is a required field
- FromTimeStamp *time.Time `location:"querystring" locationName:"fromTimeStamp" type:"timestamp" timestampFormat:"iso8601" required:"true"`
- MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
- NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
- // ToTimeStamp is a required field
- ToTimeStamp *time.Time `location:"querystring" locationName:"toTimeStamp" type:"timestamp" timestampFormat:"iso8601" required:"true"`
- }
- // String returns the string representation
- func (s ListDeviceEventsInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListDeviceEventsInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *ListDeviceEventsInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "ListDeviceEventsInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if s.FromTimeStamp == nil {
- invalidParams.Add(request.NewErrParamRequired("FromTimeStamp"))
- }
- if s.MaxResults != nil && *s.MaxResults < 1 {
- invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
- }
- if s.ToTimeStamp == nil {
- invalidParams.Add(request.NewErrParamRequired("ToTimeStamp"))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *ListDeviceEventsInput) SetDeviceId(v string) *ListDeviceEventsInput {
- s.DeviceId = &v
- return s
- }
- // SetFromTimeStamp sets the FromTimeStamp field's value.
- func (s *ListDeviceEventsInput) SetFromTimeStamp(v time.Time) *ListDeviceEventsInput {
- s.FromTimeStamp = &v
- return s
- }
- // SetMaxResults sets the MaxResults field's value.
- func (s *ListDeviceEventsInput) SetMaxResults(v int64) *ListDeviceEventsInput {
- s.MaxResults = &v
- return s
- }
- // SetNextToken sets the NextToken field's value.
- func (s *ListDeviceEventsInput) SetNextToken(v string) *ListDeviceEventsInput {
- s.NextToken = &v
- return s
- }
- // SetToTimeStamp sets the ToTimeStamp field's value.
- func (s *ListDeviceEventsInput) SetToTimeStamp(v time.Time) *ListDeviceEventsInput {
- s.ToTimeStamp = &v
- return s
- }
- type ListDeviceEventsOutput struct {
- _ struct{} `type:"structure"`
- Events []*DeviceEvent `locationName:"events" type:"list"`
- NextToken *string `locationName:"nextToken" type:"string"`
- }
- // String returns the string representation
- func (s ListDeviceEventsOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListDeviceEventsOutput) GoString() string {
- return s.String()
- }
- // SetEvents sets the Events field's value.
- func (s *ListDeviceEventsOutput) SetEvents(v []*DeviceEvent) *ListDeviceEventsOutput {
- s.Events = v
- return s
- }
- // SetNextToken sets the NextToken field's value.
- func (s *ListDeviceEventsOutput) SetNextToken(v string) *ListDeviceEventsOutput {
- s.NextToken = &v
- return s
- }
- type ListDevicesInput struct {
- _ struct{} `type:"structure"`
- DeviceType *string `location:"querystring" locationName:"deviceType" type:"string"`
- MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"`
- NextToken *string `location:"querystring" locationName:"nextToken" type:"string"`
- }
- // String returns the string representation
- func (s ListDevicesInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListDevicesInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *ListDevicesInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "ListDevicesInput"}
- if s.MaxResults != nil && *s.MaxResults < 1 {
- invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceType sets the DeviceType field's value.
- func (s *ListDevicesInput) SetDeviceType(v string) *ListDevicesInput {
- s.DeviceType = &v
- return s
- }
- // SetMaxResults sets the MaxResults field's value.
- func (s *ListDevicesInput) SetMaxResults(v int64) *ListDevicesInput {
- s.MaxResults = &v
- return s
- }
- // SetNextToken sets the NextToken field's value.
- func (s *ListDevicesInput) SetNextToken(v string) *ListDevicesInput {
- s.NextToken = &v
- return s
- }
- type ListDevicesOutput struct {
- _ struct{} `type:"structure"`
- // A list of devices.
- Devices []*DeviceDescription `locationName:"devices" type:"list"`
- // The token to retrieve the next set of results.
- NextToken *string `locationName:"nextToken" type:"string"`
- }
- // String returns the string representation
- func (s ListDevicesOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s ListDevicesOutput) GoString() string {
- return s.String()
- }
- // SetDevices sets the Devices field's value.
- func (s *ListDevicesOutput) SetDevices(v []*DeviceDescription) *ListDevicesOutput {
- s.Devices = v
- return s
- }
- // SetNextToken sets the NextToken field's value.
- func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput {
- s.NextToken = &v
- return s
- }
- type UnclaimDeviceInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- }
- // String returns the string representation
- func (s UnclaimDeviceInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UnclaimDeviceInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *UnclaimDeviceInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "UnclaimDeviceInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *UnclaimDeviceInput) SetDeviceId(v string) *UnclaimDeviceInput {
- s.DeviceId = &v
- return s
- }
- type UnclaimDeviceOutput struct {
- _ struct{} `type:"structure"`
- State *string `locationName:"state" type:"string"`
- }
- // String returns the string representation
- func (s UnclaimDeviceOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UnclaimDeviceOutput) GoString() string {
- return s.String()
- }
- // SetState sets the State field's value.
- func (s *UnclaimDeviceOutput) SetState(v string) *UnclaimDeviceOutput {
- s.State = &v
- return s
- }
- type UpdateDeviceStateInput struct {
- _ struct{} `type:"structure"`
- // DeviceId is a required field
- DeviceId *string `location:"uri" locationName:"deviceId" type:"string" required:"true"`
- // If true, the device is enabled. If false, the device is disabled.
- Enabled *bool `locationName:"enabled" type:"boolean"`
- }
- // String returns the string representation
- func (s UpdateDeviceStateInput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UpdateDeviceStateInput) GoString() string {
- return s.String()
- }
- // Validate inspects the fields of the type to determine if they are valid.
- func (s *UpdateDeviceStateInput) Validate() error {
- invalidParams := request.ErrInvalidParams{Context: "UpdateDeviceStateInput"}
- if s.DeviceId == nil {
- invalidParams.Add(request.NewErrParamRequired("DeviceId"))
- }
- if s.DeviceId != nil && len(*s.DeviceId) < 1 {
- invalidParams.Add(request.NewErrParamMinLen("DeviceId", 1))
- }
- if invalidParams.Len() > 0 {
- return invalidParams
- }
- return nil
- }
- // SetDeviceId sets the DeviceId field's value.
- func (s *UpdateDeviceStateInput) SetDeviceId(v string) *UpdateDeviceStateInput {
- s.DeviceId = &v
- return s
- }
- // SetEnabled sets the Enabled field's value.
- func (s *UpdateDeviceStateInput) SetEnabled(v bool) *UpdateDeviceStateInput {
- s.Enabled = &v
- return s
- }
- type UpdateDeviceStateOutput struct {
- _ struct{} `type:"structure"`
- }
- // String returns the string representation
- func (s UpdateDeviceStateOutput) String() string {
- return awsutil.Prettify(s)
- }
- // GoString returns the string representation
- func (s UpdateDeviceStateOutput) GoString() string {
- return s.String()
- }
|