diff --git a/.changelog/d40ecb47e15b4e95aeaa651fb0ca1e61.json b/.changelog/d40ecb47e15b4e95aeaa651fb0ca1e61.json new file mode 100644 index 00000000000..6ae762ad9bc --- /dev/null +++ b/.changelog/d40ecb47e15b4e95aeaa651fb0ca1e61.json @@ -0,0 +1,8 @@ +{ + "id": "d40ecb47-e15b-4e95-aeaa-651fb0ca1e61", + "type": "release", + "description": "remove iotroborunner service", + "modules": [ + "." + ] +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/iot-roborunner.json b/codegen/sdk-codegen/aws-models/iot-roborunner.json deleted file mode 100644 index b6dee2cc9a5..00000000000 --- a/codegen/sdk-codegen/aws-models/iot-roborunner.json +++ /dev/null @@ -1,3326 +0,0 @@ -{ - "smithy": "2.0", - "shapes": { - "com.amazonaws.iotroborunner#AccessDeniedException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": " User does not have sufficient access to perform this action.\t", - "smithy.api#error": "client", - "smithy.api#httpError": 403, - "smithy.api#retryable": {} - } - }, - "com.amazonaws.iotroborunner#CartesianCoordinates": { - "type": "structure", - "members": { - "x": { - "target": "smithy.api#Double", - "traits": { - "smithy.api#documentation": "X coordinate.", - "smithy.api#required": {} - } - }, - "y": { - "target": "smithy.api#Double", - "traits": { - "smithy.api#documentation": "Y coordinate.", - "smithy.api#required": {} - } - }, - "z": { - "target": "smithy.api#Double", - "traits": { - "smithy.api#default": null, - "smithy.api#documentation": "Z coordinate." - } - } - }, - "traits": { - "smithy.api#documentation": "Cartesian coordinates in 3D space relative to the RoboRunner origin." - } - }, - "com.amazonaws.iotroborunner#ConflictException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if a resource in a create request already exists.", - "smithy.api#error": "client", - "smithy.api#httpError": 409 - } - }, - "com.amazonaws.iotroborunner#CreateDestination": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#CreateDestinationRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#CreateDestinationResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ServiceQuotaExceededException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to create a destination", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/createDestination" - }, - "smithy.api#idempotent": {} - } - }, - "com.amazonaws.iotroborunner#CreateDestinationRequest": { - "type": "structure", - "members": { - "clientToken": { - "target": "com.amazonaws.iotroborunner#IdempotencyToken", - "traits": { - "smithy.api#idempotencyToken": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#documentation": "The state of the destination. Default used if not specified." - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#CreateDestinationResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#DestinationArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#DestinationId", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#CreateSite": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#CreateSiteRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#CreateSiteResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ServiceQuotaExceededException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to create a site", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/createSite" - }, - "smithy.api#idempotent": {} - } - }, - "com.amazonaws.iotroborunner#CreateSiteRequest": { - "type": "structure", - "members": { - "clientToken": { - "target": "com.amazonaws.iotroborunner#IdempotencyToken", - "traits": { - "smithy.api#idempotencyToken": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "countryCode": { - "target": "com.amazonaws.iotroborunner#SiteCountryCode", - "traits": { - "smithy.api#required": {} - } - }, - "description": { - "target": "com.amazonaws.iotroborunner#SiteDescription" - } - } - }, - "com.amazonaws.iotroborunner#CreateSiteResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#SiteId", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#CreateWorker": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#CreateWorkerRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#CreateWorkerResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ServiceQuotaExceededException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to create a worker", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/createWorker" - }, - "smithy.api#idempotent": {} - } - }, - "com.amazonaws.iotroborunner#CreateWorkerFleet": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#CreateWorkerFleetRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#CreateWorkerFleetResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ServiceQuotaExceededException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to create a worker fleet", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/createWorkerFleet" - }, - "smithy.api#idempotent": {} - } - }, - "com.amazonaws.iotroborunner#CreateWorkerFleetRequest": { - "type": "structure", - "members": { - "clientToken": { - "target": "com.amazonaws.iotroborunner#IdempotencyToken", - "traits": { - "smithy.api#idempotencyToken": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "siteId" - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#CreateWorkerFleetResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#CreateWorkerRequest": { - "type": "structure", - "members": { - "clientToken": { - "target": "com.amazonaws.iotroborunner#IdempotencyToken", - "traits": { - "smithy.api#idempotencyToken": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "fleet": { - "target": "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - }, - "additionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson" - }, - "vendorProperties": { - "target": "com.amazonaws.iotroborunner#VendorProperties" - }, - "position": { - "target": "com.amazonaws.iotroborunner#PositionCoordinates" - }, - "orientation": { - "target": "com.amazonaws.iotroborunner#Orientation" - } - } - }, - "com.amazonaws.iotroborunner#CreateWorkerResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerId", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#CreatedAtTimestamp": { - "type": "timestamp", - "traits": { - "smithy.api#documentation": "Timestamp at which the resource was created." - } - }, - "com.amazonaws.iotroborunner#DeleteDestination": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#DeleteDestinationRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#DeleteDestinationResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to delete a destination", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/deleteDestination" - } - } - }, - "com.amazonaws.iotroborunner#DeleteDestinationRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#DestinationGenericIdentifier", - "traits": { - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "id" - } - } - } - }, - "com.amazonaws.iotroborunner#DeleteDestinationResponse": { - "type": "structure", - "members": {} - }, - "com.amazonaws.iotroborunner#DeleteSite": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#DeleteSiteRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#DeleteSiteResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to delete a site", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/deleteSite" - } - } - }, - "com.amazonaws.iotroborunner#DeleteSiteRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "siteId" - } - } - } - }, - "com.amazonaws.iotroborunner#DeleteSiteResponse": { - "type": "structure", - "members": {} - }, - "com.amazonaws.iotroborunner#DeleteWorker": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#DeleteWorkerRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#DeleteWorkerResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to delete a worker", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/deleteWorker" - } - } - }, - "com.amazonaws.iotroborunner#DeleteWorkerFleet": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#DeleteWorkerFleetRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#DeleteWorkerFleetResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#ConflictException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to delete a worker fleet", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/deleteWorkerFleet" - } - } - }, - "com.amazonaws.iotroborunner#DeleteWorkerFleetRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#DeleteWorkerFleetResponse": { - "type": "structure", - "members": {} - }, - "com.amazonaws.iotroborunner#DeleteWorkerRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#DeleteWorkerResponse": { - "type": "structure", - "members": {} - }, - "com.amazonaws.iotroborunner#Destination": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#DestinationArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#DestinationId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties" - } - }, - "traits": { - "smithy.api#documentation": "Area within a facility where work can be performed." - } - }, - "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON document containing additional fixed properties regarding the destination", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#DestinationArn": { - "type": "string", - "traits": { - "aws.api#arnReference": { - "service": "com.amazonaws.iotroborunner#IoTRoboRunner", - "resource": "com.amazonaws.iotroborunner#DestinationResource" - }, - "smithy.api#documentation": "Destination ARN.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#DestinationGenericIdentifier": { - "type": "string", - "traits": { - "smithy.api#documentation": "Destination ARN.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$|^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/destination/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#DestinationId": { - "type": "string", - "traits": { - "smithy.api#documentation": "Filters access by the destination's identifier", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#DestinationResource": { - "type": "resource", - "identifiers": { - "id": { - "target": "com.amazonaws.iotroborunner#DestinationId" - } - }, - "create": { - "target": "com.amazonaws.iotroborunner#CreateDestination" - }, - "read": { - "target": "com.amazonaws.iotroborunner#GetDestination" - }, - "update": { - "target": "com.amazonaws.iotroborunner#UpdateDestination" - }, - "list": { - "target": "com.amazonaws.iotroborunner#ListDestinations" - }, - "operations": [ - { - "target": "com.amazonaws.iotroborunner#DeleteDestination" - } - ], - "traits": { - "aws.api#arn": { - "template": "{id}", - "absolute": true - }, - "smithy.api#documentation": "Represents a Destination that defines a location within a Site" - } - }, - "com.amazonaws.iotroborunner#DestinationState": { - "type": "string", - "traits": { - "smithy.api#documentation": "State of the destination.", - "smithy.api#enum": [ - { - "value": "ENABLED", - "name": "ENABLED" - }, - { - "value": "DISABLED", - "name": "DISABLED" - }, - { - "value": "DECOMMISSIONED", - "name": "DECOMMISSIONED" - } - ] - } - }, - "com.amazonaws.iotroborunner#Destinations": { - "type": "list", - "member": { - "target": "com.amazonaws.iotroborunner#Destination" - }, - "traits": { - "smithy.api#documentation": "List of destinations." - } - }, - "com.amazonaws.iotroborunner#GetDestination": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#GetDestinationRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#GetDestinationResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to get a destination", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/getDestination" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#GetDestinationRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#DestinationGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "id", - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "id" - } - } - } - }, - "com.amazonaws.iotroborunner#GetDestinationResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#DestinationArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#DestinationId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#GetSite": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#GetSiteRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#GetSiteResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to get a site", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/getSite" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#GetSiteRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "id", - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "siteId" - } - } - } - }, - "com.amazonaws.iotroborunner#GetSiteResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#SiteId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "countryCode": { - "target": "com.amazonaws.iotroborunner#SiteCountryCode", - "traits": { - "smithy.api#required": {} - } - }, - "description": { - "target": "com.amazonaws.iotroborunner#SiteDescription" - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#GetWorker": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#GetWorkerRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#GetWorkerResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to get a worker", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/getWorker" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#GetWorkerFleet": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#GetWorkerFleetRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#GetWorkerFleetResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to get a worker fleet", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/getWorkerFleet" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#GetWorkerFleetRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "id", - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#GetWorkerFleetResponse": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId", - "traits": { - "smithy.api#required": {} - } - }, - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#GetWorkerRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "id", - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#GetWorkerResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerId", - "traits": { - "smithy.api#required": {} - } - }, - "fleet": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "additionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson" - }, - "vendorProperties": { - "target": "com.amazonaws.iotroborunner#VendorProperties" - }, - "position": { - "target": "com.amazonaws.iotroborunner#PositionCoordinates" - }, - "orientation": { - "target": "com.amazonaws.iotroborunner#Orientation" - } - } - }, - "com.amazonaws.iotroborunner#IdempotencyToken": { - "type": "string", - "traits": { - "smithy.api#documentation": "Token used for detecting replayed requests. Replayed requests will not be performed multiple times.", - "smithy.api#length": { - "min": 1, - "max": 64 - }, - "smithy.api#pattern": "^[!-~]*$" - } - }, - "com.amazonaws.iotroborunner#InternalServerException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if something goes wrong within the service.", - "smithy.api#error": "server", - "smithy.api#httpError": 500 - } - }, - "com.amazonaws.iotroborunner#IoTRoboRunner": { - "type": "service", - "version": "2018-05-10", - "operations": [ - { - "target": "com.amazonaws.iotroborunner#CreateWorker" - }, - { - "target": "com.amazonaws.iotroborunner#DeleteWorker" - }, - { - "target": "com.amazonaws.iotroborunner#DeleteWorkerFleet" - }, - { - "target": "com.amazonaws.iotroborunner#GetWorker" - }, - { - "target": "com.amazonaws.iotroborunner#GetWorkerFleet" - }, - { - "target": "com.amazonaws.iotroborunner#ListWorkers" - }, - { - "target": "com.amazonaws.iotroborunner#UpdateWorker" - }, - { - "target": "com.amazonaws.iotroborunner#UpdateWorkerFleet" - } - ], - "resources": [ - { - "target": "com.amazonaws.iotroborunner#DestinationResource" - }, - { - "target": "com.amazonaws.iotroborunner#SiteResource" - } - ], - "traits": { - "aws.api#service": { - "sdkId": "IoT RoboRunner", - "arnNamespace": "iotroborunner", - "endpointPrefix": "iotroborunner", - "cloudTrailEventSource": "iotroborunner.amazonaws.com" - }, - "aws.auth#sigv4": { - "name": "iotroborunner" - }, - "aws.protocols#restJson1": {}, - "smithy.api#cors": { - "additionalAllowedHeaders": [ - "*", - "authorization", - "date", - "x-amz-date", - "x-amz-security-token", - "x-amz-target", - "content-type", - "x-amz-content-sha256", - "x-amz-user-agent", - "x-amzn-platform-id", - "x-amzn-trace-id", - "amz-sdk-invocation-id", - "amz-sdk-request" - ], - "additionalExposedHeaders": [ - "x-amzn-errortype", - "x-amzn-requestid", - "x-amzn-errormessage", - "x-amzn-trace-id", - "x-amz-apigw-id", - "date" - ] - }, - "smithy.api#documentation": "An example service, deployed with the Octane Service creator,\nwhich will echo the string", - "smithy.api#title": "AWS IoT RoboRunner", - "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": [], - "type": "tree", - "rules": [ - { - "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": [], - "type": "tree", - "rules": [ - { - "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": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://iotroborunner-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": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://iotroborunner-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": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://iotroborunner.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" - } - ] - }, - { - "conditions": [], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://iotroborunner.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] - } - ] - }, - { - "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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner.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://iotroborunner-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://iotroborunner.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.iotroborunner#ListDestinations": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#ListDestinationsRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#ListDestinationsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to list destinations", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/listDestinations" - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults", - "items": "destinations" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#ListDestinationsRequest": { - "type": "structure", - "members": { - "site": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "site", - "smithy.api#required": {} - } - }, - "maxResults": { - "target": "com.amazonaws.iotroborunner#PageSize", - "traits": { - "smithy.api#httpQuery": "maxResults" - } - }, - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken", - "traits": { - "smithy.api#httpQuery": "nextToken" - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#httpQuery": "state" - } - } - } - }, - "com.amazonaws.iotroborunner#ListDestinationsResponse": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken" - }, - "destinations": { - "target": "com.amazonaws.iotroborunner#Destinations" - } - } - }, - "com.amazonaws.iotroborunner#ListSites": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#ListSitesRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#ListSitesResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to list sites", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/listSites" - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults", - "items": "sites" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#ListSitesPageSize": { - "type": "integer", - "traits": { - "smithy.api#documentation": "Maximum number of results to retrieve in a single ListSites call.", - "smithy.api#range": { - "min": 1, - "max": 25 - } - } - }, - "com.amazonaws.iotroborunner#ListSitesRequest": { - "type": "structure", - "members": { - "maxResults": { - "target": "com.amazonaws.iotroborunner#ListSitesPageSize", - "traits": { - "smithy.api#httpQuery": "maxResults" - } - }, - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken", - "traits": { - "smithy.api#httpQuery": "nextToken" - } - } - } - }, - "com.amazonaws.iotroborunner#ListSitesResponse": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken" - }, - "sites": { - "target": "com.amazonaws.iotroborunner#Sites" - } - } - }, - "com.amazonaws.iotroborunner#ListWorkerFleets": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#ListWorkerFleetsRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#ListWorkerFleetsResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to list worker fleets", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/listWorkerFleets" - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults", - "items": "workerFleets" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#ListWorkerFleetsPageSize": { - "type": "integer", - "traits": { - "smithy.api#documentation": "Maximum number of results to retrieve in a single ListWorkerFleets call.", - "smithy.api#range": { - "min": 1, - "max": 25 - } - } - }, - "com.amazonaws.iotroborunner#ListWorkerFleetsRequest": { - "type": "structure", - "members": { - "site": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "site", - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "siteId" - } - }, - "maxResults": { - "target": "com.amazonaws.iotroborunner#ListWorkerFleetsPageSize", - "traits": { - "smithy.api#httpQuery": "maxResults" - } - }, - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken", - "traits": { - "smithy.api#httpQuery": "nextToken" - } - } - } - }, - "com.amazonaws.iotroborunner#ListWorkerFleetsResponse": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken" - }, - "workerFleets": { - "target": "com.amazonaws.iotroborunner#WorkerFleets" - } - } - }, - "com.amazonaws.iotroborunner#ListWorkers": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#ListWorkersRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#ListWorkersResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to list workers", - "smithy.api#http": { - "code": 200, - "method": "GET", - "uri": "/listWorkers" - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults", - "items": "workers" - }, - "smithy.api#readonly": {} - } - }, - "com.amazonaws.iotroborunner#ListWorkersPageSize": { - "type": "integer", - "traits": { - "smithy.api#documentation": "Maximum number of results to retrieve in a single ListWorkers call.", - "smithy.api#range": { - "min": 1, - "max": 25 - } - } - }, - "com.amazonaws.iotroborunner#ListWorkersRequest": { - "type": "structure", - "members": { - "site": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "site", - "smithy.api#required": {} - } - }, - "maxResults": { - "target": "com.amazonaws.iotroborunner#ListWorkersPageSize", - "traits": { - "smithy.api#httpQuery": "maxResults" - } - }, - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken", - "traits": { - "smithy.api#httpQuery": "nextToken" - } - }, - "fleet": { - "target": "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier", - "traits": { - "smithy.api#httpQuery": "fleet" - } - } - } - }, - "com.amazonaws.iotroborunner#ListWorkersResponse": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.iotroborunner#PaginationToken" - }, - "workers": { - "target": "com.amazonaws.iotroborunner#Workers" - } - } - }, - "com.amazonaws.iotroborunner#Name": { - "type": "string", - "traits": { - "smithy.api#documentation": "Human friendly name of the resource.", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#Orientation": { - "type": "union", - "members": { - "degrees": { - "target": "smithy.api#Double", - "traits": { - "smithy.api#documentation": "Degrees, limited on [0, 360)", - "smithy.api#range": { - "min": 0, - "max": 360 - } - } - } - }, - "traits": { - "smithy.api#documentation": "Worker orientation measured in units clockwise from north." - } - }, - "com.amazonaws.iotroborunner#PageSize": { - "type": "integer", - "traits": { - "smithy.api#documentation": "Maximum number of results to retrieve in a single call.", - "smithy.api#range": { - "min": 1, - "max": 1000 - } - } - }, - "com.amazonaws.iotroborunner#PaginationToken": { - "type": "string", - "traits": { - "smithy.api#documentation": "Pagination token returned when another page of data exists. Provide it in your next call to the API to receive\nthe next page.", - "smithy.api#length": { - "min": 1, - "max": 2048 - }, - "smithy.api#pattern": "[a-zA-Z0-9_.-/+=]*" - } - }, - "com.amazonaws.iotroborunner#PositionCoordinates": { - "type": "union", - "members": { - "cartesianCoordinates": { - "target": "com.amazonaws.iotroborunner#CartesianCoordinates", - "traits": { - "smithy.api#documentation": "Cartesian coordinates." - } - } - }, - "traits": { - "smithy.api#documentation": "Supported coordinates for worker position." - } - }, - "com.amazonaws.iotroborunner#ResourceNotFoundException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if a resource referenced in the request doesn't exist.", - "smithy.api#error": "client", - "smithy.api#httpError": 404 - } - }, - "com.amazonaws.iotroborunner#ServiceQuotaExceededException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if the user's AWS account has reached a service limit and the operation cannot proceed.", - "smithy.api#error": "client", - "smithy.api#httpError": 402, - "smithy.api#retryable": {} - } - }, - "com.amazonaws.iotroborunner#Site": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#documentation": "The name of the site. Mutable after creation and unique within a given account.", - "smithy.api#required": {} - } - }, - "countryCode": { - "target": "com.amazonaws.iotroborunner#SiteCountryCode", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "Facility containing destinations, workers, activities, and tasks." - } - }, - "com.amazonaws.iotroborunner#SiteArn": { - "type": "string", - "traits": { - "aws.api#arnReference": { - "service": "com.amazonaws.iotroborunner#IoTRoboRunner", - "resource": "com.amazonaws.iotroborunner#SiteResource" - }, - "smithy.api#documentation": "Site ARN.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#SiteCountryCode": { - "type": "string", - "traits": { - "smithy.api#documentation": "A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., US.", - "smithy.api#length": { - "min": 2, - "max": 2 - }, - "smithy.api#pattern": "^[a-zA-Z]{2}$" - } - }, - "com.amazonaws.iotroborunner#SiteDescription": { - "type": "string", - "traits": { - "smithy.api#documentation": "A high-level description of the site.", - "smithy.api#length": { - "min": 0, - "max": 140 - } - } - }, - "com.amazonaws.iotroborunner#SiteGenericIdentifier": { - "type": "string", - "traits": { - "smithy.api#documentation": "Site ARN.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#SiteId": { - "type": "string", - "traits": { - "smithy.api#documentation": "Filters access by the site's identifier", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#SiteResource": { - "type": "resource", - "identifiers": { - "siteId": { - "target": "com.amazonaws.iotroborunner#SiteId" - } - }, - "create": { - "target": "com.amazonaws.iotroborunner#CreateSite" - }, - "read": { - "target": "com.amazonaws.iotroborunner#GetSite" - }, - "update": { - "target": "com.amazonaws.iotroborunner#UpdateSite" - }, - "list": { - "target": "com.amazonaws.iotroborunner#ListSites" - }, - "operations": [ - { - "target": "com.amazonaws.iotroborunner#DeleteSite" - } - ], - "resources": [ - { - "target": "com.amazonaws.iotroborunner#WorkerFleetResource" - } - ], - "traits": { - "aws.api#arn": { - "template": "site/{siteId}", - "absolute": true - }, - "smithy.api#documentation": "Represents a Site where work is being performed" - } - }, - "com.amazonaws.iotroborunner#Sites": { - "type": "list", - "member": { - "target": "com.amazonaws.iotroborunner#Site" - }, - "traits": { - "smithy.api#documentation": "List of facilities." - } - }, - "com.amazonaws.iotroborunner#ThrottlingException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if the api has been called too quickly be the client.", - "smithy.api#error": "client", - "smithy.api#httpError": 429, - "smithy.api#retryable": { - "throttling": true - } - } - }, - "com.amazonaws.iotroborunner#UpdateDestination": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#UpdateDestinationRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#UpdateDestinationResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to update a destination", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/updateDestination" - } - } - }, - "com.amazonaws.iotroborunner#UpdateDestinationRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#DestinationGenericIdentifier", - "traits": { - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "id" - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name" - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#UpdateDestinationResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#DestinationArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#DestinationId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "state": { - "target": "com.amazonaws.iotroborunner#DestinationState", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#DestinationAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#UpdateSite": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#UpdateSiteRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#UpdateSiteResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to update a site", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/updateSite" - } - } - }, - "com.amazonaws.iotroborunner#UpdateSiteRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#SiteGenericIdentifier", - "traits": { - "smithy.api#required": {}, - "smithy.api#resourceIdentifier": "siteId" - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name" - }, - "countryCode": { - "target": "com.amazonaws.iotroborunner#SiteCountryCode" - }, - "description": { - "target": "com.amazonaws.iotroborunner#SiteDescription" - } - } - }, - "com.amazonaws.iotroborunner#UpdateSiteResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#SiteId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "countryCode": { - "target": "com.amazonaws.iotroborunner#SiteCountryCode" - }, - "description": { - "target": "com.amazonaws.iotroborunner#SiteDescription" - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorker": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#UpdateWorkerRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#UpdateWorkerResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to update a worker", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/updateWorker" - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorkerFleet": { - "type": "operation", - "input": { - "target": "com.amazonaws.iotroborunner#UpdateWorkerFleetRequest" - }, - "output": { - "target": "com.amazonaws.iotroborunner#UpdateWorkerFleetResponse" - }, - "errors": [ - { - "target": "com.amazonaws.iotroborunner#AccessDeniedException" - }, - { - "target": "com.amazonaws.iotroborunner#InternalServerException" - }, - { - "target": "com.amazonaws.iotroborunner#ResourceNotFoundException" - }, - { - "target": "com.amazonaws.iotroborunner#ThrottlingException" - }, - { - "target": "com.amazonaws.iotroborunner#ValidationException" - } - ], - "traits": { - "smithy.api#documentation": "Grants permission to update a worker fleet", - "smithy.api#http": { - "code": 200, - "method": "POST", - "uri": "/updateWorkerFleet" - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorkerFleetRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorkerFleetResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties" - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorkerRequest": { - "type": "structure", - "members": { - "id": { - "target": "com.amazonaws.iotroborunner#WorkerGenericIdentifier", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name" - }, - "additionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson" - }, - "vendorProperties": { - "target": "com.amazonaws.iotroborunner#VendorProperties" - }, - "position": { - "target": "com.amazonaws.iotroborunner#PositionCoordinates" - }, - "orientation": { - "target": "com.amazonaws.iotroborunner#Orientation" - } - } - }, - "com.amazonaws.iotroborunner#UpdateWorkerResponse": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerId", - "traits": { - "smithy.api#required": {} - } - }, - "fleet": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "additionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson" - }, - "orientation": { - "target": "com.amazonaws.iotroborunner#Orientation" - }, - "vendorProperties": { - "target": "com.amazonaws.iotroborunner#VendorProperties" - }, - "position": { - "target": "com.amazonaws.iotroborunner#PositionCoordinates" - } - } - }, - "com.amazonaws.iotroborunner#UpdatedAtTimestamp": { - "type": "timestamp", - "traits": { - "smithy.api#documentation": "Timestamp at which the resource was last updated." - } - }, - "com.amazonaws.iotroborunner#ValidationException": { - "type": "structure", - "members": { - "message": { - "target": "smithy.api#String" - } - }, - "traits": { - "smithy.api#documentation": "Exception thrown if an invalid parameter is provided to an API.", - "smithy.api#error": "client", - "smithy.api#httpError": 400 - } - }, - "com.amazonaws.iotroborunner#VendorAdditionalFixedPropertiesJson": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON blob containing unstructured vendor properties that are fixed and won't change during regular operation.", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#VendorAdditionalTransientPropertiesJson": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON blob containing unstructured vendor properties that are transient and may change during regular operation.", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#VendorProperties": { - "type": "structure", - "members": { - "vendorWorkerId": { - "target": "com.amazonaws.iotroborunner#VendorWorkerId", - "traits": { - "smithy.api#required": {} - } - }, - "vendorWorkerIpAddress": { - "target": "com.amazonaws.iotroborunner#VendorWorkerIpAddress" - }, - "vendorAdditionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#VendorAdditionalTransientPropertiesJson" - }, - "vendorAdditionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#VendorAdditionalFixedPropertiesJson" - } - }, - "traits": { - "smithy.api#documentation": "Properties of the worker that are provided by the vendor FMS." - } - }, - "com.amazonaws.iotroborunner#VendorWorkerId": { - "type": "string", - "traits": { - "smithy.api#documentation": "The worker ID defined by the vendor FMS.", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#VendorWorkerIpAddress": { - "type": "string", - "traits": { - "smithy.api#documentation": "The worker IP address defined by the vendor FMS.", - "smithy.api#length": { - "min": 1, - "max": 45 - } - } - }, - "com.amazonaws.iotroborunner#Worker": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerId", - "traits": { - "smithy.api#required": {} - } - }, - "fleet": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "additionalTransientProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson" - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson" - }, - "vendorProperties": { - "target": "com.amazonaws.iotroborunner#VendorProperties" - }, - "position": { - "target": "com.amazonaws.iotroborunner#PositionCoordinates" - }, - "orientation": { - "target": "com.amazonaws.iotroborunner#Orientation" - } - }, - "traits": { - "smithy.api#documentation": "A unit capable of performing tasks." - } - }, - "com.amazonaws.iotroborunner#WorkerAdditionalFixedPropertiesJson": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON blob containing unstructured worker properties that are fixed and won't change during regular operation.", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#WorkerAdditionalTransientPropertiesJson": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON blob containing unstructured worker properties that are transient and may change during regular operation.", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#WorkerArn": { - "type": "string", - "traits": { - "aws.api#arnReference": { - "service": "com.amazonaws.iotroborunner#IoTRoboRunner", - "resource": "com.amazonaws.iotroborunner#WorkerResource" - }, - "smithy.api#documentation": "Full ARN of the worker.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#WorkerFleet": { - "type": "structure", - "members": { - "arn": { - "target": "com.amazonaws.iotroborunner#WorkerFleetArn", - "traits": { - "smithy.api#required": {} - } - }, - "id": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId", - "traits": { - "smithy.api#required": {} - } - }, - "name": { - "target": "com.amazonaws.iotroborunner#Name", - "traits": { - "smithy.api#required": {} - } - }, - "site": { - "target": "com.amazonaws.iotroborunner#SiteArn", - "traits": { - "smithy.api#required": {} - } - }, - "createdAt": { - "target": "com.amazonaws.iotroborunner#CreatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "updatedAt": { - "target": "com.amazonaws.iotroborunner#UpdatedAtTimestamp", - "traits": { - "smithy.api#required": {} - } - }, - "additionalFixedProperties": { - "target": "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties" - } - }, - "traits": { - "smithy.api#documentation": "A collection of workers organized within a facility." - } - }, - "com.amazonaws.iotroborunner#WorkerFleetAdditionalFixedProperties": { - "type": "string", - "traits": { - "smithy.api#documentation": "JSON blob containing additional fixed properties regarding the worker fleet", - "smithy.api#length": { - "min": 1, - "max": 131072 - } - } - }, - "com.amazonaws.iotroborunner#WorkerFleetArn": { - "type": "string", - "traits": { - "aws.api#arnReference": { - "service": "com.amazonaws.iotroborunner#IoTRoboRunner", - "resource": "com.amazonaws.iotroborunner#WorkerFleetResource" - }, - "smithy.api#documentation": "Full ARN of the worker fleet.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#WorkerFleetGenericIdentifier": { - "type": "string", - "traits": { - "smithy.api#documentation": "Full ARN of the worker fleet.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#WorkerFleetId": { - "type": "string", - "traits": { - "smithy.api#documentation": "Filters access by the worker fleet's identifier", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#WorkerFleetResource": { - "type": "resource", - "identifiers": { - "workerFleetId": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId" - }, - "siteId": { - "target": "com.amazonaws.iotroborunner#SiteId" - } - }, - "create": { - "target": "com.amazonaws.iotroborunner#CreateWorkerFleet" - }, - "list": { - "target": "com.amazonaws.iotroborunner#ListWorkerFleets" - }, - "resources": [ - { - "target": "com.amazonaws.iotroborunner#WorkerResource" - } - ], - "traits": { - "aws.api#arn": { - "template": "site/{siteId}/worker-fleet/{workerFleetId}", - "absolute": true - }, - "smithy.api#documentation": "Represents a WorkerFleet that operates at a Site and contains Workers" - } - }, - "com.amazonaws.iotroborunner#WorkerFleets": { - "type": "list", - "member": { - "target": "com.amazonaws.iotroborunner#WorkerFleet" - }, - "traits": { - "smithy.api#documentation": "List of worker fleets." - } - }, - "com.amazonaws.iotroborunner#WorkerGenericIdentifier": { - "type": "string", - "traits": { - "smithy.api#documentation": "Full ARN of the worker.", - "smithy.api#length": { - "min": 1, - "max": 1011 - }, - "smithy.api#pattern": "^arn:aws:iotroborunner:[\\w-]+:\\w+:site/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker-fleet/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/worker/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$" - } - }, - "com.amazonaws.iotroborunner#WorkerId": { - "type": "string", - "traits": { - "smithy.api#documentation": "Filters access by the workers identifier", - "smithy.api#length": { - "min": 1, - "max": 255 - } - } - }, - "com.amazonaws.iotroborunner#WorkerResource": { - "type": "resource", - "identifiers": { - "workerId": { - "target": "com.amazonaws.iotroborunner#WorkerId" - }, - "workerFleetId": { - "target": "com.amazonaws.iotroborunner#WorkerFleetId" - }, - "siteId": { - "target": "com.amazonaws.iotroborunner#SiteId" - } - }, - "traits": { - "aws.api#arn": { - "template": "site/{siteId}/worker-fleet/{workerFleetId}/worker/{workerId}", - "absolute": true - }, - "smithy.api#documentation": "Represents a Worker that performs Actions" - } - }, - "com.amazonaws.iotroborunner#Workers": { - "type": "list", - "member": { - "target": "com.amazonaws.iotroborunner#Worker" - }, - "traits": { - "smithy.api#documentation": "List of workers." - } - } - } -} \ No newline at end of file diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json index 98b4b6aef59..99a2143074d 100644 --- a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json +++ b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/endpoints.json @@ -9486,12 +9486,6 @@ "us-east-1" : { } } }, - "iotroborunner" : { - "endpoints" : { - "eu-central-1" : { }, - "us-east-1" : { } - } - }, "iotsecuredtunneling" : { "defaults" : { "variants" : [ { diff --git a/service/iotroborunner/CHANGELOG.md b/service/iotroborunner/CHANGELOG.md deleted file mode 100644 index 222fee457a1..00000000000 --- a/service/iotroborunner/CHANGELOG.md +++ /dev/null @@ -1,200 +0,0 @@ -# v1.8.2 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.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.8.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.7.2 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.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.7.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.6.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.6.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.6.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.6.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.5.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.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.4.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.3.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.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.2.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.2.1 (2023-08-01) - -* No change notes available for this release. - -# v1.2.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.1.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.12 (2023-06-15) - -* No change notes available for this release. - -# v1.1.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.10 (2023-05-04) - -* No change notes available for this release. - -# v1.1.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.8 (2023-04-10) - -* No change notes available for this release. - -# v1.1.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.1.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.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.1.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.1.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.0.2 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.1 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.0.0 (2022-11-18) - -* **Release**: New AWS service client module -* **Feature**: AWS IoT RoboRunner is a new service that makes it easy to build applications that help multi-vendor robots work together seamlessly. See the IoT RoboRunner developer guide for more details on getting started. https://docs.aws.amazon.com/iotroborunner/latest/dev/iotroborunner-welcome.html - diff --git a/service/iotroborunner/LICENSE.txt b/service/iotroborunner/LICENSE.txt deleted file mode 100644 index d6456956733..00000000000 --- a/service/iotroborunner/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/iotroborunner/api_client.go b/service/iotroborunner/api_client.go deleted file mode 100644 index 3b2a7d30a82..00000000000 --- a/service/iotroborunner/api_client.go +++ /dev/null @@ -1,553 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - cryptorand "crypto/rand" - "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" - smithy "github.com/aws/smithy-go" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyrand "github.com/aws/smithy-go/rand" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "time" -) - -const ServiceID = "IoT RoboRunner" -const ServiceAPIVersion = "2018-05-10" - -// Client provides the API client to make operations call for AWS IoT RoboRunner. -type Client struct { - options Options -} - -// 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) - - resolveIdempotencyTokenProvider(&options) - - resolveEndpointResolverV2(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - 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) - 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 - } - } - - handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) - result, metadata, err = handler.Handle(ctx, params) - if err != nil { - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - 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{}, "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, "iotroborunner", 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 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 resolveIdempotencyTokenProvider(o *Options) { - if o.IdempotencyTokenProvider != nil { - return - } - o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - }) - 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 -} - -// IdempotencyTokenProvider interface for providing idempotency token -type IdempotencyTokenProvider interface { - GetIdempotencyToken() (string, error) -} - -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) -} diff --git a/service/iotroborunner/api_client_test.go b/service/iotroborunner/api_client_test.go deleted file mode 100644 index 90396e238a8..00000000000 --- a/service/iotroborunner/api_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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/iotroborunner/api_op_CreateDestination.go b/service/iotroborunner/api_op_CreateDestination.go deleted file mode 100644 index 7f36bbd4fb9..00000000000 --- a/service/iotroborunner/api_op_CreateDestination.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to create a destination -func (c *Client) CreateDestination(ctx context.Context, params *CreateDestinationInput, optFns ...func(*Options)) (*CreateDestinationOutput, error) { - if params == nil { - params = &CreateDestinationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateDestination", params, optFns, c.addOperationCreateDestinationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateDestinationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateDestinationInput struct { - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string - - // The state of the destination. Default used if not specified. - State types.DestinationState - - noSmithyDocumentSerde -} - -type CreateDestinationOutput struct { - - // Destination ARN. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the destination's identifier - // - // This member is required. - Id *string - - // State of the destination. - // - // This member is required. - State types.DestinationState - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDestination{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDestination{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDestination"); 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 = 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 = addIdempotencyToken_opCreateDestinationMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateDestinationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDestination(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 - } - return nil -} - -type idempotencyToken_initializeOpCreateDestination struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateDestination) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDestinationInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateDestinationMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDestination{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateDestination(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateDestination", - } -} diff --git a/service/iotroborunner/api_op_CreateSite.go b/service/iotroborunner/api_op_CreateSite.go deleted file mode 100644 index 30109ff538a..00000000000 --- a/service/iotroborunner/api_op_CreateSite.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to create a site -func (c *Client) CreateSite(ctx context.Context, params *CreateSiteInput, optFns ...func(*Options)) (*CreateSiteOutput, error) { - if params == nil { - params = &CreateSiteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateSite", params, optFns, c.addOperationCreateSiteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateSiteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateSiteInput struct { - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // This member is required. - CountryCode *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string - - // A high-level description of the site. - Description *string - - noSmithyDocumentSerde -} - -type CreateSiteOutput struct { - - // Site ARN. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the site's identifier - // - // This member is required. - Id *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSite{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSite{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateSite"); 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 = 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 = addIdempotencyToken_opCreateSiteMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateSiteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSite(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 - } - return nil -} - -type idempotencyToken_initializeOpCreateSite struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateSite) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateSiteInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSiteInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateSiteMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSite{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateSite(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateSite", - } -} diff --git a/service/iotroborunner/api_op_CreateWorker.go b/service/iotroborunner/api_op_CreateWorker.go deleted file mode 100644 index 67d1d14fda5..00000000000 --- a/service/iotroborunner/api_op_CreateWorker.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to create a worker -func (c *Client) CreateWorker(ctx context.Context, params *CreateWorkerInput, optFns ...func(*Options)) (*CreateWorkerOutput, error) { - if params == nil { - params = &CreateWorkerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateWorker", params, optFns, c.addOperationCreateWorkerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateWorkerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateWorkerInput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Fleet *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string - - // JSON blob containing unstructured worker properties that are transient and may - // change during regular operation. - AdditionalTransientProperties *string - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string - - // Worker orientation measured in units clockwise from north. - Orientation types.Orientation - - // Supported coordinates for worker position. - Position types.PositionCoordinates - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *types.VendorProperties - - noSmithyDocumentSerde -} - -type CreateWorkerOutput struct { - - // Full ARN of the worker. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the workers identifier - // - // This member is required. - Id *string - - // Site ARN. - // - // This member is required. - Site *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorker{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorker{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateWorker"); 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 = 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 = addIdempotencyToken_opCreateWorkerMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateWorkerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorker(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 - } - return nil -} - -type idempotencyToken_initializeOpCreateWorker struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateWorker) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateWorkerInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkerInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateWorkerMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorker{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateWorker(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateWorker", - } -} diff --git a/service/iotroborunner/api_op_CreateWorkerFleet.go b/service/iotroborunner/api_op_CreateWorkerFleet.go deleted file mode 100644 index 6d86f64775e..00000000000 --- a/service/iotroborunner/api_op_CreateWorkerFleet.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to create a worker fleet -func (c *Client) CreateWorkerFleet(ctx context.Context, params *CreateWorkerFleetInput, optFns ...func(*Options)) (*CreateWorkerFleetOutput, error) { - if params == nil { - params = &CreateWorkerFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateWorkerFleet", params, optFns, c.addOperationCreateWorkerFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateWorkerFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateWorkerFleetInput struct { - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string - - // Token used for detecting replayed requests. Replayed requests will not be - // performed multiple times. - ClientToken *string - - noSmithyDocumentSerde -} - -type CreateWorkerFleetOutput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the worker fleet's identifier - // - // This member is required. - Id *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkerFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkerFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateWorkerFleet"); 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 = 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 = addIdempotencyToken_opCreateWorkerFleetMiddleware(stack, options); err != nil { - return err - } - if err = addOpCreateWorkerFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkerFleet(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 - } - return nil -} - -type idempotencyToken_initializeOpCreateWorkerFleet struct { - tokenProvider IdempotencyTokenProvider -} - -func (*idempotencyToken_initializeOpCreateWorkerFleet) ID() string { - return "OperationIdempotencyTokenAutoFill" -} - -func (m *idempotencyToken_initializeOpCreateWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.tokenProvider == nil { - return next.HandleInitialize(ctx, in) - } - - input, ok := in.Parameters.(*CreateWorkerFleetInput) - if !ok { - return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkerFleetInput ") - } - - if input.ClientToken == nil { - t, err := m.tokenProvider.GetIdempotencyToken() - if err != nil { - return out, metadata, err - } - input.ClientToken = &t - } - return next.HandleInitialize(ctx, in) -} -func addIdempotencyToken_opCreateWorkerFleetMiddleware(stack *middleware.Stack, cfg Options) error { - return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkerFleet{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) -} - -func newServiceMetadataMiddleware_opCreateWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateWorkerFleet", - } -} diff --git a/service/iotroborunner/api_op_DeleteDestination.go b/service/iotroborunner/api_op_DeleteDestination.go deleted file mode 100644 index 802ac43b355..00000000000 --- a/service/iotroborunner/api_op_DeleteDestination.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" -) - -// Grants permission to delete a destination -func (c *Client) DeleteDestination(ctx context.Context, params *DeleteDestinationInput, optFns ...func(*Options)) (*DeleteDestinationOutput, error) { - if params == nil { - params = &DeleteDestinationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteDestination", params, optFns, c.addOperationDeleteDestinationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteDestinationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteDestinationInput struct { - - // Destination ARN. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DeleteDestinationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDestination{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDestination{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDestination"); 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 = 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 = addOpDeleteDestinationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDestination(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 - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteDestination(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteDestination", - } -} diff --git a/service/iotroborunner/api_op_DeleteSite.go b/service/iotroborunner/api_op_DeleteSite.go deleted file mode 100644 index d575a9f0138..00000000000 --- a/service/iotroborunner/api_op_DeleteSite.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" -) - -// Grants permission to delete a site -func (c *Client) DeleteSite(ctx context.Context, params *DeleteSiteInput, optFns ...func(*Options)) (*DeleteSiteOutput, error) { - if params == nil { - params = &DeleteSiteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteSite", params, optFns, c.addOperationDeleteSiteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteSiteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteSiteInput struct { - - // Site ARN. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DeleteSiteOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSite{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSite{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteSite"); 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 = 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 = addOpDeleteSiteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSite(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 - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteSite(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteSite", - } -} diff --git a/service/iotroborunner/api_op_DeleteWorker.go b/service/iotroborunner/api_op_DeleteWorker.go deleted file mode 100644 index 8740523d5f1..00000000000 --- a/service/iotroborunner/api_op_DeleteWorker.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" -) - -// Grants permission to delete a worker -func (c *Client) DeleteWorker(ctx context.Context, params *DeleteWorkerInput, optFns ...func(*Options)) (*DeleteWorkerOutput, error) { - if params == nil { - params = &DeleteWorkerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteWorker", params, optFns, c.addOperationDeleteWorkerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteWorkerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteWorkerInput struct { - - // Full ARN of the worker. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DeleteWorkerOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorker{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorker{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteWorker"); 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 = 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 = addOpDeleteWorkerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorker(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 - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteWorker(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteWorker", - } -} diff --git a/service/iotroborunner/api_op_DeleteWorkerFleet.go b/service/iotroborunner/api_op_DeleteWorkerFleet.go deleted file mode 100644 index 849f6189cd7..00000000000 --- a/service/iotroborunner/api_op_DeleteWorkerFleet.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" -) - -// Grants permission to delete a worker fleet -func (c *Client) DeleteWorkerFleet(ctx context.Context, params *DeleteWorkerFleetInput, optFns ...func(*Options)) (*DeleteWorkerFleetOutput, error) { - if params == nil { - params = &DeleteWorkerFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteWorkerFleet", params, optFns, c.addOperationDeleteWorkerFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteWorkerFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteWorkerFleetInput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DeleteWorkerFleetOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkerFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkerFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteWorkerFleet"); 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 = 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 = addOpDeleteWorkerFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkerFleet(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 - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteWorkerFleet", - } -} diff --git a/service/iotroborunner/api_op_GetDestination.go b/service/iotroborunner/api_op_GetDestination.go deleted file mode 100644 index a173aa2dafb..00000000000 --- a/service/iotroborunner/api_op_GetDestination.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to get a destination -func (c *Client) GetDestination(ctx context.Context, params *GetDestinationInput, optFns ...func(*Options)) (*GetDestinationOutput, error) { - if params == nil { - params = &GetDestinationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDestination", params, optFns, c.addOperationGetDestinationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDestinationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDestinationInput struct { - - // Destination ARN. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type GetDestinationOutput struct { - - // Destination ARN. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the destination's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // State of the destination. - // - // This member is required. - State types.DestinationState - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDestination{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDestination{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDestination"); 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 = 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 = addOpGetDestinationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDestination(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 - } - return nil -} - -func newServiceMetadataMiddleware_opGetDestination(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDestination", - } -} diff --git a/service/iotroborunner/api_op_GetSite.go b/service/iotroborunner/api_op_GetSite.go deleted file mode 100644 index e5d19c466d7..00000000000 --- a/service/iotroborunner/api_op_GetSite.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to get a site -func (c *Client) GetSite(ctx context.Context, params *GetSiteInput, optFns ...func(*Options)) (*GetSiteOutput, error) { - if params == nil { - params = &GetSiteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSite", params, optFns, c.addOperationGetSiteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSiteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSiteInput struct { - - // Site ARN. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type GetSiteOutput struct { - - // Site ARN. - // - // This member is required. - Arn *string - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // This member is required. - CountryCode *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the site's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // A high-level description of the site. - Description *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSite{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSite{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSite"); 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 = 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 = addOpGetSiteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSite(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 - } - return nil -} - -func newServiceMetadataMiddleware_opGetSite(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSite", - } -} diff --git a/service/iotroborunner/api_op_GetWorker.go b/service/iotroborunner/api_op_GetWorker.go deleted file mode 100644 index 288b0c6a0a3..00000000000 --- a/service/iotroborunner/api_op_GetWorker.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to get a worker -func (c *Client) GetWorker(ctx context.Context, params *GetWorkerInput, optFns ...func(*Options)) (*GetWorkerOutput, error) { - if params == nil { - params = &GetWorkerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetWorker", params, optFns, c.addOperationGetWorkerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetWorkerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetWorkerInput struct { - - // Full ARN of the worker. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type GetWorkerOutput struct { - - // Full ARN of the worker. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Full ARN of the worker fleet. - // - // This member is required. - Fleet *string - - // Filters access by the workers identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string - - // JSON blob containing unstructured worker properties that are transient and may - // change during regular operation. - AdditionalTransientProperties *string - - // Worker orientation measured in units clockwise from north. - Orientation types.Orientation - - // Supported coordinates for worker position. - Position types.PositionCoordinates - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *types.VendorProperties - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorker{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorker{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetWorker"); 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 = 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 = addOpGetWorkerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorker(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 - } - return nil -} - -func newServiceMetadataMiddleware_opGetWorker(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetWorker", - } -} diff --git a/service/iotroborunner/api_op_GetWorkerFleet.go b/service/iotroborunner/api_op_GetWorkerFleet.go deleted file mode 100644 index dd2f7410812..00000000000 --- a/service/iotroborunner/api_op_GetWorkerFleet.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to get a worker fleet -func (c *Client) GetWorkerFleet(ctx context.Context, params *GetWorkerFleetInput, optFns ...func(*Options)) (*GetWorkerFleetOutput, error) { - if params == nil { - params = &GetWorkerFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetWorkerFleet", params, optFns, c.addOperationGetWorkerFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetWorkerFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetWorkerFleetInput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type GetWorkerFleetOutput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the worker fleet's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkerFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkerFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetWorkerFleet"); 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 = 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 = addOpGetWorkerFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkerFleet(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 - } - return nil -} - -func newServiceMetadataMiddleware_opGetWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetWorkerFleet", - } -} diff --git a/service/iotroborunner/api_op_ListDestinations.go b/service/iotroborunner/api_op_ListDestinations.go deleted file mode 100644 index 627f72cca36..00000000000 --- a/service/iotroborunner/api_op_ListDestinations.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Grants permission to list destinations -func (c *Client) ListDestinations(ctx context.Context, params *ListDestinationsInput, optFns ...func(*Options)) (*ListDestinationsOutput, error) { - if params == nil { - params = &ListDestinationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListDestinations", params, optFns, c.addOperationListDestinationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListDestinationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListDestinationsInput struct { - - // Site ARN. - // - // This member is required. - Site *string - - // Maximum number of results to retrieve in a single call. - MaxResults *int32 - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - // State of the destination. - State types.DestinationState - - noSmithyDocumentSerde -} - -type ListDestinationsOutput struct { - - // List of destinations. - Destinations []types.Destination - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListDestinations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDestinations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListDestinations"); 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 = 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 = addOpListDestinationsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDestinations(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 - } - return nil -} - -// ListDestinationsAPIClient is a client that implements the ListDestinations -// operation. -type ListDestinationsAPIClient interface { - ListDestinations(context.Context, *ListDestinationsInput, ...func(*Options)) (*ListDestinationsOutput, error) -} - -var _ ListDestinationsAPIClient = (*Client)(nil) - -// ListDestinationsPaginatorOptions is the paginator options for ListDestinations -type ListDestinationsPaginatorOptions struct { - // Maximum number of results to retrieve in a single call. - 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 -} - -// ListDestinationsPaginator is a paginator for ListDestinations -type ListDestinationsPaginator struct { - options ListDestinationsPaginatorOptions - client ListDestinationsAPIClient - params *ListDestinationsInput - nextToken *string - firstPage bool -} - -// NewListDestinationsPaginator returns a new ListDestinationsPaginator -func NewListDestinationsPaginator(client ListDestinationsAPIClient, params *ListDestinationsInput, optFns ...func(*ListDestinationsPaginatorOptions)) *ListDestinationsPaginator { - if params == nil { - params = &ListDestinationsInput{} - } - - options := ListDestinationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListDestinationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListDestinationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListDestinations page. -func (p *ListDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDestinationsOutput, 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 - - result, err := p.client.ListDestinations(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 -} - -func newServiceMetadataMiddleware_opListDestinations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListDestinations", - } -} diff --git a/service/iotroborunner/api_op_ListSites.go b/service/iotroborunner/api_op_ListSites.go deleted file mode 100644 index dd0ceeb89c6..00000000000 --- a/service/iotroborunner/api_op_ListSites.go +++ /dev/null @@ -1,228 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Grants permission to list sites -func (c *Client) ListSites(ctx context.Context, params *ListSitesInput, optFns ...func(*Options)) (*ListSitesOutput, error) { - if params == nil { - params = &ListSitesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListSites", params, optFns, c.addOperationListSitesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListSitesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListSitesInput struct { - - // Maximum number of results to retrieve in a single ListSites call. - MaxResults *int32 - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - noSmithyDocumentSerde -} - -type ListSitesOutput struct { - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - // List of facilities. - Sites []types.Site - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListSitesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListSites{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSites{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListSites"); 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 = 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 = stack.Initialize.Add(newServiceMetadataMiddleware_opListSites(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 - } - return nil -} - -// ListSitesAPIClient is a client that implements the ListSites operation. -type ListSitesAPIClient interface { - ListSites(context.Context, *ListSitesInput, ...func(*Options)) (*ListSitesOutput, error) -} - -var _ ListSitesAPIClient = (*Client)(nil) - -// ListSitesPaginatorOptions is the paginator options for ListSites -type ListSitesPaginatorOptions struct { - // Maximum number of results to retrieve in a single ListSites call. - 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 -} - -// ListSitesPaginator is a paginator for ListSites -type ListSitesPaginator struct { - options ListSitesPaginatorOptions - client ListSitesAPIClient - params *ListSitesInput - nextToken *string - firstPage bool -} - -// NewListSitesPaginator returns a new ListSitesPaginator -func NewListSitesPaginator(client ListSitesAPIClient, params *ListSitesInput, optFns ...func(*ListSitesPaginatorOptions)) *ListSitesPaginator { - if params == nil { - params = &ListSitesInput{} - } - - options := ListSitesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListSitesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListSitesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListSites page. -func (p *ListSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSitesOutput, 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 - - result, err := p.client.ListSites(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 -} - -func newServiceMetadataMiddleware_opListSites(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListSites", - } -} diff --git a/service/iotroborunner/api_op_ListWorkerFleets.go b/service/iotroborunner/api_op_ListWorkerFleets.go deleted file mode 100644 index 64f6f02098f..00000000000 --- a/service/iotroborunner/api_op_ListWorkerFleets.go +++ /dev/null @@ -1,237 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Grants permission to list worker fleets -func (c *Client) ListWorkerFleets(ctx context.Context, params *ListWorkerFleetsInput, optFns ...func(*Options)) (*ListWorkerFleetsOutput, error) { - if params == nil { - params = &ListWorkerFleetsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListWorkerFleets", params, optFns, c.addOperationListWorkerFleetsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListWorkerFleetsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListWorkerFleetsInput struct { - - // Site ARN. - // - // This member is required. - Site *string - - // Maximum number of results to retrieve in a single ListWorkerFleets call. - MaxResults *int32 - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - noSmithyDocumentSerde -} - -type ListWorkerFleetsOutput struct { - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - // List of worker fleets. - WorkerFleets []types.WorkerFleet - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListWorkerFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkerFleets{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkerFleets{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListWorkerFleets"); 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 = 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 = addOpListWorkerFleetsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkerFleets(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 - } - return nil -} - -// ListWorkerFleetsAPIClient is a client that implements the ListWorkerFleets -// operation. -type ListWorkerFleetsAPIClient interface { - ListWorkerFleets(context.Context, *ListWorkerFleetsInput, ...func(*Options)) (*ListWorkerFleetsOutput, error) -} - -var _ ListWorkerFleetsAPIClient = (*Client)(nil) - -// ListWorkerFleetsPaginatorOptions is the paginator options for ListWorkerFleets -type ListWorkerFleetsPaginatorOptions struct { - // Maximum number of results to retrieve in a single ListWorkerFleets call. - 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 -} - -// ListWorkerFleetsPaginator is a paginator for ListWorkerFleets -type ListWorkerFleetsPaginator struct { - options ListWorkerFleetsPaginatorOptions - client ListWorkerFleetsAPIClient - params *ListWorkerFleetsInput - nextToken *string - firstPage bool -} - -// NewListWorkerFleetsPaginator returns a new ListWorkerFleetsPaginator -func NewListWorkerFleetsPaginator(client ListWorkerFleetsAPIClient, params *ListWorkerFleetsInput, optFns ...func(*ListWorkerFleetsPaginatorOptions)) *ListWorkerFleetsPaginator { - if params == nil { - params = &ListWorkerFleetsInput{} - } - - options := ListWorkerFleetsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListWorkerFleetsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListWorkerFleetsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListWorkerFleets page. -func (p *ListWorkerFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerFleetsOutput, 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 - - result, err := p.client.ListWorkerFleets(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 -} - -func newServiceMetadataMiddleware_opListWorkerFleets(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListWorkerFleets", - } -} diff --git a/service/iotroborunner/api_op_ListWorkers.go b/service/iotroborunner/api_op_ListWorkers.go deleted file mode 100644 index 89a511a9b33..00000000000 --- a/service/iotroborunner/api_op_ListWorkers.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Grants permission to list workers -func (c *Client) ListWorkers(ctx context.Context, params *ListWorkersInput, optFns ...func(*Options)) (*ListWorkersOutput, error) { - if params == nil { - params = &ListWorkersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListWorkers", params, optFns, c.addOperationListWorkersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListWorkersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListWorkersInput struct { - - // Site ARN. - // - // This member is required. - Site *string - - // Full ARN of the worker fleet. - Fleet *string - - // Maximum number of results to retrieve in a single ListWorkers call. - MaxResults *int32 - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - noSmithyDocumentSerde -} - -type ListWorkersOutput struct { - - // Pagination token returned when another page of data exists. Provide it in your - // next call to the API to receive the next page. - NextToken *string - - // List of workers. - Workers []types.Worker - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListWorkersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListWorkers"); 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 = 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 = addOpListWorkersValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkers(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 - } - return nil -} - -// ListWorkersAPIClient is a client that implements the ListWorkers operation. -type ListWorkersAPIClient interface { - ListWorkers(context.Context, *ListWorkersInput, ...func(*Options)) (*ListWorkersOutput, error) -} - -var _ ListWorkersAPIClient = (*Client)(nil) - -// ListWorkersPaginatorOptions is the paginator options for ListWorkers -type ListWorkersPaginatorOptions struct { - // Maximum number of results to retrieve in a single ListWorkers call. - 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 -} - -// ListWorkersPaginator is a paginator for ListWorkers -type ListWorkersPaginator struct { - options ListWorkersPaginatorOptions - client ListWorkersAPIClient - params *ListWorkersInput - nextToken *string - firstPage bool -} - -// NewListWorkersPaginator returns a new ListWorkersPaginator -func NewListWorkersPaginator(client ListWorkersAPIClient, params *ListWorkersInput, optFns ...func(*ListWorkersPaginatorOptions)) *ListWorkersPaginator { - if params == nil { - params = &ListWorkersInput{} - } - - options := ListWorkersPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListWorkersPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListWorkersPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListWorkers page. -func (p *ListWorkersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkersOutput, 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 - - result, err := p.client.ListWorkers(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 -} - -func newServiceMetadataMiddleware_opListWorkers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListWorkers", - } -} diff --git a/service/iotroborunner/api_op_UpdateDestination.go b/service/iotroborunner/api_op_UpdateDestination.go deleted file mode 100644 index 0f04f0e6558..00000000000 --- a/service/iotroborunner/api_op_UpdateDestination.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to update a destination -func (c *Client) UpdateDestination(ctx context.Context, params *UpdateDestinationInput, optFns ...func(*Options)) (*UpdateDestinationOutput, error) { - if params == nil { - params = &UpdateDestinationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateDestination", params, optFns, c.addOperationUpdateDestinationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateDestinationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateDestinationInput struct { - - // Destination ARN. - // - // This member is required. - Id *string - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string - - // Human friendly name of the resource. - Name *string - - // State of the destination. - State types.DestinationState - - noSmithyDocumentSerde -} - -type UpdateDestinationOutput struct { - - // Destination ARN. - // - // This member is required. - Arn *string - - // Filters access by the destination's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // State of the destination. - // - // This member is required. - State types.DestinationState - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDestination{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDestination{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDestination"); 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 = 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 = addOpUpdateDestinationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDestination(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 - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateDestination(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateDestination", - } -} diff --git a/service/iotroborunner/api_op_UpdateSite.go b/service/iotroborunner/api_op_UpdateSite.go deleted file mode 100644 index 0af3d8ed6e3..00000000000 --- a/service/iotroborunner/api_op_UpdateSite.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to update a site -func (c *Client) UpdateSite(ctx context.Context, params *UpdateSiteInput, optFns ...func(*Options)) (*UpdateSiteOutput, error) { - if params == nil { - params = &UpdateSiteInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateSite", params, optFns, c.addOperationUpdateSiteMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateSiteOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateSiteInput struct { - - // Site ARN. - // - // This member is required. - Id *string - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - CountryCode *string - - // A high-level description of the site. - Description *string - - // Human friendly name of the resource. - Name *string - - noSmithyDocumentSerde -} - -type UpdateSiteOutput struct { - - // Site ARN. - // - // This member is required. - Arn *string - - // Filters access by the site's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - CountryCode *string - - // A high-level description of the site. - Description *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSite{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSite{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateSite"); 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 = 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 = addOpUpdateSiteValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSite(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 - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateSite(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateSite", - } -} diff --git a/service/iotroborunner/api_op_UpdateWorker.go b/service/iotroborunner/api_op_UpdateWorker.go deleted file mode 100644 index 12a7916605d..00000000000 --- a/service/iotroborunner/api_op_UpdateWorker.go +++ /dev/null @@ -1,196 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Grants permission to update a worker -func (c *Client) UpdateWorker(ctx context.Context, params *UpdateWorkerInput, optFns ...func(*Options)) (*UpdateWorkerOutput, error) { - if params == nil { - params = &UpdateWorkerInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateWorker", params, optFns, c.addOperationUpdateWorkerMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateWorkerOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateWorkerInput struct { - - // Full ARN of the worker. - // - // This member is required. - Id *string - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string - - // JSON blob containing unstructured worker properties that are transient and may - // change during regular operation. - AdditionalTransientProperties *string - - // Human friendly name of the resource. - Name *string - - // Worker orientation measured in units clockwise from north. - Orientation types.Orientation - - // Supported coordinates for worker position. - Position types.PositionCoordinates - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *types.VendorProperties - - noSmithyDocumentSerde -} - -type UpdateWorkerOutput struct { - - // Full ARN of the worker. - // - // This member is required. - Arn *string - - // Full ARN of the worker fleet. - // - // This member is required. - Fleet *string - - // Filters access by the workers identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string - - // JSON blob containing unstructured worker properties that are transient and may - // change during regular operation. - AdditionalTransientProperties *string - - // Worker orientation measured in units clockwise from north. - Orientation types.Orientation - - // Supported coordinates for worker position. - Position types.PositionCoordinates - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *types.VendorProperties - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorker{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorker{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateWorker"); 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 = 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 = addOpUpdateWorkerValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorker(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 - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateWorker(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateWorker", - } -} diff --git a/service/iotroborunner/api_op_UpdateWorkerFleet.go b/service/iotroborunner/api_op_UpdateWorkerFleet.go deleted file mode 100644 index 936bc997d07..00000000000 --- a/service/iotroborunner/api_op_UpdateWorkerFleet.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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" - "time" -) - -// Grants permission to update a worker fleet -func (c *Client) UpdateWorkerFleet(ctx context.Context, params *UpdateWorkerFleetInput, optFns ...func(*Options)) (*UpdateWorkerFleetOutput, error) { - if params == nil { - params = &UpdateWorkerFleetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateWorkerFleet", params, optFns, c.addOperationUpdateWorkerFleetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateWorkerFleetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateWorkerFleetInput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Id *string - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string - - // Human friendly name of the resource. - Name *string - - noSmithyDocumentSerde -} - -type UpdateWorkerFleetOutput struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Arn *string - - // Filters access by the worker fleet's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorkerFleet{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorkerFleet{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateWorkerFleet"); 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 = 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 = addOpUpdateWorkerFleetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorkerFleet(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 - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateWorkerFleet", - } -} diff --git a/service/iotroborunner/auth.go b/service/iotroborunner/auth.go deleted file mode 100644 index 697a1a31481..00000000000 --- a/service/iotroborunner/auth.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(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(operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(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, "iotroborunner") - 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, -) { - params := bindAuthResolverParams(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) - 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, -) { - rscheme := getResolvedAuthScheme(ctx) - 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 := resolver.GetIdentity(ctx, rscheme.IdentityProperties) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - 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 { -} - -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, -) { - 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") - } - - if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/service/iotroborunner/deserializers.go b/service/iotroborunner/deserializers.go deleted file mode 100644 index f634b0edd49..00000000000 --- a/service/iotroborunner/deserializers.go +++ /dev/null @@ -1,5193 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/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" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "math" - "strings" -) - -type awsRestjson1_deserializeOpCreateDestination struct { -} - -func (*awsRestjson1_deserializeOpCreateDestination) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateDestination) 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 - } - - 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_deserializeOpErrorCreateDestination(response, &metadata) - } - output := &CreateDestinationOutput{} - 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_deserializeOpDocumentCreateDestinationOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateDestination(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateDestinationOutput(v **CreateDestinationOutput, 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 *CreateDestinationOutput - if *v == nil { - sv = &CreateDestinationOutput{} - } 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 DestinationArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) - } - sv.State = types.DestinationState(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateSite struct { -} - -func (*awsRestjson1_deserializeOpCreateSite) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateSite) 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 - } - - 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_deserializeOpErrorCreateSite(response, &metadata) - } - output := &CreateSiteOutput{} - 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_deserializeOpDocumentCreateSiteOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateSite(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateSiteOutput(v **CreateSiteOutput, 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 *CreateSiteOutput - if *v == nil { - sv = &CreateSiteOutput{} - } 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 SiteArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateWorker struct { -} - -func (*awsRestjson1_deserializeOpCreateWorker) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateWorker) 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 - } - - 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_deserializeOpErrorCreateWorker(response, &metadata) - } - output := &CreateWorkerOutput{} - 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_deserializeOpDocumentCreateWorkerOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateWorker(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateWorkerOutput(v **CreateWorkerOutput, 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 *CreateWorkerOutput - if *v == nil { - sv = &CreateWorkerOutput{} - } 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 WorkerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpCreateWorkerFleet struct { -} - -func (*awsRestjson1_deserializeOpCreateWorkerFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpCreateWorkerFleet) 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 - } - - 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_deserializeOpErrorCreateWorkerFleet(response, &metadata) - } - output := &CreateWorkerFleetOutput{} - 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_deserializeOpDocumentCreateWorkerFleetOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorCreateWorkerFleet(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentCreateWorkerFleetOutput(v **CreateWorkerFleetOutput, 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 *CreateWorkerFleetOutput - if *v == nil { - sv = &CreateWorkerFleetOutput{} - } 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 WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDeleteDestination struct { -} - -func (*awsRestjson1_deserializeOpDeleteDestination) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteDestination) 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 - } - - 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_deserializeOpErrorDeleteDestination(response, &metadata) - } - output := &DeleteDestinationOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteDestination(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteSite struct { -} - -func (*awsRestjson1_deserializeOpDeleteSite) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteSite) 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 - } - - 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_deserializeOpErrorDeleteSite(response, &metadata) - } - output := &DeleteSiteOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteSite(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteWorker struct { -} - -func (*awsRestjson1_deserializeOpDeleteWorker) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteWorker) 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 - } - - 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_deserializeOpErrorDeleteWorker(response, &metadata) - } - output := &DeleteWorkerOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteWorker(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteWorkerFleet struct { -} - -func (*awsRestjson1_deserializeOpDeleteWorkerFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteWorkerFleet) 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 - } - - 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_deserializeOpErrorDeleteWorkerFleet(response, &metadata) - } - output := &DeleteWorkerFleetOutput{} - out.Result = output - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteWorkerFleet(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpGetDestination struct { -} - -func (*awsRestjson1_deserializeOpGetDestination) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetDestination) 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 - } - - 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_deserializeOpErrorGetDestination(response, &metadata) - } - output := &GetDestinationOutput{} - 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_deserializeOpDocumentGetDestinationOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetDestination(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetDestinationOutput(v **GetDestinationOutput, 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 *GetDestinationOutput - if *v == nil { - sv = &GetDestinationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) - } - sv.State = types.DestinationState(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetSite struct { -} - -func (*awsRestjson1_deserializeOpGetSite) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetSite) 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 - } - - 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_deserializeOpErrorGetSite(response, &metadata) - } - output := &GetSiteOutput{} - 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_deserializeOpDocumentGetSiteOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetSite(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetSiteOutput(v **GetSiteOutput, 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 *GetSiteOutput - if *v == nil { - sv = &GetSiteOutput{} - } 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 SiteArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "countryCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) - } - sv.CountryCode = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetWorker struct { -} - -func (*awsRestjson1_deserializeOpGetWorker) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetWorker) 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 - } - - 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_deserializeOpErrorGetWorker(response, &metadata) - } - output := &GetWorkerOutput{} - 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_deserializeOpDocumentGetWorkerOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetWorker(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetWorkerOutput(v **GetWorkerOutput, 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 *GetWorkerOutput - if *v == nil { - sv = &GetWorkerOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "additionalTransientProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalTransientProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "fleet": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Fleet = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "orientation": - if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { - return err - } - - case "position": - if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { - return err - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "vendorProperties": - if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpGetWorkerFleet struct { -} - -func (*awsRestjson1_deserializeOpGetWorkerFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpGetWorkerFleet) 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 - } - - 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_deserializeOpErrorGetWorkerFleet(response, &metadata) - } - output := &GetWorkerFleetOutput{} - 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_deserializeOpDocumentGetWorkerFleetOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorGetWorkerFleet(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentGetWorkerFleetOutput(v **GetWorkerFleetOutput, 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 *GetWorkerFleetOutput - if *v == nil { - sv = &GetWorkerFleetOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListDestinations struct { -} - -func (*awsRestjson1_deserializeOpListDestinations) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListDestinations) 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 - } - - 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_deserializeOpErrorListDestinations(response, &metadata) - } - output := &ListDestinationsOutput{} - 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_deserializeOpDocumentListDestinationsOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListDestinations(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListDestinationsOutput(v **ListDestinationsOutput, 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 *ListDestinationsOutput - if *v == nil { - sv = &ListDestinationsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "destinations": - if err := awsRestjson1_deserializeDocumentDestinations(&sv.Destinations, value); err != nil { - return err - } - - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListSites struct { -} - -func (*awsRestjson1_deserializeOpListSites) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListSites) 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 - } - - 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_deserializeOpErrorListSites(response, &metadata) - } - output := &ListSitesOutput{} - 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_deserializeOpDocumentListSitesOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListSites(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, 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 *ListSitesOutput - if *v == nil { - sv = &ListSitesOutput{} - } 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 PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "sites": - if err := awsRestjson1_deserializeDocumentSites(&sv.Sites, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListWorkerFleets struct { -} - -func (*awsRestjson1_deserializeOpListWorkerFleets) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListWorkerFleets) 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 - } - - 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_deserializeOpErrorListWorkerFleets(response, &metadata) - } - output := &ListWorkerFleetsOutput{} - 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_deserializeOpDocumentListWorkerFleetsOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListWorkerFleets(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListWorkerFleetsOutput(v **ListWorkerFleetsOutput, 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 *ListWorkerFleetsOutput - if *v == nil { - sv = &ListWorkerFleetsOutput{} - } 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 PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "workerFleets": - if err := awsRestjson1_deserializeDocumentWorkerFleets(&sv.WorkerFleets, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListWorkers struct { -} - -func (*awsRestjson1_deserializeOpListWorkers) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListWorkers) 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 - } - - 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_deserializeOpErrorListWorkers(response, &metadata) - } - output := &ListWorkersOutput{} - 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_deserializeOpDocumentListWorkersOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListWorkers(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentListWorkersOutput(v **ListWorkersOutput, 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 *ListWorkersOutput - if *v == nil { - sv = &ListWorkersOutput{} - } 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 PaginationToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "workers": - if err := awsRestjson1_deserializeDocumentWorkers(&sv.Workers, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateDestination struct { -} - -func (*awsRestjson1_deserializeOpUpdateDestination) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateDestination) 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 - } - - 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_deserializeOpErrorUpdateDestination(response, &metadata) - } - output := &UpdateDestinationOutput{} - 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_deserializeOpDocumentUpdateDestinationOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateDestination(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateDestinationOutput(v **UpdateDestinationOutput, 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 *UpdateDestinationOutput - if *v == nil { - sv = &UpdateDestinationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) - } - sv.State = types.DestinationState(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateSite struct { -} - -func (*awsRestjson1_deserializeOpUpdateSite) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateSite) 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 - } - - 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_deserializeOpErrorUpdateSite(response, &metadata) - } - output := &UpdateSiteOutput{} - 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_deserializeOpDocumentUpdateSiteOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateSite(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateSiteOutput(v **UpdateSiteOutput, 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 *UpdateSiteOutput - if *v == nil { - sv = &UpdateSiteOutput{} - } 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 SiteArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "countryCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) - } - sv.CountryCode = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateWorker struct { -} - -func (*awsRestjson1_deserializeOpUpdateWorker) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateWorker) 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 - } - - 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_deserializeOpErrorUpdateWorker(response, &metadata) - } - output := &UpdateWorkerOutput{} - 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_deserializeOpDocumentUpdateWorkerOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateWorker(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateWorkerOutput(v **UpdateWorkerOutput, 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 *UpdateWorkerOutput - if *v == nil { - sv = &UpdateWorkerOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "additionalTransientProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalTransientProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "fleet": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Fleet = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "orientation": - if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { - return err - } - - case "position": - if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { - return err - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "vendorProperties": - if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateWorkerFleet struct { -} - -func (*awsRestjson1_deserializeOpUpdateWorkerFleet) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateWorkerFleet) 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 - } - - 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_deserializeOpErrorUpdateWorkerFleet(response, &metadata) - } - output := &UpdateWorkerFleetOutput{} - 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_deserializeOpDocumentUpdateWorkerFleetOutput(&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(), - } - } - - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateWorkerFleet(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("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestjson1_deserializeOpDocumentUpdateWorkerFleetOutput(v **UpdateWorkerFleetOutput, 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 *UpdateWorkerFleetOutput - if *v == nil { - sv = &UpdateWorkerFleetOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - 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_deserializeDocumentAccessDeniedException(&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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictException{} - 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_deserializeDocumentConflictException(&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_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InternalServerException{} - 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_deserializeDocumentInternalServerException(&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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} - 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_deserializeDocumentServiceQuotaExceededException(&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_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} - 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_deserializeDocumentThrottlingException(&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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ValidationException{} - 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_deserializeDocumentValidationException(&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_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, 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.AccessDeniedException - if *v == nil { - sv = &types.AccessDeniedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentCartesianCoordinates(v **types.CartesianCoordinates, 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.CartesianCoordinates - if *v == nil { - sv = &types.CartesianCoordinates{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "x": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.X = 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.X = ptr.Float64(f64) - - default: - return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) - - } - } - - case "y": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Y = 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.Y = ptr.Float64(f64) - - default: - return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) - - } - } - - case "z": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Z = 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.Z = ptr.Float64(f64) - - default: - return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, 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.ConflictException - if *v == nil { - sv = &types.ConflictException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentDestination(v **types.Destination, 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.Destination - if *v == nil { - sv = &types.Destination{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "state": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) - } - sv.State = types.DestinationState(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, 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.Destination - if *v == nil { - cv = []types.Destination{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Destination - destAddr := &col - if err := awsRestjson1_deserializeDocumentDestination(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, 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.InternalServerException - if *v == nil { - sv = &types.InternalServerException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentOrientation(v *types.Orientation, 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 uv types.Orientation -loop: - for key, value := range shape { - if value == nil { - continue - } - switch key { - case "degrees": - var mv float64 - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - mv = 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) - - } - mv = f64 - - default: - return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) - - } - } - uv = &types.OrientationMemberDegrees{Value: mv} - break loop - - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop - - } - } - *v = uv - return nil -} - -func awsRestjson1_deserializeDocumentPositionCoordinates(v *types.PositionCoordinates, 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 uv types.PositionCoordinates -loop: - for key, value := range shape { - if value == nil { - continue - } - switch key { - case "cartesianCoordinates": - var mv types.CartesianCoordinates - destAddr := &mv - if err := awsRestjson1_deserializeDocumentCartesianCoordinates(&destAddr, value); err != nil { - return err - } - mv = *destAddr - uv = &types.PositionCoordinatesMemberCartesianCoordinates{Value: mv} - break loop - - default: - uv = &types.UnknownUnionMember{Tag: key} - break loop - - } - } - *v = uv - 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 "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_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, 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.ServiceQuotaExceededException - if *v == nil { - sv = &types.ServiceQuotaExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentSite(v **types.Site, 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.Site - if *v == nil { - sv = &types.Site{} - } 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 SiteArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "countryCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) - } - sv.CountryCode = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentSites(v *[]types.Site, 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.Site - if *v == nil { - cv = []types.Site{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Site - destAddr := &col - if err := awsRestjson1_deserializeDocumentSite(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, 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.ThrottlingException - if *v == nil { - sv = &types.ThrottlingException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentValidationException(v **types.ValidationException, 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.ValidationException - if *v == nil { - sv = &types.ValidationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "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_deserializeDocumentVendorProperties(v **types.VendorProperties, 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.VendorProperties - if *v == nil { - sv = &types.VendorProperties{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "vendorAdditionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VendorAdditionalFixedPropertiesJson to be of type string, got %T instead", value) - } - sv.VendorAdditionalFixedProperties = ptr.String(jtv) - } - - case "vendorAdditionalTransientProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VendorAdditionalTransientPropertiesJson to be of type string, got %T instead", value) - } - sv.VendorAdditionalTransientProperties = ptr.String(jtv) - } - - case "vendorWorkerId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VendorWorkerId to be of type string, got %T instead", value) - } - sv.VendorWorkerId = ptr.String(jtv) - } - - case "vendorWorkerIpAddress": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VendorWorkerIpAddress to be of type string, got %T instead", value) - } - sv.VendorWorkerIpAddress = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentWorker(v **types.Worker, 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.Worker - if *v == nil { - sv = &types.Worker{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "additionalTransientProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) - } - sv.AdditionalTransientProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "fleet": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Fleet = ptr.String(jtv) - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "orientation": - if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { - return err - } - - case "position": - if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { - return err - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "vendorProperties": - if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentWorkerFleet(v **types.WorkerFleet, 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.WorkerFleet - if *v == nil { - sv = &types.WorkerFleet{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "additionalFixedProperties": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) - } - sv.AdditionalFixedProperties = ptr.String(jtv) - } - - case "arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "createdAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - case "id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Name to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "site": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) - } - sv.Site = ptr.String(jtv) - } - - case "updatedAt": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentWorkerFleets(v *[]types.WorkerFleet, 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.WorkerFleet - if *v == nil { - cv = []types.WorkerFleet{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.WorkerFleet - destAddr := &col - if err := awsRestjson1_deserializeDocumentWorkerFleet(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentWorkers(v *[]types.Worker, 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.Worker - if *v == nil { - cv = []types.Worker{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Worker - destAddr := &col - if err := awsRestjson1_deserializeDocumentWorker(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} diff --git a/service/iotroborunner/doc.go b/service/iotroborunner/doc.go deleted file mode 100644 index dc60a0abfcd..00000000000 --- a/service/iotroborunner/doc.go +++ /dev/null @@ -1,8 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package iotroborunner provides the API client, operations, and parameter types -// for AWS IoT RoboRunner. -// -// An example service, deployed with the Octane Service creator, which will echo -// the string -package iotroborunner diff --git a/service/iotroborunner/endpoints.go b/service/iotroborunner/endpoints.go deleted file mode 100644 index c4ac97412cb..00000000000 --- a/service/iotroborunner/endpoints.go +++ /dev/null @@ -1,516 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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/iotroborunner/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" - 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 = "iotroborunner" - } - 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_ROBORUNNER") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "IoT RoboRunner", 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 -} - -// 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://iotroborunner-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://iotroborunner-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://iotroborunner.") - 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://iotroborunner.") - 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(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, -) { - 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(getOperationInput(ctx), m.options) - endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - 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) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/service/iotroborunner/endpoints_config_test.go b/service/iotroborunner/endpoints_config_test.go deleted file mode 100644 index e8dd0f41eee..00000000000 --- a/service/iotroborunner/endpoints_config_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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-roborunner.dev", - envIgnore: true, - configGlobal: "http://config-global.dev", - configService: "http://config-iot-roborunner.dev", - expectURL: nil, - }, - "env global": { - envGlobal: "https://env-global.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-roborunner.dev", - expectURL: aws.String("https://env-global.dev"), - }, - "env service": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-roborunner.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-roborunner.dev", - expectURL: aws.String("https://env-iot-roborunner.dev"), - }, - "config ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-roborunner.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-roborunner.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-roborunner.dev", - expectURL: aws.String("http://config-iot-roborunner.dev"), - }, - "client": { - envGlobal: "https://env-global.dev", - envService: "https://env-iot-roborunner.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-iot-roborunner.dev", - clientEndpoint: aws.String("https://client-iot-roborunner.dev"), - expectURL: aws.String("https://client-iot-roborunner.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_ROBORUNNER", 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/iotroborunner/endpoints_test.go b/service/iotroborunner/endpoints_test.go deleted file mode 100644 index 96b7ac56bd8..00000000000 --- a/service/iotroborunner/endpoints_test.go +++ /dev/null @@ -1,820 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner-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://iotroborunner.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://iotroborunner.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://iotroborunner-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://iotroborunner.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://iotroborunner-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://iotroborunner.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/iotroborunner/generated.json b/service/iotroborunner/generated.json deleted file mode 100644 index 619bb312bf1..00000000000 --- a/service/iotroborunner/generated.json +++ /dev/null @@ -1,53 +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_CreateDestination.go", - "api_op_CreateSite.go", - "api_op_CreateWorker.go", - "api_op_CreateWorkerFleet.go", - "api_op_DeleteDestination.go", - "api_op_DeleteSite.go", - "api_op_DeleteWorker.go", - "api_op_DeleteWorkerFleet.go", - "api_op_GetDestination.go", - "api_op_GetSite.go", - "api_op_GetWorker.go", - "api_op_GetWorkerFleet.go", - "api_op_ListDestinations.go", - "api_op_ListSites.go", - "api_op_ListWorkerFleets.go", - "api_op_ListWorkers.go", - "api_op_UpdateDestination.go", - "api_op_UpdateSite.go", - "api_op_UpdateWorker.go", - "api_op_UpdateWorkerFleet.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/enums.go", - "types/errors.go", - "types/types.go", - "types/types_exported_test.go", - "validators.go" - ], - "go": "1.15", - "module": "github.com/aws/aws-sdk-go-v2/service/iotroborunner", - "unstable": false -} diff --git a/service/iotroborunner/go.mod b/service/iotroborunner/go.mod deleted file mode 100644 index 11d1fd6ebde..00000000000 --- a/service/iotroborunner/go.mod +++ /dev/null @@ -1,16 +0,0 @@ -module github.com/aws/aws-sdk-go-v2/service/iotroborunner - -go 1.20 - -require ( - github.com/aws/aws-sdk-go-v2 v1.25.3 - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.3 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.3 - github.com/aws/smithy-go v1.20.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/iotroborunner/go.sum b/service/iotroborunner/go.sum deleted file mode 100644 index a0cddd7b526..00000000000 --- a/service/iotroborunner/go.sum +++ /dev/null @@ -1,2 +0,0 @@ -github.com/aws/smithy-go v1.20.1 h1:4SZlSlMr36UEqC7XOyRVb27XMeZubNcBNN+9IgEPIQw= -github.com/aws/smithy-go v1.20.1/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= diff --git a/service/iotroborunner/go_module_metadata.go b/service/iotroborunner/go_module_metadata.go deleted file mode 100644 index f8196448f2d..00000000000 --- a/service/iotroborunner/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package iotroborunner - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.8.2" diff --git a/service/iotroborunner/internal/endpoints/endpoints.go b/service/iotroborunner/internal/endpoints/endpoints.go deleted file mode 100644 index 9de278f5b43..00000000000 --- a/service/iotroborunner/internal/endpoints/endpoints.go +++ /dev/null @@ -1,304 +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 RoboRunner 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)\\-\\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: "iotroborunner.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "iotroborunner-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "iotroborunner-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "eu-central-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{}, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "iotroborunner.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "iotroborunner-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "iotroborunner-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{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: "iotroborunner-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{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: "iotroborunner-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{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: "iotroborunner-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{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: "iotroborunner-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{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: "iotroborunner.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "iotroborunner-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "iotroborunner-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "iotroborunner.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - }, -} diff --git a/service/iotroborunner/internal/endpoints/endpoints_test.go b/service/iotroborunner/internal/endpoints/endpoints_test.go deleted file mode 100644 index 08e5da2d833..00000000000 --- a/service/iotroborunner/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/iotroborunner/options.go b/service/iotroborunner/options.go deleted file mode 100644 index 66da194453c..00000000000 --- a/service/iotroborunner/options.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -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/middleware" - 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 - - // Provides idempotency tokens values that will be automatically populated into - // idempotent API operations. - IdempotencyTokenProvider IdempotencyTokenProvider - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // 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 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/iotroborunner/protocol_test.go b/service/iotroborunner/protocol_test.go deleted file mode 100644 index ca067cafb16..00000000000 --- a/service/iotroborunner/protocol_test.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner diff --git a/service/iotroborunner/serializers.go b/service/iotroborunner/serializers.go deleted file mode 100644 index e44748e15bd..00000000000 --- a/service/iotroborunner/serializers.go +++ /dev/null @@ -1,1734 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/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" - smithyhttp "github.com/aws/smithy-go/transport/http" - "math" -) - -type awsRestjson1_serializeOpCreateDestination struct { -} - -func (*awsRestjson1_serializeOpCreateDestination) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*CreateDestinationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/createDestination") - 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_serializeOpDocumentCreateDestinationInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateDestinationInput(v *CreateDestinationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateDestinationInput(v *CreateDestinationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Site != nil { - ok := object.Key("site") - ok.String(*v.Site) - } - - if len(v.State) > 0 { - ok := object.Key("state") - ok.String(string(v.State)) - } - - return nil -} - -type awsRestjson1_serializeOpCreateSite struct { -} - -func (*awsRestjson1_serializeOpCreateSite) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*CreateSiteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/createSite") - 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_serializeOpDocumentCreateSiteInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateSiteInput(v *CreateSiteInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateSiteInput(v *CreateSiteInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.CountryCode != nil { - ok := object.Key("countryCode") - ok.String(*v.CountryCode) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - return nil -} - -type awsRestjson1_serializeOpCreateWorker struct { -} - -func (*awsRestjson1_serializeOpCreateWorker) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*CreateWorkerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/createWorker") - 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_serializeOpDocumentCreateWorkerInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateWorkerInput(v *CreateWorkerInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateWorkerInput(v *CreateWorkerInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.AdditionalTransientProperties != nil { - ok := object.Key("additionalTransientProperties") - ok.String(*v.AdditionalTransientProperties) - } - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.Fleet != nil { - ok := object.Key("fleet") - ok.String(*v.Fleet) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Orientation != nil { - ok := object.Key("orientation") - if err := awsRestjson1_serializeDocumentOrientation(v.Orientation, ok); err != nil { - return err - } - } - - if v.Position != nil { - ok := object.Key("position") - if err := awsRestjson1_serializeDocumentPositionCoordinates(v.Position, ok); err != nil { - return err - } - } - - if v.VendorProperties != nil { - ok := object.Key("vendorProperties") - if err := awsRestjson1_serializeDocumentVendorProperties(v.VendorProperties, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpCreateWorkerFleet struct { -} - -func (*awsRestjson1_serializeOpCreateWorkerFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpCreateWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*CreateWorkerFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/createWorkerFleet") - 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_serializeOpDocumentCreateWorkerFleetInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsCreateWorkerFleetInput(v *CreateWorkerFleetInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentCreateWorkerFleetInput(v *CreateWorkerFleetInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.ClientToken != nil { - ok := object.Key("clientToken") - ok.String(*v.ClientToken) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Site != nil { - ok := object.Key("site") - ok.String(*v.Site) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteDestination struct { -} - -func (*awsRestjson1_serializeOpDeleteDestination) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*DeleteDestinationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/deleteDestination") - 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_serializeOpDocumentDeleteDestinationInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteDestinationInput(v *DeleteDestinationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteDestinationInput(v *DeleteDestinationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteSite struct { -} - -func (*awsRestjson1_serializeOpDeleteSite) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*DeleteSiteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/deleteSite") - 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_serializeOpDocumentDeleteSiteInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteSiteInput(v *DeleteSiteInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteSiteInput(v *DeleteSiteInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteWorker struct { -} - -func (*awsRestjson1_serializeOpDeleteWorker) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*DeleteWorkerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/deleteWorker") - 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_serializeOpDocumentDeleteWorkerInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteWorkerInput(v *DeleteWorkerInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteWorkerInput(v *DeleteWorkerInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpDeleteWorkerFleet struct { -} - -func (*awsRestjson1_serializeOpDeleteWorkerFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpDeleteWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*DeleteWorkerFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/deleteWorkerFleet") - 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_serializeOpDocumentDeleteWorkerFleetInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsDeleteWorkerFleetInput(v *DeleteWorkerFleetInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentDeleteWorkerFleetInput(v *DeleteWorkerFleetInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpGetDestination struct { -} - -func (*awsRestjson1_serializeOpGetDestination) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*GetDestinationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/getDestination") - 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_serializeOpHttpBindingsGetDestinationInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetDestinationInput(v *GetDestinationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id != nil { - encoder.SetQuery("id").String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpGetSite struct { -} - -func (*awsRestjson1_serializeOpGetSite) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*GetSiteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/getSite") - 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_serializeOpHttpBindingsGetSiteInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetSiteInput(v *GetSiteInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id != nil { - encoder.SetQuery("id").String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpGetWorker struct { -} - -func (*awsRestjson1_serializeOpGetWorker) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*GetWorkerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/getWorker") - 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_serializeOpHttpBindingsGetWorkerInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetWorkerInput(v *GetWorkerInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id != nil { - encoder.SetQuery("id").String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpGetWorkerFleet struct { -} - -func (*awsRestjson1_serializeOpGetWorkerFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpGetWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*GetWorkerFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/getWorkerFleet") - 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_serializeOpHttpBindingsGetWorkerFleetInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsGetWorkerFleetInput(v *GetWorkerFleetInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Id != nil { - encoder.SetQuery("id").String(*v.Id) - } - - return nil -} - -type awsRestjson1_serializeOpListDestinations struct { -} - -func (*awsRestjson1_serializeOpListDestinations) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*ListDestinationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/listDestinations") - 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_serializeOpHttpBindingsListDestinationsInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListDestinationsInput(v *ListDestinationsInput, 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.Site != nil { - encoder.SetQuery("site").String(*v.Site) - } - - if len(v.State) > 0 { - encoder.SetQuery("state").String(string(v.State)) - } - - return nil -} - -type awsRestjson1_serializeOpListSites struct { -} - -func (*awsRestjson1_serializeOpListSites) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListSites) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*ListSitesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/listSites") - 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_serializeOpHttpBindingsListSitesInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListSitesInput(v *ListSitesInput, 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_serializeOpListWorkerFleets struct { -} - -func (*awsRestjson1_serializeOpListWorkerFleets) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListWorkerFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*ListWorkerFleetsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/listWorkerFleets") - 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_serializeOpHttpBindingsListWorkerFleetsInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListWorkerFleetsInput(v *ListWorkerFleetsInput, 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.Site != nil { - encoder.SetQuery("site").String(*v.Site) - } - - return nil -} - -type awsRestjson1_serializeOpListWorkers struct { -} - -func (*awsRestjson1_serializeOpListWorkers) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpListWorkers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*ListWorkersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/listWorkers") - 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_serializeOpHttpBindingsListWorkersInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsListWorkersInput(v *ListWorkersInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - if v.Fleet != nil { - encoder.SetQuery("fleet").String(*v.Fleet) - } - - if v.MaxResults != nil { - encoder.SetQuery("maxResults").Integer(*v.MaxResults) - } - - if v.NextToken != nil { - encoder.SetQuery("nextToken").String(*v.NextToken) - } - - if v.Site != nil { - encoder.SetQuery("site").String(*v.Site) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateDestination struct { -} - -func (*awsRestjson1_serializeOpUpdateDestination) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*UpdateDestinationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/updateDestination") - 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_serializeOpDocumentUpdateDestinationInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateDestinationInput(v *UpdateDestinationInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateDestinationInput(v *UpdateDestinationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if len(v.State) > 0 { - ok := object.Key("state") - ok.String(string(v.State)) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateSite struct { -} - -func (*awsRestjson1_serializeOpUpdateSite) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*UpdateSiteInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/updateSite") - 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_serializeOpDocumentUpdateSiteInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateSiteInput(v *UpdateSiteInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateSiteInput(v *UpdateSiteInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CountryCode != nil { - ok := object.Key("countryCode") - ok.String(*v.CountryCode) - } - - if v.Description != nil { - ok := object.Key("description") - ok.String(*v.Description) - } - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - return nil -} - -type awsRestjson1_serializeOpUpdateWorker struct { -} - -func (*awsRestjson1_serializeOpUpdateWorker) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*UpdateWorkerInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/updateWorker") - 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_serializeOpDocumentUpdateWorkerInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateWorkerInput(v *UpdateWorkerInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateWorkerInput(v *UpdateWorkerInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.AdditionalTransientProperties != nil { - ok := object.Key("additionalTransientProperties") - ok.String(*v.AdditionalTransientProperties) - } - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - if v.Orientation != nil { - ok := object.Key("orientation") - if err := awsRestjson1_serializeDocumentOrientation(v.Orientation, ok); err != nil { - return err - } - } - - if v.Position != nil { - ok := object.Key("position") - if err := awsRestjson1_serializeDocumentPositionCoordinates(v.Position, ok); err != nil { - return err - } - } - - if v.VendorProperties != nil { - ok := object.Key("vendorProperties") - if err := awsRestjson1_serializeDocumentVendorProperties(v.VendorProperties, ok); err != nil { - return err - } - } - - return nil -} - -type awsRestjson1_serializeOpUpdateWorkerFleet struct { -} - -func (*awsRestjson1_serializeOpUpdateWorkerFleet) ID() string { - return "OperationSerializer" -} - -func (m *awsRestjson1_serializeOpUpdateWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - 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.(*UpdateWorkerFleetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - opPath, opQuery := httpbinding.SplitURI("/updateWorkerFleet") - 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_serializeOpDocumentUpdateWorkerFleetInput(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 - - return next.HandleSerialize(ctx, in) -} -func awsRestjson1_serializeOpHttpBindingsUpdateWorkerFleetInput(v *UpdateWorkerFleetInput, encoder *httpbinding.Encoder) error { - if v == nil { - return fmt.Errorf("unsupported serialization of nil %T", v) - } - - return nil -} - -func awsRestjson1_serializeOpDocumentUpdateWorkerFleetInput(v *UpdateWorkerFleetInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AdditionalFixedProperties != nil { - ok := object.Key("additionalFixedProperties") - ok.String(*v.AdditionalFixedProperties) - } - - if v.Id != nil { - ok := object.Key("id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) - } - - return nil -} - -func awsRestjson1_serializeDocumentCartesianCoordinates(v *types.CartesianCoordinates, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.X != nil { - ok := object.Key("x") - switch { - case math.IsNaN(*v.X): - ok.String("NaN") - - case math.IsInf(*v.X, 1): - ok.String("Infinity") - - case math.IsInf(*v.X, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.X) - - } - } - - if v.Y != nil { - ok := object.Key("y") - switch { - case math.IsNaN(*v.Y): - ok.String("NaN") - - case math.IsInf(*v.Y, 1): - ok.String("Infinity") - - case math.IsInf(*v.Y, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.Y) - - } - } - - if v.Z != nil { - ok := object.Key("z") - switch { - case math.IsNaN(*v.Z): - ok.String("NaN") - - case math.IsInf(*v.Z, 1): - ok.String("Infinity") - - case math.IsInf(*v.Z, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.Z) - - } - } - - return nil -} - -func awsRestjson1_serializeDocumentOrientation(v types.Orientation, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - switch uv := v.(type) { - case *types.OrientationMemberDegrees: - av := object.Key("degrees") - switch { - case math.IsNaN(uv.Value): - av.String("NaN") - - case math.IsInf(uv.Value, 1): - av.String("Infinity") - - case math.IsInf(uv.Value, -1): - av.String("-Infinity") - - default: - av.Double(uv.Value) - - } - - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - - } - return nil -} - -func awsRestjson1_serializeDocumentPositionCoordinates(v types.PositionCoordinates, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - switch uv := v.(type) { - case *types.PositionCoordinatesMemberCartesianCoordinates: - av := object.Key("cartesianCoordinates") - if err := awsRestjson1_serializeDocumentCartesianCoordinates(&uv.Value, av); err != nil { - return err - } - - default: - return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) - - } - return nil -} - -func awsRestjson1_serializeDocumentVendorProperties(v *types.VendorProperties, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.VendorAdditionalFixedProperties != nil { - ok := object.Key("vendorAdditionalFixedProperties") - ok.String(*v.VendorAdditionalFixedProperties) - } - - if v.VendorAdditionalTransientProperties != nil { - ok := object.Key("vendorAdditionalTransientProperties") - ok.String(*v.VendorAdditionalTransientProperties) - } - - if v.VendorWorkerId != nil { - ok := object.Key("vendorWorkerId") - ok.String(*v.VendorWorkerId) - } - - if v.VendorWorkerIpAddress != nil { - ok := object.Key("vendorWorkerIpAddress") - ok.String(*v.VendorWorkerIpAddress) - } - - return nil -} diff --git a/service/iotroborunner/snapshot/api_op_CreateDestination.go.snap b/service/iotroborunner/snapshot/api_op_CreateDestination.go.snap deleted file mode 100644 index ff591e3f990..00000000000 --- a/service/iotroborunner/snapshot/api_op_CreateDestination.go.snap +++ /dev/null @@ -1,35 +0,0 @@ -CreateDestination - Initialize stack step - RegisterServiceMetadata - OperationIdempotencyTokenAutoFill - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_CreateSite.go.snap b/service/iotroborunner/snapshot/api_op_CreateSite.go.snap deleted file mode 100644 index 15e38db5be4..00000000000 --- a/service/iotroborunner/snapshot/api_op_CreateSite.go.snap +++ /dev/null @@ -1,35 +0,0 @@ -CreateSite - Initialize stack step - RegisterServiceMetadata - OperationIdempotencyTokenAutoFill - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_CreateWorker.go.snap b/service/iotroborunner/snapshot/api_op_CreateWorker.go.snap deleted file mode 100644 index 2891338114f..00000000000 --- a/service/iotroborunner/snapshot/api_op_CreateWorker.go.snap +++ /dev/null @@ -1,35 +0,0 @@ -CreateWorker - Initialize stack step - RegisterServiceMetadata - OperationIdempotencyTokenAutoFill - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_CreateWorkerFleet.go.snap b/service/iotroborunner/snapshot/api_op_CreateWorkerFleet.go.snap deleted file mode 100644 index ce117e83438..00000000000 --- a/service/iotroborunner/snapshot/api_op_CreateWorkerFleet.go.snap +++ /dev/null @@ -1,35 +0,0 @@ -CreateWorkerFleet - Initialize stack step - RegisterServiceMetadata - OperationIdempotencyTokenAutoFill - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_DeleteDestination.go.snap b/service/iotroborunner/snapshot/api_op_DeleteDestination.go.snap deleted file mode 100644 index e7ef5be59c3..00000000000 --- a/service/iotroborunner/snapshot/api_op_DeleteDestination.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -DeleteDestination - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_DeleteSite.go.snap b/service/iotroborunner/snapshot/api_op_DeleteSite.go.snap deleted file mode 100644 index 70665280163..00000000000 --- a/service/iotroborunner/snapshot/api_op_DeleteSite.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -DeleteSite - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_DeleteWorker.go.snap b/service/iotroborunner/snapshot/api_op_DeleteWorker.go.snap deleted file mode 100644 index a09fde5e8ad..00000000000 --- a/service/iotroborunner/snapshot/api_op_DeleteWorker.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -DeleteWorker - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_DeleteWorkerFleet.go.snap b/service/iotroborunner/snapshot/api_op_DeleteWorkerFleet.go.snap deleted file mode 100644 index 52e6ffe25f2..00000000000 --- a/service/iotroborunner/snapshot/api_op_DeleteWorkerFleet.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -DeleteWorkerFleet - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_GetDestination.go.snap b/service/iotroborunner/snapshot/api_op_GetDestination.go.snap deleted file mode 100644 index a8a239e22c3..00000000000 --- a/service/iotroborunner/snapshot/api_op_GetDestination.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -GetDestination - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_GetSite.go.snap b/service/iotroborunner/snapshot/api_op_GetSite.go.snap deleted file mode 100644 index 002f347f1b6..00000000000 --- a/service/iotroborunner/snapshot/api_op_GetSite.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -GetSite - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_GetWorker.go.snap b/service/iotroborunner/snapshot/api_op_GetWorker.go.snap deleted file mode 100644 index 73357caec31..00000000000 --- a/service/iotroborunner/snapshot/api_op_GetWorker.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -GetWorker - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_GetWorkerFleet.go.snap b/service/iotroborunner/snapshot/api_op_GetWorkerFleet.go.snap deleted file mode 100644 index 28e1fdc7723..00000000000 --- a/service/iotroborunner/snapshot/api_op_GetWorkerFleet.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -GetWorkerFleet - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_ListDestinations.go.snap b/service/iotroborunner/snapshot/api_op_ListDestinations.go.snap deleted file mode 100644 index 88a37bf5567..00000000000 --- a/service/iotroborunner/snapshot/api_op_ListDestinations.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -ListDestinations - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_ListSites.go.snap b/service/iotroborunner/snapshot/api_op_ListSites.go.snap deleted file mode 100644 index b5dc4fac67e..00000000000 --- a/service/iotroborunner/snapshot/api_op_ListSites.go.snap +++ /dev/null @@ -1,33 +0,0 @@ -ListSites - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_ListWorkerFleets.go.snap b/service/iotroborunner/snapshot/api_op_ListWorkerFleets.go.snap deleted file mode 100644 index 7a513e5f494..00000000000 --- a/service/iotroborunner/snapshot/api_op_ListWorkerFleets.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -ListWorkerFleets - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_ListWorkers.go.snap b/service/iotroborunner/snapshot/api_op_ListWorkers.go.snap deleted file mode 100644 index 492fb1282b7..00000000000 --- a/service/iotroborunner/snapshot/api_op_ListWorkers.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -ListWorkers - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_UpdateDestination.go.snap b/service/iotroborunner/snapshot/api_op_UpdateDestination.go.snap deleted file mode 100644 index e565dc00f0f..00000000000 --- a/service/iotroborunner/snapshot/api_op_UpdateDestination.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -UpdateDestination - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_UpdateSite.go.snap b/service/iotroborunner/snapshot/api_op_UpdateSite.go.snap deleted file mode 100644 index 46bbd7b1b8d..00000000000 --- a/service/iotroborunner/snapshot/api_op_UpdateSite.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -UpdateSite - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_UpdateWorker.go.snap b/service/iotroborunner/snapshot/api_op_UpdateWorker.go.snap deleted file mode 100644 index 7ec285b69fc..00000000000 --- a/service/iotroborunner/snapshot/api_op_UpdateWorker.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -UpdateWorker - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot/api_op_UpdateWorkerFleet.go.snap b/service/iotroborunner/snapshot/api_op_UpdateWorkerFleet.go.snap deleted file mode 100644 index 9404082539f..00000000000 --- a/service/iotroborunner/snapshot/api_op_UpdateWorkerFleet.go.snap +++ /dev/null @@ -1,34 +0,0 @@ -UpdateWorkerFleet - Initialize stack step - RegisterServiceMetadata - legacyEndpointContextSetter - SetLogger - OperationInputValidation - Serialize stack step - setOperationInput - ResolveEndpoint - OperationSerializer - Build stack step - ClientRequestID - ComputeContentLength - UserAgent - RecursionDetection - Finalize stack step - ResolveAuthScheme - GetIdentity - ResolveEndpointV2 - disableHTTPS - ComputePayloadHash - Retry - RetryMetricsHeader - setLegacyContextSigningOptions - Signing - Deserialize stack step - AddRawResponseToMetadata - ErrorCloseResponseBody - CloseResponseBody - ResponseErrorWrapper - RequestIDRetriever - OperationDeserializer - RecordResponseTiming - RequestResponseLogger diff --git a/service/iotroborunner/snapshot_test.go b/service/iotroborunner/snapshot_test.go deleted file mode 100644 index 65c71b68f94..00000000000 --- a/service/iotroborunner/snapshot_test.go +++ /dev/null @@ -1,542 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -//go:build snapshot - -package iotroborunner - -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_CreateDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreateDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_CreateSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreateSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_CreateWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreateWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_CreateWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "CreateWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeleteDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeleteDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeleteSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeleteSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeleteWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeleteWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_DeleteWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "DeleteWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_GetWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "GetWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListDestinations(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDestinations(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListDestinations") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListSites(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListSites(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListSites") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListWorkerFleets(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListWorkerFleets(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListWorkerFleets") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_ListWorkers(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListWorkers(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "ListWorkers") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestCheckSnapshot_UpdateWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return testSnapshot(stack, "UpdateWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} -func TestUpdateSnapshot_CreateDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreateDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_CreateSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreateSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_CreateWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreateWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_CreateWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.CreateWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "CreateWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeleteDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeleteDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeleteSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeleteSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeleteWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeleteWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_DeleteWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.DeleteWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "DeleteWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_GetWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.GetWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "GetWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListDestinations(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListDestinations(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListDestinations") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListSites(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListSites(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListSites") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListWorkerFleets(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListWorkerFleets(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListWorkerFleets") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_ListWorkers(t *testing.T) { - svc := New(Options{}) - _, err := svc.ListWorkers(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "ListWorkers") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateDestination(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateDestination(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateDestination") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateSite(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateSite(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateSite") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateWorker(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateWorker(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateWorker") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} - -func TestUpdateSnapshot_UpdateWorkerFleet(t *testing.T) { - svc := New(Options{}) - _, err := svc.UpdateWorkerFleet(context.Background(), nil, func(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - return updateSnapshot(stack, "UpdateWorkerFleet") - }) - }) - if _, ok := err.(snapshotOK); !ok && err != nil { - t.Fatal(err) - } -} diff --git a/service/iotroborunner/types/enums.go b/service/iotroborunner/types/enums.go deleted file mode 100644 index 019e33b1761..00000000000 --- a/service/iotroborunner/types/enums.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type DestinationState string - -// Enum values for DestinationState -const ( - DestinationStateEnabled DestinationState = "ENABLED" - DestinationStateDisabled DestinationState = "DISABLED" - DestinationStateDecommissioned DestinationState = "DECOMMISSIONED" -) - -// Values returns all known values for DestinationState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. The -// ordering of this slice is not guaranteed to be stable across updates. -func (DestinationState) Values() []DestinationState { - return []DestinationState{ - "ENABLED", - "DISABLED", - "DECOMMISSIONED", - } -} diff --git a/service/iotroborunner/types/errors.go b/service/iotroborunner/types/errors.go deleted file mode 100644 index acac967ca78..00000000000 --- a/service/iotroborunner/types/errors.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// User does not have sufficient access to perform this action. -type AccessDeniedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Exception thrown if a resource in a create request already exists. -type ConflictException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ConflictException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ConflictException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ConflictException" - } - return *e.ErrorCodeOverride -} -func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Exception thrown if something goes wrong within the service. -type InternalServerException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InternalServerException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InternalServerException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InternalServerException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InternalServerException" - } - return *e.ErrorCodeOverride -} -func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// Exception thrown if a resource referenced in the request doesn't exist. -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *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 } - -// Exception thrown if the user's AWS account has reached a service limit and the -// operation cannot proceed. -type ServiceQuotaExceededException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ServiceQuotaExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ServiceQuotaExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ServiceQuotaExceededException" - } - return *e.ErrorCodeOverride -} -func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Exception thrown if the api has been called too quickly be the client. -type ThrottlingException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ThrottlingException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ThrottlingException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ThrottlingException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ThrottlingException" - } - return *e.ErrorCodeOverride -} -func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Exception thrown if an invalid parameter is provided to an API. -type ValidationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ValidationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ValidationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ValidationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ValidationException" - } - return *e.ErrorCodeOverride -} -func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotroborunner/types/types.go b/service/iotroborunner/types/types.go deleted file mode 100644 index 17b5a53cc96..00000000000 --- a/service/iotroborunner/types/types.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// Cartesian coordinates in 3D space relative to the RoboRunner origin. -type CartesianCoordinates struct { - - // X coordinate. - // - // This member is required. - X *float64 - - // Y coordinate. - // - // This member is required. - Y *float64 - - // Z coordinate. - Z *float64 - - noSmithyDocumentSerde -} - -// Area within a facility where work can be performed. -type Destination struct { - - // Destination ARN. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the destination's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // State of the destination. - // - // This member is required. - State DestinationState - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON document containing additional fixed properties regarding the destination - AdditionalFixedProperties *string - - noSmithyDocumentSerde -} - -// Worker orientation measured in units clockwise from north. -// -// The following types satisfy this interface: -// -// OrientationMemberDegrees -type Orientation interface { - isOrientation() -} - -// Degrees, limited on [0, 360) -type OrientationMemberDegrees struct { - Value float64 - - noSmithyDocumentSerde -} - -func (*OrientationMemberDegrees) isOrientation() {} - -// Supported coordinates for worker position. -// -// The following types satisfy this interface: -// -// PositionCoordinatesMemberCartesianCoordinates -type PositionCoordinates interface { - isPositionCoordinates() -} - -// Cartesian coordinates. -type PositionCoordinatesMemberCartesianCoordinates struct { - Value CartesianCoordinates - - noSmithyDocumentSerde -} - -func (*PositionCoordinatesMemberCartesianCoordinates) isPositionCoordinates() {} - -// Facility containing destinations, workers, activities, and tasks. -type Site struct { - - // Site ARN. - // - // This member is required. - Arn *string - - // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. - // e.g., US. - // - // This member is required. - CountryCode *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // The name of the site. Mutable after creation and unique within a given account. - // - // This member is required. - Name *string - - noSmithyDocumentSerde -} - -// Properties of the worker that are provided by the vendor FMS. -type VendorProperties struct { - - // The worker ID defined by the vendor FMS. - // - // This member is required. - VendorWorkerId *string - - // JSON blob containing unstructured vendor properties that are fixed and won't - // change during regular operation. - VendorAdditionalFixedProperties *string - - // JSON blob containing unstructured vendor properties that are transient and may - // change during regular operation. - VendorAdditionalTransientProperties *string - - // The worker IP address defined by the vendor FMS. - VendorWorkerIpAddress *string - - noSmithyDocumentSerde -} - -// A unit capable of performing tasks. -type Worker struct { - - // Full ARN of the worker. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Full ARN of the worker fleet. - // - // This member is required. - Fleet *string - - // Filters access by the workers identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing unstructured worker properties that are fixed and won't - // change during regular operation. - AdditionalFixedProperties *string - - // JSON blob containing unstructured worker properties that are transient and may - // change during regular operation. - AdditionalTransientProperties *string - - // Worker orientation measured in units clockwise from north. - Orientation Orientation - - // Supported coordinates for worker position. - Position PositionCoordinates - - // Properties of the worker that are provided by the vendor FMS. - VendorProperties *VendorProperties - - noSmithyDocumentSerde -} - -// A collection of workers organized within a facility. -type WorkerFleet struct { - - // Full ARN of the worker fleet. - // - // This member is required. - Arn *string - - // Timestamp at which the resource was created. - // - // This member is required. - CreatedAt *time.Time - - // Filters access by the worker fleet's identifier - // - // This member is required. - Id *string - - // Human friendly name of the resource. - // - // This member is required. - Name *string - - // Site ARN. - // - // This member is required. - Site *string - - // Timestamp at which the resource was last updated. - // - // This member is required. - UpdatedAt *time.Time - - // JSON blob containing additional fixed properties regarding the worker fleet - AdditionalFixedProperties *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -// UnknownUnionMember is returned when a union member is returned over the wire, -// but has an unknown tag. -type UnknownUnionMember struct { - Tag string - Value []byte - - noSmithyDocumentSerde -} - -func (*UnknownUnionMember) isOrientation() {} -func (*UnknownUnionMember) isPositionCoordinates() {} diff --git a/service/iotroborunner/types/types_exported_test.go b/service/iotroborunner/types/types_exported_test.go deleted file mode 100644 index 9e42a7135cc..00000000000 --- a/service/iotroborunner/types/types_exported_test.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types_test - -import ( - "fmt" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" -) - -func ExampleOrientation_outputUsage() { - var union types.Orientation - // type switches can be used to check the union value - switch v := union.(type) { - case *types.OrientationMemberDegrees: - _ = v.Value // Value is float64 - - case *types.UnknownUnionMember: - fmt.Println("unknown tag:", v.Tag) - - default: - fmt.Println("union is nil or unknown type") - - } -} - -var _ *float64 - -func ExamplePositionCoordinates_outputUsage() { - var union types.PositionCoordinates - // type switches can be used to check the union value - switch v := union.(type) { - case *types.PositionCoordinatesMemberCartesianCoordinates: - _ = v.Value // Value is types.CartesianCoordinates - - case *types.UnknownUnionMember: - fmt.Println("unknown tag:", v.Tag) - - default: - fmt.Println("union is nil or unknown type") - - } -} - -var _ *types.CartesianCoordinates diff --git a/service/iotroborunner/validators.go b/service/iotroborunner/validators.go deleted file mode 100644 index 1ae565ef72e..00000000000 --- a/service/iotroborunner/validators.go +++ /dev/null @@ -1,836 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package iotroborunner - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpCreateDestination struct { -} - -func (*validateOpCreateDestination) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateDestinationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateSite struct { -} - -func (*validateOpCreateSite) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateSiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateSiteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateWorkerFleet struct { -} - -func (*validateOpCreateWorkerFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateWorkerFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateWorkerFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateWorker struct { -} - -func (*validateOpCreateWorker) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateWorkerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateWorkerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteDestination struct { -} - -func (*validateOpDeleteDestination) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteDestinationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteSite struct { -} - -func (*validateOpDeleteSite) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteSiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteSiteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteWorkerFleet struct { -} - -func (*validateOpDeleteWorkerFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteWorkerFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteWorkerFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteWorker struct { -} - -func (*validateOpDeleteWorker) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteWorkerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteWorkerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDestination struct { -} - -func (*validateOpGetDestination) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDestinationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSite struct { -} - -func (*validateOpGetSite) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSiteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetWorkerFleet struct { -} - -func (*validateOpGetWorkerFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetWorkerFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetWorkerFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetWorker struct { -} - -func (*validateOpGetWorker) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetWorkerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetWorkerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListDestinations struct { -} - -func (*validateOpListDestinations) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListDestinations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListDestinationsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListDestinationsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListWorkerFleets struct { -} - -func (*validateOpListWorkerFleets) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListWorkerFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListWorkerFleetsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListWorkerFleetsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListWorkers struct { -} - -func (*validateOpListWorkers) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListWorkers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListWorkersInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListWorkersInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateDestination struct { -} - -func (*validateOpUpdateDestination) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateDestinationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateDestinationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateSite struct { -} - -func (*validateOpUpdateSite) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateSiteInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateSiteInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateWorkerFleet struct { -} - -func (*validateOpUpdateWorkerFleet) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateWorkerFleetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateWorkerFleetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateWorker struct { -} - -func (*validateOpUpdateWorker) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateWorkerInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateWorkerInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpCreateDestinationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateDestination{}, middleware.After) -} - -func addOpCreateSiteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateSite{}, middleware.After) -} - -func addOpCreateWorkerFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateWorkerFleet{}, middleware.After) -} - -func addOpCreateWorkerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateWorker{}, middleware.After) -} - -func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) -} - -func addOpDeleteSiteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteSite{}, middleware.After) -} - -func addOpDeleteWorkerFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteWorkerFleet{}, middleware.After) -} - -func addOpDeleteWorkerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteWorker{}, middleware.After) -} - -func addOpGetDestinationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDestination{}, middleware.After) -} - -func addOpGetSiteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSite{}, middleware.After) -} - -func addOpGetWorkerFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetWorkerFleet{}, middleware.After) -} - -func addOpGetWorkerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetWorker{}, middleware.After) -} - -func addOpListDestinationsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListDestinations{}, middleware.After) -} - -func addOpListWorkerFleetsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListWorkerFleets{}, middleware.After) -} - -func addOpListWorkersValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListWorkers{}, middleware.After) -} - -func addOpUpdateDestinationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateDestination{}, middleware.After) -} - -func addOpUpdateSiteValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateSite{}, middleware.After) -} - -func addOpUpdateWorkerFleetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateWorkerFleet{}, middleware.After) -} - -func addOpUpdateWorkerValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateWorker{}, middleware.After) -} - -func validateCartesianCoordinates(v *types.CartesianCoordinates) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CartesianCoordinates"} - if v.X == nil { - invalidParams.Add(smithy.NewErrParamRequired("X")) - } - if v.Y == nil { - invalidParams.Add(smithy.NewErrParamRequired("Y")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validatePositionCoordinates(v types.PositionCoordinates) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PositionCoordinates"} - switch uv := v.(type) { - case *types.PositionCoordinatesMemberCartesianCoordinates: - if err := validateCartesianCoordinates(&uv.Value); err != nil { - invalidParams.AddNested("[cartesianCoordinates]", err.(smithy.InvalidParamsError)) - } - - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateVendorProperties(v *types.VendorProperties) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "VendorProperties"} - if v.VendorWorkerId == nil { - invalidParams.Add(smithy.NewErrParamRequired("VendorWorkerId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateDestinationInput(v *CreateDestinationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateDestinationInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Site == nil { - invalidParams.Add(smithy.NewErrParamRequired("Site")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateSiteInput(v *CreateSiteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateSiteInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.CountryCode == nil { - invalidParams.Add(smithy.NewErrParamRequired("CountryCode")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateWorkerFleetInput(v *CreateWorkerFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerFleetInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Site == nil { - invalidParams.Add(smithy.NewErrParamRequired("Site")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateWorkerInput(v *CreateWorkerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Fleet == nil { - invalidParams.Add(smithy.NewErrParamRequired("Fleet")) - } - if v.VendorProperties != nil { - if err := validateVendorProperties(v.VendorProperties); err != nil { - invalidParams.AddNested("VendorProperties", err.(smithy.InvalidParamsError)) - } - } - if v.Position != nil { - if err := validatePositionCoordinates(v.Position); err != nil { - invalidParams.AddNested("Position", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteDestinationInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteSiteInput(v *DeleteSiteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteSiteInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteWorkerFleetInput(v *DeleteWorkerFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkerFleetInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteWorkerInput(v *DeleteWorkerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkerInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDestinationInput(v *GetDestinationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDestinationInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSiteInput(v *GetSiteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSiteInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetWorkerFleetInput(v *GetWorkerFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetWorkerFleetInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetWorkerInput(v *GetWorkerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetWorkerInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListDestinationsInput(v *ListDestinationsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListDestinationsInput"} - if v.Site == nil { - invalidParams.Add(smithy.NewErrParamRequired("Site")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListWorkerFleetsInput(v *ListWorkerFleetsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListWorkerFleetsInput"} - if v.Site == nil { - invalidParams.Add(smithy.NewErrParamRequired("Site")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListWorkersInput(v *ListWorkersInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListWorkersInput"} - if v.Site == nil { - invalidParams.Add(smithy.NewErrParamRequired("Site")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateDestinationInput(v *UpdateDestinationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateDestinationInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateSiteInput(v *UpdateSiteInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateSiteInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateWorkerFleetInput(v *UpdateWorkerFleetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkerFleetInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateWorkerInput(v *UpdateWorkerInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkerInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if v.VendorProperties != nil { - if err := validateVendorProperties(v.VendorProperties); err != nil { - invalidParams.AddNested("VendorProperties", err.(smithy.InvalidParamsError)) - } - } - if v.Position != nil { - if err := validatePositionCoordinates(v.Position); err != nil { - invalidParams.AddNested("Position", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -}