diff --git a/codegen/sdk-codegen/aws-models/iot-1click-devices-service.json b/codegen/sdk-codegen/aws-models/iot-1click-devices-service.json deleted file mode 100644 index 5f09660ca51..00000000000 --- a/codegen/sdk-codegen/aws-models/iot-1click-devices-service.json +++ /dev/null @@ -1,1945 +0,0 @@ -{ - "smithy": "2.0", - "metadata": { - "suppressions": [ - { - "id": "HttpMethodSemantics", - "namespace": "*" - }, - { - "id": "HttpResponseCodeSemantics", - "namespace": "*" - }, - { - "id": "PaginatedTrait", - "namespace": "*" - }, - { - "id": "HttpHeaderTrait", - "namespace": "*" - }, - { - "id": "HttpUriConflict", - "namespace": "*" - }, - { - "id": "Service", - "namespace": "*" - } - ] - }, - "shapes": { - "com.amazonaws.iot1clickdevicesservice#Attributes": { - "type": "structure", - "members": {} - }, - "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCode": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCodeRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCodeResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#ForbiddenException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - } - ], - "traits": { - "smithy.api#documentation": "

Adds device(s) to your account (i.e., claim one or more devices) if and only if you\n received a claim code with the device(s).

", - "smithy.api#http": { - "method": "PUT", - "uri": "/claims/{ClaimCode}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCodeRequest": { - "type": "structure", - "members": { - "ClaimCode": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The claim code, starting with \"C-\", as provided by the device manufacturer.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCodeResponse": { - "type": "structure", - "members": { - "ClaimCode": { - "target": "com.amazonaws.iot1clickdevicesservice#__stringMin12Max40", - "traits": { - "smithy.api#documentation": "

The claim code provided by the device manufacturer.

", - "smithy.api#jsonName": "claimCode" - } - }, - "Total": { - "target": "com.amazonaws.iot1clickdevicesservice#__integer", - "traits": { - "smithy.api#documentation": "

The total number of devices associated with the claim code that has been processed in\n the claim request.

", - "smithy.api#jsonName": "total" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#DescribeDevice": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#DescribeDeviceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#DescribeDeviceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Given a device ID, returns a DescribeDeviceResponse object describing the\n details of the device.

", - "smithy.api#http": { - "method": "GET", - "uri": "/devices/{DeviceId}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#DescribeDeviceRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#DescribeDeviceResponse": { - "type": "structure", - "members": { - "DeviceDescription": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceDescription", - "traits": { - "smithy.api#documentation": "

Device details.

", - "smithy.api#jsonName": "deviceDescription" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#Device": { - "type": "structure", - "members": { - "Attributes": { - "target": "com.amazonaws.iot1clickdevicesservice#Attributes", - "traits": { - "smithy.api#documentation": "

The user specified attributes associated with the device for an event.

", - "smithy.api#jsonName": "attributes" - } - }, - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#jsonName": "deviceId" - } - }, - "Type": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The device type, such as \"button\".

", - "smithy.api#jsonName": "type" - } - } - } - }, - "com.amazonaws.iot1clickdevicesservice#DeviceAttributes": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickdevicesservice#__string" - }, - "value": { - "target": "com.amazonaws.iot1clickdevicesservice#__string" - }, - "traits": { - "smithy.api#documentation": "

\n DeviceAttributes is a string-to-string map specified by the user.

" - } - }, - "com.amazonaws.iot1clickdevicesservice#DeviceDescription": { - "type": "structure", - "members": { - "Arn": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The ARN of the device.

", - "smithy.api#jsonName": "arn" - } - }, - "Attributes": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceAttributes", - "traits": { - "smithy.api#documentation": "

An array of zero or more elements of DeviceAttribute objects providing\n user specified device attributes.

", - "smithy.api#jsonName": "attributes" - } - }, - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#jsonName": "deviceId" - } - }, - "Enabled": { - "target": "com.amazonaws.iot1clickdevicesservice#__boolean", - "traits": { - "smithy.api#documentation": "

A Boolean value indicating whether or not the device is enabled.

", - "smithy.api#jsonName": "enabled" - } - }, - "RemainingLife": { - "target": "com.amazonaws.iot1clickdevicesservice#__doubleMin0Max100", - "traits": { - "smithy.api#documentation": "

A value between 0 and 1 inclusive, representing the fraction of life remaining for the\n device.

", - "smithy.api#jsonName": "remainingLife" - } - }, - "Type": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The type of the device, such as \"button\".

", - "smithy.api#jsonName": "type" - } - }, - "Tags": { - "target": "com.amazonaws.iot1clickdevicesservice#__mapOf__string", - "traits": { - "smithy.api#documentation": "

The tags currently associated with the AWS IoT 1-Click device.

", - "smithy.api#jsonName": "tags" - } - } - } - }, - "com.amazonaws.iot1clickdevicesservice#DeviceEvent": { - "type": "structure", - "members": { - "Device": { - "target": "com.amazonaws.iot1clickdevicesservice#Device", - "traits": { - "smithy.api#documentation": "

An object representing the device associated with the event.

", - "smithy.api#jsonName": "device" - } - }, - "StdEvent": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

A serialized JSON object representing the device-type specific event.

", - "smithy.api#jsonName": "stdEvent" - } - } - } - }, - "com.amazonaws.iot1clickdevicesservice#DeviceMethod": { - "type": "structure", - "members": { - "DeviceType": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The type of the device, such as \"button\".

", - "smithy.api#jsonName": "deviceType" - } - }, - "MethodName": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The name of the method applicable to the deviceType.

", - "smithy.api#jsonName": "methodName" - } - } - } - }, - "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaim": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaimRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaimResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceConflictException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Given a device ID, finalizes the claim request for the associated device.

\n

Claiming a device consists of initiating a claim, then publishing a device event,\n and finalizing the claim. For a device of type button, a device event can\n be published by simply clicking the device.

\n
", - "smithy.api#http": { - "method": "PUT", - "uri": "/devices/{DeviceId}/finalize-claim", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaimRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "Tags": { - "target": "com.amazonaws.iot1clickdevicesservice#__mapOf__string", - "traits": { - "smithy.api#documentation": "

A collection of key/value pairs defining the resource tags. For example, {\n \"tags\": {\"key1\": \"value1\", \"key2\": \"value2\"} }. For more information, see AWS\n Tagging Strategies.

\n \n

", - "smithy.api#jsonName": "tags" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaimResponse": { - "type": "structure", - "members": { - "State": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The device's final claim state.

", - "smithy.api#jsonName": "state" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ForbiddenException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

403

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The 403 error message returned by the web server.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 403 - } - }, - "com.amazonaws.iot1clickdevicesservice#GetDeviceMethods": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#GetDeviceMethodsRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#GetDeviceMethodsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Given a device ID, returns the invokable methods associated with the device.

", - "smithy.api#http": { - "method": "GET", - "uri": "/devices/{DeviceId}/methods", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#GetDeviceMethodsRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#GetDeviceMethodsResponse": { - "type": "structure", - "members": { - "DeviceMethods": { - "target": "com.amazonaws.iot1clickdevicesservice#__listOfDeviceMethod", - "traits": { - "smithy.api#documentation": "

List of available device APIs.

", - "smithy.api#jsonName": "deviceMethods" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaim": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaimRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaimResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceConflictException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Given a device ID, initiates a claim request for the associated device.

\n

Claiming a device consists of initiating a claim, then publishing a device event,\n and finalizing the claim. For a device of type button, a device event can\n be published by simply clicking the device.

\n
", - "smithy.api#http": { - "method": "PUT", - "uri": "/devices/{DeviceId}/initiate-claim", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaimRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaimResponse": { - "type": "structure", - "members": { - "State": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The device's final claim state.

", - "smithy.api#jsonName": "state" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#InternalFailureException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

500

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The 500 error message returned by the web server.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "server", - "smithy.api#httpError": 500 - } - }, - "com.amazonaws.iot1clickdevicesservice#InvalidRequestException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

400

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The 400 error message returned by the web server.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 400 - } - }, - "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethod": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethodRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethodResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceConflictException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Given a device ID, issues a request to invoke a named device method (with possible\n parameters). See the \"Example POST\" code snippet below.

", - "smithy.api#http": { - "method": "POST", - "uri": "/devices/{DeviceId}/methods", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethodRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "DeviceMethod": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceMethod", - "traits": { - "smithy.api#documentation": "

The device method to invoke.

", - "smithy.api#jsonName": "deviceMethod" - } - }, - "DeviceMethodParameters": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

A JSON encoded string containing the device method request parameters.

", - "smithy.api#jsonName": "deviceMethodParameters" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethodResponse": { - "type": "structure", - "members": { - "DeviceMethodResponse": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

A JSON encoded string containing the device method response.

", - "smithy.api#jsonName": "deviceMethodResponse" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#IoT1ClickDevicesService": { - "type": "service", - "version": "2018-05-14", - "operations": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#ClaimDevicesByClaimCode" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#DescribeDevice" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#FinalizeDeviceClaim" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#GetDeviceMethods" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InitiateDeviceClaim" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvokeDeviceMethod" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ListDeviceEvents" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ListDevices" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ListTagsForResource" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#TagResource" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#UnclaimDevice" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#UntagResource" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#UpdateDeviceState" - } - ], - "traits": { - "aws.api#service": { - "sdkId": "IoT 1Click Devices Service", - "arnNamespace": "iot1click", - "cloudFormationName": "IoT1ClickDevicesService", - "cloudTrailEventSource": "iot1clickdevicesservice.amazonaws.com", - "docId": "devices-2018-05-14", - "endpointPrefix": "devices.iot1click" - }, - "aws.auth#sigv4": { - "name": "iot1click" - }, - "aws.protocols#restJson1": {}, - "smithy.api#documentation": "

Describes all of the AWS IoT 1-Click device-related API operations for the service.\n Also provides sample requests, responses, and errors for the supported web services\n protocols.

", - "smithy.api#title": "AWS IoT 1-Click Devices Service", - "smithy.rules#endpointRuleSet": { - "version": "1.0", - "parameters": { - "Region": { - "builtIn": "AWS::Region", - "required": false, - "documentation": "The AWS region used to dispatch the request.", - "type": "String" - }, - "UseDualStack": { - "builtIn": "AWS::UseDualStack", - "required": true, - "default": false, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "Boolean" - }, - "UseFIPS": { - "builtIn": "AWS::UseFIPS", - "required": true, - "default": false, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "Boolean" - }, - "Endpoint": { - "builtIn": "SDK::Endpoint", - "required": false, - "documentation": "Override the endpoint used to send this request", - "type": "String" - } - }, - "rules": [ - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Endpoint" - } - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - }, - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Region" - } - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "aws.partition", - "argv": [ - { - "ref": "Region" - } - ], - "assign": "PartitionResult" - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://devices.iot1click-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - }, - { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ], - "type": "tree" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - }, - true - ] - } - ], - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://devices.iot1click-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ], - "type": "tree" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://devices.iot1click.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" - } - ], - "type": "tree" - }, - { - "conditions": [], - "endpoint": { - "url": "https://devices.iot1click.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ], - "type": "tree" - } - ], - "type": "tree" - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" - } - ] - }, - "smithy.rules#endpointTests": { - "testCases": [ - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click-fips.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://devices.iot1click.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips enabled and dualstack disabled", - "expect": { - "error": "Invalid Configuration: FIPS and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips disabled and dualstack enabled", - "expect": { - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "Missing region", - "expect": { - "error": "Invalid Configuration: Missing Region" - } - } - ], - "version": "1.0" - } - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDeviceEvents": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#ListDeviceEventsRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#ListDeviceEventsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Using a device ID, returns a DeviceEventsResponse object containing an\n array of events for the device.

", - "smithy.api#http": { - "method": "GET", - "uri": "/devices/{DeviceId}/events", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDeviceEventsRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "FromTimeStamp": { - "target": "com.amazonaws.iot1clickdevicesservice#__timestampIso8601", - "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The start date for the device event query, in ISO8061 format. For example,\n 2018-03-28T15:45:12.880Z\n

", - "smithy.api#httpQuery": "fromTimeStamp", - "smithy.api#required": {} - } - }, - "MaxResults": { - "target": "com.amazonaws.iot1clickdevicesservice#MaxResults", - "traits": { - "smithy.api#documentation": "

The maximum number of results to return per request. If not set, a default value of\n 100 is used.

", - "smithy.api#httpQuery": "maxResults" - } - }, - "NextToken": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#httpQuery": "nextToken" - } - }, - "ToTimeStamp": { - "target": "com.amazonaws.iot1clickdevicesservice#__timestampIso8601", - "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

The end date for the device event query, in ISO8061 format. For example,\n 2018-03-28T15:45:12.880Z\n

", - "smithy.api#httpQuery": "toTimeStamp", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDeviceEventsResponse": { - "type": "structure", - "members": { - "Events": { - "target": "com.amazonaws.iot1clickdevicesservice#__listOfDeviceEvent", - "traits": { - "smithy.api#documentation": "

An array of zero or more elements describing the event(s) associated with the\n device.

", - "smithy.api#jsonName": "events" - } - }, - "NextToken": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#jsonName": "nextToken" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDevices": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#ListDevicesRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#ListDevicesResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException" - } - ], - "traits": { - "smithy.api#documentation": "

Lists the 1-Click compatible devices associated with your AWS account.

", - "smithy.api#http": { - "method": "GET", - "uri": "/devices", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDevicesRequest": { - "type": "structure", - "members": { - "DeviceType": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The type of the device, such as \"button\".

", - "smithy.api#httpQuery": "deviceType" - } - }, - "MaxResults": { - "target": "com.amazonaws.iot1clickdevicesservice#MaxResults", - "traits": { - "smithy.api#documentation": "

The maximum number of results to return per request. If not set, a default value of\n 100 is used.

", - "smithy.api#httpQuery": "maxResults" - } - }, - "NextToken": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#httpQuery": "nextToken" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ListDevicesResponse": { - "type": "structure", - "members": { - "Devices": { - "target": "com.amazonaws.iot1clickdevicesservice#__listOfDeviceDescription", - "traits": { - "smithy.api#documentation": "

A list of devices.

", - "smithy.api#jsonName": "devices" - } - }, - "NextToken": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#jsonName": "nextToken" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ListTagsForResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#ListTagsForResourceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#ListTagsForResourceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Lists the tags associated with the specified resource ARN.

", - "smithy.api#http": { - "method": "GET", - "uri": "/tags/{ResourceArn}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#ListTagsForResourceRequest": { - "type": "structure", - "members": { - "ResourceArn": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The ARN of the resource.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#ListTagsForResourceResponse": { - "type": "structure", - "members": { - "Tags": { - "target": "com.amazonaws.iot1clickdevicesservice#__mapOf__string", - "traits": { - "smithy.api#documentation": "

A collection of key/value pairs defining the resource tags. For example, {\n \"tags\": {\"key1\": \"value1\", \"key2\": \"value2\"} }. For more information, see AWS\n Tagging Strategies.

\n \n

", - "smithy.api#jsonName": "tags" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#MaxResults": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 1, - "max": 250 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#PreconditionFailedException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

412

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

An error message explaining the error or its remedy.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 412 - } - }, - "com.amazonaws.iot1clickdevicesservice#RangeNotSatisfiableException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

416

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The requested number of results specified by nextToken cannot be\n satisfied.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 416 - } - }, - "com.amazonaws.iot1clickdevicesservice#ResourceConflictException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

409

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

An error message explaining the error or its remedy.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 409 - } - }, - "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException": { - "type": "structure", - "members": { - "Code": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

404

", - "smithy.api#jsonName": "code" - } - }, - "Message": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The requested device could not be found.

", - "smithy.api#jsonName": "message" - } - } - }, - "traits": { - "smithy.api#error": "client", - "smithy.api#httpError": 404 - } - }, - "com.amazonaws.iot1clickdevicesservice#TagResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#TagResourceRequest" - }, - "output": { - "target": "smithy.api#Unit" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Adds or updates the tags associated with the resource ARN. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per\n resource.

", - "smithy.api#http": { - "method": "POST", - "uri": "/tags/{ResourceArn}", - "code": 204 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#TagResourceRequest": { - "type": "structure", - "members": { - "ResourceArn": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The ARN of the resource.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "Tags": { - "target": "com.amazonaws.iot1clickdevicesservice#__mapOf__string", - "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

A collection of key/value pairs defining the resource tags. For example, {\n \"tags\": {\"key1\": \"value1\", \"key2\": \"value2\"} }. For more information, see AWS\n Tagging Strategies.

\n \n

", - "smithy.api#jsonName": "tags", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#UnclaimDevice": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#UnclaimDeviceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#UnclaimDeviceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Disassociates a device from your AWS account using its device ID.

", - "smithy.api#http": { - "method": "PUT", - "uri": "/devices/{DeviceId}/unclaim", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#UnclaimDeviceRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#UnclaimDeviceResponse": { - "type": "structure", - "members": { - "State": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The device's final claim state.

", - "smithy.api#jsonName": "state" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#UntagResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#UntagResourceRequest" - }, - "output": { - "target": "smithy.api#Unit" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Using tag keys, deletes the tags (key/value pairs) associated with the specified\n resource ARN.

", - "smithy.api#http": { - "method": "DELETE", - "uri": "/tags/{ResourceArn}", - "code": 204 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#UntagResourceRequest": { - "type": "structure", - "members": { - "ResourceArn": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The ARN of the resource.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "TagKeys": { - "target": "com.amazonaws.iot1clickdevicesservice#__listOf__string", - "traits": { - "smithy.api#clientOptional": {}, - "smithy.api#documentation": "

A collections of tag keys. For example, {\"key1\",\"key2\"}

", - "smithy.api#httpQuery": "tagKeys", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#UpdateDeviceState": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickdevicesservice#UpdateDeviceStateRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickdevicesservice#UpdateDeviceStateResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickdevicesservice#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickdevicesservice#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Using a Boolean value (true or false), this operation\n enables or disables the device given a device ID.

", - "smithy.api#http": { - "method": "PUT", - "uri": "/devices/{DeviceId}/state", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#UpdateDeviceStateRequest": { - "type": "structure", - "members": { - "DeviceId": { - "target": "com.amazonaws.iot1clickdevicesservice#__string", - "traits": { - "smithy.api#documentation": "

The unique identifier of the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "Enabled": { - "target": "com.amazonaws.iot1clickdevicesservice#__boolean", - "traits": { - "smithy.api#documentation": "

If true, the device is enabled. If false, the device is\n disabled.

", - "smithy.api#jsonName": "enabled" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#UpdateDeviceStateResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickdevicesservice#__boolean": { - "type": "boolean" - }, - "com.amazonaws.iot1clickdevicesservice#__doubleMin0Max100": { - "type": "double" - }, - "com.amazonaws.iot1clickdevicesservice#__integer": { - "type": "integer" - }, - "com.amazonaws.iot1clickdevicesservice#__listOfDeviceDescription": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceDescription" - } - }, - "com.amazonaws.iot1clickdevicesservice#__listOfDeviceEvent": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceEvent" - } - }, - "com.amazonaws.iot1clickdevicesservice#__listOfDeviceMethod": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickdevicesservice#DeviceMethod" - } - }, - "com.amazonaws.iot1clickdevicesservice#__listOf__string": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickdevicesservice#__string" - } - }, - "com.amazonaws.iot1clickdevicesservice#__mapOf__string": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickdevicesservice#__string" - }, - "value": { - "target": "com.amazonaws.iot1clickdevicesservice#__string" - } - }, - "com.amazonaws.iot1clickdevicesservice#__string": { - "type": "string" - }, - "com.amazonaws.iot1clickdevicesservice#__stringMin12Max40": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 12, - "max": 40 - } - } - }, - "com.amazonaws.iot1clickdevicesservice#__timestampIso8601": { - "type": "timestamp", - "traits": { - "smithy.api#timestampFormat": "date-time" - } - } - } -} diff --git a/codegen/sdk-codegen/aws-models/iot-1click-projects.json b/codegen/sdk-codegen/aws-models/iot-1click-projects.json deleted file mode 100644 index 941ea127e32..00000000000 --- a/codegen/sdk-codegen/aws-models/iot-1click-projects.json +++ /dev/null @@ -1,2429 +0,0 @@ -{ - "smithy": "2.0", - "metadata": { - "suppressions": [ - { - "id": "HttpMethodSemantics", - "namespace": "*" - }, - { - "id": "HttpResponseCodeSemantics", - "namespace": "*" - }, - { - "id": "PaginatedTrait", - "namespace": "*" - }, - { - "id": "HttpHeaderTrait", - "namespace": "*" - }, - { - "id": "HttpUriConflict", - "namespace": "*" - }, - { - "id": "Service", - "namespace": "*" - } - ] - }, - "shapes": { - "com.amazonaws.iot1clickprojects#AWSIoT1ClickProjects": { - "type": "service", - "version": "2018-05-14", - "operations": [ - { - "target": "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#CreatePlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#CreateProject" - }, - { - "target": "com.amazonaws.iot1clickprojects#DeletePlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#DeleteProject" - }, - { - "target": "com.amazonaws.iot1clickprojects#DescribePlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#DescribeProject" - }, - { - "target": "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#GetDevicesInPlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#ListPlacements" - }, - { - "target": "com.amazonaws.iot1clickprojects#ListProjects" - }, - { - "target": "com.amazonaws.iot1clickprojects#ListTagsForResource" - }, - { - "target": "com.amazonaws.iot1clickprojects#TagResource" - }, - { - "target": "com.amazonaws.iot1clickprojects#UntagResource" - }, - { - "target": "com.amazonaws.iot1clickprojects#UpdatePlacement" - }, - { - "target": "com.amazonaws.iot1clickprojects#UpdateProject" - } - ], - "traits": { - "aws.api#service": { - "sdkId": "IoT 1Click Projects", - "arnNamespace": "iot1click", - "cloudFormationName": "IoT1Click", - "cloudTrailEventSource": "iot1clickprojects.amazonaws.com", - "docId": "iot1click-projects-2018-05-14", - "endpointPrefix": "projects.iot1click" - }, - "aws.auth#sigv4": { - "name": "iot1click" - }, - "aws.protocols#restJson1": {}, - "smithy.api#documentation": "

The AWS IoT 1-Click Projects API Reference

", - "smithy.api#title": "AWS IoT 1-Click Projects Service", - "smithy.rules#endpointRuleSet": { - "version": "1.0", - "parameters": { - "Region": { - "builtIn": "AWS::Region", - "required": false, - "documentation": "The AWS region used to dispatch the request.", - "type": "String" - }, - "UseDualStack": { - "builtIn": "AWS::UseDualStack", - "required": true, - "default": false, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "Boolean" - }, - "UseFIPS": { - "builtIn": "AWS::UseFIPS", - "required": true, - "default": false, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "Boolean" - }, - "Endpoint": { - "builtIn": "SDK::Endpoint", - "required": false, - "documentation": "Override the endpoint used to send this request", - "type": "String" - } - }, - "rules": [ - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Endpoint" - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Region" - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "aws.partition", - "argv": [ - { - "ref": "Region" - } - ], - "assign": "PartitionResult" - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://projects.iot1click-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://projects.iot1click-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://projects.iot1click.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" - } - ] - }, - { - "conditions": [], - "endpoint": { - "url": "https://projects.iot1click.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" - } - ] - }, - "smithy.rules#endpointTests": { - "testCases": [ - { - "documentation": "For region ap-northeast-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.ap-northeast-1.amazonaws.com" - } - }, - "params": { - "Region": "ap-northeast-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region eu-central-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.eu-central-1.amazonaws.com" - } - }, - "params": { - "Region": "eu-central-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.eu-west-1.amazonaws.com" - } - }, - "params": { - "Region": "eu-west-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region eu-west-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.eu-west-2.amazonaws.com" - } - }, - "params": { - "Region": "eu-west-2", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-east-2.amazonaws.com" - } - }, - "params": { - "Region": "us-east-2", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-west-2.amazonaws.com" - } - }, - "params": { - "Region": "us-west-2", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click-fips.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://projects.iot1click.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips enabled and dualstack disabled", - "expect": { - "error": "Invalid Configuration: FIPS and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips disabled and dualstack enabled", - "expect": { - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "Missing region", - "expect": { - "error": "Invalid Configuration: Missing Region" - } - } - ], - "version": "1.0" - } - } - }, - "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceConflictException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Associates a physical device with a placement.

", - "smithy.api#http": { - "method": "PUT", - "uri": "/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacementRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project containing the placement in which to associate the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement in which to associate the device.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "deviceId": { - "target": "com.amazonaws.iot1clickprojects#DeviceId", - "traits": { - "smithy.api#documentation": "

The ID of the physical device to be associated with the given placement in the project.\n Note that a mandatory 4 character prefix is required for all deviceId\n values.

", - "smithy.api#required": {} - } - }, - "deviceTemplateName": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplateName", - "traits": { - "smithy.api#documentation": "

The device template name to associate with the device ID.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#AssociateDeviceWithPlacementResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#AttributeDefaultValue": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 800 - } - } - }, - "com.amazonaws.iot1clickprojects#AttributeName": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - } - } - }, - "com.amazonaws.iot1clickprojects#AttributeValue": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 800 - } - } - }, - "com.amazonaws.iot1clickprojects#Code": { - "type": "string" - }, - "com.amazonaws.iot1clickprojects#CreatePlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#CreatePlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#CreatePlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceConflictException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Creates an empty placement.

", - "smithy.api#http": { - "method": "POST", - "uri": "/projects/{projectName}/placements", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#CreatePlacementRequest": { - "type": "structure", - "members": { - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement to be created.

", - "smithy.api#required": {} - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project in which to create the placement.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "attributes": { - "target": "com.amazonaws.iot1clickprojects#PlacementAttributeMap", - "traits": { - "smithy.api#documentation": "

Optional user-defined key/value pairs providing contextual data (such as location or\n function) for the placement.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#CreatePlacementResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#CreateProject": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#CreateProjectRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#CreateProjectResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceConflictException" - } - ], - "traits": { - "smithy.api#documentation": "

Creates an empty project with a placement template. A project contains zero or more\n placements that adhere to the placement template defined in the project.

", - "smithy.api#http": { - "method": "POST", - "uri": "/projects", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#CreateProjectRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project to create.

", - "smithy.api#required": {} - } - }, - "description": { - "target": "com.amazonaws.iot1clickprojects#Description", - "traits": { - "smithy.api#documentation": "

An optional description for the project.

" - } - }, - "placementTemplate": { - "target": "com.amazonaws.iot1clickprojects#PlacementTemplate", - "traits": { - "smithy.api#documentation": "

The schema defining the placement to be created. A placement template defines placement\n default attributes and device templates. You cannot add or remove device templates after the\n project has been created. However, you can update callbackOverrides for the\n device templates using the UpdateProject API.

" - } - }, - "tags": { - "target": "com.amazonaws.iot1clickprojects#TagMap", - "traits": { - "smithy.api#documentation": "

Optional tags (metadata key/value pairs) to be associated with the project. For example,\n { {\"key1\": \"value1\", \"key2\": \"value2\"} }. For more information, see AWS Tagging\n Strategies.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#CreateProjectResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#DefaultPlacementAttributeMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#AttributeName" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#AttributeDefaultValue" - } - }, - "com.amazonaws.iot1clickprojects#DeletePlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#DeletePlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#DeletePlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iot1clickprojects#TooManyRequestsException" - } - ], - "traits": { - "smithy.api#documentation": "

Deletes a placement. To delete a placement, it must not have any devices associated with\n it.

\n \n

When you delete a placement, all associated data becomes irretrievable.

\n
", - "smithy.api#http": { - "method": "DELETE", - "uri": "/projects/{projectName}/placements/{placementName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DeletePlacementRequest": { - "type": "structure", - "members": { - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the empty placement to delete.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The project containing the empty placement to delete.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#DeletePlacementResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#DeleteProject": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#DeleteProjectRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#DeleteProjectResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iot1clickprojects#TooManyRequestsException" - } - ], - "traits": { - "smithy.api#documentation": "

Deletes a project. To delete a project, it must not have any placements associated with\n it.

\n \n

When you delete a project, all associated data becomes irretrievable.

\n
", - "smithy.api#http": { - "method": "DELETE", - "uri": "/projects/{projectName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DeleteProjectRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the empty project to delete.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#DeleteProjectResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#DescribePlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#DescribePlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#DescribePlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Describes a placement in a project.

", - "smithy.api#http": { - "method": "GET", - "uri": "/projects/{projectName}/placements/{placementName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DescribePlacementRequest": { - "type": "structure", - "members": { - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement within a project.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The project containing the placement to be described.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#DescribePlacementResponse": { - "type": "structure", - "members": { - "placement": { - "target": "com.amazonaws.iot1clickprojects#PlacementDescription", - "traits": { - "smithy.api#documentation": "

An object describing the placement.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#DescribeProject": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#DescribeProjectRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#DescribeProjectResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Returns an object describing a project.

", - "smithy.api#http": { - "method": "GET", - "uri": "/projects/{projectName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DescribeProjectRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project to be described.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#DescribeProjectResponse": { - "type": "structure", - "members": { - "project": { - "target": "com.amazonaws.iot1clickprojects#ProjectDescription", - "traits": { - "smithy.api#documentation": "

An object describing the project.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#Description": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 500 - } - } - }, - "com.amazonaws.iot1clickprojects#DeviceCallbackKey": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - } - } - }, - "com.amazonaws.iot1clickprojects#DeviceCallbackOverrideMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#DeviceCallbackKey" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#DeviceCallbackValue" - } - }, - "com.amazonaws.iot1clickprojects#DeviceCallbackValue": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DeviceId": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 32 - } - } - }, - "com.amazonaws.iot1clickprojects#DeviceMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplateName" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#DeviceId" - } - }, - "com.amazonaws.iot1clickprojects#DeviceTemplate": { - "type": "structure", - "members": { - "deviceType": { - "target": "com.amazonaws.iot1clickprojects#DeviceType", - "traits": { - "smithy.api#documentation": "

The device type, which currently must be \"button\".

" - } - }, - "callbackOverrides": { - "target": "com.amazonaws.iot1clickprojects#DeviceCallbackOverrideMap", - "traits": { - "smithy.api#documentation": "

An optional Lambda function to invoke instead of the default Lambda function provided by\n the placement template.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

An object representing a device for a placement template (see PlacementTemplate).

" - } - }, - "com.amazonaws.iot1clickprojects#DeviceTemplateMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplateName" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplate" - } - }, - "com.amazonaws.iot1clickprojects#DeviceTemplateName": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - }, - "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" - } - }, - "com.amazonaws.iot1clickprojects#DeviceType": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 128 - } - } - }, - "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iot1clickprojects#TooManyRequestsException" - } - ], - "traits": { - "smithy.api#documentation": "

Removes a physical device from a placement.

", - "smithy.api#http": { - "method": "DELETE", - "uri": "/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacementRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project that contains the placement.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement that the device should be removed from.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "deviceTemplateName": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplateName", - "traits": { - "smithy.api#documentation": "

The device ID that should be removed from the placement.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#DisassociateDeviceFromPlacementResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#GetDevicesInPlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#GetDevicesInPlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#GetDevicesInPlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Returns an object enumerating the devices in a placement.

", - "smithy.api#http": { - "method": "GET", - "uri": "/projects/{projectName}/placements/{placementName}/devices", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#GetDevicesInPlacementRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project containing the placement.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement to get the devices from.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#GetDevicesInPlacementResponse": { - "type": "structure", - "members": { - "devices": { - "target": "com.amazonaws.iot1clickprojects#DeviceMap", - "traits": { - "smithy.api#documentation": "

An object containing the devices (zero or more) within the placement.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#InternalFailureException": { - "type": "structure", - "members": { - "code": { - "target": "com.amazonaws.iot1clickprojects#Code", - "traits": { - "smithy.api#required": {} - } - }, - "message": { - "target": "com.amazonaws.iot1clickprojects#Message", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

", - "smithy.api#error": "server", - "smithy.api#httpError": 500 - } - }, - "com.amazonaws.iot1clickprojects#InvalidRequestException": { - "type": "structure", - "members": { - "code": { - "target": "com.amazonaws.iot1clickprojects#Code", - "traits": { - "smithy.api#required": {} - } - }, - "message": { - "target": "com.amazonaws.iot1clickprojects#Message", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

", - "smithy.api#error": "client", - "smithy.api#httpError": 400 - } - }, - "com.amazonaws.iot1clickprojects#ListPlacements": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#ListPlacementsRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#ListPlacementsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Lists the placement(s) of a project.

", - "smithy.api#http": { - "method": "GET", - "uri": "/projects/{projectName}/placements", - "code": 200 - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "items": "placements", - "pageSize": "maxResults" - } - } - }, - "com.amazonaws.iot1clickprojects#ListPlacementsRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The project containing the placements to be listed.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "nextToken": { - "target": "com.amazonaws.iot1clickprojects#NextToken", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#httpQuery": "nextToken" - } - }, - "maxResults": { - "target": "com.amazonaws.iot1clickprojects#MaxResults", - "traits": { - "smithy.api#documentation": "

The maximum number of results to return per request. If not set, a default value of 100 is\n used.

", - "smithy.api#httpQuery": "maxResults" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#ListPlacementsResponse": { - "type": "structure", - "members": { - "placements": { - "target": "com.amazonaws.iot1clickprojects#PlacementSummaryList", - "traits": { - "smithy.api#documentation": "

An object listing the requested placements.

", - "smithy.api#required": {} - } - }, - "nextToken": { - "target": "com.amazonaws.iot1clickprojects#NextToken", - "traits": { - "smithy.api#documentation": "

The token used to retrieve the next set of results - will be effectively empty if there\n are no further results.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#ListProjects": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#ListProjectsRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#ListProjectsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - } - ], - "traits": { - "smithy.api#documentation": "

Lists the AWS IoT 1-Click project(s) associated with your AWS account and region.

", - "smithy.api#http": { - "method": "GET", - "uri": "/projects", - "code": 200 - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "items": "projects", - "pageSize": "maxResults" - } - } - }, - "com.amazonaws.iot1clickprojects#ListProjectsRequest": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.iot1clickprojects#NextToken", - "traits": { - "smithy.api#documentation": "

The token to retrieve the next set of results.

", - "smithy.api#httpQuery": "nextToken" - } - }, - "maxResults": { - "target": "com.amazonaws.iot1clickprojects#MaxResults", - "traits": { - "smithy.api#documentation": "

The maximum number of results to return per request. If not set, a default value of 100 is\n used.

", - "smithy.api#httpQuery": "maxResults" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#ListProjectsResponse": { - "type": "structure", - "members": { - "projects": { - "target": "com.amazonaws.iot1clickprojects#ProjectSummaryList", - "traits": { - "smithy.api#documentation": "

An object containing the list of projects.

", - "smithy.api#required": {} - } - }, - "nextToken": { - "target": "com.amazonaws.iot1clickprojects#NextToken", - "traits": { - "smithy.api#documentation": "

The token used to retrieve the next set of results - will be effectively empty if there\n are no further results.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#ListTagsForResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#ListTagsForResourceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#ListTagsForResourceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Lists the tags (metadata key/value pairs) which you have assigned to the resource.

", - "smithy.api#http": { - "method": "GET", - "uri": "/tags/{resourceArn}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#ListTagsForResourceRequest": { - "type": "structure", - "members": { - "resourceArn": { - "target": "com.amazonaws.iot1clickprojects#ProjectArn", - "traits": { - "smithy.api#documentation": "

The ARN of the resource whose tags you want to list.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#ListTagsForResourceResponse": { - "type": "structure", - "members": { - "tags": { - "target": "com.amazonaws.iot1clickprojects#TagMap", - "traits": { - "smithy.api#documentation": "

The tags (metadata key/value pairs) which you have assigned to the resource.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#MaxResults": { - "type": "integer", - "traits": { - "smithy.api#range": { - "min": 1, - "max": 250 - } - } - }, - "com.amazonaws.iot1clickprojects#Message": { - "type": "string" - }, - "com.amazonaws.iot1clickprojects#NextToken": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 1024 - } - } - }, - "com.amazonaws.iot1clickprojects#PlacementAttributeMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#AttributeName" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#AttributeValue" - } - }, - "com.amazonaws.iot1clickprojects#PlacementDescription": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project containing the placement.

", - "smithy.api#required": {} - } - }, - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement.

", - "smithy.api#required": {} - } - }, - "attributes": { - "target": "com.amazonaws.iot1clickprojects#PlacementAttributeMap", - "traits": { - "smithy.api#documentation": "

The user-defined attributes associated with the placement.

", - "smithy.api#required": {} - } - }, - "createdDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the placement was initially created, in UNIX epoch time format.

", - "smithy.api#required": {} - } - }, - "updatedDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the placement was last updated, in UNIX epoch time format. If the placement\n was not updated, then createdDate and updatedDate are the\n same.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

An object describing a project's placement.

" - } - }, - "com.amazonaws.iot1clickprojects#PlacementName": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - }, - "smithy.api#pattern": "^[a-zA-Z0-9_-]+$" - } - }, - "com.amazonaws.iot1clickprojects#PlacementSummary": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project containing the placement.

", - "smithy.api#required": {} - } - }, - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement being summarized.

", - "smithy.api#required": {} - } - }, - "createdDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the placement was originally created, in UNIX epoch time format.

", - "smithy.api#required": {} - } - }, - "updatedDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the placement was last updated, in UNIX epoch time format. If the placement\n was not updated, then createdDate and updatedDate are the\n same.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

An object providing summary information for a particular placement.

" - } - }, - "com.amazonaws.iot1clickprojects#PlacementSummaryList": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickprojects#PlacementSummary" - } - }, - "com.amazonaws.iot1clickprojects#PlacementTemplate": { - "type": "structure", - "members": { - "defaultAttributes": { - "target": "com.amazonaws.iot1clickprojects#DefaultPlacementAttributeMap", - "traits": { - "smithy.api#documentation": "

The default attributes (key/value pairs) to be applied to all placements using this\n template.

" - } - }, - "deviceTemplates": { - "target": "com.amazonaws.iot1clickprojects#DeviceTemplateMap", - "traits": { - "smithy.api#documentation": "

An object specifying the DeviceTemplate for all placements using this\n (PlacementTemplate) template.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

An object defining the template for a placement.

" - } - }, - "com.amazonaws.iot1clickprojects#ProjectArn": { - "type": "string", - "traits": { - "smithy.api#pattern": "^arn:aws:iot1click:[A-Za-z0-9_/.-]{0,63}:\\d+:projects/[0-9A-Za-z_-]{1,128}$" - } - }, - "com.amazonaws.iot1clickprojects#ProjectDescription": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iot1clickprojects#ProjectArn", - "traits": { - "smithy.api#documentation": "

The ARN of the project.

" - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project for which to obtain information from.

", - "smithy.api#required": {} - } - }, - "description": { - "target": "com.amazonaws.iot1clickprojects#Description", - "traits": { - "smithy.api#documentation": "

The description of the project.

" - } - }, - "createdDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the project was originally created, in UNIX epoch time format.

", - "smithy.api#required": {} - } - }, - "updatedDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the project was last updated, in UNIX epoch time format. If the project was\n not updated, then createdDate and updatedDate are the same.

", - "smithy.api#required": {} - } - }, - "placementTemplate": { - "target": "com.amazonaws.iot1clickprojects#PlacementTemplate", - "traits": { - "smithy.api#documentation": "

An object describing the project's placement specifications.

" - } - }, - "tags": { - "target": "com.amazonaws.iot1clickprojects#TagMap", - "traits": { - "smithy.api#documentation": "

The tags (metadata key/value pairs) associated with the project.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

An object providing detailed information for a particular project associated with an AWS\n account and region.

" - } - }, - "com.amazonaws.iot1clickprojects#ProjectName": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - }, - "smithy.api#pattern": "^[0-9A-Za-z_-]+$" - } - }, - "com.amazonaws.iot1clickprojects#ProjectSummary": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iot1clickprojects#ProjectArn", - "traits": { - "smithy.api#documentation": "

The ARN of the project.

" - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project being summarized.

", - "smithy.api#required": {} - } - }, - "createdDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the project was originally created, in UNIX epoch time format.

", - "smithy.api#required": {} - } - }, - "updatedDate": { - "target": "com.amazonaws.iot1clickprojects#Time", - "traits": { - "smithy.api#documentation": "

The date when the project was last updated, in UNIX epoch time format. If the project was\n not updated, then createdDate and updatedDate are the same.

", - "smithy.api#required": {} - } - }, - "tags": { - "target": "com.amazonaws.iot1clickprojects#TagMap", - "traits": { - "smithy.api#documentation": "

The tags (metadata key/value pairs) associated with the project.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

An object providing summary information for a particular project for an associated AWS\n account and region.

" - } - }, - "com.amazonaws.iot1clickprojects#ProjectSummaryList": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickprojects#ProjectSummary" - } - }, - "com.amazonaws.iot1clickprojects#ResourceConflictException": { - "type": "structure", - "members": { - "code": { - "target": "com.amazonaws.iot1clickprojects#Code", - "traits": { - "smithy.api#required": {} - } - }, - "message": { - "target": "com.amazonaws.iot1clickprojects#Message", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

", - "smithy.api#error": "client", - "smithy.api#httpError": 409 - } - }, - "com.amazonaws.iot1clickprojects#ResourceNotFoundException": { - "type": "structure", - "members": { - "code": { - "target": "com.amazonaws.iot1clickprojects#Code", - "traits": { - "smithy.api#required": {} - } - }, - "message": { - "target": "com.amazonaws.iot1clickprojects#Message", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

", - "smithy.api#error": "client", - "smithy.api#httpError": 404 - } - }, - "com.amazonaws.iot1clickprojects#TagKey": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 128 - }, - "smithy.api#pattern": "^(?!aws:)[a-zA-Z+-=._:/]+$" - } - }, - "com.amazonaws.iot1clickprojects#TagKeyList": { - "type": "list", - "member": { - "target": "com.amazonaws.iot1clickprojects#TagKey" - }, - "traits": { - "smithy.api#length": { - "min": 1, - "max": 50 - } - } - }, - "com.amazonaws.iot1clickprojects#TagMap": { - "type": "map", - "key": { - "target": "com.amazonaws.iot1clickprojects#TagKey" - }, - "value": { - "target": "com.amazonaws.iot1clickprojects#TagValue" - }, - "traits": { - "smithy.api#length": { - "min": 1, - "max": 50 - } - } - }, - "com.amazonaws.iot1clickprojects#TagResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#TagResourceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#TagResourceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Creates or modifies tags for a resource. Tags are key/value pairs (metadata) that can be\n used to manage a resource. For more information, see AWS Tagging\n Strategies.

", - "smithy.api#http": { - "method": "POST", - "uri": "/tags/{resourceArn}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#TagResourceRequest": { - "type": "structure", - "members": { - "resourceArn": { - "target": "com.amazonaws.iot1clickprojects#ProjectArn", - "traits": { - "smithy.api#documentation": "

The ARN of the resouce for which tag(s) should be added or modified.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "tags": { - "target": "com.amazonaws.iot1clickprojects#TagMap", - "traits": { - "smithy.api#documentation": "

The new or modifying tag(s) for the resource. See AWS IoT 1-Click Service Limits for the maximum number of tags allowed per\n resource.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#TagResourceResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#TagValue": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 256 - } - } - }, - "com.amazonaws.iot1clickprojects#Time": { - "type": "timestamp" - }, - "com.amazonaws.iot1clickprojects#TooManyRequestsException": { - "type": "structure", - "members": { - "code": { - "target": "com.amazonaws.iot1clickprojects#Code", - "traits": { - "smithy.api#required": {} - } - }, - "message": { - "target": "com.amazonaws.iot1clickprojects#Message", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

", - "smithy.api#error": "client", - "smithy.api#httpError": 429 - } - }, - "com.amazonaws.iot1clickprojects#UntagResource": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#UntagResourceRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#UntagResourceResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - } - ], - "traits": { - "smithy.api#documentation": "

Removes one or more tags (metadata key/value pairs) from a resource.

", - "smithy.api#http": { - "method": "DELETE", - "uri": "/tags/{resourceArn}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#UntagResourceRequest": { - "type": "structure", - "members": { - "resourceArn": { - "target": "com.amazonaws.iot1clickprojects#ProjectArn", - "traits": { - "smithy.api#documentation": "

The ARN of the resource whose tag you want to remove.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "tagKeys": { - "target": "com.amazonaws.iot1clickprojects#TagKeyList", - "traits": { - "smithy.api#documentation": "

The keys of those tags which you want to remove.

", - "smithy.api#httpQuery": "tagKeys", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#UntagResourceResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#UpdatePlacement": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#UpdatePlacementRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#UpdatePlacementResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iot1clickprojects#TooManyRequestsException" - } - ], - "traits": { - "smithy.api#documentation": "

Updates a placement with the given attributes. To clear an attribute, pass an empty value\n (i.e., \"\").

", - "smithy.api#http": { - "method": "PUT", - "uri": "/projects/{projectName}/placements/{placementName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#UpdatePlacementRequest": { - "type": "structure", - "members": { - "placementName": { - "target": "com.amazonaws.iot1clickprojects#PlacementName", - "traits": { - "smithy.api#documentation": "

The name of the placement to update.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project containing the placement to be updated.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "attributes": { - "target": "com.amazonaws.iot1clickprojects#PlacementAttributeMap", - "traits": { - "smithy.api#documentation": "

The user-defined object of attributes used to update the placement. The maximum number of\n key/value pairs is 50.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#UpdatePlacementResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.iot1clickprojects#UpdateProject": { - "type": "operation", - "input": { - "target": "com.amazonaws.iot1clickprojects#UpdateProjectRequest" - }, - "output": { - "target": "com.amazonaws.iot1clickprojects#UpdateProjectResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iot1clickprojects#InternalFailureException" - }, - { - "target": "com.amazonaws.iot1clickprojects#InvalidRequestException" - }, - { - "target": "com.amazonaws.iot1clickprojects#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iot1clickprojects#TooManyRequestsException" - } - ], - "traits": { - "smithy.api#documentation": "

Updates a project associated with your AWS account and region. With the exception of\n device template names, you can pass just the values that need to be updated because the update\n request will change only the values that are provided. To clear a value, pass the empty string\n (i.e., \"\").

", - "smithy.api#http": { - "method": "PUT", - "uri": "/projects/{projectName}", - "code": 200 - } - } - }, - "com.amazonaws.iot1clickprojects#UpdateProjectRequest": { - "type": "structure", - "members": { - "projectName": { - "target": "com.amazonaws.iot1clickprojects#ProjectName", - "traits": { - "smithy.api#documentation": "

The name of the project to be updated.

", - "smithy.api#httpLabel": {}, - "smithy.api#required": {} - } - }, - "description": { - "target": "com.amazonaws.iot1clickprojects#Description", - "traits": { - "smithy.api#documentation": "

An optional user-defined description for the project.

" - } - }, - "placementTemplate": { - "target": "com.amazonaws.iot1clickprojects#PlacementTemplate", - "traits": { - "smithy.api#documentation": "

An object defining the project update. Once a project has been created, you cannot add\n device template names to the project. However, for a given placementTemplate, you\n can update the associated callbackOverrides for the device definition using this\n API.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.iot1clickprojects#UpdateProjectResponse": { - "type": "structure", - "members": {}, - "traits": { - "smithy.api#output": {} - } - } - } -} diff --git a/service/iot1clickdevicesservice/CHANGELOG.md b/service/iot1clickdevicesservice/CHANGELOG.md deleted file mode 100644 index e2a5b0eea74..00000000000 --- a/service/iot1clickdevicesservice/CHANGELOG.md +++ /dev/null @@ -1,502 +0,0 @@ -# v1.24.0 (2025-01-07) - -* **Feature**: Mark service/iot1clickdevicesservice and service/iot1clickprojects as deprecated. Those 2 services are no longer available for use. See https://docs.aws.amazon.com/iot/latest/developerguide/iot-legacy-services.html#faq-1-click-eol - -# v1.23.8 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.7 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.6 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.5 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.23.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.4 (2024-10-03) - -* No change notes available for this release. - -# v1.22.3 (2024-09-27) - -* No change notes available for this release. - -# v1.22.2 (2024-09-25) - -* No change notes available for this release. - -# v1.22.1 (2024-09-23) - -* No change notes available for this release. - -# v1.22.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.7 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.21.6 (2024-09-04) - -* No change notes available for this release. - -# v1.21.5 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.4 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.2 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.20.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.11 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.10 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.9 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.8 (2024-05-23) - -* No change notes available for this release. - -# v1.19.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.5 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.19.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.18.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.18.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.17.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.17.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.16.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2023-10-24) - -* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). -* **Feature**: **BREAKFIX**: Correct nullability representation of APIGateway-based services. - -# v1.13.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.12.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2023-08-01) - -* No change notes available for this release. - -# v1.12.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.12 (2023-06-15) - -* No change notes available for this release. - -# v1.11.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.10 (2023-05-04) - -* No change notes available for this release. - -# v1.11.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.8 (2023-04-10) - -* No change notes available for this release. - -# v1.11.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.11.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.11.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.10.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.19 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-08-27) - -* **Feature**: Updated API model to latest revision. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/service/iot1clickdevicesservice/LICENSE.txt b/service/iot1clickdevicesservice/LICENSE.txt deleted file mode 100644 index d6456956733..00000000000 --- a/service/iot1clickdevicesservice/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/service/iot1clickdevicesservice/api_client.go b/service/iot1clickdevicesservice/api_client.go deleted file mode 100644 index c727d7ef7e4..00000000000 --- a/service/iot1clickdevicesservice/api_client.go +++ /dev/null @@ -1,913 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "IoT 1Click Devices Service" -const ServiceAPIVersion = "2018-05-14" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice") -} - -// Client provides the API client to make operations call for AWS IoT 1-Click -// Devices Service. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, optFns...) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "iot1clickdevicesservice", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice") - }) - if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} diff --git a/service/iot1clickdevicesservice/api_client_test.go b/service/iot1clickdevicesservice/api_client_test.go deleted file mode 100644 index 54323d736e2..00000000000 --- a/service/iot1clickdevicesservice/api_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io/ioutil" - "net/http" - "strings" - "testing" -) - -func TestClient_resolveRetryOptions(t *testing.T) { - nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { - return &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader("")), - }, nil - }) - - cases := map[string]struct { - defaultsMode aws.DefaultsMode - retryer aws.Retryer - retryMaxAttempts int - opRetryMaxAttempts *int - retryMode aws.RetryMode - expectClientRetryMode aws.RetryMode - expectClientMaxAttempts int - expectOpMaxAttempts int - }{ - "defaults": { - defaultsMode: aws.DefaultsModeStandard, - expectClientRetryMode: aws.RetryModeStandard, - expectClientMaxAttempts: 3, - expectOpMaxAttempts: 3, - }, - "custom default retry": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(2), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 2, - }, - "custom op no change max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(10), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op 0 max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(0), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - client := NewFromConfig(aws.Config{ - DefaultsMode: c.defaultsMode, - Retryer: func() func() aws.Retryer { - if c.retryer == nil { - return nil - } - - return func() aws.Retryer { return c.retryer } - }(), - HTTPClient: nopClient, - RetryMaxAttempts: c.retryMaxAttempts, - RetryMode: c.retryMode, - }, func(o *Options) { - if o.Retryer == nil { - t.Errorf("retryer must not be nil in functional options") - } - }) - - if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { - t.Errorf("expect %v retry mode, got %v", e, a) - } - if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v max attempts, got %v", e, a) - } - - _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, - []func(*Options){ - func(o *Options) { - if c.opRetryMaxAttempts == nil { - return - } - o.RetryMaxAttempts = *c.opRetryMaxAttempts - }, - }, - func(s *middleware.Stack, o Options) error { - s.Initialize.Clear() - s.Serialize.Clear() - s.Build.Clear() - s.Finalize.Clear() - s.Deserialize.Clear() - - if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v op max attempts, got %v", e, a) - } - return nil - }) - if err != nil { - t.Fatalf("expect no operation error, got %v", err) - } - }) - } -} diff --git a/service/iot1clickdevicesservice/api_op_ClaimDevicesByClaimCode.go b/service/iot1clickdevicesservice/api_op_ClaimDevicesByClaimCode.go deleted file mode 100644 index c569771f8cb..00000000000 --- a/service/iot1clickdevicesservice/api_op_ClaimDevicesByClaimCode.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// 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). -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ClaimDevicesByClaimCode(ctx context.Context, params *ClaimDevicesByClaimCodeInput, optFns ...func(*Options)) (*ClaimDevicesByClaimCodeOutput, error) { - if params == nil { - params = &ClaimDevicesByClaimCodeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ClaimDevicesByClaimCode", params, optFns, c.addOperationClaimDevicesByClaimCodeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ClaimDevicesByClaimCodeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ClaimDevicesByClaimCodeInput struct { - - // The claim code, starting with "C-", as provided by the device manufacturer. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ClaimCode *string - - noSmithyDocumentSerde -} - -type ClaimDevicesByClaimCodeOutput struct { - - // The claim code provided by the device manufacturer. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ClaimCode *string - - // The total number of devices associated with the claim code that has been - // processed in the claim request. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Total *int32 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationClaimDevicesByClaimCodeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpClaimDevicesByClaimCode{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpClaimDevicesByClaimCode{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ClaimDevicesByClaimCode"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpClaimDevicesByClaimCodeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opClaimDevicesByClaimCode(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opClaimDevicesByClaimCode(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ClaimDevicesByClaimCode", - } -} diff --git a/service/iot1clickdevicesservice/api_op_DescribeDevice.go b/service/iot1clickdevicesservice/api_op_DescribeDevice.go deleted file mode 100644 index 2f7ca547ce1..00000000000 --- a/service/iot1clickdevicesservice/api_op_DescribeDevice.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Given a device ID, returns a DescribeDeviceResponse object describing the -// details of the device. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DescribeDevice(ctx context.Context, params *DescribeDeviceInput, optFns ...func(*Options)) (*DescribeDeviceOutput, error) { - if params == nil { - params = &DescribeDeviceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeDevice", params, optFns, c.addOperationDescribeDeviceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeDeviceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeDeviceInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - noSmithyDocumentSerde -} - -type DescribeDeviceOutput struct { - - // Device details. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceDescription *types.DeviceDescription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeDevice{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeDevice{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeDevice"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDescribeDeviceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDevice(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeDevice(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeDevice", - } -} diff --git a/service/iot1clickdevicesservice/api_op_FinalizeDeviceClaim.go b/service/iot1clickdevicesservice/api_op_FinalizeDeviceClaim.go deleted file mode 100644 index 2601cdbbc0a..00000000000 --- a/service/iot1clickdevicesservice/api_op_FinalizeDeviceClaim.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// 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. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) FinalizeDeviceClaim(ctx context.Context, params *FinalizeDeviceClaimInput, optFns ...func(*Options)) (*FinalizeDeviceClaimOutput, error) { - if params == nil { - params = &FinalizeDeviceClaimInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "FinalizeDeviceClaim", params, optFns, c.addOperationFinalizeDeviceClaimMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*FinalizeDeviceClaimOutput) - out.ResultMetadata = metadata - return out, nil -} - -type FinalizeDeviceClaimInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // A collection of key/value pairs defining the resource tags. For example, { - // "tags": {"key1": "value1", "key2": "value2"} }. For more information, see [AWS Tagging Strategies]. - // - // [AWS Tagging Strategies]: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/ - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -type FinalizeDeviceClaimOutput struct { - - // The device's final claim state. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - State *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationFinalizeDeviceClaimMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpFinalizeDeviceClaim{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpFinalizeDeviceClaim{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "FinalizeDeviceClaim"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpFinalizeDeviceClaimValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opFinalizeDeviceClaim(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opFinalizeDeviceClaim(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "FinalizeDeviceClaim", - } -} diff --git a/service/iot1clickdevicesservice/api_op_GetDeviceMethods.go b/service/iot1clickdevicesservice/api_op_GetDeviceMethods.go deleted file mode 100644 index fa3368c4ca8..00000000000 --- a/service/iot1clickdevicesservice/api_op_GetDeviceMethods.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Given a device ID, returns the invokable methods associated with the device. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) GetDeviceMethods(ctx context.Context, params *GetDeviceMethodsInput, optFns ...func(*Options)) (*GetDeviceMethodsOutput, error) { - if params == nil { - params = &GetDeviceMethodsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDeviceMethods", params, optFns, c.addOperationGetDeviceMethodsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDeviceMethodsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDeviceMethodsInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - noSmithyDocumentSerde -} - -type GetDeviceMethodsOutput struct { - - // List of available device APIs. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceMethods []types.DeviceMethod - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDeviceMethodsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeviceMethods{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeviceMethods{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDeviceMethods"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpGetDeviceMethodsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeviceMethods(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetDeviceMethods(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDeviceMethods", - } -} diff --git a/service/iot1clickdevicesservice/api_op_InitiateDeviceClaim.go b/service/iot1clickdevicesservice/api_op_InitiateDeviceClaim.go deleted file mode 100644 index 87a0b53e732..00000000000 --- a/service/iot1clickdevicesservice/api_op_InitiateDeviceClaim.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// 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. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) InitiateDeviceClaim(ctx context.Context, params *InitiateDeviceClaimInput, optFns ...func(*Options)) (*InitiateDeviceClaimOutput, error) { - if params == nil { - params = &InitiateDeviceClaimInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "InitiateDeviceClaim", params, optFns, c.addOperationInitiateDeviceClaimMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*InitiateDeviceClaimOutput) - out.ResultMetadata = metadata - return out, nil -} - -type InitiateDeviceClaimInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - noSmithyDocumentSerde -} - -type InitiateDeviceClaimOutput struct { - - // The device's final claim state. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - State *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationInitiateDeviceClaimMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpInitiateDeviceClaim{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInitiateDeviceClaim{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "InitiateDeviceClaim"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpInitiateDeviceClaimValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInitiateDeviceClaim(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opInitiateDeviceClaim(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "InitiateDeviceClaim", - } -} diff --git a/service/iot1clickdevicesservice/api_op_InvokeDeviceMethod.go b/service/iot1clickdevicesservice/api_op_InvokeDeviceMethod.go deleted file mode 100644 index 4d82118d896..00000000000 --- a/service/iot1clickdevicesservice/api_op_InvokeDeviceMethod.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Given a device ID, issues a request to invoke a named device method (with -// possible parameters). See the "Example POST" code snippet below. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) InvokeDeviceMethod(ctx context.Context, params *InvokeDeviceMethodInput, optFns ...func(*Options)) (*InvokeDeviceMethodOutput, error) { - if params == nil { - params = &InvokeDeviceMethodInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "InvokeDeviceMethod", params, optFns, c.addOperationInvokeDeviceMethodMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*InvokeDeviceMethodOutput) - out.ResultMetadata = metadata - return out, nil -} - -type InvokeDeviceMethodInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // The device method to invoke. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceMethod *types.DeviceMethod - - // A JSON encoded string containing the device method request parameters. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceMethodParameters *string - - noSmithyDocumentSerde -} - -type InvokeDeviceMethodOutput struct { - - // A JSON encoded string containing the device method response. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceMethodResponse *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationInvokeDeviceMethodMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpInvokeDeviceMethod{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpInvokeDeviceMethod{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "InvokeDeviceMethod"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpInvokeDeviceMethodValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInvokeDeviceMethod(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opInvokeDeviceMethod(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "InvokeDeviceMethod", - } -} diff --git a/service/iot1clickdevicesservice/api_op_ListDeviceEvents.go b/service/iot1clickdevicesservice/api_op_ListDeviceEvents.go deleted file mode 100644 index 3b98ae025b2..00000000000 --- a/service/iot1clickdevicesservice/api_op_ListDeviceEvents.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Using a device ID, returns a DeviceEventsResponse object containing an array of -// events for the device. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListDeviceEvents(ctx context.Context, params *ListDeviceEventsInput, optFns ...func(*Options)) (*ListDeviceEventsOutput, error) { - if params == nil { - params = &ListDeviceEventsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListDeviceEvents", params, optFns, c.addOperationListDeviceEventsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListDeviceEventsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListDeviceEventsInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // The start date for the device event query, in ISO8061 format. For example, - // 2018-03-28T15:45:12.880Z - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - FromTimeStamp *time.Time - - // The end date for the device event query, in ISO8061 format. For example, - // 2018-03-28T15:45:12.880Z - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ToTimeStamp *time.Time - - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - MaxResults *int32 - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - noSmithyDocumentSerde -} - -type ListDeviceEventsOutput struct { - - // An array of zero or more elements describing the event(s) associated with the - // device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Events []types.DeviceEvent - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListDeviceEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeviceEvents{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeviceEvents{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListDeviceEvents"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpListDeviceEventsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDeviceEvents(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListDeviceEvents(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListDeviceEvents", - } -} diff --git a/service/iot1clickdevicesservice/api_op_ListDevices.go b/service/iot1clickdevicesservice/api_op_ListDevices.go deleted file mode 100644 index c2bd2e34305..00000000000 --- a/service/iot1clickdevicesservice/api_op_ListDevices.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the 1-Click compatible devices associated with your AWS account. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListDevices(ctx context.Context, params *ListDevicesInput, optFns ...func(*Options)) (*ListDevicesOutput, error) { - if params == nil { - params = &ListDevicesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListDevices", params, optFns, c.addOperationListDevicesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListDevicesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListDevicesInput struct { - - // The type of the device, such as "button". - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceType *string - - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - MaxResults *int32 - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - noSmithyDocumentSerde -} - -type ListDevicesOutput struct { - - // A list of devices. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Devices []types.DeviceDescription - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListDevices{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDevices{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListDevices"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDevices(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListDevices", - } -} diff --git a/service/iot1clickdevicesservice/api_op_ListTagsForResource.go b/service/iot1clickdevicesservice/api_op_ListTagsForResource.go deleted file mode 100644 index 61298532edc..00000000000 --- a/service/iot1clickdevicesservice/api_op_ListTagsForResource.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the tags associated with the specified resource ARN. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if params == nil { - params = &ListTagsForResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTagsForResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTagsForResourceInput struct { - - // The ARN of the resource. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - noSmithyDocumentSerde -} - -type ListTagsForResourceOutput struct { - - // A collection of key/value pairs defining the resource tags. For example, { - // "tags": {"key1": "value1", "key2": "value2"} }. For more information, see [AWS Tagging Strategies]. - // - // [AWS Tagging Strategies]: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/ - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTagsForResource", - } -} diff --git a/service/iot1clickdevicesservice/api_op_TagResource.go b/service/iot1clickdevicesservice/api_op_TagResource.go deleted file mode 100644 index 4c1898d0693..00000000000 --- a/service/iot1clickdevicesservice/api_op_TagResource.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds or updates the tags associated with the resource ARN. See [AWS IoT 1-Click Service Limits] for the maximum -// number of tags allowed per resource. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -// -// [AWS IoT 1-Click Service Limits]: https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-appendix.html#1click-limits -func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { - if params == nil { - params = &TagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TagResourceInput struct { - - // The ARN of the resource. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - // A collection of key/value pairs defining the resource tags. For example, { - // "tags": {"key1": "value1", "key2": "value2"} }. For more information, see [AWS Tagging Strategies]. - // - // [AWS Tagging Strategies]: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/ - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -type TagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpTagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TagResource", - } -} diff --git a/service/iot1clickdevicesservice/api_op_UnclaimDevice.go b/service/iot1clickdevicesservice/api_op_UnclaimDevice.go deleted file mode 100644 index 1294d28a2b1..00000000000 --- a/service/iot1clickdevicesservice/api_op_UnclaimDevice.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disassociates a device from your AWS account using its device ID. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UnclaimDevice(ctx context.Context, params *UnclaimDeviceInput, optFns ...func(*Options)) (*UnclaimDeviceOutput, error) { - if params == nil { - params = &UnclaimDeviceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UnclaimDevice", params, optFns, c.addOperationUnclaimDeviceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UnclaimDeviceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UnclaimDeviceInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - noSmithyDocumentSerde -} - -type UnclaimDeviceOutput struct { - - // The device's final claim state. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - State *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUnclaimDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUnclaimDevice{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUnclaimDevice{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UnclaimDevice"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUnclaimDeviceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnclaimDevice(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUnclaimDevice(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UnclaimDevice", - } -} diff --git a/service/iot1clickdevicesservice/api_op_UntagResource.go b/service/iot1clickdevicesservice/api_op_UntagResource.go deleted file mode 100644 index 58c8fd21cef..00000000000 --- a/service/iot1clickdevicesservice/api_op_UntagResource.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Using tag keys, deletes the tags (key/value pairs) associated with the -// specified resource ARN. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { - if params == nil { - params = &UntagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UntagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UntagResourceInput struct { - - // The ARN of the resource. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - // A collections of tag keys. For example, {"key1","key2"} - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - TagKeys []string - - noSmithyDocumentSerde -} - -type UntagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUntagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UntagResource", - } -} diff --git a/service/iot1clickdevicesservice/api_op_UpdateDeviceState.go b/service/iot1clickdevicesservice/api_op_UpdateDeviceState.go deleted file mode 100644 index 62a66864b29..00000000000 --- a/service/iot1clickdevicesservice/api_op_UpdateDeviceState.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Using a Boolean value (true or false), this operation enables or disables the -// device given a device ID. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UpdateDeviceState(ctx context.Context, params *UpdateDeviceStateInput, optFns ...func(*Options)) (*UpdateDeviceStateOutput, error) { - if params == nil { - params = &UpdateDeviceStateInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateDeviceState", params, optFns, c.addOperationUpdateDeviceStateMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateDeviceStateOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateDeviceStateInput struct { - - // The unique identifier of the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // If true, the device is enabled. If false, the device is disabled. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Enabled *bool - - noSmithyDocumentSerde -} - -type UpdateDeviceStateOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateDeviceStateMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDeviceState{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDeviceState{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDeviceState"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUpdateDeviceStateValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDeviceState(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateDeviceState(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateDeviceState", - } -} diff --git a/service/iot1clickdevicesservice/auth.go b/service/iot1clickdevicesservice/auth.go deleted file mode 100644 index 22d423a4150..00000000000 --- a/service/iot1clickdevicesservice/auth.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "iot1click") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/service/iot1clickdevicesservice/deserializers.go b/service/iot1clickdevicesservice/deserializers.go deleted file mode 100644 index 5251aa60bb5..00000000000 --- a/service/iot1clickdevicesservice/deserializers.go +++ /dev/null @@ -1,3034 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "io/ioutil" - "math" - "strings" - "time" -) - -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - -type awsRestjson1_deserializeOpClaimDevicesByClaimCode struct { -} - -func (*awsRestjson1_deserializeOpClaimDevicesByClaimCode) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpClaimDevicesByClaimCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorClaimDevicesByClaimCode(response, &metadata) - } - output := &ClaimDevicesByClaimCodeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentClaimDevicesByClaimCodeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorClaimDevicesByClaimCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("ForbiddenException", errorCode): - return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentClaimDevicesByClaimCodeOutput(v **ClaimDevicesByClaimCodeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ClaimDevicesByClaimCodeOutput - if *v == nil { - sv = &ClaimDevicesByClaimCodeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "claimCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __stringMin12Max40 to be of type string, got %T instead", value) - } - sv.ClaimCode = ptr.String(jtv) - } - - case "total": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Total = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeDevice struct { -} - -func (*awsRestjson1_deserializeOpDescribeDevice) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeDevice(response, &metadata) - } - output := &DescribeDeviceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeDeviceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeDeviceOutput(v **DescribeDeviceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeDeviceOutput - if *v == nil { - sv = &DescribeDeviceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "deviceDescription": - if err := awsRestjson1_deserializeDocumentDeviceDescription(&sv.DeviceDescription, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpFinalizeDeviceClaim struct { -} - -func (*awsRestjson1_deserializeOpFinalizeDeviceClaim) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpFinalizeDeviceClaim) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorFinalizeDeviceClaim(response, &metadata) - } - output := &FinalizeDeviceClaimOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentFinalizeDeviceClaimOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorFinalizeDeviceClaim(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("PreconditionFailedException", errorCode): - return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentFinalizeDeviceClaimOutput(v **FinalizeDeviceClaimOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *FinalizeDeviceClaimOutput - if *v == nil { - sv = &FinalizeDeviceClaimOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.State = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetDeviceMethods struct { -} - -func (*awsRestjson1_deserializeOpGetDeviceMethods) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetDeviceMethods) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDeviceMethods(response, &metadata) - } - output := &GetDeviceMethodsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentGetDeviceMethodsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetDeviceMethods(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetDeviceMethodsOutput(v **GetDeviceMethodsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetDeviceMethodsOutput - if *v == nil { - sv = &GetDeviceMethodsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "deviceMethods": - if err := awsRestjson1_deserializeDocument__listOfDeviceMethod(&sv.DeviceMethods, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpInitiateDeviceClaim struct { -} - -func (*awsRestjson1_deserializeOpInitiateDeviceClaim) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpInitiateDeviceClaim) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorInitiateDeviceClaim(response, &metadata) - } - output := &InitiateDeviceClaimOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentInitiateDeviceClaimOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorInitiateDeviceClaim(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentInitiateDeviceClaimOutput(v **InitiateDeviceClaimOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *InitiateDeviceClaimOutput - if *v == nil { - sv = &InitiateDeviceClaimOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.State = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpInvokeDeviceMethod struct { -} - -func (*awsRestjson1_deserializeOpInvokeDeviceMethod) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpInvokeDeviceMethod) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorInvokeDeviceMethod(response, &metadata) - } - output := &InvokeDeviceMethodOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentInvokeDeviceMethodOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorInvokeDeviceMethod(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("PreconditionFailedException", errorCode): - return awsRestjson1_deserializeErrorPreconditionFailedException(response, errorBody) - - case strings.EqualFold("RangeNotSatisfiableException", errorCode): - return awsRestjson1_deserializeErrorRangeNotSatisfiableException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentInvokeDeviceMethodOutput(v **InvokeDeviceMethodOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *InvokeDeviceMethodOutput - if *v == nil { - sv = &InvokeDeviceMethodOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "deviceMethodResponse": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.DeviceMethodResponse = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListDeviceEvents struct { -} - -func (*awsRestjson1_deserializeOpListDeviceEvents) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListDeviceEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDeviceEvents(response, &metadata) - } - output := &ListDeviceEventsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListDeviceEventsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListDeviceEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("RangeNotSatisfiableException", errorCode): - return awsRestjson1_deserializeErrorRangeNotSatisfiableException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListDeviceEventsOutput(v **ListDeviceEventsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDeviceEventsOutput - if *v == nil { - sv = &ListDeviceEventsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "events": - if err := awsRestjson1_deserializeDocument__listOfDeviceEvent(&sv.Events, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListDevices struct { -} - -func (*awsRestjson1_deserializeOpListDevices) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListDevices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDevices(response, &metadata) - } - output := &ListDevicesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListDevicesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListDevices(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("RangeNotSatisfiableException", errorCode): - return awsRestjson1_deserializeErrorRangeNotSatisfiableException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListDevicesOutput(v **ListDevicesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDevicesOutput - if *v == nil { - sv = &ListDevicesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "devices": - if err := awsRestjson1_deserializeDocument__listOfDeviceDescription(&sv.Devices, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListTagsForResource struct { -} - -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) - } - output := &ListTagsForResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tags": - if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTagResource struct { -} - -func (*awsRestjson1_deserializeOpTagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) - } - output := &TagResourceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUnclaimDevice struct { -} - -func (*awsRestjson1_deserializeOpUnclaimDevice) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUnclaimDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUnclaimDevice(response, &metadata) - } - output := &UnclaimDeviceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentUnclaimDeviceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUnclaimDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUnclaimDeviceOutput(v **UnclaimDeviceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UnclaimDeviceOutput - if *v == nil { - sv = &UnclaimDeviceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.State = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUntagResource struct { -} - -func (*awsRestjson1_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUpdateDeviceState struct { -} - -func (*awsRestjson1_deserializeOpUpdateDeviceState) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateDeviceState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDeviceState(response, &metadata) - } - output := &UpdateDeviceStateOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateDeviceState(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ForbiddenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalFailureException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorPreconditionFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PreconditionFailedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentPreconditionFailedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorRangeNotSatisfiableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.RangeNotSatisfiableException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentRangeNotSatisfiableException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceConflictException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceConflictException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeDocument__listOfDeviceDescription(v *[]types.DeviceDescription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DeviceDescription - if *v == nil { - cv = []types.DeviceDescription{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DeviceDescription - destAddr := &col - if err := awsRestjson1_deserializeDocumentDeviceDescription(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfDeviceEvent(v *[]types.DeviceEvent, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DeviceEvent - if *v == nil { - cv = []types.DeviceEvent{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DeviceEvent - destAddr := &col - if err := awsRestjson1_deserializeDocumentDeviceEvent(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfDeviceMethod(v *[]types.DeviceMethod, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DeviceMethod - if *v == nil { - cv = []types.DeviceMethod{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DeviceMethod - destAddr := &col - if err := awsRestjson1_deserializeDocumentDeviceMethod(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__mapOf__string(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentAttributes(v **types.Attributes, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Attributes - if *v == nil { - sv = &types.Attributes{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDevice(v **types.Device, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Device - if *v == nil { - sv = &types.Device{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "attributes": - if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "deviceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.DeviceId = ptr.String(jtv) - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceAttributes(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceDescription(v **types.DeviceDescription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DeviceDescription - if *v == nil { - sv = &types.DeviceDescription{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "attributes": - if err := awsRestjson1_deserializeDocumentDeviceAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "deviceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.DeviceId = ptr.String(jtv) - } - - case "enabled": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value) - } - sv.Enabled = ptr.Bool(jtv) - } - - case "remainingLife": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RemainingLife = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.RemainingLife = ptr.Float64(f64) - - default: - return fmt.Errorf("expected __doubleMin0Max100 to be a JSON Number, got %T instead", value) - - } - } - - case "tags": - if err := awsRestjson1_deserializeDocument__mapOf__string(&sv.Tags, value); err != nil { - return err - } - - case "type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceEvent(v **types.DeviceEvent, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DeviceEvent - if *v == nil { - sv = &types.DeviceEvent{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "device": - if err := awsRestjson1_deserializeDocumentDevice(&sv.Device, value); err != nil { - return err - } - - case "stdEvent": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.StdEvent = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceMethod(v **types.DeviceMethod, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DeviceMethod - if *v == nil { - sv = &types.DeviceMethod{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "deviceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.DeviceType = ptr.String(jtv) - } - - case "methodName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.MethodName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ForbiddenException - if *v == nil { - sv = &types.ForbiddenException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalFailureException - if *v == nil { - sv = &types.InternalFailureException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidRequestException - if *v == nil { - sv = &types.InvalidRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPreconditionFailedException(v **types.PreconditionFailedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PreconditionFailedException - if *v == nil { - sv = &types.PreconditionFailedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentRangeNotSatisfiableException(v **types.RangeNotSatisfiableException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RangeNotSatisfiableException - if *v == nil { - sv = &types.RangeNotSatisfiableException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceConflictException - if *v == nil { - sv = &types.ResourceConflictException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceNotFoundException - if *v == nil { - sv = &types.ResourceNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/service/iot1clickdevicesservice/doc.go b/service/iot1clickdevicesservice/doc.go deleted file mode 100644 index 8bb0308ac29..00000000000 --- a/service/iot1clickdevicesservice/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package iot1clickdevicesservice provides the API client, operations, and -// parameter types for AWS IoT 1-Click Devices Service. -// -// Describes all of the AWS IoT 1-Click device-related API operations for the -// service. Also provides sample requests, responses, and errors for the supported -// web services protocols. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -package iot1clickdevicesservice diff --git a/service/iot1clickdevicesservice/endpoints.go b/service/iot1clickdevicesservice/endpoints.go deleted file mode 100644 index f5cbdab4473..00000000000 --- a/service/iot1clickdevicesservice/endpoints.go +++ /dev/null @@ -1,537 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "iot1click" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_IOT_1CLICK_DEVICES_SERVICE") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "IoT 1Click Devices Service", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://devices.iot1click-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - uriString := func() string { - var out strings.Builder - out.WriteString("https://devices.iot1click-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://devices.iot1click.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://devices.iot1click.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/service/iot1clickdevicesservice/endpoints_config_test.go b/service/iot1clickdevicesservice/endpoints_config_test.go deleted file mode 100644 index 59dedc27efd..00000000000 --- a/service/iot1clickdevicesservice/endpoints_config_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "os" - "reflect" - "testing" -) - -type mockConfigSource struct { - global string - service string - ignore bool -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { - return m.ignore, m.ignore, nil -} - -// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use -// with configured endpoints. -func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { - if m.service != "" { - return m.service, true, nil - } - return "", false, nil -} - -func TestResolveBaseEndpoint(t *testing.T) { - cases := map[string]struct { - envGlobal string - envService string - envIgnore bool - configGlobal string - configService string - configIgnore bool - clientEndpoint *string - expectURL *string - }{ - "env ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-devices-service.dev", - envIgnore: true, - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - expectURL: nil, - }, - "env global": { - envGlobal: "https://env-global.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - expectURL: aws.String("https://env-global.dev"), - }, - "env service": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-devices-service.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - expectURL: aws.String("https://env-iot-1click-devices-service.dev"), - }, - "config ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-devices-service.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - configIgnore: true, - expectURL: nil, - }, - "config global": { - configGlobal: "http://config-global.dev", - expectURL: aws.String("http://config-global.dev"), - }, - "config service": { - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - expectURL: aws.String("http://config-iot-1click-devices-service.dev"), - }, - "client": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-devices-service.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-devices-service.dev", - clientEndpoint: aws.String("https://client-iot-1click-devices-service.dev"), - expectURL: aws.String("https://client-iot-1click-devices-service.dev"), - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - os.Clearenv() - - awsConfig := aws.Config{} - ignore := c.envIgnore || c.configIgnore - - if c.configGlobal != "" && !ignore { - awsConfig.BaseEndpoint = aws.String(c.configGlobal) - } - - if c.envGlobal != "" { - t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) - if !ignore { - awsConfig.BaseEndpoint = aws.String(c.envGlobal) - } - } - - if c.envService != "" { - t.Setenv("AWS_ENDPOINT_URL_IOT_1CLICK_DEVICES_SERVICE", c.envService) - } - - awsConfig.ConfigSources = []interface{}{ - mockConfigSource{ - global: c.envGlobal, - service: c.envService, - ignore: c.envIgnore, - }, - mockConfigSource{ - global: c.configGlobal, - service: c.configService, - ignore: c.configIgnore, - }, - } - - client := NewFromConfig(awsConfig, func(o *Options) { - if c.clientEndpoint != nil { - o.BaseEndpoint = c.clientEndpoint - } - }) - - if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { - t.Errorf("expect endpoint %v , got %v", e, a) - } - }) - } -} diff --git a/service/iot1clickdevicesservice/endpoints_test.go b/service/iot1clickdevicesservice/endpoints_test.go deleted file mode 100644 index 2f5247cb65b..00000000000 --- a/service/iot1clickdevicesservice/endpoints_test.go +++ /dev/null @@ -1,820 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - smithy "github.com/aws/smithy-go" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/ptr" - "net/http" - "net/url" - "reflect" - "strings" - "testing" -) - -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase0(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase1(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase2(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase3(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase4(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase5(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase6(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase7(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase8(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase15(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase16(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase17(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click-fips.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase18(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase19(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://devices.iot1click.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase20(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase21(t *testing.T) { - var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase22(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase23(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// Missing region -func TestEndpointCase24(t *testing.T) { - var params = EndpointParameters{} - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/iot1clickdevicesservice/generated.json b/service/iot1clickdevicesservice/generated.json deleted file mode 100644 index 58a92ecf760..00000000000 --- a/service/iot1clickdevicesservice/generated.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_ClaimDevicesByClaimCode.go", - "api_op_DescribeDevice.go", - "api_op_FinalizeDeviceClaim.go", - "api_op_GetDeviceMethods.go", - "api_op_InitiateDeviceClaim.go", - "api_op_InvokeDeviceMethod.go", - "api_op_ListDeviceEvents.go", - "api_op_ListDevices.go", - "api_op_ListTagsForResource.go", - "api_op_TagResource.go", - "api_op_UnclaimDevice.go", - "api_op_UntagResource.go", - "api_op_UpdateDeviceState.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.15", - "module": "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice", - "unstable": false -} diff --git a/service/iot1clickdevicesservice/go.mod b/service/iot1clickdevicesservice/go.mod deleted file mode 100644 index 60f4e88097c..00000000000 --- a/service/iot1clickdevicesservice/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice - -go 1.21 - -require ( - github.com/aws/aws-sdk-go-v2 v1.32.7 - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 - github.com/aws/smithy-go v1.22.1 -) - -replace github.com/aws/aws-sdk-go-v2 => ../../ - -replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ - -replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/iot1clickdevicesservice/go.sum b/service/iot1clickdevicesservice/go.sum deleted file mode 100644 index bd2678891af..00000000000 --- a/service/iot1clickdevicesservice/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= -github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/iot1clickdevicesservice/go_module_metadata.go b/service/iot1clickdevicesservice/go_module_metadata.go deleted file mode 100644 index 77424f8762a..00000000000 --- a/service/iot1clickdevicesservice/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package iot1clickdevicesservice - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.24.0" diff --git a/service/iot1clickdevicesservice/internal/endpoints/endpoints.go b/service/iot1clickdevicesservice/internal/endpoints/endpoints.go deleted file mode 100644 index a1bec6d5b3f..00000000000 --- a/service/iot1clickdevicesservice/internal/endpoints/endpoints.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver IoT 1Click Devices Service endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "devices.iot1click-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "devices.iot1click.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - }, -} diff --git a/service/iot1clickdevicesservice/internal/endpoints/endpoints_test.go b/service/iot1clickdevicesservice/internal/endpoints/endpoints_test.go deleted file mode 100644 index 08e5da2d833..00000000000 --- a/service/iot1clickdevicesservice/internal/endpoints/endpoints_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "testing" -) - -func TestRegexCompile(t *testing.T) { - _ = defaultPartitions -} diff --git a/service/iot1clickdevicesservice/options.go b/service/iot1clickdevicesservice/options.go deleted file mode 100644 index 5648792635b..00000000000 --- a/service/iot1clickdevicesservice/options.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/service/iot1clickdevicesservice/protocol_test.go b/service/iot1clickdevicesservice/protocol_test.go deleted file mode 100644 index a95e9ee4389..00000000000 --- a/service/iot1clickdevicesservice/protocol_test.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice diff --git a/service/iot1clickdevicesservice/serializers.go b/service/iot1clickdevicesservice/serializers.go deleted file mode 100644 index 8f8a72ecfc1..00000000000 --- a/service/iot1clickdevicesservice/serializers.go +++ /dev/null @@ -1,1096 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/iot1clickdevicesservice/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpClaimDevicesByClaimCode struct { -} - -func (*awsRestjson1_serializeOpClaimDevicesByClaimCode) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpClaimDevicesByClaimCode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ClaimDevicesByClaimCodeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/claims/{ClaimCode}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsClaimDevicesByClaimCodeInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsClaimDevicesByClaimCodeInput(v *ClaimDevicesByClaimCodeInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ClaimCode == nil || len(*v.ClaimCode) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ClaimCode must not be empty")} - } - if v.ClaimCode != nil { - if err := encoder.SetURI("ClaimCode").String(*v.ClaimCode); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeDevice struct { -} - -func (*awsRestjson1_serializeOpDescribeDevice) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeDeviceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeDeviceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeDeviceInput(v *DescribeDeviceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpFinalizeDeviceClaim struct { -} - -func (*awsRestjson1_serializeOpFinalizeDeviceClaim) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpFinalizeDeviceClaim) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*FinalizeDeviceClaimInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/finalize-claim") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsFinalizeDeviceClaimInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentFinalizeDeviceClaimInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsFinalizeDeviceClaimInput(v *FinalizeDeviceClaimInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentFinalizeDeviceClaimInput(v *FinalizeDeviceClaimInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpGetDeviceMethods struct { -} - -func (*awsRestjson1_serializeOpGetDeviceMethods) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetDeviceMethods) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetDeviceMethodsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/methods") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsGetDeviceMethodsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetDeviceMethodsInput(v *GetDeviceMethodsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpInitiateDeviceClaim struct { -} - -func (*awsRestjson1_serializeOpInitiateDeviceClaim) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpInitiateDeviceClaim) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*InitiateDeviceClaimInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/initiate-claim") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsInitiateDeviceClaimInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsInitiateDeviceClaimInput(v *InitiateDeviceClaimInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpInvokeDeviceMethod struct { -} - -func (*awsRestjson1_serializeOpInvokeDeviceMethod) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpInvokeDeviceMethod) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*InvokeDeviceMethodInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/methods") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsInvokeDeviceMethodInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentInvokeDeviceMethodInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsInvokeDeviceMethodInput(v *InvokeDeviceMethodInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentInvokeDeviceMethodInput(v *InvokeDeviceMethodInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DeviceMethod != nil { - ok := object.Key("deviceMethod") - if err := awsRestjson1_serializeDocumentDeviceMethod(v.DeviceMethod, ok); err != nil { - return err - } - } - - if v.DeviceMethodParameters != nil { - ok := object.Key("deviceMethodParameters") - ok.String(*v.DeviceMethodParameters) - } - - return nil -} - -type awsRestjson1_serializeOpListDeviceEvents struct { -} - -func (*awsRestjson1_serializeOpListDeviceEvents) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListDeviceEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListDeviceEventsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/events") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListDeviceEventsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListDeviceEventsInput(v *ListDeviceEventsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - if v.FromTimeStamp != nil { - encoder.SetQuery("fromTimeStamp").String(smithytime.FormatDateTime(*v.FromTimeStamp)) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.ToTimeStamp != nil { - encoder.SetQuery("toTimeStamp").String(smithytime.FormatDateTime(*v.ToTimeStamp)) - } - - return nil -} - -type awsRestjson1_serializeOpListDevices struct { -} - -func (*awsRestjson1_serializeOpListDevices) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListDevicesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListDevicesInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListDevicesInput(v *ListDevicesInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceType != nil { - encoder.SetQuery("deviceType").String(*v.DeviceType) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListTagsForResource struct { -} - -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTagsForResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpTagResource struct { -} - -func (*awsRestjson1_serializeOpTagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocument__mapOf__string(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUnclaimDevice struct { -} - -func (*awsRestjson1_serializeOpUnclaimDevice) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUnclaimDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UnclaimDeviceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/unclaim") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUnclaimDeviceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUnclaimDeviceInput(v *UnclaimDeviceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUntagResource struct { -} - -func (*awsRestjson1_serializeOpUntagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UntagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{ResourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateDeviceState struct { -} - -func (*awsRestjson1_serializeOpUpdateDeviceState) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateDeviceState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateDeviceStateInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/devices/{DeviceId}/state") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateDeviceStateInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateDeviceStateInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateDeviceStateInput(v *UpdateDeviceStateInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceId == nil || len(*v.DeviceId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member DeviceId must not be empty")} - } - if v.DeviceId != nil { - if err := encoder.SetURI("DeviceId").String(*v.DeviceId); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateDeviceStateInput(v *UpdateDeviceStateInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Enabled != nil { - ok := object.Key("enabled") - ok.Boolean(*v.Enabled) - } - - return nil -} - -func awsRestjson1_serializeDocument__mapOf__string(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentDeviceMethod(v *types.DeviceMethod, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DeviceType != nil { - ok := object.Key("deviceType") - ok.String(*v.DeviceType) - } - - if v.MethodName != nil { - ok := object.Key("methodName") - ok.String(*v.MethodName) - } - - return nil -} diff --git a/service/iot1clickdevicesservice/snapshot/api_op_ClaimDevicesByClaimCode.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_ClaimDevicesByClaimCode.go.snap deleted file mode 100644 index f1411c72f8e..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_ClaimDevicesByClaimCode.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -ClaimDevicesByClaimCode - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_DescribeDevice.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_DescribeDevice.go.snap deleted file mode 100644 index 153173a40a6..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_DescribeDevice.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DescribeDevice - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_FinalizeDeviceClaim.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_FinalizeDeviceClaim.go.snap deleted file mode 100644 index 812f3cfe7cf..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_FinalizeDeviceClaim.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -FinalizeDeviceClaim - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_GetDeviceMethods.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_GetDeviceMethods.go.snap deleted file mode 100644 index 5d78822a250..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_GetDeviceMethods.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -GetDeviceMethods - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_InitiateDeviceClaim.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_InitiateDeviceClaim.go.snap deleted file mode 100644 index 365ee68e369..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_InitiateDeviceClaim.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -InitiateDeviceClaim - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_InvokeDeviceMethod.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_InvokeDeviceMethod.go.snap deleted file mode 100644 index a4697d819bc..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_InvokeDeviceMethod.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -InvokeDeviceMethod - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_ListDeviceEvents.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_ListDeviceEvents.go.snap deleted file mode 100644 index ede06afc24c..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_ListDeviceEvents.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -ListDeviceEvents - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_ListDevices.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_ListDevices.go.snap deleted file mode 100644 index 0703671c010..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_ListDevices.go.snap +++ /dev/null @@ -1,40 +0,0 @@ -ListDevices - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_ListTagsForResource.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_ListTagsForResource.go.snap deleted file mode 100644 index 071d3ac4e96..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_ListTagsForResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -ListTagsForResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_TagResource.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_TagResource.go.snap deleted file mode 100644 index ae6f8e0846c..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_TagResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -TagResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_UnclaimDevice.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_UnclaimDevice.go.snap deleted file mode 100644 index e1ea274e7ce..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_UnclaimDevice.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UnclaimDevice - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_UntagResource.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_UntagResource.go.snap deleted file mode 100644 index c7bbe038d98..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_UntagResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UntagResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot/api_op_UpdateDeviceState.go.snap b/service/iot1clickdevicesservice/snapshot/api_op_UpdateDeviceState.go.snap deleted file mode 100644 index 42556ba4c0c..00000000000 --- a/service/iot1clickdevicesservice/snapshot/api_op_UpdateDeviceState.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UpdateDeviceState - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickdevicesservice/snapshot_test.go b/service/iot1clickdevicesservice/snapshot_test.go deleted file mode 100644 index 70395eb5197..00000000000 --- a/service/iot1clickdevicesservice/snapshot_test.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -//go:build snapshot - -package iot1clickdevicesservice - -import ( - "context" - "errors" - "fmt" - "github.com/aws/smithy-go/middleware" - "io" - "io/fs" - "os" - "testing" -) - -const ssprefix = "snapshot" - -type snapshotOK struct{} - -func (snapshotOK) Error() string { return "error: success" } - -func createp(path string) (*os.File, error) { - if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { - return nil, err - } - return os.Create(path) -} - -func sspath(op string) string { - return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) -} - -func updateSnapshot(stack *middleware.Stack, operation string) error { - f, err := createp(sspath(operation)) - if err != nil { - return err - } - defer f.Close() - if _, err := f.Write([]byte(stack.String())); err != nil { - return err - } - return snapshotOK{} -} - -func testSnapshot(stack *middleware.Stack, operation string) error { - f, err := os.Open(sspath(operation)) - if errors.Is(err, fs.ErrNotExist) { - return snapshotOK{} - } - if err != nil { - return err - } - defer f.Close() - expected, err := io.ReadAll(f) - if err != nil { - return err - } - if actual := stack.String(); actual != string(expected) { - return fmt.Errorf("%s != %s", expected, actual) - } - return snapshotOK{} -} -func TestCheckSnapshot_ClaimDevicesByClaimCode(t *testing.T) { - svc := New(Options{}) - _, err := svc.ClaimDevicesByClaimCode(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ClaimDevicesByClaimCode") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DescribeDevice(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribeDevice(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DescribeDevice") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_FinalizeDeviceClaim(t *testing.T) { - svc := New(Options{}) - _, err := svc.FinalizeDeviceClaim(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "FinalizeDeviceClaim") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetDeviceMethods(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDeviceMethods(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetDeviceMethods") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_InitiateDeviceClaim(t *testing.T) { - svc := New(Options{}) - _, err := svc.InitiateDeviceClaim(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "InitiateDeviceClaim") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_InvokeDeviceMethod(t *testing.T) { - svc := New(Options{}) - _, err := svc.InvokeDeviceMethod(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "InvokeDeviceMethod") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListDeviceEvents(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDeviceEvents(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListDeviceEvents") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListDevices(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDevices(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListDevices") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListTagsForResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListTagsForResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_TagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.TagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "TagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UnclaimDevice(t *testing.T) { - svc := New(Options{}) - _, err := svc.UnclaimDevice(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UnclaimDevice") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UntagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UntagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateDeviceState(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateDeviceState(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateDeviceState") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} -func TestUpdateSnapshot_ClaimDevicesByClaimCode(t *testing.T) { - svc := New(Options{}) - _, err := svc.ClaimDevicesByClaimCode(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ClaimDevicesByClaimCode") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DescribeDevice(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribeDevice(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DescribeDevice") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_FinalizeDeviceClaim(t *testing.T) { - svc := New(Options{}) - _, err := svc.FinalizeDeviceClaim(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "FinalizeDeviceClaim") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetDeviceMethods(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDeviceMethods(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetDeviceMethods") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_InitiateDeviceClaim(t *testing.T) { - svc := New(Options{}) - _, err := svc.InitiateDeviceClaim(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "InitiateDeviceClaim") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_InvokeDeviceMethod(t *testing.T) { - svc := New(Options{}) - _, err := svc.InvokeDeviceMethod(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "InvokeDeviceMethod") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListDeviceEvents(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDeviceEvents(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListDeviceEvents") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListDevices(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDevices(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListDevices") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListTagsForResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_TagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.TagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "TagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UnclaimDevice(t *testing.T) { - svc := New(Options{}) - _, err := svc.UnclaimDevice(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UnclaimDevice") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UntagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UntagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateDeviceState(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateDeviceState(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateDeviceState") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} diff --git a/service/iot1clickdevicesservice/types/errors.go b/service/iot1clickdevicesservice/types/errors.go deleted file mode 100644 index 61235d5bb97..00000000000 --- a/service/iot1clickdevicesservice/types/errors.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -type ForbiddenException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *ForbiddenException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ForbiddenException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ForbiddenException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ForbiddenException" - } - return *e.ErrorCodeOverride -} -func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type InternalFailureException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *InternalFailureException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InternalFailureException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InternalFailureException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InternalFailureException" - } - return *e.ErrorCodeOverride -} -func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -type InvalidRequestException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type PreconditionFailedException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *PreconditionFailedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PreconditionFailedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PreconditionFailedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PreconditionFailedException" - } - return *e.ErrorCodeOverride -} -func (e *PreconditionFailedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type RangeNotSatisfiableException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *RangeNotSatisfiableException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *RangeNotSatisfiableException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *RangeNotSatisfiableException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "RangeNotSatisfiableException" - } - return *e.ErrorCodeOverride -} -func (e *RangeNotSatisfiableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type ResourceConflictException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *ResourceConflictException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceConflictException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceConflictException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceConflictException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iot1clickdevicesservice/types/types.go b/service/iot1clickdevicesservice/types/types.go deleted file mode 100644 index a70403134f7..00000000000 --- a/service/iot1clickdevicesservice/types/types.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" -) - -type Attributes struct { - noSmithyDocumentSerde -} - -type Device struct { - - // The user specified attributes associated with the device for an event. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Attributes *Attributes - - // The unique identifier of the device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // The device type, such as "button". - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Type *string - - noSmithyDocumentSerde -} - -type DeviceDescription struct { - - // The ARN of the device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Arn *string - - // An array of zero or more elements of DeviceAttribute objects providing user - // specified device attributes. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Attributes map[string]string - - // The unique identifier of the device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // A Boolean value indicating whether or not the device is enabled. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Enabled *bool - - // A value between 0 and 1 inclusive, representing the fraction of life remaining - // for the device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - RemainingLife *float64 - - // The tags currently associated with the AWS IoT 1-Click device. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - // The type of the device, such as "button". - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Type *string - - noSmithyDocumentSerde -} - -type DeviceEvent struct { - - // An object representing the device associated with the event. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Device *Device - - // A serialized JSON object representing the device-type specific event. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - StdEvent *string - - noSmithyDocumentSerde -} - -type DeviceMethod struct { - - // The type of the device, such as "button". - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceType *string - - // The name of the method applicable to the deviceType. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - MethodName *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/iot1clickdevicesservice/validators.go b/service/iot1clickdevicesservice/validators.go deleted file mode 100644 index 2b67f91445d..00000000000 --- a/service/iot1clickdevicesservice/validators.go +++ /dev/null @@ -1,490 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickdevicesservice - -import ( - "context" - "fmt" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpClaimDevicesByClaimCode struct { -} - -func (*validateOpClaimDevicesByClaimCode) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpClaimDevicesByClaimCode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ClaimDevicesByClaimCodeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpClaimDevicesByClaimCodeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeDevice struct { -} - -func (*validateOpDescribeDevice) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeDeviceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeDeviceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpFinalizeDeviceClaim struct { -} - -func (*validateOpFinalizeDeviceClaim) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpFinalizeDeviceClaim) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*FinalizeDeviceClaimInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpFinalizeDeviceClaimInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDeviceMethods struct { -} - -func (*validateOpGetDeviceMethods) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDeviceMethods) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDeviceMethodsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDeviceMethodsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpInitiateDeviceClaim struct { -} - -func (*validateOpInitiateDeviceClaim) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpInitiateDeviceClaim) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*InitiateDeviceClaimInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpInitiateDeviceClaimInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpInvokeDeviceMethod struct { -} - -func (*validateOpInvokeDeviceMethod) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpInvokeDeviceMethod) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*InvokeDeviceMethodInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpInvokeDeviceMethodInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListDeviceEvents struct { -} - -func (*validateOpListDeviceEvents) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListDeviceEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListDeviceEventsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListDeviceEventsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTagsForResource struct { -} - -func (*validateOpListTagsForResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTagsForResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTagsForResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTagResource struct { -} - -func (*validateOpTagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUnclaimDevice struct { -} - -func (*validateOpUnclaimDevice) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUnclaimDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UnclaimDeviceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUnclaimDeviceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUntagResource struct { -} - -func (*validateOpUntagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UntagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUntagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateDeviceState struct { -} - -func (*validateOpUpdateDeviceState) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateDeviceState) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateDeviceStateInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateDeviceStateInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpClaimDevicesByClaimCodeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpClaimDevicesByClaimCode{}, middleware.After) -} - -func addOpDescribeDeviceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeDevice{}, middleware.After) -} - -func addOpFinalizeDeviceClaimValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpFinalizeDeviceClaim{}, middleware.After) -} - -func addOpGetDeviceMethodsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDeviceMethods{}, middleware.After) -} - -func addOpInitiateDeviceClaimValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpInitiateDeviceClaim{}, middleware.After) -} - -func addOpInvokeDeviceMethodValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpInvokeDeviceMethod{}, middleware.After) -} - -func addOpListDeviceEventsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListDeviceEvents{}, middleware.After) -} - -func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) -} - -func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) -} - -func addOpUnclaimDeviceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUnclaimDevice{}, middleware.After) -} - -func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) -} - -func addOpUpdateDeviceStateValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateDeviceState{}, middleware.After) -} - -func validateOpClaimDevicesByClaimCodeInput(v *ClaimDevicesByClaimCodeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ClaimDevicesByClaimCodeInput"} - if v.ClaimCode == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClaimCode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeDeviceInput(v *DescribeDeviceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeDeviceInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpFinalizeDeviceClaimInput(v *FinalizeDeviceClaimInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "FinalizeDeviceClaimInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDeviceMethodsInput(v *GetDeviceMethodsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDeviceMethodsInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpInitiateDeviceClaimInput(v *InitiateDeviceClaimInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InitiateDeviceClaimInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpInvokeDeviceMethodInput(v *InvokeDeviceMethodInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InvokeDeviceMethodInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListDeviceEventsInput(v *ListDeviceEventsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListDeviceEventsInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if v.FromTimeStamp == nil { - invalidParams.Add(smithy.NewErrParamRequired("FromTimeStamp")) - } - if v.ToTimeStamp == nil { - invalidParams.Add(smithy.NewErrParamRequired("ToTimeStamp")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTagResourceInput(v *TagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.Tags == nil { - invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUnclaimDeviceInput(v *UnclaimDeviceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UnclaimDeviceInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUntagResourceInput(v *UntagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.TagKeys == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateDeviceStateInput(v *UpdateDeviceStateInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateDeviceStateInput"} - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/service/iot1clickprojects/CHANGELOG.md b/service/iot1clickprojects/CHANGELOG.md deleted file mode 100644 index ad55b824d31..00000000000 --- a/service/iot1clickprojects/CHANGELOG.md +++ /dev/null @@ -1,500 +0,0 @@ -# v1.24.0 (2025-01-07) - -* **Feature**: Mark service/iot1clickdevicesservice and service/iot1clickprojects as deprecated. Those 2 services are no longer available for use. See https://docs.aws.amazon.com/iot/latest/developerguide/iot-legacy-services.html#faq-1-click-eol - -# v1.23.8 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.7 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.6 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.5 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.23.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.4 (2024-10-03) - -* No change notes available for this release. - -# v1.22.3 (2024-09-27) - -* No change notes available for this release. - -# v1.22.2 (2024-09-25) - -* No change notes available for this release. - -# v1.22.1 (2024-09-23) - -* No change notes available for this release. - -# v1.22.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.7 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.21.6 (2024-09-04) - -* No change notes available for this release. - -# v1.21.5 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.4 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.3 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.2 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.20.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.11 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.10 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.9 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.8 (2024-05-23) - -* No change notes available for this release. - -# v1.19.7 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.6 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.5 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.19.4 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.3 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.18.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.18.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.17.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.17.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.16.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.13.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.1 (2023-08-01) - -* No change notes available for this release. - -# v1.13.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.12 (2023-06-15) - -* No change notes available for this release. - -# v1.12.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.10 (2023-05-04) - -* No change notes available for this release. - -# v1.12.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.8 (2023-04-10) - -* No change notes available for this release. - -# v1.12.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.12.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.12.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.11.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.19 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.6.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/service/iot1clickprojects/LICENSE.txt b/service/iot1clickprojects/LICENSE.txt deleted file mode 100644 index d6456956733..00000000000 --- a/service/iot1clickprojects/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/service/iot1clickprojects/api_client.go b/service/iot1clickprojects/api_client.go deleted file mode 100644 index 114a5b4691c..00000000000 --- a/service/iot1clickprojects/api_client.go +++ /dev/null @@ -1,913 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "IoT 1Click Projects" -const ServiceAPIVersion = "2018-05-14" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - instr := getOperationMetrics(ctx).histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickprojects") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - return ctx.Value(operationMetricsKey{}).(*operationMetrics) -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/iot1clickprojects") -} - -// Client provides the API client to make operations call for AWS IoT 1-Click -// Projects Service. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickprojects") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, optFns...) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "iot1clickprojects", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/iot1clickprojects") - }) - if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -type spanInitializeStart struct { -} - -func (*spanInitializeStart) ID() string { - return "spanInitializeStart" -} - -func (m *spanInitializeStart) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "Initialize") - - return next.HandleInitialize(ctx, in) -} - -type spanInitializeEnd struct { -} - -func (*spanInitializeEnd) ID() string { - return "spanInitializeEnd" -} - -func (m *spanInitializeEnd) HandleInitialize( - ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, -) ( - middleware.InitializeOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleInitialize(ctx, in) -} - -type spanBuildRequestStart struct { -} - -func (*spanBuildRequestStart) ID() string { - return "spanBuildRequestStart" -} - -func (m *spanBuildRequestStart) HandleSerialize( - ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, -) ( - middleware.SerializeOutput, middleware.Metadata, error, -) { - ctx, _ = tracing.StartSpan(ctx, "BuildRequest") - - return next.HandleSerialize(ctx, in) -} - -type spanBuildRequestEnd struct { -} - -func (*spanBuildRequestEnd) ID() string { - return "spanBuildRequestEnd" -} - -func (m *spanBuildRequestEnd) HandleBuild( - ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, -) ( - middleware.BuildOutput, middleware.Metadata, error, -) { - ctx, span := tracing.PopSpan(ctx) - span.End() - - return next.HandleBuild(ctx, in) -} - -func addSpanInitializeStart(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) -} - -func addSpanInitializeEnd(stack *middleware.Stack) error { - return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) -} - -func addSpanBuildRequestStart(stack *middleware.Stack) error { - return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) -} - -func addSpanBuildRequestEnd(stack *middleware.Stack) error { - return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) -} diff --git a/service/iot1clickprojects/api_client_test.go b/service/iot1clickprojects/api_client_test.go deleted file mode 100644 index 6e3d4725e82..00000000000 --- a/service/iot1clickprojects/api_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io/ioutil" - "net/http" - "strings" - "testing" -) - -func TestClient_resolveRetryOptions(t *testing.T) { - nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { - return &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader("")), - }, nil - }) - - cases := map[string]struct { - defaultsMode aws.DefaultsMode - retryer aws.Retryer - retryMaxAttempts int - opRetryMaxAttempts *int - retryMode aws.RetryMode - expectClientRetryMode aws.RetryMode - expectClientMaxAttempts int - expectOpMaxAttempts int - }{ - "defaults": { - defaultsMode: aws.DefaultsModeStandard, - expectClientRetryMode: aws.RetryModeStandard, - expectClientMaxAttempts: 3, - expectOpMaxAttempts: 3, - }, - "custom default retry": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(2), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 2, - }, - "custom op no change max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(10), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op 0 max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(0), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - client := NewFromConfig(aws.Config{ - DefaultsMode: c.defaultsMode, - Retryer: func() func() aws.Retryer { - if c.retryer == nil { - return nil - } - - return func() aws.Retryer { return c.retryer } - }(), - HTTPClient: nopClient, - RetryMaxAttempts: c.retryMaxAttempts, - RetryMode: c.retryMode, - }, func(o *Options) { - if o.Retryer == nil { - t.Errorf("retryer must not be nil in functional options") - } - }) - - if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { - t.Errorf("expect %v retry mode, got %v", e, a) - } - if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v max attempts, got %v", e, a) - } - - _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, - []func(*Options){ - func(o *Options) { - if c.opRetryMaxAttempts == nil { - return - } - o.RetryMaxAttempts = *c.opRetryMaxAttempts - }, - }, - func(s *middleware.Stack, o Options) error { - s.Initialize.Clear() - s.Serialize.Clear() - s.Build.Clear() - s.Finalize.Clear() - s.Deserialize.Clear() - - if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v op max attempts, got %v", e, a) - } - return nil - }) - if err != nil { - t.Fatalf("expect no operation error, got %v", err) - } - }) - } -} diff --git a/service/iot1clickprojects/api_op_AssociateDeviceWithPlacement.go b/service/iot1clickprojects/api_op_AssociateDeviceWithPlacement.go deleted file mode 100644 index 5cb90987d3b..00000000000 --- a/service/iot1clickprojects/api_op_AssociateDeviceWithPlacement.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Associates a physical device with a placement. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) AssociateDeviceWithPlacement(ctx context.Context, params *AssociateDeviceWithPlacementInput, optFns ...func(*Options)) (*AssociateDeviceWithPlacementOutput, error) { - if params == nil { - params = &AssociateDeviceWithPlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateDeviceWithPlacement", params, optFns, c.addOperationAssociateDeviceWithPlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateDeviceWithPlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateDeviceWithPlacementInput struct { - - // The ID of the physical device to be associated with the given placement in the - // project. Note that a mandatory 4 character prefix is required for all deviceId - // values. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceId *string - - // The device template name to associate with the device ID. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceTemplateName *string - - // The name of the placement in which to associate the device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project containing the placement in which to associate the - // device. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type AssociateDeviceWithPlacementOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateDeviceWithPlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateDeviceWithPlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateDeviceWithPlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateDeviceWithPlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpAssociateDeviceWithPlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateDeviceWithPlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateDeviceWithPlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateDeviceWithPlacement", - } -} diff --git a/service/iot1clickprojects/api_op_CreatePlacement.go b/service/iot1clickprojects/api_op_CreatePlacement.go deleted file mode 100644 index 749dd803080..00000000000 --- a/service/iot1clickprojects/api_op_CreatePlacement.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an empty placement. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) CreatePlacement(ctx context.Context, params *CreatePlacementInput, optFns ...func(*Options)) (*CreatePlacementOutput, error) { - if params == nil { - params = &CreatePlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreatePlacement", params, optFns, c.addOperationCreatePlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreatePlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreatePlacementInput struct { - - // The name of the placement to be created. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project in which to create the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // Optional user-defined key/value pairs providing contextual data (such as - // location or function) for the placement. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Attributes map[string]string - - noSmithyDocumentSerde -} - -type CreatePlacementOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreatePlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpCreatePlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreatePlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreatePlacement", - } -} diff --git a/service/iot1clickprojects/api_op_CreateProject.go b/service/iot1clickprojects/api_op_CreateProject.go deleted file mode 100644 index 1d75d3442fa..00000000000 --- a/service/iot1clickprojects/api_op_CreateProject.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an empty project with a placement template. A project contains zero or -// more placements that adhere to the placement template defined in the project. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) CreateProject(ctx context.Context, params *CreateProjectInput, optFns ...func(*Options)) (*CreateProjectOutput, error) { - if params == nil { - params = &CreateProjectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateProject", params, optFns, c.addOperationCreateProjectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateProjectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateProjectInput struct { - - // The name of the project to create. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // An optional description for the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Description *string - - // The schema defining the placement to be created. A placement template defines - // placement default attributes and device templates. You cannot add or remove - // device templates after the project has been created. However, you can update - // callbackOverrides for the device templates using the UpdateProject API. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementTemplate *types.PlacementTemplate - - // Optional tags (metadata key/value pairs) to be associated with the project. For - // example, { {"key1": "value1", "key2": "value2"} } . For more information, see [AWS Tagging Strategies]. - // - // [AWS Tagging Strategies]: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/ - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -type CreateProjectOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProject{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProject{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateProject"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpCreateProjectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProject(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateProject(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateProject", - } -} diff --git a/service/iot1clickprojects/api_op_DeletePlacement.go b/service/iot1clickprojects/api_op_DeletePlacement.go deleted file mode 100644 index 87269f1ef0b..00000000000 --- a/service/iot1clickprojects/api_op_DeletePlacement.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a placement. To delete a placement, it must not have any devices -// associated with it. -// -// When you delete a placement, all associated data becomes irretrievable. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DeletePlacement(ctx context.Context, params *DeletePlacementInput, optFns ...func(*Options)) (*DeletePlacementOutput, error) { - if params == nil { - params = &DeletePlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeletePlacement", params, optFns, c.addOperationDeletePlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeletePlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeletePlacementInput struct { - - // The name of the empty placement to delete. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The project containing the empty placement to delete. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type DeletePlacementOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeletePlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDeletePlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeletePlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeletePlacement", - } -} diff --git a/service/iot1clickprojects/api_op_DeleteProject.go b/service/iot1clickprojects/api_op_DeleteProject.go deleted file mode 100644 index d43297a92d6..00000000000 --- a/service/iot1clickprojects/api_op_DeleteProject.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a project. To delete a project, it must not have any placements -// associated with it. -// -// When you delete a project, all associated data becomes irretrievable. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DeleteProject(ctx context.Context, params *DeleteProjectInput, optFns ...func(*Options)) (*DeleteProjectOutput, error) { - if params == nil { - params = &DeleteProjectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteProject", params, optFns, c.addOperationDeleteProjectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteProjectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteProjectInput struct { - - // The name of the empty project to delete. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type DeleteProjectOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProject{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProject{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteProject"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDeleteProjectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProject(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteProject(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteProject", - } -} diff --git a/service/iot1clickprojects/api_op_DescribePlacement.go b/service/iot1clickprojects/api_op_DescribePlacement.go deleted file mode 100644 index dd0cab0e1b2..00000000000 --- a/service/iot1clickprojects/api_op_DescribePlacement.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Describes a placement in a project. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DescribePlacement(ctx context.Context, params *DescribePlacementInput, optFns ...func(*Options)) (*DescribePlacementOutput, error) { - if params == nil { - params = &DescribePlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePlacement", params, optFns, c.addOperationDescribePlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePlacementInput struct { - - // The name of the placement within a project. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The project containing the placement to be described. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type DescribePlacementOutput struct { - - // An object describing the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Placement *types.PlacementDescription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribePlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribePlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDescribePlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribePlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePlacement", - } -} diff --git a/service/iot1clickprojects/api_op_DescribeProject.go b/service/iot1clickprojects/api_op_DescribeProject.go deleted file mode 100644 index a51aabca9ca..00000000000 --- a/service/iot1clickprojects/api_op_DescribeProject.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns an object describing a project. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DescribeProject(ctx context.Context, params *DescribeProjectInput, optFns ...func(*Options)) (*DescribeProjectOutput, error) { - if params == nil { - params = &DescribeProjectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeProject", params, optFns, c.addOperationDescribeProjectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeProjectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeProjectInput struct { - - // The name of the project to be described. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type DescribeProjectOutput struct { - - // An object describing the project. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Project *types.ProjectDescription - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeProject{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeProject{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeProject"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDescribeProjectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeProject(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeProject(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeProject", - } -} diff --git a/service/iot1clickprojects/api_op_DisassociateDeviceFromPlacement.go b/service/iot1clickprojects/api_op_DisassociateDeviceFromPlacement.go deleted file mode 100644 index 511d1ff086a..00000000000 --- a/service/iot1clickprojects/api_op_DisassociateDeviceFromPlacement.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes a physical device from a placement. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) DisassociateDeviceFromPlacement(ctx context.Context, params *DisassociateDeviceFromPlacementInput, optFns ...func(*Options)) (*DisassociateDeviceFromPlacementOutput, error) { - if params == nil { - params = &DisassociateDeviceFromPlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateDeviceFromPlacement", params, optFns, c.addOperationDisassociateDeviceFromPlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateDeviceFromPlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateDeviceFromPlacementInput struct { - - // The device ID that should be removed from the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceTemplateName *string - - // The name of the placement that the device should be removed from. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project that contains the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type DisassociateDeviceFromPlacementOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateDeviceFromPlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateDeviceFromPlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateDeviceFromPlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateDeviceFromPlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpDisassociateDeviceFromPlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateDeviceFromPlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateDeviceFromPlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateDeviceFromPlacement", - } -} diff --git a/service/iot1clickprojects/api_op_GetDevicesInPlacement.go b/service/iot1clickprojects/api_op_GetDevicesInPlacement.go deleted file mode 100644 index 50f2151424f..00000000000 --- a/service/iot1clickprojects/api_op_GetDevicesInPlacement.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns an object enumerating the devices in a placement. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) GetDevicesInPlacement(ctx context.Context, params *GetDevicesInPlacementInput, optFns ...func(*Options)) (*GetDevicesInPlacementOutput, error) { - if params == nil { - params = &GetDevicesInPlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDevicesInPlacement", params, optFns, c.addOperationGetDevicesInPlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDevicesInPlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDevicesInPlacementInput struct { - - // The name of the placement to get the devices from. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project containing the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - noSmithyDocumentSerde -} - -type GetDevicesInPlacementOutput struct { - - // An object containing the devices (zero or more) within the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Devices map[string]string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDevicesInPlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDevicesInPlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDevicesInPlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDevicesInPlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpGetDevicesInPlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDevicesInPlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetDevicesInPlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDevicesInPlacement", - } -} diff --git a/service/iot1clickprojects/api_op_ListPlacements.go b/service/iot1clickprojects/api_op_ListPlacements.go deleted file mode 100644 index b1cbc7b89c7..00000000000 --- a/service/iot1clickprojects/api_op_ListPlacements.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the placement(s) of a project. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListPlacements(ctx context.Context, params *ListPlacementsInput, optFns ...func(*Options)) (*ListPlacementsOutput, error) { - if params == nil { - params = &ListPlacementsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListPlacements", params, optFns, c.addOperationListPlacementsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListPlacementsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListPlacementsInput struct { - - // The project containing the placements to be listed. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - MaxResults *int32 - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - noSmithyDocumentSerde -} - -type ListPlacementsOutput struct { - - // An object listing the requested placements. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Placements []types.PlacementSummary - - // The token used to retrieve the next set of results - will be effectively empty - // if there are no further results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListPlacementsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListPlacements{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPlacements{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListPlacements"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpListPlacementsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPlacements(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListPlacementsPaginatorOptions is the paginator options for ListPlacements -type ListPlacementsPaginatorOptions struct { - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListPlacementsPaginator is a paginator for ListPlacements -type ListPlacementsPaginator struct { - options ListPlacementsPaginatorOptions - client ListPlacementsAPIClient - params *ListPlacementsInput - nextToken *string - firstPage bool -} - -// NewListPlacementsPaginator returns a new ListPlacementsPaginator -func NewListPlacementsPaginator(client ListPlacementsAPIClient, params *ListPlacementsInput, optFns ...func(*ListPlacementsPaginatorOptions)) *ListPlacementsPaginator { - if params == nil { - params = &ListPlacementsInput{} - } - - options := ListPlacementsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListPlacementsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListPlacementsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListPlacements page. -func (p *ListPlacementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlacementsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListPlacements(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListPlacementsAPIClient is a client that implements the ListPlacements -// operation. -type ListPlacementsAPIClient interface { - ListPlacements(context.Context, *ListPlacementsInput, ...func(*Options)) (*ListPlacementsOutput, error) -} - -var _ ListPlacementsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListPlacements(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListPlacements", - } -} diff --git a/service/iot1clickprojects/api_op_ListProjects.go b/service/iot1clickprojects/api_op_ListProjects.go deleted file mode 100644 index b387b32077a..00000000000 --- a/service/iot1clickprojects/api_op_ListProjects.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the AWS IoT 1-Click project(s) associated with your AWS account and -// region. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListProjects(ctx context.Context, params *ListProjectsInput, optFns ...func(*Options)) (*ListProjectsOutput, error) { - if params == nil { - params = &ListProjectsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListProjects", params, optFns, c.addOperationListProjectsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListProjectsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListProjectsInput struct { - - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - MaxResults *int32 - - // The token to retrieve the next set of results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - noSmithyDocumentSerde -} - -type ListProjectsOutput struct { - - // An object containing the list of projects. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Projects []types.ProjectSummary - - // The token used to retrieve the next set of results - will be effectively empty - // if there are no further results. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListProjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListProjects{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProjects{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListProjects"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProjects(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -// ListProjectsPaginatorOptions is the paginator options for ListProjects -type ListProjectsPaginatorOptions struct { - // The maximum number of results to return per request. If not set, a default - // value of 100 is used. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListProjectsPaginator is a paginator for ListProjects -type ListProjectsPaginator struct { - options ListProjectsPaginatorOptions - client ListProjectsAPIClient - params *ListProjectsInput - nextToken *string - firstPage bool -} - -// NewListProjectsPaginator returns a new ListProjectsPaginator -func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { - if params == nil { - params = &ListProjectsInput{} - } - - options := ListProjectsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListProjectsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListProjectsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListProjects page. -func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListProjects(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListProjectsAPIClient is a client that implements the ListProjects operation. -type ListProjectsAPIClient interface { - ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) -} - -var _ ListProjectsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListProjects", - } -} diff --git a/service/iot1clickprojects/api_op_ListTagsForResource.go b/service/iot1clickprojects/api_op_ListTagsForResource.go deleted file mode 100644 index 10bba034bff..00000000000 --- a/service/iot1clickprojects/api_op_ListTagsForResource.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the tags (metadata key/value pairs) which you have assigned to the -// resource. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if params == nil { - params = &ListTagsForResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTagsForResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTagsForResourceInput struct { - - // The ARN of the resource whose tags you want to list. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - noSmithyDocumentSerde -} - -type ListTagsForResourceOutput struct { - - // The tags (metadata key/value pairs) which you have assigned to the resource. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTagsForResource", - } -} diff --git a/service/iot1clickprojects/api_op_TagResource.go b/service/iot1clickprojects/api_op_TagResource.go deleted file mode 100644 index 177cff612f2..00000000000 --- a/service/iot1clickprojects/api_op_TagResource.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates or modifies tags for a resource. Tags are key/value pairs (metadata) -// that can be used to manage a resource. For more information, see [AWS Tagging Strategies]. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -// -// [AWS Tagging Strategies]: https://aws.amazon.com/answers/account-management/aws-tagging-strategies/ -func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { - if params == nil { - params = &TagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TagResourceInput struct { - - // The ARN of the resouce for which tag(s) should be added or modified. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - // The new or modifying tag(s) for the resource. See [AWS IoT 1-Click Service Limits] for the maximum number of - // tags allowed per resource. - // - // [AWS IoT 1-Click Service Limits]: https://docs.aws.amazon.com/iot-1-click/latest/developerguide/1click-appendix.html#1click-limits - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -type TagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpTagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TagResource", - } -} diff --git a/service/iot1clickprojects/api_op_UntagResource.go b/service/iot1clickprojects/api_op_UntagResource.go deleted file mode 100644 index a5e54fed136..00000000000 --- a/service/iot1clickprojects/api_op_UntagResource.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes one or more tags (metadata key/value pairs) from a resource. -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { - if params == nil { - params = &UntagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UntagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UntagResourceInput struct { - - // The ARN of the resource whose tag you want to remove. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ResourceArn *string - - // The keys of those tags which you want to remove. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - TagKeys []string - - noSmithyDocumentSerde -} - -type UntagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUntagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UntagResource", - } -} diff --git a/service/iot1clickprojects/api_op_UpdatePlacement.go b/service/iot1clickprojects/api_op_UpdatePlacement.go deleted file mode 100644 index 138164f2795..00000000000 --- a/service/iot1clickprojects/api_op_UpdatePlacement.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates a placement with the given attributes. To clear an attribute, pass an -// empty value (i.e., ""). -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UpdatePlacement(ctx context.Context, params *UpdatePlacementInput, optFns ...func(*Options)) (*UpdatePlacementOutput, error) { - if params == nil { - params = &UpdatePlacementInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdatePlacement", params, optFns, c.addOperationUpdatePlacementMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdatePlacementOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdatePlacementInput struct { - - // The name of the placement to update. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project containing the placement to be updated. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The user-defined object of attributes used to update the placement. The maximum - // number of key/value pairs is 50. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Attributes map[string]string - - noSmithyDocumentSerde -} - -type UpdatePlacementOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdatePlacementMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePlacement{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePlacement{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePlacement"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUpdatePlacementValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePlacement(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdatePlacement(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdatePlacement", - } -} diff --git a/service/iot1clickprojects/api_op_UpdateProject.go b/service/iot1clickprojects/api_op_UpdateProject.go deleted file mode 100644 index 6694b602b59..00000000000 --- a/service/iot1clickprojects/api_op_UpdateProject.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates a project associated with your AWS account and region. With the -// exception of device template names, you can pass just the values that need to be -// updated because the update request will change only the values that are -// provided. To clear a value, pass the empty string (i.e., "" ). -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -func (c *Client) UpdateProject(ctx context.Context, params *UpdateProjectInput, optFns ...func(*Options)) (*UpdateProjectOutput, error) { - if params == nil { - params = &UpdateProjectInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateProject", params, optFns, c.addOperationUpdateProjectMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateProjectOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateProjectInput struct { - - // The name of the project to be updated. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // An optional user-defined description for the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Description *string - - // An object defining the project update. Once a project has been created, you - // cannot add device template names to the project. However, for a given - // placementTemplate , you can update the associated callbackOverrides for the - // device definition using this API. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementTemplate *types.PlacementTemplate - - noSmithyDocumentSerde -} - -type UpdateProjectOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateProjectMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProject{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProject{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateProject"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addOpUpdateProjectValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProject(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addSpanInitializeStart(stack); err != nil { - return err - } - if err = addSpanInitializeEnd(stack); err != nil { - return err - } - if err = addSpanBuildRequestStart(stack); err != nil { - return err - } - if err = addSpanBuildRequestEnd(stack); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateProject(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateProject", - } -} diff --git a/service/iot1clickprojects/auth.go b/service/iot1clickprojects/auth.go deleted file mode 100644 index 27d99cde0d5..00000000000 --- a/service/iot1clickprojects/auth.go +++ /dev/null @@ -1,313 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(ctx, params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "iot1click") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/service/iot1clickprojects/deserializers.go b/service/iot1clickprojects/deserializers.go deleted file mode 100644 index 98bc9069e20..00000000000 --- a/service/iot1clickprojects/deserializers.go +++ /dev/null @@ -1,3101 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "strings" - "time" -) - -func deserializeS3Expires(v string) (*time.Time, error) { - t, err := smithytime.ParseHTTPDate(v) - if err != nil { - return nil, nil - } - return &t, nil -} - -type awsRestjson1_deserializeOpAssociateDeviceWithPlacement struct { -} - -func (*awsRestjson1_deserializeOpAssociateDeviceWithPlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpAssociateDeviceWithPlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorAssociateDeviceWithPlacement(response, &metadata) - } - output := &AssociateDeviceWithPlacementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorAssociateDeviceWithPlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpCreatePlacement struct { -} - -func (*awsRestjson1_deserializeOpCreatePlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreatePlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreatePlacement(response, &metadata) - } - output := &CreatePlacementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreatePlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpCreateProject struct { -} - -func (*awsRestjson1_deserializeOpCreateProject) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateProject(response, &metadata) - } - output := &CreateProjectOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceConflictException", errorCode): - return awsRestjson1_deserializeErrorResourceConflictException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeletePlacement struct { -} - -func (*awsRestjson1_deserializeOpDeletePlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeletePlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePlacement(response, &metadata) - } - output := &DeletePlacementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeletePlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteProject struct { -} - -func (*awsRestjson1_deserializeOpDeleteProject) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteProject(response, &metadata) - } - output := &DeleteProjectOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDescribePlacement struct { -} - -func (*awsRestjson1_deserializeOpDescribePlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribePlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribePlacement(response, &metadata) - } - output := &DescribePlacementOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribePlacementOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribePlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribePlacementOutput(v **DescribePlacementOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribePlacementOutput - if *v == nil { - sv = &DescribePlacementOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "placement": - if err := awsRestjson1_deserializeDocumentPlacementDescription(&sv.Placement, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeProject struct { -} - -func (*awsRestjson1_deserializeOpDescribeProject) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDescribeProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeProject(response, &metadata) - } - output := &DescribeProjectOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentDescribeProjectOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDescribeProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentDescribeProjectOutput(v **DescribeProjectOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeProjectOutput - if *v == nil { - sv = &DescribeProjectOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "project": - if err := awsRestjson1_deserializeDocumentProjectDescription(&sv.Project, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDisassociateDeviceFromPlacement struct { -} - -func (*awsRestjson1_deserializeOpDisassociateDeviceFromPlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDisassociateDeviceFromPlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateDeviceFromPlacement(response, &metadata) - } - output := &DisassociateDeviceFromPlacementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDisassociateDeviceFromPlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetDevicesInPlacement struct { -} - -func (*awsRestjson1_deserializeOpGetDevicesInPlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetDevicesInPlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDevicesInPlacement(response, &metadata) - } - output := &GetDevicesInPlacementOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentGetDevicesInPlacementOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetDevicesInPlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetDevicesInPlacementOutput(v **GetDevicesInPlacementOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetDevicesInPlacementOutput - if *v == nil { - sv = &GetDevicesInPlacementOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "devices": - if err := awsRestjson1_deserializeDocumentDeviceMap(&sv.Devices, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListPlacements struct { -} - -func (*awsRestjson1_deserializeOpListPlacements) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListPlacements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPlacements(response, &metadata) - } - output := &ListPlacementsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListPlacementsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListPlacements(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListPlacementsOutput(v **ListPlacementsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListPlacementsOutput - if *v == nil { - sv = &ListPlacementsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "placements": - if err := awsRestjson1_deserializeDocumentPlacementSummaryList(&sv.Placements, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListProjects struct { -} - -func (*awsRestjson1_deserializeOpListProjects) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListProjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProjects(response, &metadata) - } - output := &ListProjectsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListProjectsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListProjects(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListProjectsOutput(v **ListProjectsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListProjectsOutput - if *v == nil { - sv = &ListProjectsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "projects": - if err := awsRestjson1_deserializeDocumentProjectSummaryList(&sv.Projects, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListTagsForResource struct { -} - -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) - } - output := &ListTagsForResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTagResource struct { -} - -func (*awsRestjson1_deserializeOpTagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) - } - output := &TagResourceOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUntagResource struct { -} - -func (*awsRestjson1_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUpdatePlacement struct { -} - -func (*awsRestjson1_deserializeOpUpdatePlacement) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdatePlacement) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePlacement(response, &metadata) - } - output := &UpdatePlacementOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdatePlacement(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpUpdateProject struct { -} - -func (*awsRestjson1_deserializeOpUpdateProject) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateProject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateProject(response, &metadata) - } - output := &UpdateProjectOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateProject(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalFailureException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceConflictException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceConflictException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyRequestsException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeDocumentDefaultPlacementAttributeMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AttributeDefaultValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceCallbackOverrideMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DeviceCallbackValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DeviceId to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceTemplate(v **types.DeviceTemplate, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DeviceTemplate - if *v == nil { - sv = &types.DeviceTemplate{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "callbackOverrides": - if err := awsRestjson1_deserializeDocumentDeviceCallbackOverrideMap(&sv.CallbackOverrides, value); err != nil { - return err - } - - case "deviceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DeviceType to be of type string, got %T instead", value) - } - sv.DeviceType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDeviceTemplateMap(v *map[string]types.DeviceTemplate, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]types.DeviceTemplate - if *v == nil { - mv = map[string]types.DeviceTemplate{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal types.DeviceTemplate - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentDeviceTemplate(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalFailureException - if *v == nil { - sv = &types.InternalFailureException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Code to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidRequestException - if *v == nil { - sv = &types.InvalidRequestException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Code to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPlacementAttributeMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentPlacementDescription(v **types.PlacementDescription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PlacementDescription - if *v == nil { - sv = &types.PlacementDescription{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "attributes": - if err := awsRestjson1_deserializeDocumentPlacementAttributeMap(&sv.Attributes, value); err != nil { - return err - } - - case "createdDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - case "placementName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PlacementName to be of type string, got %T instead", value) - } - sv.PlacementName = ptr.String(jtv) - } - - case "projectName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) - } - sv.ProjectName = ptr.String(jtv) - } - - case "updatedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPlacementSummary(v **types.PlacementSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PlacementSummary - if *v == nil { - sv = &types.PlacementSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "createdDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - case "placementName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PlacementName to be of type string, got %T instead", value) - } - sv.PlacementName = ptr.String(jtv) - } - - case "projectName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) - } - sv.ProjectName = ptr.String(jtv) - } - - case "updatedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentPlacementSummaryList(v *[]types.PlacementSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PlacementSummary - if *v == nil { - cv = []types.PlacementSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PlacementSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentPlacementSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentPlacementTemplate(v **types.PlacementTemplate, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PlacementTemplate - if *v == nil { - sv = &types.PlacementTemplate{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "defaultAttributes": - if err := awsRestjson1_deserializeDocumentDefaultPlacementAttributeMap(&sv.DefaultAttributes, value); err != nil { - return err - } - - case "deviceTemplates": - if err := awsRestjson1_deserializeDocumentDeviceTemplateMap(&sv.DeviceTemplates, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentProjectDescription(v **types.ProjectDescription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ProjectDescription - if *v == nil { - sv = &types.ProjectDescription{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Description to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "placementTemplate": - if err := awsRestjson1_deserializeDocumentPlacementTemplate(&sv.PlacementTemplate, value); err != nil { - return err - } - - case "projectName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) - } - sv.ProjectName = ptr.String(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "updatedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentProjectSummary(v **types.ProjectSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ProjectSummary - if *v == nil { - sv = &types.ProjectSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - case "projectName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ProjectName to be of type string, got %T instead", value) - } - sv.ProjectName = ptr.String(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - - case "updatedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Time to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentProjectSummaryList(v *[]types.ProjectSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ProjectSummary - if *v == nil { - cv = []types.ProjectSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ProjectSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentProjectSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceConflictException - if *v == nil { - sv = &types.ResourceConflictException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Code to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceNotFoundException - if *v == nil { - sv = &types.ResourceNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Code to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TooManyRequestsException - if *v == nil { - sv = &types.TooManyRequestsException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Code to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/service/iot1clickprojects/doc.go b/service/iot1clickprojects/doc.go deleted file mode 100644 index 5c2de0d833b..00000000000 --- a/service/iot1clickprojects/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package iot1clickprojects provides the API client, operations, and parameter -// types for AWS IoT 1-Click Projects Service. -// -// # The AWS IoT 1-Click Projects API Reference -// -// Deprecated: AWS has deprecated this service. It is no longer available for use. -package iot1clickprojects diff --git a/service/iot1clickprojects/endpoints.go b/service/iot1clickprojects/endpoints.go deleted file mode 100644 index ffb5b456ace..00000000000 --- a/service/iot1clickprojects/endpoints.go +++ /dev/null @@ -1,537 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "iot1click" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_IOT_1CLICK_PROJECTS") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "IoT 1Click Projects", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) *string { - if region == "" { - return nil - } - return aws.String(endpoints.MapFIPSRegion(region)) -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://projects.iot1click-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - uriString := func() string { - var out strings.Builder - out.WriteString("https://projects.iot1click-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://projects.iot1click.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://projects.iot1click.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = bindRegion(options.Region) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/service/iot1clickprojects/endpoints_config_test.go b/service/iot1clickprojects/endpoints_config_test.go deleted file mode 100644 index 0fad2be145a..00000000000 --- a/service/iot1clickprojects/endpoints_config_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "os" - "reflect" - "testing" -) - -type mockConfigSource struct { - global string - service string - ignore bool -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { - return m.ignore, m.ignore, nil -} - -// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use -// with configured endpoints. -func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { - if m.service != "" { - return m.service, true, nil - } - return "", false, nil -} - -func TestResolveBaseEndpoint(t *testing.T) { - cases := map[string]struct { - envGlobal string - envService string - envIgnore bool - configGlobal string - configService string - configIgnore bool - clientEndpoint *string - expectURL *string - }{ - "env ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-projects.dev", - envIgnore: true, - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - expectURL: nil, - }, - "env global": { - envGlobal: "https://env-global.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - expectURL: aws.String("https://env-global.dev"), - }, - "env service": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-projects.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - expectURL: aws.String("https://env-iot-1click-projects.dev"), - }, - "config ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-projects.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - configIgnore: true, - expectURL: nil, - }, - "config global": { - configGlobal: "http://config-global.dev", - expectURL: aws.String("http://config-global.dev"), - }, - "config service": { - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - expectURL: aws.String("http://config-iot-1click-projects.dev"), - }, - "client": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-1click-projects.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-1click-projects.dev", - clientEndpoint: aws.String("https://client-iot-1click-projects.dev"), - expectURL: aws.String("https://client-iot-1click-projects.dev"), - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - os.Clearenv() - - awsConfig := aws.Config{} - ignore := c.envIgnore || c.configIgnore - - if c.configGlobal != "" && !ignore { - awsConfig.BaseEndpoint = aws.String(c.configGlobal) - } - - if c.envGlobal != "" { - t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) - if !ignore { - awsConfig.BaseEndpoint = aws.String(c.envGlobal) - } - } - - if c.envService != "" { - t.Setenv("AWS_ENDPOINT_URL_IOT_1CLICK_PROJECTS", c.envService) - } - - awsConfig.ConfigSources = []interface{}{ - mockConfigSource{ - global: c.envGlobal, - service: c.envService, - ignore: c.envIgnore, - }, - mockConfigSource{ - global: c.configGlobal, - service: c.configService, - ignore: c.configIgnore, - }, - } - - client := NewFromConfig(awsConfig, func(o *Options) { - if c.clientEndpoint != nil { - o.BaseEndpoint = c.clientEndpoint - } - }) - - if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { - t.Errorf("expect endpoint %v , got %v", e, a) - } - }) - } -} diff --git a/service/iot1clickprojects/endpoints_test.go b/service/iot1clickprojects/endpoints_test.go deleted file mode 100644 index daf83c96282..00000000000 --- a/service/iot1clickprojects/endpoints_test.go +++ /dev/null @@ -1,1042 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - smithy "github.com/aws/smithy-go" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/ptr" - "net/http" - "net/url" - "reflect" - "strings" - "testing" -) - -// For region ap-northeast-1 with FIPS disabled and DualStack disabled -func TestEndpointCase0(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("ap-northeast-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.ap-northeast-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region eu-central-1 with FIPS disabled and DualStack disabled -func TestEndpointCase1(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-central-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.eu-central-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region eu-west-1 with FIPS disabled and DualStack disabled -func TestEndpointCase2(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.eu-west-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region eu-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase3(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("eu-west-2"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.eu-west-2.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase4(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-2 with FIPS disabled and DualStack disabled -func TestEndpointCase5(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-2"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-east-2.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase6(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-west-2"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-west-2.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase7(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase8(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase15(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase16(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase17(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase18(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase19(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase20(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase21(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase22(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase23(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click-fips.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase24(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase25(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://projects.iot1click.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase26(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase27(t *testing.T) { - var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { - t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) - } - - if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { - t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) - } -} - -// For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase28(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase29(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// Missing region -func TestEndpointCase30(t *testing.T) { - var params = EndpointParameters{} - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/iot1clickprojects/generated.json b/service/iot1clickprojects/generated.json deleted file mode 100644 index f234628d986..00000000000 --- a/service/iot1clickprojects/generated.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AssociateDeviceWithPlacement.go", - "api_op_CreatePlacement.go", - "api_op_CreateProject.go", - "api_op_DeletePlacement.go", - "api_op_DeleteProject.go", - "api_op_DescribePlacement.go", - "api_op_DescribeProject.go", - "api_op_DisassociateDeviceFromPlacement.go", - "api_op_GetDevicesInPlacement.go", - "api_op_ListPlacements.go", - "api_op_ListProjects.go", - "api_op_ListTagsForResource.go", - "api_op_TagResource.go", - "api_op_UntagResource.go", - "api_op_UpdatePlacement.go", - "api_op_UpdateProject.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "snapshot_test.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.15", - "module": "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects", - "unstable": false -} diff --git a/service/iot1clickprojects/go.mod b/service/iot1clickprojects/go.mod deleted file mode 100644 index 60ad2411975..00000000000 --- a/service/iot1clickprojects/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/aws/aws-sdk-go-v2/service/iot1clickprojects - -go 1.21 - -require ( - github.com/aws/aws-sdk-go-v2 v1.32.7 - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.26 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.26 - github.com/aws/smithy-go v1.22.1 -) - -replace github.com/aws/aws-sdk-go-v2 => ../../ - -replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ - -replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/iot1clickprojects/go.sum b/service/iot1clickprojects/go.sum deleted file mode 100644 index bd2678891af..00000000000 --- a/service/iot1clickprojects/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= -github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/iot1clickprojects/go_module_metadata.go b/service/iot1clickprojects/go_module_metadata.go deleted file mode 100644 index 3cb37f8f3ec..00000000000 --- a/service/iot1clickprojects/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package iot1clickprojects - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.24.0" diff --git a/service/iot1clickprojects/internal/endpoints/endpoints.go b/service/iot1clickprojects/internal/endpoints/endpoints.go deleted file mode 100644 index fc4faa1e083..00000000000 --- a/service/iot1clickprojects/internal/endpoints/endpoints.go +++ /dev/null @@ -1,296 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver IoT 1Click Projects endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "projects.iot1click-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "projects.iot1click.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - }, -} diff --git a/service/iot1clickprojects/internal/endpoints/endpoints_test.go b/service/iot1clickprojects/internal/endpoints/endpoints_test.go deleted file mode 100644 index 08e5da2d833..00000000000 --- a/service/iot1clickprojects/internal/endpoints/endpoints_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "testing" -) - -func TestRegexCompile(t *testing.T) { - _ = defaultPartitions -} diff --git a/service/iot1clickprojects/options.go b/service/iot1clickprojects/options.go deleted file mode 100644 index 306ee02de21..00000000000 --- a/service/iot1clickprojects/options.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/service/iot1clickprojects/protocol_test.go b/service/iot1clickprojects/protocol_test.go deleted file mode 100644 index 6df86e5829b..00000000000 --- a/service/iot1clickprojects/protocol_test.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects diff --git a/service/iot1clickprojects/serializers.go b/service/iot1clickprojects/serializers.go deleted file mode 100644 index 6dc26fac62c..00000000000 --- a/service/iot1clickprojects/serializers.go +++ /dev/null @@ -1,1497 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/iot1clickprojects/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -type awsRestjson1_serializeOpAssociateDeviceWithPlacement struct { -} - -func (*awsRestjson1_serializeOpAssociateDeviceWithPlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpAssociateDeviceWithPlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateDeviceWithPlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsAssociateDeviceWithPlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentAssociateDeviceWithPlacementInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsAssociateDeviceWithPlacementInput(v *AssociateDeviceWithPlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceTemplateName == nil || len(*v.DeviceTemplateName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member deviceTemplateName must not be empty")} - } - if v.DeviceTemplateName != nil { - if err := encoder.SetURI("deviceTemplateName").String(*v.DeviceTemplateName); err != nil { - return err - } - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentAssociateDeviceWithPlacementInput(v *AssociateDeviceWithPlacementInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DeviceId != nil { - ok := object.Key("deviceId") - ok.String(*v.DeviceId) - } - - return nil -} - -type awsRestjson1_serializeOpCreatePlacement struct { -} - -func (*awsRestjson1_serializeOpCreatePlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreatePlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreatePlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsCreatePlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreatePlacementInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreatePlacementInput(v *CreatePlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreatePlacementInput(v *CreatePlacementInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Attributes != nil { - ok := object.Key("attributes") - if err := awsRestjson1_serializeDocumentPlacementAttributeMap(v.Attributes, ok); err != nil { - return err - } - } - - if v.PlacementName != nil { - ok := object.Key("placementName") - ok.String(*v.PlacementName) - } - - return nil -} - -type awsRestjson1_serializeOpCreateProject struct { -} - -func (*awsRestjson1_serializeOpCreateProject) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateProjectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentCreateProjectInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateProjectInput(v *CreateProjectInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateProjectInput(v *CreateProjectInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.PlacementTemplate != nil { - ok := object.Key("placementTemplate") - if err := awsRestjson1_serializeDocumentPlacementTemplate(v.PlacementTemplate, ok); err != nil { - return err - } - } - - if v.ProjectName != nil { - ok := object.Key("projectName") - ok.String(*v.ProjectName) - } - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeletePlacement struct { -} - -func (*awsRestjson1_serializeOpDeletePlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeletePlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeletePlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeletePlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeletePlacementInput(v *DeletePlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDeleteProject struct { -} - -func (*awsRestjson1_serializeOpDeleteProject) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteProjectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteProjectInput(v *DeleteProjectInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribePlacement struct { -} - -func (*awsRestjson1_serializeOpDescribePlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribePlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribePlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribePlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribePlacementInput(v *DescribePlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDescribeProject struct { -} - -func (*awsRestjson1_serializeOpDescribeProject) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDescribeProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeProjectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDescribeProjectInput(v *DescribeProjectInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpDisassociateDeviceFromPlacement struct { -} - -func (*awsRestjson1_serializeOpDisassociateDeviceFromPlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDisassociateDeviceFromPlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisassociateDeviceFromPlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}/devices/{deviceTemplateName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsDisassociateDeviceFromPlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDisassociateDeviceFromPlacementInput(v *DisassociateDeviceFromPlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.DeviceTemplateName == nil || len(*v.DeviceTemplateName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member deviceTemplateName must not be empty")} - } - if v.DeviceTemplateName != nil { - if err := encoder.SetURI("deviceTemplateName").String(*v.DeviceTemplateName); err != nil { - return err - } - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpGetDevicesInPlacement struct { -} - -func (*awsRestjson1_serializeOpGetDevicesInPlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetDevicesInPlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetDevicesInPlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}/devices") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsGetDevicesInPlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetDevicesInPlacementInput(v *GetDevicesInPlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListPlacements struct { -} - -func (*awsRestjson1_serializeOpListPlacements) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListPlacements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListPlacementsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListPlacementsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListPlacementsInput(v *ListPlacementsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpListProjects struct { -} - -func (*awsRestjson1_serializeOpListProjects) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListProjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListProjectsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListProjectsInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListProjectsInput(v *ListProjectsInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - return nil -} - -type awsRestjson1_serializeOpListTagsForResource struct { -} - -func (*awsRestjson1_serializeOpListTagsForResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTagsForResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpTagResource struct { -} - -func (*awsRestjson1_serializeOpTagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Tags != nil { - ok := object.Key("tags") - if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUntagResource struct { -} - -func (*awsRestjson1_serializeOpUntagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UntagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "DELETE" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} - } - if v.ResourceArn != nil { - if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { - return err - } - } - - if v.TagKeys != nil { - for i := range v.TagKeys { - encoder.AddQuery("tagKeys").String(v.TagKeys[i]) - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdatePlacement struct { -} - -func (*awsRestjson1_serializeOpUpdatePlacement) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdatePlacement) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdatePlacementInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}/placements/{placementName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdatePlacementInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdatePlacementInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdatePlacementInput(v *UpdatePlacementInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.PlacementName == nil || len(*v.PlacementName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member placementName must not be empty")} - } - if v.PlacementName != nil { - if err := encoder.SetURI("placementName").String(*v.PlacementName); err != nil { - return err - } - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdatePlacementInput(v *UpdatePlacementInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Attributes != nil { - ok := object.Key("attributes") - if err := awsRestjson1_serializeDocumentPlacementAttributeMap(v.Attributes, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateProject struct { -} - -func (*awsRestjson1_serializeOpUpdateProject) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateProject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateProjectInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/projects/{projectName}") - request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) - request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "PUT" - var restEncoder *httpbinding.Encoder - if request.URL.RawPath == "" { - restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - } else { - request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) - restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) - } - - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if err := awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(input, restEncoder); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentUpdateProjectInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = restEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateProjectInput(v *UpdateProjectInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.ProjectName == nil || len(*v.ProjectName) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member projectName must not be empty")} - } - if v.ProjectName != nil { - if err := encoder.SetURI("projectName").String(*v.ProjectName); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateProjectInput(v *UpdateProjectInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.PlacementTemplate != nil { - ok := object.Key("placementTemplate") - if err := awsRestjson1_serializeDocumentPlacementTemplate(v.PlacementTemplate, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentDefaultPlacementAttributeMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentDeviceCallbackOverrideMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentDeviceTemplate(v *types.DeviceTemplate, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CallbackOverrides != nil { - ok := object.Key("callbackOverrides") - if err := awsRestjson1_serializeDocumentDeviceCallbackOverrideMap(v.CallbackOverrides, ok); err != nil { - return err - } - } - - if v.DeviceType != nil { - ok := object.Key("deviceType") - ok.String(*v.DeviceType) - } - - return nil -} - -func awsRestjson1_serializeDocumentDeviceTemplateMap(v map[string]types.DeviceTemplate, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - mapVar := v[key] - if err := awsRestjson1_serializeDocumentDeviceTemplate(&mapVar, om); err != nil { - return err - } - } - return nil -} - -func awsRestjson1_serializeDocumentPlacementAttributeMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} - -func awsRestjson1_serializeDocumentPlacementTemplate(v *types.PlacementTemplate, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DefaultAttributes != nil { - ok := object.Key("defaultAttributes") - if err := awsRestjson1_serializeDocumentDefaultPlacementAttributeMap(v.DefaultAttributes, ok); err != nil { - return err - } - } - - if v.DeviceTemplates != nil { - ok := object.Key("deviceTemplates") - if err := awsRestjson1_serializeDocumentDeviceTemplateMap(v.DeviceTemplates, ok); err != nil { - return err - } - } - - return nil -} - -func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - for key := range v { - om := object.Key(key) - om.String(v[key]) - } - return nil -} diff --git a/service/iot1clickprojects/snapshot/api_op_AssociateDeviceWithPlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_AssociateDeviceWithPlacement.go.snap deleted file mode 100644 index 55fd85498cd..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_AssociateDeviceWithPlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -AssociateDeviceWithPlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_CreatePlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_CreatePlacement.go.snap deleted file mode 100644 index 1f5a5e06852..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_CreatePlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -CreatePlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_CreateProject.go.snap b/service/iot1clickprojects/snapshot/api_op_CreateProject.go.snap deleted file mode 100644 index 63cd0b9e454..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_CreateProject.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -CreateProject - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_DeletePlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_DeletePlacement.go.snap deleted file mode 100644 index 4e2bd3e7eba..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_DeletePlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DeletePlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_DeleteProject.go.snap b/service/iot1clickprojects/snapshot/api_op_DeleteProject.go.snap deleted file mode 100644 index b34816d3b2c..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_DeleteProject.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DeleteProject - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_DescribePlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_DescribePlacement.go.snap deleted file mode 100644 index 05a8d6de8ba..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_DescribePlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DescribePlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_DescribeProject.go.snap b/service/iot1clickprojects/snapshot/api_op_DescribeProject.go.snap deleted file mode 100644 index 2f8e7ffd0c5..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_DescribeProject.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DescribeProject - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_DisassociateDeviceFromPlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_DisassociateDeviceFromPlacement.go.snap deleted file mode 100644 index 04317a4b1e3..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_DisassociateDeviceFromPlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -DisassociateDeviceFromPlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_GetDevicesInPlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_GetDevicesInPlacement.go.snap deleted file mode 100644 index f3e64c3e602..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_GetDevicesInPlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -GetDevicesInPlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_ListPlacements.go.snap b/service/iot1clickprojects/snapshot/api_op_ListPlacements.go.snap deleted file mode 100644 index cbbabd90588..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_ListPlacements.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -ListPlacements - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_ListProjects.go.snap b/service/iot1clickprojects/snapshot/api_op_ListProjects.go.snap deleted file mode 100644 index 2d4bbf8611d..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_ListProjects.go.snap +++ /dev/null @@ -1,40 +0,0 @@ -ListProjects - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_ListTagsForResource.go.snap b/service/iot1clickprojects/snapshot/api_op_ListTagsForResource.go.snap deleted file mode 100644 index 071d3ac4e96..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_ListTagsForResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -ListTagsForResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_TagResource.go.snap b/service/iot1clickprojects/snapshot/api_op_TagResource.go.snap deleted file mode 100644 index ae6f8e0846c..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_TagResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -TagResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_UntagResource.go.snap b/service/iot1clickprojects/snapshot/api_op_UntagResource.go.snap deleted file mode 100644 index c7bbe038d98..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_UntagResource.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UntagResource - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_UpdatePlacement.go.snap b/service/iot1clickprojects/snapshot/api_op_UpdatePlacement.go.snap deleted file mode 100644 index aded8669b46..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_UpdatePlacement.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UpdatePlacement - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot/api_op_UpdateProject.go.snap b/service/iot1clickprojects/snapshot/api_op_UpdateProject.go.snap deleted file mode 100644 index 182b42d6077..00000000000 --- a/service/iot1clickprojects/snapshot/api_op_UpdateProject.go.snap +++ /dev/null @@ -1,41 +0,0 @@ -UpdateProject - Initialize stack step - spanInitializeStart - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - spanInitializeEnd - Serialize stack step - spanBuildRequestStart - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - AddTimeOffsetMiddleware - RecursionDetection - spanBuildRequestEnd - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - spanRetryLoop - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - AddTimeOffsetMiddleware - RecordResponseTiming - RequestResponseLogger diff --git a/service/iot1clickprojects/snapshot_test.go b/service/iot1clickprojects/snapshot_test.go deleted file mode 100644 index bc22d804630..00000000000 --- a/service/iot1clickprojects/snapshot_test.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -//go:build snapshot - -package iot1clickprojects - -import ( - "context" - "errors" - "fmt" - "github.com/aws/smithy-go/middleware" - "io" - "io/fs" - "os" - "testing" -) - -const ssprefix = "snapshot" - -type snapshotOK struct{} - -func (snapshotOK) Error() string { return "error: success" } - -func createp(path string) (*os.File, error) { - if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { - return nil, err - } - return os.Create(path) -} - -func sspath(op string) string { - return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) -} - -func updateSnapshot(stack *middleware.Stack, operation string) error { - f, err := createp(sspath(operation)) - if err != nil { - return err - } - defer f.Close() - if _, err := f.Write([]byte(stack.String())); err != nil { - return err - } - return snapshotOK{} -} - -func testSnapshot(stack *middleware.Stack, operation string) error { - f, err := os.Open(sspath(operation)) - if errors.Is(err, fs.ErrNotExist) { - return snapshotOK{} - } - if err != nil { - return err - } - defer f.Close() - expected, err := io.ReadAll(f) - if err != nil { - return err - } - if actual := stack.String(); actual != string(expected) { - return fmt.Errorf("%s != %s", expected, actual) - } - return snapshotOK{} -} -func TestCheckSnapshot_AssociateDeviceWithPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.AssociateDeviceWithPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "AssociateDeviceWithPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_CreatePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreatePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreatePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_CreateProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreateProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeletePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeletePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeletePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeleteProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeleteProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DescribePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DescribePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DescribeProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribeProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DescribeProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DisassociateDeviceFromPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DisassociateDeviceFromPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DisassociateDeviceFromPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetDevicesInPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDevicesInPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetDevicesInPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListPlacements(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListPlacements(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListPlacements") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListProjects(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListProjects(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListProjects") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListTagsForResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListTagsForResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_TagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.TagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "TagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UntagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UntagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdatePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdatePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdatePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} -func TestUpdateSnapshot_AssociateDeviceWithPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.AssociateDeviceWithPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "AssociateDeviceWithPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_CreatePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreatePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreatePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_CreateProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreateProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeletePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeletePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeletePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeleteProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeleteProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DescribePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DescribePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DescribeProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.DescribeProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DescribeProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DisassociateDeviceFromPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.DisassociateDeviceFromPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DisassociateDeviceFromPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetDevicesInPlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDevicesInPlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetDevicesInPlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListPlacements(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListPlacements(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListPlacements") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListProjects(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListProjects(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListProjects") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListTagsForResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_TagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.TagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "TagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UntagResource(t *testing.T) { - svc := New(Options{}) - _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UntagResource") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdatePlacement(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdatePlacement(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdatePlacement") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateProject(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateProject(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateProject") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} diff --git a/service/iot1clickprojects/types/errors.go b/service/iot1clickprojects/types/errors.go deleted file mode 100644 index fafa22dabf9..00000000000 --- a/service/iot1clickprojects/types/errors.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -type InternalFailureException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *InternalFailureException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InternalFailureException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InternalFailureException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InternalFailureException" - } - return *e.ErrorCodeOverride -} -func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -type InvalidRequestException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *InvalidRequestException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidRequestException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidRequestException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidRequestException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type ResourceConflictException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *ResourceConflictException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceConflictException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceConflictException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceConflictException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -type TooManyRequestsException struct { - Message *string - - ErrorCodeOverride *string - - Code *string - - noSmithyDocumentSerde -} - -func (e *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *TooManyRequestsException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *TooManyRequestsException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "TooManyRequestsException" - } - return *e.ErrorCodeOverride -} -func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iot1clickprojects/types/types.go b/service/iot1clickprojects/types/types.go deleted file mode 100644 index 95d41323991..00000000000 --- a/service/iot1clickprojects/types/types.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// An object representing a device for a placement template (see PlacementTemplate). -type DeviceTemplate struct { - - // An optional Lambda function to invoke instead of the default Lambda function - // provided by the placement template. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - CallbackOverrides map[string]string - - // The device type, which currently must be "button" . - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceType *string - - noSmithyDocumentSerde -} - -// An object describing a project's placement. -type PlacementDescription struct { - - // The user-defined attributes associated with the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Attributes map[string]string - - // The date when the placement was initially created, in UNIX epoch time format. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - CreatedDate *time.Time - - // The name of the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project containing the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The date when the placement was last updated, in UNIX epoch time format. If the - // placement was not updated, then createdDate and updatedDate are the same. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - UpdatedDate *time.Time - - noSmithyDocumentSerde -} - -// An object providing summary information for a particular placement. -type PlacementSummary struct { - - // The date when the placement was originally created, in UNIX epoch time format. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - CreatedDate *time.Time - - // The name of the placement being summarized. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementName *string - - // The name of the project containing the placement. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The date when the placement was last updated, in UNIX epoch time format. If the - // placement was not updated, then createdDate and updatedDate are the same. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - UpdatedDate *time.Time - - noSmithyDocumentSerde -} - -// An object defining the template for a placement. -type PlacementTemplate struct { - - // The default attributes (key/value pairs) to be applied to all placements using - // this template. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DefaultAttributes map[string]string - - // An object specifying the DeviceTemplate for all placements using this (PlacementTemplate ) template. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - DeviceTemplates map[string]DeviceTemplate - - noSmithyDocumentSerde -} - -// An object providing detailed information for a particular project associated -// with an AWS account and region. -type ProjectDescription struct { - - // The date when the project was originally created, in UNIX epoch time format. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - CreatedDate *time.Time - - // The name of the project for which to obtain information from. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The date when the project was last updated, in UNIX epoch time format. If the - // project was not updated, then createdDate and updatedDate are the same. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - UpdatedDate *time.Time - - // The ARN of the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Arn *string - - // The description of the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Description *string - - // An object describing the project's placement specifications. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - PlacementTemplate *PlacementTemplate - - // The tags (metadata key/value pairs) associated with the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -// An object providing summary information for a particular project for an -// associated AWS account and region. -type ProjectSummary struct { - - // The date when the project was originally created, in UNIX epoch time format. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - CreatedDate *time.Time - - // The name of the project being summarized. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - ProjectName *string - - // The date when the project was last updated, in UNIX epoch time format. If the - // project was not updated, then createdDate and updatedDate are the same. - // - // This member is required. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - UpdatedDate *time.Time - - // The ARN of the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Arn *string - - // The tags (metadata key/value pairs) associated with the project. - // - // Deprecated: AWS has deprecated this service. It is no longer available for use. - Tags map[string]string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/iot1clickprojects/validators.go b/service/iot1clickprojects/validators.go deleted file mode 100644 index 2ad66abecd0..00000000000 --- a/service/iot1clickprojects/validators.go +++ /dev/null @@ -1,631 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iot1clickprojects - -import ( - "context" - "fmt" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAssociateDeviceWithPlacement struct { -} - -func (*validateOpAssociateDeviceWithPlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateDeviceWithPlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateDeviceWithPlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateDeviceWithPlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreatePlacement struct { -} - -func (*validateOpCreatePlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreatePlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreatePlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreatePlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateProject struct { -} - -func (*validateOpCreateProject) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateProjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateProjectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeletePlacement struct { -} - -func (*validateOpDeletePlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeletePlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeletePlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeletePlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteProject struct { -} - -func (*validateOpDeleteProject) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteProjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteProjectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribePlacement struct { -} - -func (*validateOpDescribePlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribePlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribePlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribePlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeProject struct { -} - -func (*validateOpDescribeProject) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeProjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeProjectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateDeviceFromPlacement struct { -} - -func (*validateOpDisassociateDeviceFromPlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateDeviceFromPlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateDeviceFromPlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateDeviceFromPlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDevicesInPlacement struct { -} - -func (*validateOpGetDevicesInPlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDevicesInPlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDevicesInPlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDevicesInPlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListPlacements struct { -} - -func (*validateOpListPlacements) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListPlacements) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListPlacementsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListPlacementsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTagsForResource struct { -} - -func (*validateOpListTagsForResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTagsForResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTagsForResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTagResource struct { -} - -func (*validateOpTagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUntagResource struct { -} - -func (*validateOpUntagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UntagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUntagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdatePlacement struct { -} - -func (*validateOpUpdatePlacement) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdatePlacement) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdatePlacementInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdatePlacementInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateProject struct { -} - -func (*validateOpUpdateProject) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateProject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateProjectInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateProjectInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAssociateDeviceWithPlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateDeviceWithPlacement{}, middleware.After) -} - -func addOpCreatePlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreatePlacement{}, middleware.After) -} - -func addOpCreateProjectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateProject{}, middleware.After) -} - -func addOpDeletePlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeletePlacement{}, middleware.After) -} - -func addOpDeleteProjectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteProject{}, middleware.After) -} - -func addOpDescribePlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribePlacement{}, middleware.After) -} - -func addOpDescribeProjectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeProject{}, middleware.After) -} - -func addOpDisassociateDeviceFromPlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateDeviceFromPlacement{}, middleware.After) -} - -func addOpGetDevicesInPlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDevicesInPlacement{}, middleware.After) -} - -func addOpListPlacementsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListPlacements{}, middleware.After) -} - -func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) -} - -func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) -} - -func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) -} - -func addOpUpdatePlacementValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdatePlacement{}, middleware.After) -} - -func addOpUpdateProjectValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateProject{}, middleware.After) -} - -func validateOpAssociateDeviceWithPlacementInput(v *AssociateDeviceWithPlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateDeviceWithPlacementInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.DeviceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceId")) - } - if v.DeviceTemplateName == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceTemplateName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreatePlacementInput(v *CreatePlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreatePlacementInput"} - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateProjectInput(v *CreateProjectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateProjectInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeletePlacementInput(v *DeletePlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeletePlacementInput"} - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteProjectInput(v *DeleteProjectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteProjectInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribePlacementInput(v *DescribePlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribePlacementInput"} - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeProjectInput(v *DescribeProjectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeProjectInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateDeviceFromPlacementInput(v *DisassociateDeviceFromPlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateDeviceFromPlacementInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.DeviceTemplateName == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeviceTemplateName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDevicesInPlacementInput(v *GetDevicesInPlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDevicesInPlacementInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListPlacementsInput(v *ListPlacementsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListPlacementsInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTagResourceInput(v *TagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.Tags == nil { - invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUntagResourceInput(v *UntagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.TagKeys == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdatePlacementInput(v *UpdatePlacementInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdatePlacementInput"} - if v.PlacementName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PlacementName")) - } - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateProjectInput(v *UpdateProjectInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateProjectInput"} - if v.ProjectName == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProjectName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -}