From b6cdf8c71c32875d1eb9dcf79548b3fca657507c Mon Sep 17 00:00:00 2001 From: Sogo Kato Date: Mon, 25 Mar 2024 11:25:16 +0900 Subject: [PATCH] Add devops and devops-runner APIs --- README.md | 2 +- .../nifcloud-models/devops-runner.smithy | 1026 +++ .../sdk-codegen/nifcloud-models/devops.smithy | 1582 +++++ service/devops/api_client.go | 439 ++ service/devops/api_client_test.go | 124 + .../devops/api_op_AuthorizeFirewallRules.go | 119 + service/devops/api_op_CreateBackupRule.go | 121 + service/devops/api_op_CreateFirewallGroup.go | 120 + service/devops/api_op_CreateInstance.go | 137 + service/devops/api_op_CreateParameterGroup.go | 118 + service/devops/api_op_DeleteBackup.go | 113 + service/devops/api_op_DeleteBackupRule.go | 113 + service/devops/api_op_DeleteFirewallGroup.go | 116 + service/devops/api_op_DeleteInstance.go | 116 + service/devops/api_op_DeleteParameterGroup.go | 113 + service/devops/api_op_ExtendDisk.go | 116 + service/devops/api_op_GetBackup.go | 116 + service/devops/api_op_GetBackupRule.go | 116 + service/devops/api_op_GetFirewallGroup.go | 116 + service/devops/api_op_GetInstance.go | 116 + service/devops/api_op_GetParameterGroup.go | 116 + service/devops/api_op_ListBackupRules.go | 109 + service/devops/api_op_ListBackups.go | 109 + service/devops/api_op_ListFirewallGroups.go | 109 + service/devops/api_op_ListInstances.go | 109 + service/devops/api_op_ListParameterGroups.go | 109 + service/devops/api_op_RebootInstance.go | 116 + service/devops/api_op_RestoreInstance.go | 137 + service/devops/api_op_RevokeFirewallRules.go | 119 + service/devops/api_op_UpdateBackupRule.go | 120 + service/devops/api_op_UpdateFirewallGroup.go | 120 + service/devops/api_op_UpdateInstance.go | 122 + .../devops/api_op_UpdateNetworkInterface.go | 118 + service/devops/api_op_UpdateParameterGroup.go | 122 + service/devops/api_op_UpgradeInstance.go | 118 + service/devops/deserializers.go | 5752 +++++++++++++++++ service/devops/doc.go | 8 + service/devops/endpoints.go | 232 + service/devops/endpoints_test.go | 6 + service/devops/generated.json | 57 + .../devops/internal/endpoints/endpoints.go | 109 + .../internal/endpoints/endpoints_test.go | 12 + service/devops/protocol_test.go | 6 + service/devops/serializers.go | 2534 ++++++++ service/devops/types/enums.go | 384 ++ service/devops/types/types.go | 383 ++ service/devops/validators.go | 1065 +++ service/devopsrunner/api_client.go | 439 ++ service/devopsrunner/api_client_test.go | 124 + service/devopsrunner/api_op_CreateRunner.go | 127 + .../api_op_CreateRunnerParameterGroup.go | 118 + service/devopsrunner/api_op_DeleteRunner.go | 116 + .../api_op_DeleteRunnerParameterGroup.go | 113 + service/devopsrunner/api_op_GetRunner.go | 116 + .../api_op_GetRunnerParameterGroup.go | 116 + .../api_op_ListRunnerParameterGroups.go | 109 + .../api_op_ListRunnerRegistrations.go | 116 + service/devopsrunner/api_op_ListRunners.go | 109 + .../api_op_ModifyRunnerInstanceType.go | 119 + service/devopsrunner/api_op_RegisterRunner.go | 143 + .../devopsrunner/api_op_UnregisterRunner.go | 119 + service/devopsrunner/api_op_UpdateRunner.go | 122 + .../api_op_UpdateRunnerParameter.go | 118 + .../api_op_UpdateRunnerParameterGroup.go | 120 + .../api_op_UpdateRunnerRegistration.go | 122 + service/devopsrunner/deserializers.go | 3228 +++++++++ service/devopsrunner/doc.go | 8 + service/devopsrunner/endpoints.go | 232 + service/devopsrunner/endpoints_test.go | 6 + service/devopsrunner/generated.json | 43 + .../internal/endpoints/endpoints.go | 109 + .../internal/endpoints/endpoints_test.go | 12 + service/devopsrunner/protocol_test.go | 6 + service/devopsrunner/serializers.go | 1443 +++++ service/devopsrunner/types/enums.go | 270 + service/devopsrunner/types/types.go | 208 + service/devopsrunner/validators.go | 575 ++ .../integrationtest/devops/smoke_test.go | 45 + .../devops_runner/smoke_test.go | 45 + 79 files changed, 25935 insertions(+), 1 deletion(-) create mode 100644 codegen/sdk-codegen/nifcloud-models/devops-runner.smithy create mode 100644 codegen/sdk-codegen/nifcloud-models/devops.smithy create mode 100644 service/devops/api_client.go create mode 100644 service/devops/api_client_test.go create mode 100644 service/devops/api_op_AuthorizeFirewallRules.go create mode 100644 service/devops/api_op_CreateBackupRule.go create mode 100644 service/devops/api_op_CreateFirewallGroup.go create mode 100644 service/devops/api_op_CreateInstance.go create mode 100644 service/devops/api_op_CreateParameterGroup.go create mode 100644 service/devops/api_op_DeleteBackup.go create mode 100644 service/devops/api_op_DeleteBackupRule.go create mode 100644 service/devops/api_op_DeleteFirewallGroup.go create mode 100644 service/devops/api_op_DeleteInstance.go create mode 100644 service/devops/api_op_DeleteParameterGroup.go create mode 100644 service/devops/api_op_ExtendDisk.go create mode 100644 service/devops/api_op_GetBackup.go create mode 100644 service/devops/api_op_GetBackupRule.go create mode 100644 service/devops/api_op_GetFirewallGroup.go create mode 100644 service/devops/api_op_GetInstance.go create mode 100644 service/devops/api_op_GetParameterGroup.go create mode 100644 service/devops/api_op_ListBackupRules.go create mode 100644 service/devops/api_op_ListBackups.go create mode 100644 service/devops/api_op_ListFirewallGroups.go create mode 100644 service/devops/api_op_ListInstances.go create mode 100644 service/devops/api_op_ListParameterGroups.go create mode 100644 service/devops/api_op_RebootInstance.go create mode 100644 service/devops/api_op_RestoreInstance.go create mode 100644 service/devops/api_op_RevokeFirewallRules.go create mode 100644 service/devops/api_op_UpdateBackupRule.go create mode 100644 service/devops/api_op_UpdateFirewallGroup.go create mode 100644 service/devops/api_op_UpdateInstance.go create mode 100644 service/devops/api_op_UpdateNetworkInterface.go create mode 100644 service/devops/api_op_UpdateParameterGroup.go create mode 100644 service/devops/api_op_UpgradeInstance.go create mode 100644 service/devops/deserializers.go create mode 100644 service/devops/doc.go create mode 100644 service/devops/endpoints.go create mode 100644 service/devops/endpoints_test.go create mode 100644 service/devops/generated.json create mode 100644 service/devops/internal/endpoints/endpoints.go create mode 100644 service/devops/internal/endpoints/endpoints_test.go create mode 100644 service/devops/protocol_test.go create mode 100644 service/devops/serializers.go create mode 100644 service/devops/types/enums.go create mode 100644 service/devops/types/types.go create mode 100644 service/devops/validators.go create mode 100644 service/devopsrunner/api_client.go create mode 100644 service/devopsrunner/api_client_test.go create mode 100644 service/devopsrunner/api_op_CreateRunner.go create mode 100644 service/devopsrunner/api_op_CreateRunnerParameterGroup.go create mode 100644 service/devopsrunner/api_op_DeleteRunner.go create mode 100644 service/devopsrunner/api_op_DeleteRunnerParameterGroup.go create mode 100644 service/devopsrunner/api_op_GetRunner.go create mode 100644 service/devopsrunner/api_op_GetRunnerParameterGroup.go create mode 100644 service/devopsrunner/api_op_ListRunnerParameterGroups.go create mode 100644 service/devopsrunner/api_op_ListRunnerRegistrations.go create mode 100644 service/devopsrunner/api_op_ListRunners.go create mode 100644 service/devopsrunner/api_op_ModifyRunnerInstanceType.go create mode 100644 service/devopsrunner/api_op_RegisterRunner.go create mode 100644 service/devopsrunner/api_op_UnregisterRunner.go create mode 100644 service/devopsrunner/api_op_UpdateRunner.go create mode 100644 service/devopsrunner/api_op_UpdateRunnerParameter.go create mode 100644 service/devopsrunner/api_op_UpdateRunnerParameterGroup.go create mode 100644 service/devopsrunner/api_op_UpdateRunnerRegistration.go create mode 100644 service/devopsrunner/deserializers.go create mode 100644 service/devopsrunner/doc.go create mode 100644 service/devopsrunner/endpoints.go create mode 100644 service/devopsrunner/endpoints_test.go create mode 100644 service/devopsrunner/generated.json create mode 100644 service/devopsrunner/internal/endpoints/endpoints.go create mode 100644 service/devopsrunner/internal/endpoints/endpoints_test.go create mode 100644 service/devopsrunner/protocol_test.go create mode 100644 service/devopsrunner/serializers.go create mode 100644 service/devopsrunner/types/enums.go create mode 100644 service/devopsrunner/types/types.go create mode 100644 service/devopsrunner/validators.go create mode 100644 service/internal/integrationtest/devops/smoke_test.go create mode 100644 service/internal/integrationtest/devops_runner/smoke_test.go diff --git a/README.md b/README.md index 88494b5..f7cced7 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ It works by feeding AWS-SDK-compatible model JSONs to [github.com/aws/aws-sdk-go ## Features -* :heavy_check_mark: Support for NIFCLOUD Computing / RDB / NAS / ESS / DNS / ObjectStorageService / ServiceActivity APIs +* :heavy_check_mark: Support for NIFCLOUD Computing / RDB / NAS / ESS / DNS / ObjectStorageService / ServiceActivity / DevOps with GitLab APIs * :heavy_check_mark: AWS-SDK-compatible data-driven architecture # Getting started diff --git a/codegen/sdk-codegen/nifcloud-models/devops-runner.smithy b/codegen/sdk-codegen/nifcloud-models/devops-runner.smithy new file mode 100644 index 0000000..fe6ee74 --- /dev/null +++ b/codegen/sdk-codegen/nifcloud-models/devops-runner.smithy @@ -0,0 +1,1026 @@ +namespace com.nifcloud.api.devopsrunner + +use aws.auth#sigv4 +use aws.api#service +use aws.protocols#restJson1 +use aws.protocols#restXml +use aws.protocols#awsQuery +use aws.protocols#ec2Query +use smithy.waiters#waitable +use aws.protocols#ec2QueryName + + +structure ListRunnersRequest {} + +list ListOfRunners { + member: Runners, +} + +structure Runners { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("concurrent") + Concurrent: Integer, + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("instanceType") + InstanceType: String, + @jsonName("networkConfig") + NetworkConfig: NetworkConfig, + @jsonName("publicIpAddress") + PublicIpAddress: String, + @jsonName("region") + Region: String, + @jsonName("runnerName") + RunnerName: String, + @jsonName("runnerVersion") + RunnerVersion: String, + @jsonName("status") + Status: Status, + @jsonName("systemId") + SystemId: String, +} + +structure NetworkConfig { + @jsonName("networkId") + NetworkId: String, + @jsonName("privateAddress") + PrivateAddress: String, +} + +structure Status { + @jsonName("code") + Code: Integer, + @jsonName("name") + Name: String, +} + +structure ListRunnersResult { + @jsonName("runners") + Runners: ListOfRunners, +} + +@enum([ + { + name: "EAST_11", + value: "east-11", + }, + { + name: "EAST_12", + value: "east-12", + }, + { + name: "EAST_13", + value: "east-13", + }, + { + name: "EAST_14", + value: "east-14", + }, + { + name: "EAST_31", + value: "east-31", + }, + { + name: "WEST_11", + value: "west-11", + }, + { + name: "WEST_12", + value: "west-12", + }, + { + name: "WEST_13", + value: "west-13", + }, + { + name: "JP_WEST_21", + value: "jp-west-21", + }, +]) +string AvailabilityZoneOfCreateRunnerRequest + +@enum([ + { + name: "C_SMALL", + value: "c-small", + }, + { + name: "C_SMALL2", + value: "c-small2", + }, + { + name: "C_SMALL4", + value: "c-small4", + }, + { + name: "C_MEDIUM", + value: "c-medium", + }, + { + name: "C_MEDIUM4", + value: "c-medium4", + }, + { + name: "C_MEDIUM8", + value: "c-medium8", + }, + { + name: "C_LARGE", + value: "c-large", + }, + { + name: "C_LARGE8", + value: "c-large8", + }, + { + name: "E_SMALL", + value: "e-small", + }, + { + name: "E_SMALL2", + value: "e-small2", + }, + { + name: "E_SMALL4", + value: "e-small4", + }, + { + name: "E_SMALL8", + value: "e-small8", + }, + { + name: "E_SMALL16", + value: "e-small16", + }, + { + name: "E_MEDIUM", + value: "e-medium", + }, + { + name: "E_MEDIUM4", + value: "e-medium4", + }, + { + name: "E_MEDIUM8", + value: "e-medium8", + }, + { + name: "E_MEDIUM16", + value: "e-medium16", + }, + { + name: "E_MEDIUM24", + value: "e-medium24", + }, + { + name: "E_LARGE", + value: "e-large", + }, + { + name: "E_LARGE8", + value: "e-large8", + }, + { + name: "E_LARGE16", + value: "e-large16", + }, + { + name: "E_LARGE24", + value: "e-large24", + }, + { + name: "E_EXTRA_LARGE8", + value: "e-extra-large8", + }, + { + name: "E_EXTRA_LARGE16", + value: "e-extra-large16", + }, + { + name: "E_EXTRA_LARGE24", + value: "e-extra-large24", + }, + { + name: "E_DOUBLE_LARGE16", + value: "e-double-large16", + }, + { + name: "E_DOUBLE_LARGE24", + value: "e-double-large24", + }, + { + name: "H2_SMALL", + value: "h2-small", + }, + { + name: "H2_SMALL2", + value: "h2-small2", + }, + { + name: "H2_SMALL4", + value: "h2-small4", + }, + { + name: "H2_SMALL8", + value: "h2-small8", + }, + { + name: "H2_SMALL16", + value: "h2-small16", + }, + { + name: "H2_MEDIUM", + value: "h2-medium", + }, + { + name: "H2_MEDIUM4", + value: "h2-medium4", + }, + { + name: "H2_MEDIUM8", + value: "h2-medium8", + }, + { + name: "H2_MEDIUM16", + value: "h2-medium16", + }, + { + name: "H2_MEDIUM24", + value: "h2-medium24", + }, + { + name: "H2_LARGE", + value: "h2-large", + }, + { + name: "H2_LARGE8", + value: "h2-large8", + }, + { + name: "H2_LARGE16", + value: "h2-large16", + }, + { + name: "H2_LARGE24", + value: "h2-large24", + }, + { + name: "H2_EXTRA_LARGE8", + value: "h2-extra-large8", + }, + { + name: "H2_EXTRA_LARGE16", + value: "h2-extra-large16", + }, + { + name: "H2_EXTRA_LARGE24", + value: "h2-extra-large24", + }, + { + name: "H2_DOUBLE_LARGE16", + value: "h2-double-large16", + }, + { + name: "H2_DOUBLE_LARGE24", + value: "h2-double-large24", + }, +]) +string InstanceTypeOfCreateRunnerRequest + +structure RequestNetworkConfig { + @jsonName("networkId") + NetworkId: String, + @jsonName("privateAddress") + PrivateAddress: String, +} + +structure CreateRunnerRequest { + @jsonName("availabilityZone") + AvailabilityZone: AvailabilityZoneOfCreateRunnerRequest, + @jsonName("concurrent") + Concurrent: Integer, + @jsonName("description") + Description: String, + @required + @jsonName("instanceType") + InstanceType: InstanceTypeOfCreateRunnerRequest, + @jsonName("networkConfig") + NetworkConfig: RequestNetworkConfig, + @required + @jsonName("runnerName") + RunnerName: String, +} + +structure Runner { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("concurrent") + Concurrent: Integer, + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("instanceType") + InstanceType: String, + @jsonName("networkConfig") + NetworkConfig: NetworkConfig, + @jsonName("publicIpAddress") + PublicIpAddress: String, + @jsonName("region") + Region: String, + @jsonName("runnerName") + RunnerName: String, + @jsonName("runnerVersion") + RunnerVersion: String, + @jsonName("status") + Status: Status, + @jsonName("systemId") + SystemId: String, +} + +structure CreateRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +structure GetRunnerRequest { + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure GetRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +structure UpdateRunnerRequest { + @jsonName("changedRunnerName") + ChangedRunnerName: String, + @jsonName("concurrent") + Concurrent: Integer, + @jsonName("description") + Description: String, + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure UpdateRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +structure DeleteRunnerRequest { + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure DeleteRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +@enum([ + { + name: "C_SMALL", + value: "c-small", + }, + { + name: "C_SMALL2", + value: "c-small2", + }, + { + name: "C_SMALL4", + value: "c-small4", + }, + { + name: "C_MEDIUM", + value: "c-medium", + }, + { + name: "C_MEDIUM4", + value: "c-medium4", + }, + { + name: "C_MEDIUM8", + value: "c-medium8", + }, + { + name: "C_LARGE", + value: "c-large", + }, + { + name: "C_LARGE8", + value: "c-large8", + }, + { + name: "E_SMALL", + value: "e-small", + }, + { + name: "E_SMALL2", + value: "e-small2", + }, + { + name: "E_SMALL4", + value: "e-small4", + }, + { + name: "E_SMALL8", + value: "e-small8", + }, + { + name: "E_SMALL16", + value: "e-small16", + }, + { + name: "E_MEDIUM", + value: "e-medium", + }, + { + name: "E_MEDIUM4", + value: "e-medium4", + }, + { + name: "E_MEDIUM8", + value: "e-medium8", + }, + { + name: "E_MEDIUM16", + value: "e-medium16", + }, + { + name: "E_MEDIUM24", + value: "e-medium24", + }, + { + name: "E_LARGE", + value: "e-large", + }, + { + name: "E_LARGE8", + value: "e-large8", + }, + { + name: "E_LARGE16", + value: "e-large16", + }, + { + name: "E_LARGE24", + value: "e-large24", + }, + { + name: "E_EXTRA_LARGE8", + value: "e-extra-large8", + }, + { + name: "E_EXTRA_LARGE16", + value: "e-extra-large16", + }, + { + name: "E_EXTRA_LARGE24", + value: "e-extra-large24", + }, + { + name: "E_DOUBLE_LARGE16", + value: "e-double-large16", + }, + { + name: "E_DOUBLE_LARGE24", + value: "e-double-large24", + }, + { + name: "H2_SMALL", + value: "h2-small", + }, + { + name: "H2_SMALL2", + value: "h2-small2", + }, + { + name: "H2_SMALL4", + value: "h2-small4", + }, + { + name: "H2_SMALL8", + value: "h2-small8", + }, + { + name: "H2_SMALL16", + value: "h2-small16", + }, + { + name: "H2_MEDIUM", + value: "h2-medium", + }, + { + name: "H2_MEDIUM4", + value: "h2-medium4", + }, + { + name: "H2_MEDIUM8", + value: "h2-medium8", + }, + { + name: "H2_MEDIUM16", + value: "h2-medium16", + }, + { + name: "H2_MEDIUM24", + value: "h2-medium24", + }, + { + name: "H2_LARGE", + value: "h2-large", + }, + { + name: "H2_LARGE8", + value: "h2-large8", + }, + { + name: "H2_LARGE16", + value: "h2-large16", + }, + { + name: "H2_LARGE24", + value: "h2-large24", + }, + { + name: "H2_EXTRA_LARGE8", + value: "h2-extra-large8", + }, + { + name: "H2_EXTRA_LARGE16", + value: "h2-extra-large16", + }, + { + name: "H2_EXTRA_LARGE24", + value: "h2-extra-large24", + }, + { + name: "H2_DOUBLE_LARGE16", + value: "h2-double-large16", + }, + { + name: "H2_DOUBLE_LARGE24", + value: "h2-double-large24", + }, +]) +string InstanceTypeOfModifyRunnerInstanceTypeRequest + +structure ModifyRunnerInstanceTypeRequest { + @required + @jsonName("instanceType") + InstanceType: InstanceTypeOfModifyRunnerInstanceTypeRequest, + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure ModifyRunnerInstanceTypeResult { + @jsonName("runner") + Runner: Runner, +} + +structure ListRunnerRegistrationsRequest { + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +list ListOfRegistrations { + member: Registrations, +} + +structure Registrations { + @jsonName("gitlabUrl") + GitlabUrl: String, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("registrationId") + RegistrationId: String, + @jsonName("status") + Status: Status, + @jsonName("token") + Token: String, +} + +structure ListRunnerRegistrationsResult { + @jsonName("registrations") + Registrations: ListOfRegistrations, +} + +@enum([ + { + name: "NOT_PROTECTED", + value: "not_protected", + }, + { + name: "REF_PROTECTED", + value: "ref_protected", + }, +]) +string AccessLevelOfRegisterRunnerRequest + +structure RequestExtraHosts { + @jsonName("hostName") + HostName: String, + @jsonName("ipAddress") + IpAddress: String, +} + +list ListOfRequestExtraHosts { + member: RequestExtraHosts, +} + +list ListOfRequestTags { + member: String, +} + +structure RegisterRunnerRequest { + @jsonName("accessLevel") + AccessLevel: AccessLevelOfRegisterRunnerRequest, + @jsonName("authenticationToken") + AuthenticationToken: String, + @jsonName("defaultDockerImage") + DefaultDockerImage: String, + @jsonName("extraHosts") + ExtraHosts: ListOfRequestExtraHosts, + @required + @jsonName("gitlabUrl") + GitlabUrl: String, + @jsonName("locked") + Locked: Boolean, + @jsonName("maximumTimeout") + MaximumTimeout: Integer, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("paused") + Paused: Boolean, + @jsonName("privileged") + Privileged: Boolean, + @jsonName("registrationToken") + RegistrationToken: String, + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, + @jsonName("runUntagged") + RunUntagged: Boolean, + @jsonName("tags") + Tags: ListOfRequestTags, +} + +structure RegisterRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +structure UpdateRunnerRegistrationRequest { + @required + @jsonName("parameterGroupName") + ParameterGroupName: String, + @required + @httpLabel + @jsonName("RegistrationId") + RegistrationId: String, + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure UpdateRunnerRegistrationResult { + @jsonName("runner") + Runner: Runner, +} + +structure UnregisterRunnerRequest { + @required + @httpLabel + @jsonName("RegistrationId") + RegistrationId: String, + @required + @httpLabel + @jsonName("RunnerName") + RunnerName: String, +} + +structure UnregisterRunnerResult { + @jsonName("runner") + Runner: Runner, +} + +structure ListRunnerParameterGroupsRequest {} + +list ListOfParameterGroups { + member: ParameterGroups, +} + +structure ParameterGroups { + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("dockerParameters") + DockerParameters: DockerParameters, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("region") + Region: String, + @jsonName("runnerNames") + RunnerNames: ListOfRunnerNames, +} + +structure DockerParameters { + @jsonName("disableCache") + DisableCache: Boolean, + @jsonName("disableEntrypointOverwrite") + DisableEntrypointOverwrite: Boolean, + @jsonName("extraHosts") + ExtraHosts: ListOfExtraHosts, + @jsonName("image") + Image: String, + @jsonName("oomKillDisable") + OomKillDisable: Boolean, + @jsonName("privileged") + Privileged: Boolean, + @jsonName("shmSize") + ShmSize: Integer, + @jsonName("tlsVerify") + TlsVerify: Boolean, + @jsonName("volumes") + Volumes: ListOfVolumes, +} + +list ListOfExtraHosts { + member: ExtraHosts, +} + +structure ExtraHosts { + @jsonName("hostName") + HostName: String, + @jsonName("ipAddress") + IpAddress: String, +} + +list ListOfVolumes { + member: String, +} + +list ListOfRunnerNames { + member: String, +} + +structure ListRunnerParameterGroupsResult { + @jsonName("parameterGroups") + ParameterGroups: ListOfParameterGroups, +} + +structure CreateRunnerParameterGroupRequest { + @jsonName("description") + Description: String, + @required + @jsonName("parameterGroupName") + ParameterGroupName: String, +} + +structure ParameterGroup { + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("dockerParameters") + DockerParameters: DockerParameters, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("region") + Region: String, + @jsonName("runnerNames") + RunnerNames: ListOfRunnerNames, +} + +structure CreateRunnerParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure GetRunnerParameterGroupRequest { + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure GetRunnerParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure UpdateRunnerParameterGroupRequest { + @jsonName("changedParameterGroupName") + ChangedParameterGroupName: String, + @jsonName("description") + Description: String, + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure UpdateRunnerParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure DeleteRunnerParameterGroupRequest { + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure RequestDockerParameters { + @jsonName("disableCache") + DisableCache: Boolean, + @jsonName("disableEntrypointOverwrite") + DisableEntrypointOverwrite: Boolean, + @jsonName("image") + Image: String, + @jsonName("extraHosts") + ListOfRequestExtraHosts: ListOfRequestExtraHosts, + @jsonName("volumes") + ListOfRequestVolumes: ListOfRequestVolumes, + @jsonName("oomKillDisable") + OomKillDisable: Boolean, + @jsonName("privileged") + Privileged: Boolean, + @jsonName("shmSize") + ShmSize: Integer, + @jsonName("tlsVerify") + TlsVerify: Boolean, +} + +list ListOfRequestVolumes { + member: String, +} + +structure UpdateRunnerParameterRequest { + @jsonName("dockerParameters") + DockerParameters: RequestDockerParameters, + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure UpdateRunnerParameterResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +@restJson1 +@sigv4(name: "devops") +@service( + sdkId: "devopsrunner", + arnNamespace: "devops-runner", + endpointPrefix: "runner.devops" +) +service DevOpswithGitLabRunner { + version: "v1", + operations: [ + ListRunners, + CreateRunner, + GetRunner, + UpdateRunner, + DeleteRunner, + ModifyRunnerInstanceType, + ListRunnerRegistrations, + RegisterRunner, + UpdateRunnerRegistration, + UnregisterRunner, + ListRunnerParameterGroups, + CreateRunnerParameterGroup, + GetRunnerParameterGroup, + UpdateRunnerParameterGroup, + DeleteRunnerParameterGroup, + UpdateRunnerParameter, + ], +} + + +@http(method: "GET", uri: "/v1/runners" ) +@readonly +operation ListRunners { + input: ListRunnersRequest, + output: ListRunnersResult, +} + +@http(method: "POST", uri: "/v1/runners" ) +operation CreateRunner { + input: CreateRunnerRequest, + output: CreateRunnerResult, +} + +@http(method: "GET", uri: "/v1/runners/{RunnerName}" ) +@readonly +operation GetRunner { + input: GetRunnerRequest, + output: GetRunnerResult, +} + +@http(method: "PUT", uri: "/v1/runners/{RunnerName}" ) +@idempotent +operation UpdateRunner { + input: UpdateRunnerRequest, + output: UpdateRunnerResult, +} + +@http(method: "DELETE", uri: "/v1/runners/{RunnerName}" ) +@idempotent +operation DeleteRunner { + input: DeleteRunnerRequest, + output: DeleteRunnerResult, +} + +@http(method: "POST", uri: "/v1/runners/{RunnerName}/:modifyInstanceType" ) +operation ModifyRunnerInstanceType { + input: ModifyRunnerInstanceTypeRequest, + output: ModifyRunnerInstanceTypeResult, +} + +@http(method: "GET", uri: "/v1/runners/{RunnerName}/registrations" ) +@readonly +operation ListRunnerRegistrations { + input: ListRunnerRegistrationsRequest, + output: ListRunnerRegistrationsResult, +} + +@http(method: "POST", uri: "/v1/runners/{RunnerName}/registrations" ) +operation RegisterRunner { + input: RegisterRunnerRequest, + output: RegisterRunnerResult, +} + +@http(method: "PUT", uri: "/v1/runners/{RunnerName}/registrations/{RegistrationId}" ) +@idempotent +operation UpdateRunnerRegistration { + input: UpdateRunnerRegistrationRequest, + output: UpdateRunnerRegistrationResult, +} + +@http(method: "DELETE", uri: "/v1/runners/{RunnerName}/registrations/{RegistrationId}" ) +@idempotent +operation UnregisterRunner { + input: UnregisterRunnerRequest, + output: UnregisterRunnerResult, +} + +@http(method: "GET", uri: "/v1/parameterGroups" ) +@readonly +operation ListRunnerParameterGroups { + input: ListRunnerParameterGroupsRequest, + output: ListRunnerParameterGroupsResult, +} + +@http(method: "POST", uri: "/v1/parameterGroups" ) +operation CreateRunnerParameterGroup { + input: CreateRunnerParameterGroupRequest, + output: CreateRunnerParameterGroupResult, +} + +@http(method: "GET", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@readonly +operation GetRunnerParameterGroup { + input: GetRunnerParameterGroupRequest, + output: GetRunnerParameterGroupResult, +} + +@http(method: "PUT", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@idempotent +operation UpdateRunnerParameterGroup { + input: UpdateRunnerParameterGroupRequest, + output: UpdateRunnerParameterGroupResult, +} + +@http(method: "DELETE", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@idempotent +operation DeleteRunnerParameterGroup { + input: DeleteRunnerParameterGroupRequest, +} + +@http(method: "POST", uri: "/v1/parameterGroups/{ParameterGroupName}/:updateParameter" ) +operation UpdateRunnerParameter { + input: UpdateRunnerParameterRequest, + output: UpdateRunnerParameterResult, +} diff --git a/codegen/sdk-codegen/nifcloud-models/devops.smithy b/codegen/sdk-codegen/nifcloud-models/devops.smithy new file mode 100644 index 0000000..a174266 --- /dev/null +++ b/codegen/sdk-codegen/nifcloud-models/devops.smithy @@ -0,0 +1,1582 @@ +namespace com.nifcloud.api.devops + +use aws.auth#sigv4 +use aws.api#service +use aws.protocols#restJson1 +use aws.protocols#restXml +use aws.protocols#awsQuery +use aws.protocols#ec2Query +use smithy.waiters#waitable +use aws.protocols#ec2QueryName + + +structure ListInstancesRequest {} + +list ListOfInstances { + member: Instances, +} + +structure Instances { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("diskSize") + DiskSize: Integer, + @jsonName("firewallGroupName") + FirewallGroupName: String, + @jsonName("gitlabUrl") + GitlabUrl: String, + @jsonName("gitlabVersion") + GitlabVersion: String, + @jsonName("instanceId") + InstanceId: String, + @jsonName("instanceType") + InstanceType: String, + @jsonName("networkConfig") + NetworkConfig: NetworkConfig, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("publicIpAddress") + PublicIpAddress: String, + @jsonName("region") + Region: String, + @jsonName("registryUrl") + RegistryUrl: String, + @jsonName("state") + State: String, + @jsonName("status") + Status: Status, + @jsonName("upgradableGitlabVersions") + UpgradableGitlabVersions: ListOfUpgradableGitlabVersions, +} + +list ListOfUpgradableGitlabVersions { + member: String, +} + +structure NetworkConfig { + @jsonName("networkId") + NetworkId: String, + @jsonName("privateAddress") + PrivateAddress: String, +} + +structure Status { + @jsonName("code") + Code: Integer, + @jsonName("name") + Name: String, +} + +structure ListInstancesResult { + @jsonName("instances") + Instances: ListOfInstances, +} + +@enum([ + { + name: "C_LARGE", + value: "c-large", + }, + { + name: "C_LARGE8", + value: "c-large8", + }, + { + name: "E_LARGE", + value: "e-large", + }, + { + name: "E_LARGE8", + value: "e-large8", + }, + { + name: "E_LARGE16", + value: "e-large16", + }, + { + name: "E_LARGE24", + value: "e-large24", + }, + { + name: "E_LARGE32", + value: "e-large32", + }, + { + name: "E_EXTRA_LARGE8", + value: "e-extra-large8", + }, + { + name: "E_EXTRA_LARGE16", + value: "e-extra-large16", + }, + { + name: "E_EXTRA_LARGE24", + value: "e-extra-large24", + }, + { + name: "E_EXTRA_LARGE32", + value: "e-extra-large32", + }, + { + name: "E_EXTRA_LARGE48", + value: "e-extra-large48", + }, + { + name: "E_DOUBLE_LARGE16", + value: "e-double-large16", + }, + { + name: "E_DOUBLE_LARGE24", + value: "e-double-large24", + }, + { + name: "E_DOUBLE_LARGE32", + value: "e-double-large32", + }, + { + name: "E_DOUBLE_LARGE48", + value: "e-double-large48", + }, + { + name: "E_DOUBLE_LARGE64", + value: "e-double-large64", + }, + { + name: "E_DOUBLE_LARGE96", + value: "e-double-large96", + }, + { + name: "H2_LARGE", + value: "h2-large", + }, + { + name: "H2_LARGE8", + value: "h2-large8", + }, + { + name: "H2_LARGE16", + value: "h2-large16", + }, + { + name: "H2_LARGE24", + value: "h2-large24", + }, + { + name: "H2_LARGE32", + value: "h2-large32", + }, + { + name: "H2_EXTRA_LARGE8", + value: "h2-extra-large8", + }, + { + name: "H2_EXTRA_LARGE16", + value: "h2-extra-large16", + }, + { + name: "H2_EXTRA_LARGE24", + value: "h2-extra-large24", + }, + { + name: "H2_EXTRA_LARGE32", + value: "h2-extra-large32", + }, + { + name: "H2_EXTRA_LARGE48", + value: "h2-extra-large48", + }, + { + name: "H2_DOUBLE_LARGE16", + value: "h2-double-large16", + }, + { + name: "H2_DOUBLE_LARGE24", + value: "h2-double-large24", + }, + { + name: "H2_DOUBLE_LARGE32", + value: "h2-double-large32", + }, + { + name: "H2_DOUBLE_LARGE48", + value: "h2-double-large48", + }, + { + name: "H2_DOUBLE_LARGE64", + value: "h2-double-large64", + }, + { + name: "H2_DOUBLE_LARGE96", + value: "h2-double-large96", + }, +]) +string InstanceTypeOfCreateInstanceRequest + +@enum([ + { + name: "EAST_11", + value: "east-11", + }, + { + name: "EAST_12", + value: "east-12", + }, + { + name: "EAST_13", + value: "east-13", + }, + { + name: "EAST_14", + value: "east-14", + }, + { + name: "EAST_31", + value: "east-31", + }, + { + name: "WEST_12", + value: "west-12", + }, + { + name: "WEST_13", + value: "west-13", + }, + { + name: "JP_WEST_21", + value: "jp-west-21", + }, +]) +string AvailabilityZoneOfCreateInstanceRequest + +structure RequestNetworkConfig { + @jsonName("networkId") + NetworkId: String, + @jsonName("privateAddress") + PrivateAddress: String, +} + +structure CreateInstanceRequest { + @jsonName("availabilityZone") + AvailabilityZone: AvailabilityZoneOfCreateInstanceRequest, + @jsonName("description") + Description: String, + @required + @jsonName("diskSize") + DiskSize: Integer, + @required + @jsonName("firewallGroupName") + FirewallGroupName: String, + @required + @jsonName("initialRootPassword") + InitialRootPassword: String, + @required + @jsonName("instanceId") + InstanceId: String, + @required + @jsonName("instanceType") + InstanceType: InstanceTypeOfCreateInstanceRequest, + @jsonName("networkConfig") + NetworkConfig: RequestNetworkConfig, + @required + @jsonName("parameterGroupName") + ParameterGroupName: String, +} + +structure Instance { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("createTime") + CreateTime: String, + @jsonName("description") + Description: String, + @jsonName("diskSize") + DiskSize: Integer, + @jsonName("firewallGroupName") + FirewallGroupName: String, + @jsonName("gitlabUrl") + GitlabUrl: String, + @jsonName("gitlabVersion") + GitlabVersion: String, + @jsonName("instanceId") + InstanceId: String, + @jsonName("instanceType") + InstanceType: String, + @jsonName("networkConfig") + NetworkConfig: NetworkConfig, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("publicIpAddress") + PublicIpAddress: String, + @jsonName("region") + Region: String, + @jsonName("registryUrl") + RegistryUrl: String, + @jsonName("state") + State: String, + @jsonName("status") + Status: Status, + @jsonName("upgradableGitlabVersions") + UpgradableGitlabVersions: ListOfUpgradableGitlabVersions, +} + +structure CreateInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +structure GetInstanceRequest { + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, +} + +structure GetInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +@enum([ + { + name: "C_LARGE", + value: "c-large", + }, + { + name: "C_LARGE8", + value: "c-large8", + }, + { + name: "E_LARGE", + value: "e-large", + }, + { + name: "E_LARGE8", + value: "e-large8", + }, + { + name: "E_LARGE16", + value: "e-large16", + }, + { + name: "E_LARGE24", + value: "e-large24", + }, + { + name: "E_LARGE32", + value: "e-large32", + }, + { + name: "E_EXTRA_LARGE8", + value: "e-extra-large8", + }, + { + name: "E_EXTRA_LARGE16", + value: "e-extra-large16", + }, + { + name: "E_EXTRA_LARGE24", + value: "e-extra-large24", + }, + { + name: "E_EXTRA_LARGE32", + value: "e-extra-large32", + }, + { + name: "E_EXTRA_LARGE48", + value: "e-extra-large48", + }, + { + name: "E_DOUBLE_LARGE16", + value: "e-double-large16", + }, + { + name: "E_DOUBLE_LARGE24", + value: "e-double-large24", + }, + { + name: "E_DOUBLE_LARGE32", + value: "e-double-large32", + }, + { + name: "E_DOUBLE_LARGE48", + value: "e-double-large48", + }, + { + name: "E_DOUBLE_LARGE64", + value: "e-double-large64", + }, + { + name: "E_DOUBLE_LARGE96", + value: "e-double-large96", + }, + { + name: "H2_LARGE", + value: "h2-large", + }, + { + name: "H2_LARGE8", + value: "h2-large8", + }, + { + name: "H2_LARGE16", + value: "h2-large16", + }, + { + name: "H2_LARGE24", + value: "h2-large24", + }, + { + name: "H2_LARGE32", + value: "h2-large32", + }, + { + name: "H2_EXTRA_LARGE8", + value: "h2-extra-large8", + }, + { + name: "H2_EXTRA_LARGE16", + value: "h2-extra-large16", + }, + { + name: "H2_EXTRA_LARGE24", + value: "h2-extra-large24", + }, + { + name: "H2_EXTRA_LARGE32", + value: "h2-extra-large32", + }, + { + name: "H2_EXTRA_LARGE48", + value: "h2-extra-large48", + }, + { + name: "H2_DOUBLE_LARGE16", + value: "h2-double-large16", + }, + { + name: "H2_DOUBLE_LARGE24", + value: "h2-double-large24", + }, + { + name: "H2_DOUBLE_LARGE32", + value: "h2-double-large32", + }, + { + name: "H2_DOUBLE_LARGE48", + value: "h2-double-large48", + }, + { + name: "H2_DOUBLE_LARGE64", + value: "h2-double-large64", + }, + { + name: "H2_DOUBLE_LARGE96", + value: "h2-double-large96", + }, +]) +string InstanceTypeOfUpdateInstanceRequest + +structure UpdateInstanceRequest { + @jsonName("description") + Description: String, + @jsonName("firewallGroupName") + FirewallGroupName: String, + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, + @jsonName("instanceType") + InstanceType: InstanceTypeOfUpdateInstanceRequest, +} + +structure UpdateInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +structure DeleteInstanceRequest { + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, +} + +structure DeleteInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +structure UpdateNetworkInterfaceRequest { + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, + @jsonName("networkConfig") + NetworkConfig: RequestNetworkConfig, +} + +structure UpdateNetworkInterfaceResult { + @jsonName("instance") + Instance: Instance, +} + +structure ExtendDiskRequest { + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, +} + +structure ExtendDiskResult { + @jsonName("instance") + Instance: Instance, +} + +structure UpgradeInstanceRequest { + @jsonName("gitlabVersion") + GitlabVersion: String, + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, +} + +structure UpgradeInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +structure RebootInstanceRequest { + @required + @httpLabel + @jsonName("InstanceId") + InstanceId: String, +} + +structure RebootInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +@enum([ + { + name: "C_LARGE", + value: "c-large", + }, + { + name: "C_LARGE8", + value: "c-large8", + }, + { + name: "E_LARGE", + value: "e-large", + }, + { + name: "E_LARGE8", + value: "e-large8", + }, + { + name: "E_LARGE16", + value: "e-large16", + }, + { + name: "E_LARGE24", + value: "e-large24", + }, + { + name: "E_LARGE32", + value: "e-large32", + }, + { + name: "E_EXTRA_LARGE8", + value: "e-extra-large8", + }, + { + name: "E_EXTRA_LARGE16", + value: "e-extra-large16", + }, + { + name: "E_EXTRA_LARGE24", + value: "e-extra-large24", + }, + { + name: "E_EXTRA_LARGE32", + value: "e-extra-large32", + }, + { + name: "E_EXTRA_LARGE48", + value: "e-extra-large48", + }, + { + name: "E_DOUBLE_LARGE16", + value: "e-double-large16", + }, + { + name: "E_DOUBLE_LARGE24", + value: "e-double-large24", + }, + { + name: "E_DOUBLE_LARGE32", + value: "e-double-large32", + }, + { + name: "E_DOUBLE_LARGE48", + value: "e-double-large48", + }, + { + name: "E_DOUBLE_LARGE64", + value: "e-double-large64", + }, + { + name: "E_DOUBLE_LARGE96", + value: "e-double-large96", + }, + { + name: "H2_LARGE", + value: "h2-large", + }, + { + name: "H2_LARGE8", + value: "h2-large8", + }, + { + name: "H2_LARGE16", + value: "h2-large16", + }, + { + name: "H2_LARGE24", + value: "h2-large24", + }, + { + name: "H2_LARGE32", + value: "h2-large32", + }, + { + name: "H2_EXTRA_LARGE8", + value: "h2-extra-large8", + }, + { + name: "H2_EXTRA_LARGE16", + value: "h2-extra-large16", + }, + { + name: "H2_EXTRA_LARGE24", + value: "h2-extra-large24", + }, + { + name: "H2_EXTRA_LARGE32", + value: "h2-extra-large32", + }, + { + name: "H2_EXTRA_LARGE48", + value: "h2-extra-large48", + }, + { + name: "H2_DOUBLE_LARGE16", + value: "h2-double-large16", + }, + { + name: "H2_DOUBLE_LARGE24", + value: "h2-double-large24", + }, + { + name: "H2_DOUBLE_LARGE32", + value: "h2-double-large32", + }, + { + name: "H2_DOUBLE_LARGE48", + value: "h2-double-large48", + }, + { + name: "H2_DOUBLE_LARGE64", + value: "h2-double-large64", + }, + { + name: "H2_DOUBLE_LARGE96", + value: "h2-double-large96", + }, +]) +string InstanceTypeOfRestoreInstanceRequest + +@enum([ + { + name: "EAST_11", + value: "east-11", + }, + { + name: "EAST_12", + value: "east-12", + }, + { + name: "EAST_13", + value: "east-13", + }, + { + name: "EAST_14", + value: "east-14", + }, + { + name: "EAST_31", + value: "east-31", + }, + { + name: "WEST_12", + value: "west-12", + }, + { + name: "WEST_13", + value: "west-13", + }, + { + name: "JP_WEST_21", + value: "jp-west-21", + }, +]) +string AvailabilityZoneOfRestoreInstanceRequest + +structure RestoreInstanceRequest { + @jsonName("availabilityZone") + AvailabilityZone: AvailabilityZoneOfRestoreInstanceRequest, + @required + @jsonName("backupId") + BackupId: String, + @jsonName("description") + Description: String, + @required + @jsonName("diskSize") + DiskSize: Integer, + @required + @jsonName("firewallGroupName") + FirewallGroupName: String, + @required + @jsonName("instanceId") + InstanceId: String, + @required + @jsonName("instanceType") + InstanceType: InstanceTypeOfRestoreInstanceRequest, + @jsonName("networkConfig") + NetworkConfig: RequestNetworkConfig, + @required + @jsonName("parameterGroupName") + ParameterGroupName: String, +} + +structure RestoreInstanceResult { + @jsonName("instance") + Instance: Instance, +} + +structure ListParameterGroupsRequest {} + +list ListOfParameterGroups { + member: ParameterGroups, +} + +structure ParameterGroups { + @jsonName("description") + Description: String, + @jsonName("instanceId") + InstanceId: String, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("parameters") + Parameters: ListOfParameters, + @jsonName("region") + Region: String, +} + +list ListOfParameters { + member: Parameters, +} + +structure Parameters { + @jsonName("allowed_values") + AllowedValues: ListOfAllowedValues, + @jsonName("data_type") + DataType: String, + @jsonName("description") + Description: String, + @jsonName("is_modifiable") + IsModifiable: Boolean, + @jsonName("is_secret") + IsSecret: Boolean, + @jsonName("name") + Name: String, + @jsonName("value") + Value: String, +} + +list ListOfAllowedValues { + member: String, +} + +structure ListParameterGroupsResult { + @jsonName("parameterGroups") + ParameterGroups: ListOfParameterGroups, +} + +structure CreateParameterGroupRequest { + @jsonName("description") + Description: String, + @required + @jsonName("parameterGroupName") + ParameterGroupName: String, +} + +structure ParameterGroup { + @jsonName("description") + Description: String, + @jsonName("instanceId") + InstanceId: String, + @jsonName("parameterGroupName") + ParameterGroupName: String, + @jsonName("parameters") + Parameters: ListOfParameters, + @jsonName("region") + Region: String, +} + +structure CreateParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure GetParameterGroupRequest { + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure GetParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure RequestParameters { + @jsonName("gitlab_email_from") + GitlabEmailFrom: String, + @jsonName("gitlab_email_reply_to") + GitlabEmailReplyTo: String, + @jsonName("ldap_enabled") + LdapEnabled: String, + @jsonName("ldap_servers_active_directory") + LdapServersActiveDirectory: String, + @jsonName("ldap_servers_allow_username_or_email_login") + LdapServersAllowUsernameOrEmailLogin: String, + @jsonName("ldap_servers_attributes_email") + LdapServersAttributesEmail: String, + @jsonName("ldap_servers_attributes_first_name") + LdapServersAttributesFirstName: String, + @jsonName("ldap_servers_attributes_last_name") + LdapServersAttributesLastName: String, + @jsonName("ldap_servers_attributes_name") + LdapServersAttributesName: String, + @jsonName("ldap_servers_attributes_username") + LdapServersAttributesUsername: String, + @jsonName("ldap_servers_base") + LdapServersBase: String, + @jsonName("ldap_servers_bind_dn") + LdapServersBindDn: String, + @jsonName("ldap_servers_block_auto_created_users") + LdapServersBlockAutoCreatedUsers: String, + @jsonName("ldap_servers_encryption") + LdapServersEncryption: String, + @jsonName("ldap_servers_host") + LdapServersHost: String, + @jsonName("ldap_servers_label") + LdapServersLabel: String, + @jsonName("ldap_servers_lowercase_usernames") + LdapServersLowercaseUsernames: String, + @jsonName("ldap_servers_name") + LdapServersName: String, + @jsonName("ldap_servers_password") + LdapServersPassword: String, + @jsonName("ldap_servers_port") + LdapServersPort: String, + @jsonName("ldap_servers_timeout") + LdapServersTimeout: String, + @jsonName("ldap_servers_uid") + LdapServersUid: String, + @jsonName("ldap_servers_user_filter") + LdapServersUserFilter: String, + @jsonName("ldap_servers_verify_certificates") + LdapServersVerifyCertificates: String, + @jsonName("omniauth_allow_single_sign_on") + OmniauthAllowSingleSignOn: String, + @jsonName("omniauth_auto_link_saml_user") + OmniauthAutoLinkSamlUser: String, + @jsonName("omniauth_auto_sign_in_with_provider") + OmniauthAutoSignInWithProvider: String, + @jsonName("omniauth_block_auto_created_users") + OmniauthBlockAutoCreatedUsers: String, + @jsonName("omniauth_providers_saml_admin_groups") + OmniauthProvidersSamlAdminGroups: String, + @jsonName("omniauth_providers_saml_assertion_consumer_service_url") + OmniauthProvidersSamlAssertionConsumerServiceUrl: String, + @jsonName("omniauth_providers_saml_auditor_groups") + OmniauthProvidersSamlAuditorGroups: String, + @jsonName("omniauth_providers_saml_external_groups") + OmniauthProvidersSamlExternalGroups: String, + @jsonName("omniauth_providers_saml_groups_attribute") + OmniauthProvidersSamlGroupsAttribute: String, + @jsonName("omniauth_providers_saml_idp_cert_fingerprint") + OmniauthProvidersSamlIdpCertFingerprint: String, + @jsonName("omniauth_providers_saml_idp_sso_target_url") + OmniauthProvidersSamlIdpSsoTargetUrl: String, + @jsonName("omniauth_providers_saml_issuer") + OmniauthProvidersSamlIssuer: String, + @jsonName("omniauth_providers_saml_label") + OmniauthProvidersSamlLabel: String, + @jsonName("omniauth_providers_saml_name") + OmniauthProvidersSamlName: String, + @jsonName("omniauth_providers_saml_name_identifier_format") + OmniauthProvidersSamlNameIdentifierFormat: String, + @jsonName("omniauth_providers_saml_required_groups") + OmniauthProvidersSamlRequiredGroups: String, + @jsonName("smtp_password") + SmtpPassword: String, + @jsonName("smtp_user_name") + SmtpUserName: String, +} + +structure UpdateParameterGroupRequest { + @jsonName("changedParameterGroupName") + ChangedParameterGroupName: String, + @jsonName("description") + Description: String, + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, + @jsonName("parameters") + Parameters: RequestParameters, +} + +structure UpdateParameterGroupResult { + @jsonName("parameterGroup") + ParameterGroup: ParameterGroup, +} + +structure DeleteParameterGroupRequest { + @required + @httpLabel + @jsonName("ParameterGroupName") + ParameterGroupName: String, +} + +structure ListFirewallGroupsRequest {} + +list ListOfFirewallGroups { + member: FirewallGroups, +} + +structure FirewallGroups { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("description") + Description: String, + @jsonName("firewallGroupName") + FirewallGroupName: String, + @jsonName("region") + Region: String, + @jsonName("rules") + Rules: ListOfRules, + @jsonName("state") + State: String, +} + +list ListOfRules { + member: Rules, +} + +structure Rules { + @jsonName("cidrIp") + CidrIp: String, + @jsonName("description") + Description: String, + @jsonName("id") + Id: String, + @jsonName("port") + Port: Integer, + @jsonName("protocol") + Protocol: String, + @jsonName("state") + State: String, +} + +structure ListFirewallGroupsResult { + @jsonName("firewallGroups") + FirewallGroups: ListOfFirewallGroups, +} + +@enum([ + { + name: "EAST_11", + value: "east-11", + }, + { + name: "EAST_12", + value: "east-12", + }, + { + name: "EAST_13", + value: "east-13", + }, + { + name: "EAST_14", + value: "east-14", + }, + { + name: "EAST_31", + value: "east-31", + }, + { + name: "WEST_12", + value: "west-12", + }, + { + name: "WEST_13", + value: "west-13", + }, + { + name: "JP_WEST_21", + value: "jp-west-21", + }, +]) +string AvailabilityZoneOfCreateFirewallGroupRequest + +structure CreateFirewallGroupRequest { + @jsonName("availabilityZone") + AvailabilityZone: AvailabilityZoneOfCreateFirewallGroupRequest, + @jsonName("description") + Description: String, + @required + @jsonName("firewallGroupName") + FirewallGroupName: String, +} + +structure FirewallGroup { + @jsonName("availabilityZone") + AvailabilityZone: String, + @jsonName("description") + Description: String, + @jsonName("firewallGroupName") + FirewallGroupName: String, + @jsonName("region") + Region: String, + @jsonName("rules") + Rules: ListOfRules, + @jsonName("state") + State: String, +} + +structure CreateFirewallGroupResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +structure GetFirewallGroupRequest { + @required + @httpLabel + @jsonName("FirewallGroupName") + FirewallGroupName: String, +} + +structure GetFirewallGroupResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +structure UpdateFirewallGroupRequest { + @jsonName("changedFirewallGroupName") + ChangedFirewallGroupName: String, + @jsonName("description") + Description: String, + @required + @httpLabel + @jsonName("FirewallGroupName") + FirewallGroupName: String, +} + +structure UpdateFirewallGroupResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +structure DeleteFirewallGroupRequest { + @required + @httpLabel + @jsonName("FirewallGroupName") + FirewallGroupName: String, +} + +structure DeleteFirewallGroupResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +@enum([ + { + name: "TCP", + value: "TCP", + }, + { + name: "ICMP", + value: "ICMP", + }, +]) +string ProtocolOfrulesForAuthorizeFirewallRules + +structure RequestRules { + @required + @jsonName("cidrIp") + CidrIp: CidrIpOfrulesForAuthorizeFirewallRules, + @jsonName("description") + Description: String, + @jsonName("port") + Port: Integer, + @required + @jsonName("protocol") + Protocol: ProtocolOfrulesForAuthorizeFirewallRules, +} + +list ListOfRequestRules { + member: RequestRules, +} + +@enum([ + { + name: "IPV4IP", + value: "IPv4IP", + }, + { + name: "CIDR", + value: "CIDR", + }, +]) +string CidrIpOfrulesForAuthorizeFirewallRules + +structure AuthorizeFirewallRulesRequest { + @required + @httpLabel + @jsonName("FirewallGroupName") + FirewallGroupName: String, + @required + @jsonName("rules") + Rules: ListOfRequestRules, +} + +structure AuthorizeFirewallRulesResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +structure RevokeFirewallRulesRequest { + @required + @httpLabel + @jsonName("FirewallGroupName") + FirewallGroupName: String, + @required + @httpQuery("ids") + @jsonName("ids") + Ids: String, +} + +structure RevokeFirewallRulesResult { + @jsonName("firewallGroup") + FirewallGroup: FirewallGroup, +} + +structure ListBackupsRequest {} + +list ListOfBackups { + member: Backups, +} + +structure Backups { + @jsonName("backupId") + BackupId: String, + @jsonName("createTime") + CreateTime: String, + @jsonName("fileName") + FileName: String, + @jsonName("fileSize") + FileSize: Integer, + @jsonName("instanceId") + InstanceId: String, + @jsonName("region") + Region: String, +} + +structure ListBackupsResult { + @jsonName("backups") + Backups: ListOfBackups, +} + +structure GetBackupRequest { + @required + @httpLabel + @jsonName("BackupId") + BackupId: String, +} + +structure Backup { + @jsonName("backupId") + BackupId: String, + @jsonName("createTime") + CreateTime: String, + @jsonName("fileName") + FileName: String, + @jsonName("fileSize") + FileSize: Integer, + @jsonName("instanceId") + InstanceId: String, + @jsonName("region") + Region: String, +} + +structure GetBackupResult { + @jsonName("backup") + Backup: Backup, +} + +structure DeleteBackupRequest { + @required + @httpLabel + @jsonName("BackupId") + BackupId: String, +} + +structure ListBackupRulesRequest {} + +list ListOfBackupRules { + member: BackupRules, +} + +structure BackupRules { + @jsonName("backupRuleName") + BackupRuleName: String, + @jsonName("backupTime") + BackupTime: String, + @jsonName("description") + Description: String, + @jsonName("generation") + Generation: Integer, + @jsonName("instanceId") + InstanceId: String, +} + +structure ListBackupRulesResult { + @jsonName("backupRules") + BackupRules: ListOfBackupRules, +} + +structure CreateBackupRuleRequest { + @required + @jsonName("backupRuleName") + BackupRuleName: String, + @jsonName("description") + Description: String, + @required + @jsonName("instanceId") + InstanceId: String, +} + +structure BackupRule { + @jsonName("backupRuleName") + BackupRuleName: String, + @jsonName("backupTime") + BackupTime: String, + @jsonName("description") + Description: String, + @jsonName("generation") + Generation: Integer, + @jsonName("instanceId") + InstanceId: String, +} + +structure CreateBackupRuleResult { + @jsonName("backupRule") + BackupRule: BackupRule, +} + +structure GetBackupRuleRequest { + @required + @httpLabel + @jsonName("BackupRuleName") + BackupRuleName: String, +} + +structure GetBackupRuleResult { + @jsonName("backupRule") + BackupRule: BackupRule, +} + +structure UpdateBackupRuleRequest { + @required + @httpLabel + @jsonName("BackupRuleName") + BackupRuleName: String, + @jsonName("changedBackupRuleName") + ChangedBackupRuleName: String, + @jsonName("description") + Description: String, +} + +structure UpdateBackupRuleResult { + @jsonName("backupRule") + BackupRule: BackupRule, +} + +structure DeleteBackupRuleRequest { + @required + @httpLabel + @jsonName("BackupRuleName") + BackupRuleName: String, +} + +@restJson1 +@sigv4(name: "devops") +@service( + sdkId: "devops", + arnNamespace: "devops", + endpointPrefix: "devops" +) +service DevOpswithGitLab { + version: "v1", + operations: [ + ListInstances, + CreateInstance, + GetInstance, + UpdateInstance, + DeleteInstance, + UpdateNetworkInterface, + ExtendDisk, + UpgradeInstance, + RebootInstance, + RestoreInstance, + ListParameterGroups, + CreateParameterGroup, + GetParameterGroup, + UpdateParameterGroup, + DeleteParameterGroup, + ListFirewallGroups, + CreateFirewallGroup, + GetFirewallGroup, + UpdateFirewallGroup, + DeleteFirewallGroup, + AuthorizeFirewallRules, + RevokeFirewallRules, + ListBackups, + GetBackup, + DeleteBackup, + ListBackupRules, + CreateBackupRule, + GetBackupRule, + UpdateBackupRule, + DeleteBackupRule, + ], +} + + +@http(method: "GET", uri: "/v1/instances" ) +@readonly +operation ListInstances { + input: ListInstancesRequest, + output: ListInstancesResult, +} + +@http(method: "POST", uri: "/v1/instances" ) +operation CreateInstance { + input: CreateInstanceRequest, + output: CreateInstanceResult, +} + +@http(method: "GET", uri: "/v1/instances/{InstanceId}" ) +@readonly +operation GetInstance { + input: GetInstanceRequest, + output: GetInstanceResult, +} + +@http(method: "PUT", uri: "/v1/instances/{InstanceId}" ) +@idempotent +operation UpdateInstance { + input: UpdateInstanceRequest, + output: UpdateInstanceResult, +} + +@http(method: "DELETE", uri: "/v1/instances/{InstanceId}" ) +@idempotent +operation DeleteInstance { + input: DeleteInstanceRequest, + output: DeleteInstanceResult, +} + +@http(method: "POST", uri: "/v1/instances/{InstanceId}/:updateNetworkInterface" ) +operation UpdateNetworkInterface { + input: UpdateNetworkInterfaceRequest, + output: UpdateNetworkInterfaceResult, +} + +@http(method: "POST", uri: "/v1/instances/{InstanceId}/:extendDisk" ) +operation ExtendDisk { + input: ExtendDiskRequest, + output: ExtendDiskResult, +} + +@http(method: "POST", uri: "/v1/instances/{InstanceId}/:upgrade" ) +operation UpgradeInstance { + input: UpgradeInstanceRequest, + output: UpgradeInstanceResult, +} + +@http(method: "POST", uri: "/v1/instances/{InstanceId}/:reboot" ) +operation RebootInstance { + input: RebootInstanceRequest, + output: RebootInstanceResult, +} + +@http(method: "POST", uri: "/v1/instances:restore" ) +operation RestoreInstance { + input: RestoreInstanceRequest, + output: RestoreInstanceResult, +} + +@http(method: "GET", uri: "/v1/parameterGroups" ) +@readonly +operation ListParameterGroups { + input: ListParameterGroupsRequest, + output: ListParameterGroupsResult, +} + +@http(method: "POST", uri: "/v1/parameterGroups" ) +operation CreateParameterGroup { + input: CreateParameterGroupRequest, + output: CreateParameterGroupResult, +} + +@http(method: "GET", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@readonly +operation GetParameterGroup { + input: GetParameterGroupRequest, + output: GetParameterGroupResult, +} + +@http(method: "PUT", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@idempotent +operation UpdateParameterGroup { + input: UpdateParameterGroupRequest, + output: UpdateParameterGroupResult, +} + +@http(method: "DELETE", uri: "/v1/parameterGroups/{ParameterGroupName}" ) +@idempotent +operation DeleteParameterGroup { + input: DeleteParameterGroupRequest, +} + +@http(method: "GET", uri: "/v1/firewallGroups" ) +@readonly +operation ListFirewallGroups { + input: ListFirewallGroupsRequest, + output: ListFirewallGroupsResult, +} + +@http(method: "POST", uri: "/v1/firewallGroups" ) +operation CreateFirewallGroup { + input: CreateFirewallGroupRequest, + output: CreateFirewallGroupResult, +} + +@http(method: "GET", uri: "/v1/firewallGroups/{FirewallGroupName}" ) +@readonly +operation GetFirewallGroup { + input: GetFirewallGroupRequest, + output: GetFirewallGroupResult, +} + +@http(method: "PUT", uri: "/v1/firewallGroups/{FirewallGroupName}" ) +@idempotent +operation UpdateFirewallGroup { + input: UpdateFirewallGroupRequest, + output: UpdateFirewallGroupResult, +} + +@http(method: "DELETE", uri: "/v1/firewallGroups/{FirewallGroupName}" ) +@idempotent +operation DeleteFirewallGroup { + input: DeleteFirewallGroupRequest, + output: DeleteFirewallGroupResult, +} + +@http(method: "POST", uri: "/v1/firewallGroups/{FirewallGroupName}/rules" ) +operation AuthorizeFirewallRules { + input: AuthorizeFirewallRulesRequest, + output: AuthorizeFirewallRulesResult, +} + +@http(method: "DELETE", uri: "/v1/firewallGroups/{FirewallGroupName}/rules" ) +@idempotent +operation RevokeFirewallRules { + input: RevokeFirewallRulesRequest, + output: RevokeFirewallRulesResult, +} + +@http(method: "GET", uri: "/v1/backups" ) +@readonly +operation ListBackups { + input: ListBackupsRequest, + output: ListBackupsResult, +} + +@http(method: "GET", uri: "/v1/backups/{BackupId}" ) +@readonly +operation GetBackup { + input: GetBackupRequest, + output: GetBackupResult, +} + +@http(method: "DELETE", uri: "/v1/backups/{BackupId}" ) +@idempotent +operation DeleteBackup { + input: DeleteBackupRequest, +} + +@http(method: "GET", uri: "/v1/backupRules" ) +@readonly +operation ListBackupRules { + input: ListBackupRulesRequest, + output: ListBackupRulesResult, +} + +@http(method: "POST", uri: "/v1/backupRules" ) +operation CreateBackupRule { + input: CreateBackupRuleRequest, + output: CreateBackupRuleResult, +} + +@http(method: "GET", uri: "/v1/backupRules/{BackupRuleName}" ) +@readonly +operation GetBackupRule { + input: GetBackupRuleRequest, + output: GetBackupRuleResult, +} + +@http(method: "PUT", uri: "/v1/backupRules/{BackupRuleName}" ) +@idempotent +operation UpdateBackupRule { + input: UpdateBackupRuleRequest, + output: UpdateBackupRuleResult, +} + +@http(method: "DELETE", uri: "/v1/backupRules/{BackupRuleName}" ) +@idempotent +operation DeleteBackupRule { + input: DeleteBackupRuleRequest, +} diff --git a/service/devops/api_client.go b/service/devops/api_client.go new file mode 100644 index 0000000..d4dd310 --- /dev/null +++ b/service/devops/api_client.go @@ -0,0 +1,439 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + "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" + 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" + smithyhttp "github.com/aws/smithy-go/transport/http" + internalConfig "github.com/nifcloud/nifcloud-sdk-go/internal/configsources" + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "net" + "net/http" + "time" +) + +const ServiceID = "devops" +const ServiceAPIVersion = "v1" + +// Client provides the API client to make operations call for the API. +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) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // 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. 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. 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 +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (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) + } + + finalizeRetryMaxAttemptOptions(&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 noSmithyDocumentSerde = smithydocument.NoSerde + +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 nifcloud.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, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(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 nifcloud.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg nifcloud.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg nifcloud.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(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 nifcloud.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "devops", nifcloud.SDKVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg nifcloud.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 nifcloud.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +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) +} diff --git a/service/devops/api_client_test.go b/service/devops/api_client_test.go new file mode 100644 index 0000000..4da2d61 --- /dev/null +++ b/service/devops/api_client_test.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "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(nifcloud.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, + }) + + 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/devops/api_op_AuthorizeFirewallRules.go b/service/devops/api_op_AuthorizeFirewallRules.go new file mode 100644 index 0000000..36c24fd --- /dev/null +++ b/service/devops/api_op_AuthorizeFirewallRules.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) AuthorizeFirewallRules(ctx context.Context, params *AuthorizeFirewallRulesInput, optFns ...func(*Options)) (*AuthorizeFirewallRulesOutput, error) { + if params == nil { + params = &AuthorizeFirewallRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AuthorizeFirewallRules", params, optFns, c.addOperationAuthorizeFirewallRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AuthorizeFirewallRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AuthorizeFirewallRulesInput struct { + + // This member is required. + FirewallGroupName *string + + // This member is required. + Rules []types.RequestRules + + noSmithyDocumentSerde +} + +type AuthorizeFirewallRulesOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAuthorizeFirewallRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAuthorizeFirewallRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAuthorizeFirewallRules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAuthorizeFirewallRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAuthorizeFirewallRules(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opAuthorizeFirewallRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "AuthorizeFirewallRules", + } +} diff --git a/service/devops/api_op_CreateBackupRule.go b/service/devops/api_op_CreateBackupRule.go new file mode 100644 index 0000000..fcb1449 --- /dev/null +++ b/service/devops/api_op_CreateBackupRule.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) CreateBackupRule(ctx context.Context, params *CreateBackupRuleInput, optFns ...func(*Options)) (*CreateBackupRuleOutput, error) { + if params == nil { + params = &CreateBackupRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateBackupRule", params, optFns, c.addOperationCreateBackupRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateBackupRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateBackupRuleInput struct { + + // This member is required. + BackupRuleName *string + + // This member is required. + InstanceId *string + + Description *string + + noSmithyDocumentSerde +} + +type CreateBackupRuleOutput struct { + BackupRule *types.BackupRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateBackupRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateBackupRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateBackupRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateBackupRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateBackupRule(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateBackupRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateBackupRule", + } +} diff --git a/service/devops/api_op_CreateFirewallGroup.go b/service/devops/api_op_CreateFirewallGroup.go new file mode 100644 index 0000000..b69cf49 --- /dev/null +++ b/service/devops/api_op_CreateFirewallGroup.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) CreateFirewallGroup(ctx context.Context, params *CreateFirewallGroupInput, optFns ...func(*Options)) (*CreateFirewallGroupOutput, error) { + if params == nil { + params = &CreateFirewallGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateFirewallGroup", params, optFns, c.addOperationCreateFirewallGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateFirewallGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateFirewallGroupInput struct { + + // This member is required. + FirewallGroupName *string + + AvailabilityZone types.AvailabilityZoneOfCreateFirewallGroupRequest + + Description *string + + noSmithyDocumentSerde +} + +type CreateFirewallGroupOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateFirewallGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateFirewallGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateFirewallGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateFirewallGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateFirewallGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateFirewallGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateFirewallGroup", + } +} diff --git a/service/devops/api_op_CreateInstance.go b/service/devops/api_op_CreateInstance.go new file mode 100644 index 0000000..654b225 --- /dev/null +++ b/service/devops/api_op_CreateInstance.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) CreateInstance(ctx context.Context, params *CreateInstanceInput, optFns ...func(*Options)) (*CreateInstanceOutput, error) { + if params == nil { + params = &CreateInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateInstance", params, optFns, c.addOperationCreateInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateInstanceInput struct { + + // This member is required. + DiskSize *int32 + + // This member is required. + FirewallGroupName *string + + // This member is required. + InitialRootPassword *string + + // This member is required. + InstanceId *string + + // This member is required. + InstanceType types.InstanceTypeOfCreateInstanceRequest + + // This member is required. + ParameterGroupName *string + + AvailabilityZone types.AvailabilityZoneOfCreateInstanceRequest + + Description *string + + NetworkConfig *types.RequestNetworkConfig + + noSmithyDocumentSerde +} + +type CreateInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateInstance", + } +} diff --git a/service/devops/api_op_CreateParameterGroup.go b/service/devops/api_op_CreateParameterGroup.go new file mode 100644 index 0000000..59df2e8 --- /dev/null +++ b/service/devops/api_op_CreateParameterGroup.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) CreateParameterGroup(ctx context.Context, params *CreateParameterGroupInput, optFns ...func(*Options)) (*CreateParameterGroupOutput, error) { + if params == nil { + params = &CreateParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateParameterGroup", params, optFns, c.addOperationCreateParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + Description *string + + noSmithyDocumentSerde +} + +type CreateParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateParameterGroup", + } +} diff --git a/service/devops/api_op_DeleteBackup.go b/service/devops/api_op_DeleteBackup.go new file mode 100644 index 0000000..73eebbe --- /dev/null +++ b/service/devops/api_op_DeleteBackup.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteBackup(ctx context.Context, params *DeleteBackupInput, optFns ...func(*Options)) (*DeleteBackupOutput, error) { + if params == nil { + params = &DeleteBackupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteBackup", params, optFns, c.addOperationDeleteBackupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteBackupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteBackupInput struct { + + // This member is required. + BackupId *string + + noSmithyDocumentSerde +} + +type DeleteBackupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBackup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBackup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteBackupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBackup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteBackup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteBackup", + } +} diff --git a/service/devops/api_op_DeleteBackupRule.go b/service/devops/api_op_DeleteBackupRule.go new file mode 100644 index 0000000..afbba6f --- /dev/null +++ b/service/devops/api_op_DeleteBackupRule.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteBackupRule(ctx context.Context, params *DeleteBackupRuleInput, optFns ...func(*Options)) (*DeleteBackupRuleOutput, error) { + if params == nil { + params = &DeleteBackupRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteBackupRule", params, optFns, c.addOperationDeleteBackupRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteBackupRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteBackupRuleInput struct { + + // This member is required. + BackupRuleName *string + + noSmithyDocumentSerde +} + +type DeleteBackupRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteBackupRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteBackupRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteBackupRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteBackupRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteBackupRule(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteBackupRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteBackupRule", + } +} diff --git a/service/devops/api_op_DeleteFirewallGroup.go b/service/devops/api_op_DeleteFirewallGroup.go new file mode 100644 index 0000000..524e37b --- /dev/null +++ b/service/devops/api_op_DeleteFirewallGroup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) DeleteFirewallGroup(ctx context.Context, params *DeleteFirewallGroupInput, optFns ...func(*Options)) (*DeleteFirewallGroupOutput, error) { + if params == nil { + params = &DeleteFirewallGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteFirewallGroup", params, optFns, c.addOperationDeleteFirewallGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteFirewallGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteFirewallGroupInput struct { + + // This member is required. + FirewallGroupName *string + + noSmithyDocumentSerde +} + +type DeleteFirewallGroupOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteFirewallGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteFirewallGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteFirewallGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteFirewallGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteFirewallGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteFirewallGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteFirewallGroup", + } +} diff --git a/service/devops/api_op_DeleteInstance.go b/service/devops/api_op_DeleteInstance.go new file mode 100644 index 0000000..4f0e6c5 --- /dev/null +++ b/service/devops/api_op_DeleteInstance.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) DeleteInstance(ctx context.Context, params *DeleteInstanceInput, optFns ...func(*Options)) (*DeleteInstanceOutput, error) { + if params == nil { + params = &DeleteInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteInstance", params, optFns, c.addOperationDeleteInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteInstanceInput struct { + + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type DeleteInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteInstance", + } +} diff --git a/service/devops/api_op_DeleteParameterGroup.go b/service/devops/api_op_DeleteParameterGroup.go new file mode 100644 index 0000000..f842446 --- /dev/null +++ b/service/devops/api_op_DeleteParameterGroup.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteParameterGroup(ctx context.Context, params *DeleteParameterGroupInput, optFns ...func(*Options)) (*DeleteParameterGroupOutput, error) { + if params == nil { + params = &DeleteParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteParameterGroup", params, optFns, c.addOperationDeleteParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + noSmithyDocumentSerde +} + +type DeleteParameterGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteParameterGroup", + } +} diff --git a/service/devops/api_op_ExtendDisk.go b/service/devops/api_op_ExtendDisk.go new file mode 100644 index 0000000..d6cf6a8 --- /dev/null +++ b/service/devops/api_op_ExtendDisk.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ExtendDisk(ctx context.Context, params *ExtendDiskInput, optFns ...func(*Options)) (*ExtendDiskOutput, error) { + if params == nil { + params = &ExtendDiskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ExtendDisk", params, optFns, c.addOperationExtendDiskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ExtendDiskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ExtendDiskInput struct { + + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type ExtendDiskOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationExtendDiskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpExtendDisk{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpExtendDisk{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpExtendDiskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opExtendDisk(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opExtendDisk(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ExtendDisk", + } +} diff --git a/service/devops/api_op_GetBackup.go b/service/devops/api_op_GetBackup.go new file mode 100644 index 0000000..444f92d --- /dev/null +++ b/service/devops/api_op_GetBackup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) GetBackup(ctx context.Context, params *GetBackupInput, optFns ...func(*Options)) (*GetBackupOutput, error) { + if params == nil { + params = &GetBackupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetBackup", params, optFns, c.addOperationGetBackupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetBackupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetBackupInput struct { + + // This member is required. + BackupId *string + + noSmithyDocumentSerde +} + +type GetBackupOutput struct { + Backup *types.Backup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetBackupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBackup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBackup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetBackupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBackup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetBackup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetBackup", + } +} diff --git a/service/devops/api_op_GetBackupRule.go b/service/devops/api_op_GetBackupRule.go new file mode 100644 index 0000000..2471b53 --- /dev/null +++ b/service/devops/api_op_GetBackupRule.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) GetBackupRule(ctx context.Context, params *GetBackupRuleInput, optFns ...func(*Options)) (*GetBackupRuleOutput, error) { + if params == nil { + params = &GetBackupRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetBackupRule", params, optFns, c.addOperationGetBackupRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetBackupRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetBackupRuleInput struct { + + // This member is required. + BackupRuleName *string + + noSmithyDocumentSerde +} + +type GetBackupRuleOutput struct { + BackupRule *types.BackupRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetBackupRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetBackupRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetBackupRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetBackupRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetBackupRule(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetBackupRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetBackupRule", + } +} diff --git a/service/devops/api_op_GetFirewallGroup.go b/service/devops/api_op_GetFirewallGroup.go new file mode 100644 index 0000000..15accf7 --- /dev/null +++ b/service/devops/api_op_GetFirewallGroup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) GetFirewallGroup(ctx context.Context, params *GetFirewallGroupInput, optFns ...func(*Options)) (*GetFirewallGroupOutput, error) { + if params == nil { + params = &GetFirewallGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetFirewallGroup", params, optFns, c.addOperationGetFirewallGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetFirewallGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetFirewallGroupInput struct { + + // This member is required. + FirewallGroupName *string + + noSmithyDocumentSerde +} + +type GetFirewallGroupOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetFirewallGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetFirewallGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetFirewallGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetFirewallGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFirewallGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetFirewallGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetFirewallGroup", + } +} diff --git a/service/devops/api_op_GetInstance.go b/service/devops/api_op_GetInstance.go new file mode 100644 index 0000000..0334b31 --- /dev/null +++ b/service/devops/api_op_GetInstance.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) GetInstance(ctx context.Context, params *GetInstanceInput, optFns ...func(*Options)) (*GetInstanceOutput, error) { + if params == nil { + params = &GetInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetInstance", params, optFns, c.addOperationGetInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetInstanceInput struct { + + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type GetInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetInstance", + } +} diff --git a/service/devops/api_op_GetParameterGroup.go b/service/devops/api_op_GetParameterGroup.go new file mode 100644 index 0000000..069c4cc --- /dev/null +++ b/service/devops/api_op_GetParameterGroup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) GetParameterGroup(ctx context.Context, params *GetParameterGroupInput, optFns ...func(*Options)) (*GetParameterGroupOutput, error) { + if params == nil { + params = &GetParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetParameterGroup", params, optFns, c.addOperationGetParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + noSmithyDocumentSerde +} + +type GetParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetParameterGroup", + } +} diff --git a/service/devops/api_op_ListBackupRules.go b/service/devops/api_op_ListBackupRules.go new file mode 100644 index 0000000..c9c7853 --- /dev/null +++ b/service/devops/api_op_ListBackupRules.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ListBackupRules(ctx context.Context, params *ListBackupRulesInput, optFns ...func(*Options)) (*ListBackupRulesOutput, error) { + if params == nil { + params = &ListBackupRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListBackupRules", params, optFns, c.addOperationListBackupRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListBackupRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListBackupRulesInput struct { + noSmithyDocumentSerde +} + +type ListBackupRulesOutput struct { + BackupRules []types.BackupRules + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListBackupRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListBackupRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBackupRules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBackupRules(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListBackupRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListBackupRules", + } +} diff --git a/service/devops/api_op_ListBackups.go b/service/devops/api_op_ListBackups.go new file mode 100644 index 0000000..80daebb --- /dev/null +++ b/service/devops/api_op_ListBackups.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ListBackups(ctx context.Context, params *ListBackupsInput, optFns ...func(*Options)) (*ListBackupsOutput, error) { + if params == nil { + params = &ListBackupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListBackups", params, optFns, c.addOperationListBackupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListBackupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListBackupsInput struct { + noSmithyDocumentSerde +} + +type ListBackupsOutput struct { + Backups []types.Backups + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListBackupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListBackups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListBackups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListBackups(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListBackups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListBackups", + } +} diff --git a/service/devops/api_op_ListFirewallGroups.go b/service/devops/api_op_ListFirewallGroups.go new file mode 100644 index 0000000..108926b --- /dev/null +++ b/service/devops/api_op_ListFirewallGroups.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ListFirewallGroups(ctx context.Context, params *ListFirewallGroupsInput, optFns ...func(*Options)) (*ListFirewallGroupsOutput, error) { + if params == nil { + params = &ListFirewallGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListFirewallGroups", params, optFns, c.addOperationListFirewallGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListFirewallGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListFirewallGroupsInput struct { + noSmithyDocumentSerde +} + +type ListFirewallGroupsOutput struct { + FirewallGroups []types.FirewallGroups + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListFirewallGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListFirewallGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListFirewallGroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListFirewallGroups(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListFirewallGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListFirewallGroups", + } +} diff --git a/service/devops/api_op_ListInstances.go b/service/devops/api_op_ListInstances.go new file mode 100644 index 0000000..56ada4d --- /dev/null +++ b/service/devops/api_op_ListInstances.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ListInstances(ctx context.Context, params *ListInstancesInput, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if params == nil { + params = &ListInstancesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListInstances", params, optFns, c.addOperationListInstancesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListInstancesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListInstancesInput struct { + noSmithyDocumentSerde +} + +type ListInstancesOutput struct { + Instances []types.Instances + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListInstancesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListInstances{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInstances{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInstances(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListInstances", + } +} diff --git a/service/devops/api_op_ListParameterGroups.go b/service/devops/api_op_ListParameterGroups.go new file mode 100644 index 0000000..47907e8 --- /dev/null +++ b/service/devops/api_op_ListParameterGroups.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) ListParameterGroups(ctx context.Context, params *ListParameterGroupsInput, optFns ...func(*Options)) (*ListParameterGroupsOutput, error) { + if params == nil { + params = &ListParameterGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListParameterGroups", params, optFns, c.addOperationListParameterGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListParameterGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListParameterGroupsInput struct { + noSmithyDocumentSerde +} + +type ListParameterGroupsOutput struct { + ParameterGroups []types.ParameterGroups + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListParameterGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListParameterGroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListParameterGroups(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListParameterGroups", + } +} diff --git a/service/devops/api_op_RebootInstance.go b/service/devops/api_op_RebootInstance.go new file mode 100644 index 0000000..95644a5 --- /dev/null +++ b/service/devops/api_op_RebootInstance.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) RebootInstance(ctx context.Context, params *RebootInstanceInput, optFns ...func(*Options)) (*RebootInstanceOutput, error) { + if params == nil { + params = &RebootInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RebootInstance", params, optFns, c.addOperationRebootInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RebootInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RebootInstanceInput struct { + + // This member is required. + InstanceId *string + + noSmithyDocumentSerde +} + +type RebootInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRebootInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRebootInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRebootInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRebootInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRebootInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRebootInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "RebootInstance", + } +} diff --git a/service/devops/api_op_RestoreInstance.go b/service/devops/api_op_RestoreInstance.go new file mode 100644 index 0000000..0335772 --- /dev/null +++ b/service/devops/api_op_RestoreInstance.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) RestoreInstance(ctx context.Context, params *RestoreInstanceInput, optFns ...func(*Options)) (*RestoreInstanceOutput, error) { + if params == nil { + params = &RestoreInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreInstance", params, optFns, c.addOperationRestoreInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreInstanceInput struct { + + // This member is required. + BackupId *string + + // This member is required. + DiskSize *int32 + + // This member is required. + FirewallGroupName *string + + // This member is required. + InstanceId *string + + // This member is required. + InstanceType types.InstanceTypeOfRestoreInstanceRequest + + // This member is required. + ParameterGroupName *string + + AvailabilityZone types.AvailabilityZoneOfRestoreInstanceRequest + + Description *string + + NetworkConfig *types.RequestNetworkConfig + + noSmithyDocumentSerde +} + +type RestoreInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRestoreInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRestoreInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRestoreInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRestoreInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "RestoreInstance", + } +} diff --git a/service/devops/api_op_RevokeFirewallRules.go b/service/devops/api_op_RevokeFirewallRules.go new file mode 100644 index 0000000..f9d51e2 --- /dev/null +++ b/service/devops/api_op_RevokeFirewallRules.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) RevokeFirewallRules(ctx context.Context, params *RevokeFirewallRulesInput, optFns ...func(*Options)) (*RevokeFirewallRulesOutput, error) { + if params == nil { + params = &RevokeFirewallRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RevokeFirewallRules", params, optFns, c.addOperationRevokeFirewallRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RevokeFirewallRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RevokeFirewallRulesInput struct { + + // This member is required. + FirewallGroupName *string + + // This member is required. + Ids *string + + noSmithyDocumentSerde +} + +type RevokeFirewallRulesOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRevokeFirewallRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRevokeFirewallRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRevokeFirewallRules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRevokeFirewallRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRevokeFirewallRules(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRevokeFirewallRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "RevokeFirewallRules", + } +} diff --git a/service/devops/api_op_UpdateBackupRule.go b/service/devops/api_op_UpdateBackupRule.go new file mode 100644 index 0000000..8418d37 --- /dev/null +++ b/service/devops/api_op_UpdateBackupRule.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpdateBackupRule(ctx context.Context, params *UpdateBackupRuleInput, optFns ...func(*Options)) (*UpdateBackupRuleOutput, error) { + if params == nil { + params = &UpdateBackupRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateBackupRule", params, optFns, c.addOperationUpdateBackupRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateBackupRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateBackupRuleInput struct { + + // This member is required. + BackupRuleName *string + + ChangedBackupRuleName *string + + Description *string + + noSmithyDocumentSerde +} + +type UpdateBackupRuleOutput struct { + BackupRule *types.BackupRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateBackupRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateBackupRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateBackupRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateBackupRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateBackupRule(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateBackupRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateBackupRule", + } +} diff --git a/service/devops/api_op_UpdateFirewallGroup.go b/service/devops/api_op_UpdateFirewallGroup.go new file mode 100644 index 0000000..96764a1 --- /dev/null +++ b/service/devops/api_op_UpdateFirewallGroup.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpdateFirewallGroup(ctx context.Context, params *UpdateFirewallGroupInput, optFns ...func(*Options)) (*UpdateFirewallGroupOutput, error) { + if params == nil { + params = &UpdateFirewallGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateFirewallGroup", params, optFns, c.addOperationUpdateFirewallGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateFirewallGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateFirewallGroupInput struct { + + // This member is required. + FirewallGroupName *string + + ChangedFirewallGroupName *string + + Description *string + + noSmithyDocumentSerde +} + +type UpdateFirewallGroupOutput struct { + FirewallGroup *types.FirewallGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateFirewallGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateFirewallGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateFirewallGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateFirewallGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateFirewallGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateFirewallGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateFirewallGroup", + } +} diff --git a/service/devops/api_op_UpdateInstance.go b/service/devops/api_op_UpdateInstance.go new file mode 100644 index 0000000..9dfa9b1 --- /dev/null +++ b/service/devops/api_op_UpdateInstance.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpdateInstance(ctx context.Context, params *UpdateInstanceInput, optFns ...func(*Options)) (*UpdateInstanceOutput, error) { + if params == nil { + params = &UpdateInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateInstance", params, optFns, c.addOperationUpdateInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateInstanceInput struct { + + // This member is required. + InstanceId *string + + Description *string + + FirewallGroupName *string + + InstanceType types.InstanceTypeOfUpdateInstanceRequest + + noSmithyDocumentSerde +} + +type UpdateInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateInstance", + } +} diff --git a/service/devops/api_op_UpdateNetworkInterface.go b/service/devops/api_op_UpdateNetworkInterface.go new file mode 100644 index 0000000..290a49d --- /dev/null +++ b/service/devops/api_op_UpdateNetworkInterface.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpdateNetworkInterface(ctx context.Context, params *UpdateNetworkInterfaceInput, optFns ...func(*Options)) (*UpdateNetworkInterfaceOutput, error) { + if params == nil { + params = &UpdateNetworkInterfaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateNetworkInterface", params, optFns, c.addOperationUpdateNetworkInterfaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateNetworkInterfaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateNetworkInterfaceInput struct { + + // This member is required. + InstanceId *string + + NetworkConfig *types.RequestNetworkConfig + + noSmithyDocumentSerde +} + +type UpdateNetworkInterfaceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateNetworkInterfaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateNetworkInterface{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateNetworkInterface{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateNetworkInterfaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNetworkInterface(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateNetworkInterface(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateNetworkInterface", + } +} diff --git a/service/devops/api_op_UpdateParameterGroup.go b/service/devops/api_op_UpdateParameterGroup.go new file mode 100644 index 0000000..d6437c5 --- /dev/null +++ b/service/devops/api_op_UpdateParameterGroup.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpdateParameterGroup(ctx context.Context, params *UpdateParameterGroupInput, optFns ...func(*Options)) (*UpdateParameterGroupOutput, error) { + if params == nil { + params = &UpdateParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateParameterGroup", params, optFns, c.addOperationUpdateParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + ChangedParameterGroupName *string + + Description *string + + Parameters *types.RequestParameters + + noSmithyDocumentSerde +} + +type UpdateParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateParameterGroup", + } +} diff --git a/service/devops/api_op_UpgradeInstance.go b/service/devops/api_op_UpgradeInstance.go new file mode 100644 index 0000000..a888bae --- /dev/null +++ b/service/devops/api_op_UpgradeInstance.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +func (c *Client) UpgradeInstance(ctx context.Context, params *UpgradeInstanceInput, optFns ...func(*Options)) (*UpgradeInstanceOutput, error) { + if params == nil { + params = &UpgradeInstanceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpgradeInstance", params, optFns, c.addOperationUpgradeInstanceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpgradeInstanceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpgradeInstanceInput struct { + + // This member is required. + InstanceId *string + + GitlabVersion *string + + noSmithyDocumentSerde +} + +type UpgradeInstanceOutput struct { + Instance *types.Instance + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpgradeInstanceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpgradeInstance{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpgradeInstance{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpgradeInstanceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpgradeInstance(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpgradeInstance(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpgradeInstance", + } +} diff --git a/service/devops/deserializers.go b/service/devops/deserializers.go new file mode 100644 index 0000000..5d73bc5 --- /dev/null +++ b/service/devops/deserializers.go @@ -0,0 +1,5752 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + 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" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" + "io" + "io/ioutil" +) + +type awsRestjson1_deserializeOpAuthorizeFirewallRules struct { +} + +func (*awsRestjson1_deserializeOpAuthorizeFirewallRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAuthorizeFirewallRules) 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_deserializeOpErrorAuthorizeFirewallRules(response, &metadata) + } + output := &AuthorizeFirewallRulesOutput{} + 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_deserializeOpDocumentAuthorizeFirewallRulesOutput(&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_deserializeOpErrorAuthorizeFirewallRules(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAuthorizeFirewallRulesOutput(v **AuthorizeFirewallRulesOutput, 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 *AuthorizeFirewallRulesOutput + if *v == nil { + sv = &AuthorizeFirewallRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateBackupRule struct { +} + +func (*awsRestjson1_deserializeOpCreateBackupRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateBackupRule) 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_deserializeOpErrorCreateBackupRule(response, &metadata) + } + output := &CreateBackupRuleOutput{} + 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_deserializeOpDocumentCreateBackupRuleOutput(&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_deserializeOpErrorCreateBackupRule(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateBackupRuleOutput(v **CreateBackupRuleOutput, 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 *CreateBackupRuleOutput + if *v == nil { + sv = &CreateBackupRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRule": + if err := awsRestjson1_deserializeDocumentBackupRule(&sv.BackupRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateFirewallGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateFirewallGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateFirewallGroup) 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_deserializeOpErrorCreateFirewallGroup(response, &metadata) + } + output := &CreateFirewallGroupOutput{} + 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_deserializeOpDocumentCreateFirewallGroupOutput(&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_deserializeOpErrorCreateFirewallGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateFirewallGroupOutput(v **CreateFirewallGroupOutput, 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 *CreateFirewallGroupOutput + if *v == nil { + sv = &CreateFirewallGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateInstance struct { +} + +func (*awsRestjson1_deserializeOpCreateInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateInstance) 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_deserializeOpErrorCreateInstance(response, &metadata) + } + output := &CreateInstanceOutput{} + 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_deserializeOpDocumentCreateInstanceOutput(&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_deserializeOpErrorCreateInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateInstanceOutput(v **CreateInstanceOutput, 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 *CreateInstanceOutput + if *v == nil { + sv = &CreateInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateParameterGroup) 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_deserializeOpErrorCreateParameterGroup(response, &metadata) + } + output := &CreateParameterGroupOutput{} + 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_deserializeOpDocumentCreateParameterGroupOutput(&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_deserializeOpErrorCreateParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateParameterGroupOutput(v **CreateParameterGroupOutput, 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 *CreateParameterGroupOutput + if *v == nil { + sv = &CreateParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteBackup struct { +} + +func (*awsRestjson1_deserializeOpDeleteBackup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteBackup) 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_deserializeOpErrorDeleteBackup(response, &metadata) + } + output := &DeleteBackupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteBackup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteBackupRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteBackupRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteBackupRule) 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_deserializeOpErrorDeleteBackupRule(response, &metadata) + } + output := &DeleteBackupRuleOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteBackupRule(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteFirewallGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteFirewallGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteFirewallGroup) 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_deserializeOpErrorDeleteFirewallGroup(response, &metadata) + } + output := &DeleteFirewallGroupOutput{} + 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_deserializeOpDocumentDeleteFirewallGroupOutput(&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_deserializeOpErrorDeleteFirewallGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteFirewallGroupOutput(v **DeleteFirewallGroupOutput, 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 *DeleteFirewallGroupOutput + if *v == nil { + sv = &DeleteFirewallGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteInstance struct { +} + +func (*awsRestjson1_deserializeOpDeleteInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteInstance) 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_deserializeOpErrorDeleteInstance(response, &metadata) + } + output := &DeleteInstanceOutput{} + 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_deserializeOpDocumentDeleteInstanceOutput(&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_deserializeOpErrorDeleteInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteInstanceOutput(v **DeleteInstanceOutput, 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 *DeleteInstanceOutput + if *v == nil { + sv = &DeleteInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteParameterGroup) 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_deserializeOpErrorDeleteParameterGroup(response, &metadata) + } + output := &DeleteParameterGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpExtendDisk struct { +} + +func (*awsRestjson1_deserializeOpExtendDisk) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpExtendDisk) 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_deserializeOpErrorExtendDisk(response, &metadata) + } + output := &ExtendDiskOutput{} + 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_deserializeOpDocumentExtendDiskOutput(&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_deserializeOpErrorExtendDisk(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentExtendDiskOutput(v **ExtendDiskOutput, 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 *ExtendDiskOutput + if *v == nil { + sv = &ExtendDiskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetBackup struct { +} + +func (*awsRestjson1_deserializeOpGetBackup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetBackup) 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_deserializeOpErrorGetBackup(response, &metadata) + } + output := &GetBackupOutput{} + 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_deserializeOpDocumentGetBackupOutput(&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_deserializeOpErrorGetBackup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetBackupOutput(v **GetBackupOutput, 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 *GetBackupOutput + if *v == nil { + sv = &GetBackupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backup": + if err := awsRestjson1_deserializeDocumentBackup(&sv.Backup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetBackupRule struct { +} + +func (*awsRestjson1_deserializeOpGetBackupRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetBackupRule) 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_deserializeOpErrorGetBackupRule(response, &metadata) + } + output := &GetBackupRuleOutput{} + 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_deserializeOpDocumentGetBackupRuleOutput(&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_deserializeOpErrorGetBackupRule(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetBackupRuleOutput(v **GetBackupRuleOutput, 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 *GetBackupRuleOutput + if *v == nil { + sv = &GetBackupRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRule": + if err := awsRestjson1_deserializeDocumentBackupRule(&sv.BackupRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetFirewallGroup struct { +} + +func (*awsRestjson1_deserializeOpGetFirewallGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetFirewallGroup) 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_deserializeOpErrorGetFirewallGroup(response, &metadata) + } + output := &GetFirewallGroupOutput{} + 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_deserializeOpDocumentGetFirewallGroupOutput(&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_deserializeOpErrorGetFirewallGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetFirewallGroupOutput(v **GetFirewallGroupOutput, 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 *GetFirewallGroupOutput + if *v == nil { + sv = &GetFirewallGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetInstance struct { +} + +func (*awsRestjson1_deserializeOpGetInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetInstance) 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_deserializeOpErrorGetInstance(response, &metadata) + } + output := &GetInstanceOutput{} + 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_deserializeOpDocumentGetInstanceOutput(&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_deserializeOpErrorGetInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetInstanceOutput(v **GetInstanceOutput, 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 *GetInstanceOutput + if *v == nil { + sv = &GetInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpGetParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetParameterGroup) 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_deserializeOpErrorGetParameterGroup(response, &metadata) + } + output := &GetParameterGroupOutput{} + 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_deserializeOpDocumentGetParameterGroupOutput(&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_deserializeOpErrorGetParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetParameterGroupOutput(v **GetParameterGroupOutput, 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 *GetParameterGroupOutput + if *v == nil { + sv = &GetParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListBackupRules struct { +} + +func (*awsRestjson1_deserializeOpListBackupRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListBackupRules) 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_deserializeOpErrorListBackupRules(response, &metadata) + } + output := &ListBackupRulesOutput{} + 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_deserializeOpDocumentListBackupRulesOutput(&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_deserializeOpErrorListBackupRules(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListBackupRulesOutput(v **ListBackupRulesOutput, 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 *ListBackupRulesOutput + if *v == nil { + sv = &ListBackupRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRules": + if err := awsRestjson1_deserializeDocumentListOfBackupRules(&sv.BackupRules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListBackups struct { +} + +func (*awsRestjson1_deserializeOpListBackups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListBackups) 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_deserializeOpErrorListBackups(response, &metadata) + } + output := &ListBackupsOutput{} + 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_deserializeOpDocumentListBackupsOutput(&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_deserializeOpErrorListBackups(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListBackupsOutput(v **ListBackupsOutput, 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 *ListBackupsOutput + if *v == nil { + sv = &ListBackupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backups": + if err := awsRestjson1_deserializeDocumentListOfBackups(&sv.Backups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListFirewallGroups struct { +} + +func (*awsRestjson1_deserializeOpListFirewallGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListFirewallGroups) 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_deserializeOpErrorListFirewallGroups(response, &metadata) + } + output := &ListFirewallGroupsOutput{} + 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_deserializeOpDocumentListFirewallGroupsOutput(&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_deserializeOpErrorListFirewallGroups(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListFirewallGroupsOutput(v **ListFirewallGroupsOutput, 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 *ListFirewallGroupsOutput + if *v == nil { + sv = &ListFirewallGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroups": + if err := awsRestjson1_deserializeDocumentListOfFirewallGroups(&sv.FirewallGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListInstances struct { +} + +func (*awsRestjson1_deserializeOpListInstances) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListInstances) 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_deserializeOpErrorListInstances(response, &metadata) + } + output := &ListInstancesOutput{} + 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_deserializeOpDocumentListInstancesOutput(&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_deserializeOpErrorListInstances(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListInstancesOutput(v **ListInstancesOutput, 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 *ListInstancesOutput + if *v == nil { + sv = &ListInstancesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instances": + if err := awsRestjson1_deserializeDocumentListOfInstances(&sv.Instances, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListParameterGroups struct { +} + +func (*awsRestjson1_deserializeOpListParameterGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListParameterGroups) 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_deserializeOpErrorListParameterGroups(response, &metadata) + } + output := &ListParameterGroupsOutput{} + 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_deserializeOpDocumentListParameterGroupsOutput(&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_deserializeOpErrorListParameterGroups(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListParameterGroupsOutput(v **ListParameterGroupsOutput, 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 *ListParameterGroupsOutput + if *v == nil { + sv = &ListParameterGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroups": + if err := awsRestjson1_deserializeDocumentListOfParameterGroups(&sv.ParameterGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRebootInstance struct { +} + +func (*awsRestjson1_deserializeOpRebootInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRebootInstance) 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_deserializeOpErrorRebootInstance(response, &metadata) + } + output := &RebootInstanceOutput{} + 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_deserializeOpDocumentRebootInstanceOutput(&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_deserializeOpErrorRebootInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRebootInstanceOutput(v **RebootInstanceOutput, 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 *RebootInstanceOutput + if *v == nil { + sv = &RebootInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRestoreInstance struct { +} + +func (*awsRestjson1_deserializeOpRestoreInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRestoreInstance) 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_deserializeOpErrorRestoreInstance(response, &metadata) + } + output := &RestoreInstanceOutput{} + 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_deserializeOpDocumentRestoreInstanceOutput(&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_deserializeOpErrorRestoreInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRestoreInstanceOutput(v **RestoreInstanceOutput, 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 *RestoreInstanceOutput + if *v == nil { + sv = &RestoreInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRevokeFirewallRules struct { +} + +func (*awsRestjson1_deserializeOpRevokeFirewallRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRevokeFirewallRules) 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_deserializeOpErrorRevokeFirewallRules(response, &metadata) + } + output := &RevokeFirewallRulesOutput{} + 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_deserializeOpDocumentRevokeFirewallRulesOutput(&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_deserializeOpErrorRevokeFirewallRules(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRevokeFirewallRulesOutput(v **RevokeFirewallRulesOutput, 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 *RevokeFirewallRulesOutput + if *v == nil { + sv = &RevokeFirewallRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateBackupRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateBackupRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateBackupRule) 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_deserializeOpErrorUpdateBackupRule(response, &metadata) + } + output := &UpdateBackupRuleOutput{} + 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_deserializeOpDocumentUpdateBackupRuleOutput(&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_deserializeOpErrorUpdateBackupRule(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateBackupRuleOutput(v **UpdateBackupRuleOutput, 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 *UpdateBackupRuleOutput + if *v == nil { + sv = &UpdateBackupRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRule": + if err := awsRestjson1_deserializeDocumentBackupRule(&sv.BackupRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateFirewallGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateFirewallGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateFirewallGroup) 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_deserializeOpErrorUpdateFirewallGroup(response, &metadata) + } + output := &UpdateFirewallGroupOutput{} + 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_deserializeOpDocumentUpdateFirewallGroupOutput(&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_deserializeOpErrorUpdateFirewallGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateFirewallGroupOutput(v **UpdateFirewallGroupOutput, 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 *UpdateFirewallGroupOutput + if *v == nil { + sv = &UpdateFirewallGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "firewallGroup": + if err := awsRestjson1_deserializeDocumentFirewallGroup(&sv.FirewallGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateInstance struct { +} + +func (*awsRestjson1_deserializeOpUpdateInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateInstance) 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_deserializeOpErrorUpdateInstance(response, &metadata) + } + output := &UpdateInstanceOutput{} + 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_deserializeOpDocumentUpdateInstanceOutput(&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_deserializeOpErrorUpdateInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateInstanceOutput(v **UpdateInstanceOutput, 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 *UpdateInstanceOutput + if *v == nil { + sv = &UpdateInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateNetworkInterface struct { +} + +func (*awsRestjson1_deserializeOpUpdateNetworkInterface) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateNetworkInterface) 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_deserializeOpErrorUpdateNetworkInterface(response, &metadata) + } + output := &UpdateNetworkInterfaceOutput{} + 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_deserializeOpDocumentUpdateNetworkInterfaceOutput(&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_deserializeOpErrorUpdateNetworkInterface(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateNetworkInterfaceOutput(v **UpdateNetworkInterfaceOutput, 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 *UpdateNetworkInterfaceOutput + if *v == nil { + sv = &UpdateNetworkInterfaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateParameterGroup) 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_deserializeOpErrorUpdateParameterGroup(response, &metadata) + } + output := &UpdateParameterGroupOutput{} + 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_deserializeOpDocumentUpdateParameterGroupOutput(&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_deserializeOpErrorUpdateParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateParameterGroupOutput(v **UpdateParameterGroupOutput, 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 *UpdateParameterGroupOutput + if *v == nil { + sv = &UpdateParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpgradeInstance struct { +} + +func (*awsRestjson1_deserializeOpUpgradeInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeInstance) 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_deserializeOpErrorUpgradeInstance(response, &metadata) + } + output := &UpgradeInstanceOutput{} + 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_deserializeOpDocumentUpgradeInstanceOutput(&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_deserializeOpErrorUpgradeInstance(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpgradeInstanceOutput(v **UpgradeInstanceOutput, 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 *UpgradeInstanceOutput + if *v == nil { + sv = &UpgradeInstanceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "instance": + if err := awsRestjson1_deserializeDocumentInstance(&sv.Instance, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBackup(v **types.Backup, 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.Backup + if *v == nil { + sv = &types.Backup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupId = ptr.String(jtv) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "fileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FileName = ptr.String(jtv) + } + + case "fileSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FileSize = ptr.Int32(int32(i64)) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBackupRule(v **types.BackupRule, 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.BackupRule + if *v == nil { + sv = &types.BackupRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRuleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupRuleName = ptr.String(jtv) + } + + case "backupTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "generation": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Generation = ptr.Int32(int32(i64)) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBackupRules(v **types.BackupRules, 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.BackupRules + if *v == nil { + sv = &types.BackupRules{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupRuleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupRuleName = ptr.String(jtv) + } + + case "backupTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "generation": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Generation = ptr.Int32(int32(i64)) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentBackups(v **types.Backups, 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.Backups + if *v == nil { + sv = &types.Backups{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.BackupId = ptr.String(jtv) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "fileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FileName = ptr.String(jtv) + } + + case "fileSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.FileSize = ptr.Int32(int32(i64)) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFirewallGroup(v **types.FirewallGroup, 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.FirewallGroup + if *v == nil { + sv = &types.FirewallGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "firewallGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FirewallGroupName = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "rules": + if err := awsRestjson1_deserializeDocumentListOfRules(&sv.Rules, value); err != nil { + return err + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFirewallGroups(v **types.FirewallGroups, 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.FirewallGroups + if *v == nil { + sv = &types.FirewallGroups{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "firewallGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FirewallGroupName = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "rules": + if err := awsRestjson1_deserializeDocumentListOfRules(&sv.Rules, value); err != nil { + return err + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInstance(v **types.Instance, 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.Instance + if *v == nil { + sv = &types.Instance{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "diskSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DiskSize = ptr.Int32(int32(i64)) + } + + case "firewallGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FirewallGroupName = ptr.String(jtv) + } + + case "gitlabUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GitlabUrl = ptr.String(jtv) + } + + case "gitlabVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GitlabVersion = ptr.String(jtv) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "networkConfig": + if err := awsRestjson1_deserializeDocumentNetworkConfig(&sv.NetworkConfig, value); err != nil { + return err + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "publicIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PublicIpAddress = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "registryUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RegistryUrl = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "upgradableGitlabVersions": + if err := awsRestjson1_deserializeDocumentListOfUpgradableGitlabVersions(&sv.UpgradableGitlabVersions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInstances(v **types.Instances, 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.Instances + if *v == nil { + sv = &types.Instances{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "diskSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DiskSize = ptr.Int32(int32(i64)) + } + + case "firewallGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.FirewallGroupName = ptr.String(jtv) + } + + case "gitlabUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GitlabUrl = ptr.String(jtv) + } + + case "gitlabVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GitlabVersion = ptr.String(jtv) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "networkConfig": + if err := awsRestjson1_deserializeDocumentNetworkConfig(&sv.NetworkConfig, value); err != nil { + return err + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "publicIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PublicIpAddress = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "registryUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RegistryUrl = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "upgradableGitlabVersions": + if err := awsRestjson1_deserializeDocumentListOfUpgradableGitlabVersions(&sv.UpgradableGitlabVersions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListOfAllowedValues(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfBackupRules(v *[]types.BackupRules, 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.BackupRules + if *v == nil { + cv = []types.BackupRules{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.BackupRules + destAddr := &col + if err := awsRestjson1_deserializeDocumentBackupRules(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfBackups(v *[]types.Backups, 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.Backups + if *v == nil { + cv = []types.Backups{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Backups + destAddr := &col + if err := awsRestjson1_deserializeDocumentBackups(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfFirewallGroups(v *[]types.FirewallGroups, 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.FirewallGroups + if *v == nil { + cv = []types.FirewallGroups{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FirewallGroups + destAddr := &col + if err := awsRestjson1_deserializeDocumentFirewallGroups(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfInstances(v *[]types.Instances, 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.Instances + if *v == nil { + cv = []types.Instances{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Instances + destAddr := &col + if err := awsRestjson1_deserializeDocumentInstances(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfParameterGroups(v *[]types.ParameterGroups, 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.ParameterGroups + if *v == nil { + cv = []types.ParameterGroups{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ParameterGroups + destAddr := &col + if err := awsRestjson1_deserializeDocumentParameterGroups(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfParameters(v *[]types.Parameters, 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.Parameters + if *v == nil { + cv = []types.Parameters{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Parameters + destAddr := &col + if err := awsRestjson1_deserializeDocumentParameters(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfRules(v *[]types.Rules, 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.Rules + if *v == nil { + cv = []types.Rules{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Rules + destAddr := &col + if err := awsRestjson1_deserializeDocumentRules(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfUpgradableGitlabVersions(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNetworkConfig(v **types.NetworkConfig, 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.NetworkConfig + if *v == nil { + sv = &types.NetworkConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NetworkId = ptr.String(jtv) + } + + case "privateAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrivateAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterGroup(v **types.ParameterGroup, 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.ParameterGroup + if *v == nil { + sv = &types.ParameterGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentListOfParameters(&sv.Parameters, value); err != nil { + return err + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterGroups(v **types.ParameterGroups, 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.ParameterGroups + if *v == nil { + sv = &types.ParameterGroups{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "instanceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceId = ptr.String(jtv) + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentListOfParameters(&sv.Parameters, value); err != nil { + return err + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameters(v **types.Parameters, 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.Parameters + if *v == nil { + sv = &types.Parameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allowed_values": + if err := awsRestjson1_deserializeDocumentListOfAllowedValues(&sv.AllowedValues, value); err != nil { + return err + } + + case "data_type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DataType = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "is_modifiable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsModifiable = ptr.Bool(jtv) + } + + case "is_secret": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsSecret = ptr.Bool(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRules(v **types.Rules, 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.Rules + if *v == nil { + sv = &types.Rules{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cidrIp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CidrIp = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String 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 String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Protocol = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStatus(v **types.Status, 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.Status + if *v == nil { + sv = &types.Status{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Code = ptr.Int32(int32(i64)) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/devops/doc.go b/service/devops/doc.go new file mode 100644 index 0000000..ac71aec --- /dev/null +++ b/service/devops/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package devops provides the API client, operations, and parameter types for the +// API. +// +package devops + + diff --git a/service/devops/endpoints.go b/service/devops/endpoints.go new file mode 100644 index 0000000..f9c0c8f --- /dev/null +++ b/service/devops/endpoints.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + internalendpoints "github.com/nifcloud/nifcloud-sdk-go/service/devops/internal/endpoints" + "net/url" + "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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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 { + 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 = "devops" + } + 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 + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(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 EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +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 + } + } + +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { +} + +// 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, +) { + return endpoint, fmt.Errorf("no endpoint rules defined") +} diff --git a/service/devops/endpoints_test.go b/service/devops/endpoints_test.go new file mode 100644 index 0000000..e826d86 --- /dev/null +++ b/service/devops/endpoints_test.go @@ -0,0 +1,6 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devops + + diff --git a/service/devops/generated.json b/service/devops/generated.json new file mode 100644 index 0000000..ce6493f --- /dev/null +++ b/service/devops/generated.json @@ -0,0 +1,57 @@ +{ + "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_AuthorizeFirewallRules.go", + "api_op_CreateBackupRule.go", + "api_op_CreateFirewallGroup.go", + "api_op_CreateInstance.go", + "api_op_CreateParameterGroup.go", + "api_op_DeleteBackup.go", + "api_op_DeleteBackupRule.go", + "api_op_DeleteFirewallGroup.go", + "api_op_DeleteInstance.go", + "api_op_DeleteParameterGroup.go", + "api_op_ExtendDisk.go", + "api_op_GetBackup.go", + "api_op_GetBackupRule.go", + "api_op_GetFirewallGroup.go", + "api_op_GetInstance.go", + "api_op_GetParameterGroup.go", + "api_op_ListBackupRules.go", + "api_op_ListBackups.go", + "api_op_ListFirewallGroups.go", + "api_op_ListInstances.go", + "api_op_ListParameterGroups.go", + "api_op_RebootInstance.go", + "api_op_RestoreInstance.go", + "api_op_RevokeFirewallRules.go", + "api_op_UpdateBackupRule.go", + "api_op_UpdateFirewallGroup.go", + "api_op_UpdateInstance.go", + "api_op_UpdateNetworkInterface.go", + "api_op_UpdateParameterGroup.go", + "api_op_UpgradeInstance.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/nifcloud/nifcloud-sdk-go/service/devops", + "unstable": false +} diff --git a/service/devops/internal/endpoints/endpoints.go b/service/devops/internal/endpoints/endpoints.go new file mode 100644 index 0000000..66a7cbd --- /dev/null +++ b/service/devops/internal/endpoints/endpoints.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/logging" + endpoints "github.com/nifcloud/nifcloud-sdk-go/internal/endpoints/v2" + "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 devops 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 { + Nifcloud *regexp.Regexp +}{ + + Nifcloud: regexp.MustCompile("^(us|jp)\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "nifcloud", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + endpoints.DefaultKey{ + Variant: 0, + }: { + Hostname: "{region}.devops.api.nifcloud.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4", "v3", "v2"}, + }, + }, + RegionRegex: partitionRegexp.Nifcloud, + IsRegionalized: true, + }, +} diff --git a/service/devops/internal/endpoints/endpoints_test.go b/service/devops/internal/endpoints/endpoints_test.go new file mode 100644 index 0000000..5fb0ff1 --- /dev/null +++ b/service/devops/internal/endpoints/endpoints_test.go @@ -0,0 +1,12 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/devops/protocol_test.go b/service/devops/protocol_test.go new file mode 100644 index 0000000..e826d86 --- /dev/null +++ b/service/devops/protocol_test.go @@ -0,0 +1,6 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devops + + diff --git a/service/devops/serializers.go b/service/devops/serializers.go new file mode 100644 index 0000000..7c9e7ad --- /dev/null +++ b/service/devops/serializers.go @@ -0,0 +1,2534 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devops + +import ( + "bytes" + "context" + "fmt" + 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" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +type awsRestjson1_serializeOpAuthorizeFirewallRules struct { +} + +func (*awsRestjson1_serializeOpAuthorizeFirewallRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAuthorizeFirewallRules) 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.(*AuthorizeFirewallRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups/{FirewallGroupName}/rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAuthorizeFirewallRulesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAuthorizeFirewallRulesInput(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_serializeOpHttpBindingsAuthorizeFirewallRulesInput(v *AuthorizeFirewallRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FirewallGroupName == nil || len(*v.FirewallGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FirewallGroupName must not be empty")} + } + if v.FirewallGroupName != nil { + if err := encoder.SetURI("FirewallGroupName").String(*v.FirewallGroupName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAuthorizeFirewallRulesInput(v *AuthorizeFirewallRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Rules != nil { + ok := object.Key("rules") + if err := awsRestjson1_serializeDocumentListOfRequestRules(v.Rules, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateBackupRule struct { +} + +func (*awsRestjson1_serializeOpCreateBackupRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateBackupRule) 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.(*CreateBackupRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backupRules") + 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_serializeOpDocumentCreateBackupRuleInput(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_serializeOpHttpBindingsCreateBackupRuleInput(v *CreateBackupRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateBackupRuleInput(v *CreateBackupRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BackupRuleName != nil { + ok := object.Key("backupRuleName") + ok.String(*v.BackupRuleName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.InstanceId != nil { + ok := object.Key("instanceId") + ok.String(*v.InstanceId) + } + + return nil +} + +type awsRestjson1_serializeOpCreateFirewallGroup struct { +} + +func (*awsRestjson1_serializeOpCreateFirewallGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateFirewallGroup) 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.(*CreateFirewallGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups") + 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_serializeOpDocumentCreateFirewallGroupInput(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_serializeOpHttpBindingsCreateFirewallGroupInput(v *CreateFirewallGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateFirewallGroupInput(v *CreateFirewallGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AvailabilityZone) > 0 { + ok := object.Key("availabilityZone") + ok.String(string(v.AvailabilityZone)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FirewallGroupName != nil { + ok := object.Key("firewallGroupName") + ok.String(*v.FirewallGroupName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateInstance struct { +} + +func (*awsRestjson1_serializeOpCreateInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateInstance) 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.(*CreateInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances") + 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_serializeOpDocumentCreateInstanceInput(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_serializeOpHttpBindingsCreateInstanceInput(v *CreateInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateInstanceInput(v *CreateInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AvailabilityZone) > 0 { + ok := object.Key("availabilityZone") + ok.String(string(v.AvailabilityZone)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DiskSize != nil { + ok := object.Key("diskSize") + ok.Integer(*v.DiskSize) + } + + if v.FirewallGroupName != nil { + ok := object.Key("firewallGroupName") + ok.String(*v.FirewallGroupName) + } + + if v.InitialRootPassword != nil { + ok := object.Key("initialRootPassword") + ok.String(*v.InitialRootPassword) + } + + if v.InstanceId != nil { + ok := object.Key("instanceId") + ok.String(*v.InstanceId) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + if v.NetworkConfig != nil { + ok := object.Key("networkConfig") + if err := awsRestjson1_serializeDocumentRequestNetworkConfig(v.NetworkConfig, ok); err != nil { + return err + } + } + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateParameterGroup struct { +} + +func (*awsRestjson1_serializeOpCreateParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateParameterGroup) 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.(*CreateParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups") + 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_serializeOpDocumentCreateParameterGroupInput(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_serializeOpHttpBindingsCreateParameterGroupInput(v *CreateParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateParameterGroupInput(v *CreateParameterGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteBackup struct { +} + +func (*awsRestjson1_serializeOpDeleteBackup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteBackup) 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.(*DeleteBackupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backups/{BackupId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteBackupInput(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_serializeOpHttpBindingsDeleteBackupInput(v *DeleteBackupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BackupId == nil || len(*v.BackupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member BackupId must not be empty")} + } + if v.BackupId != nil { + if err := encoder.SetURI("BackupId").String(*v.BackupId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteBackupRule struct { +} + +func (*awsRestjson1_serializeOpDeleteBackupRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteBackupRule) 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.(*DeleteBackupRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backupRules/{BackupRuleName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteBackupRuleInput(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_serializeOpHttpBindingsDeleteBackupRuleInput(v *DeleteBackupRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BackupRuleName == nil || len(*v.BackupRuleName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member BackupRuleName must not be empty")} + } + if v.BackupRuleName != nil { + if err := encoder.SetURI("BackupRuleName").String(*v.BackupRuleName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteFirewallGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteFirewallGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteFirewallGroup) 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.(*DeleteFirewallGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups/{FirewallGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteFirewallGroupInput(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_serializeOpHttpBindingsDeleteFirewallGroupInput(v *DeleteFirewallGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FirewallGroupName == nil || len(*v.FirewallGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FirewallGroupName must not be empty")} + } + if v.FirewallGroupName != nil { + if err := encoder.SetURI("FirewallGroupName").String(*v.FirewallGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteInstance struct { +} + +func (*awsRestjson1_serializeOpDeleteInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteInstance) 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.(*DeleteInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteInstanceInput(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_serializeOpHttpBindingsDeleteInstanceInput(v *DeleteInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteParameterGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteParameterGroup) 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.(*DeleteParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteParameterGroupInput(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_serializeOpHttpBindingsDeleteParameterGroupInput(v *DeleteParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpExtendDisk struct { +} + +func (*awsRestjson1_serializeOpExtendDisk) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpExtendDisk) 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.(*ExtendDiskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}:extendDisk") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsExtendDiskInput(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_serializeOpHttpBindingsExtendDiskInput(v *ExtendDiskInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetBackup struct { +} + +func (*awsRestjson1_serializeOpGetBackup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetBackup) 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.(*GetBackupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backups/{BackupId}") + 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_serializeOpHttpBindingsGetBackupInput(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_serializeOpHttpBindingsGetBackupInput(v *GetBackupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BackupId == nil || len(*v.BackupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member BackupId must not be empty")} + } + if v.BackupId != nil { + if err := encoder.SetURI("BackupId").String(*v.BackupId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetBackupRule struct { +} + +func (*awsRestjson1_serializeOpGetBackupRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetBackupRule) 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.(*GetBackupRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backupRules/{BackupRuleName}") + 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_serializeOpHttpBindingsGetBackupRuleInput(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_serializeOpHttpBindingsGetBackupRuleInput(v *GetBackupRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BackupRuleName == nil || len(*v.BackupRuleName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member BackupRuleName must not be empty")} + } + if v.BackupRuleName != nil { + if err := encoder.SetURI("BackupRuleName").String(*v.BackupRuleName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetFirewallGroup struct { +} + +func (*awsRestjson1_serializeOpGetFirewallGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetFirewallGroup) 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.(*GetFirewallGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups/{FirewallGroupName}") + 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_serializeOpHttpBindingsGetFirewallGroupInput(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_serializeOpHttpBindingsGetFirewallGroupInput(v *GetFirewallGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FirewallGroupName == nil || len(*v.FirewallGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FirewallGroupName must not be empty")} + } + if v.FirewallGroupName != nil { + if err := encoder.SetURI("FirewallGroupName").String(*v.FirewallGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetInstance struct { +} + +func (*awsRestjson1_serializeOpGetInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetInstance) 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.(*GetInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}") + 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_serializeOpHttpBindingsGetInstanceInput(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_serializeOpHttpBindingsGetInstanceInput(v *GetInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetParameterGroup struct { +} + +func (*awsRestjson1_serializeOpGetParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetParameterGroup) 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.(*GetParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + 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_serializeOpHttpBindingsGetParameterGroupInput(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_serializeOpHttpBindingsGetParameterGroupInput(v *GetParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListBackupRules struct { +} + +func (*awsRestjson1_serializeOpListBackupRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListBackupRules) 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.(*ListBackupRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backupRules") + 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 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_serializeOpHttpBindingsListBackupRulesInput(v *ListBackupRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListBackups struct { +} + +func (*awsRestjson1_serializeOpListBackups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListBackups) 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.(*ListBackupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backups") + 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 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_serializeOpHttpBindingsListBackupsInput(v *ListBackupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListFirewallGroups struct { +} + +func (*awsRestjson1_serializeOpListFirewallGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListFirewallGroups) 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.(*ListFirewallGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups") + 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 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_serializeOpHttpBindingsListFirewallGroupsInput(v *ListFirewallGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListInstances struct { +} + +func (*awsRestjson1_serializeOpListInstances) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListInstances) 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.(*ListInstancesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances") + 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 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_serializeOpHttpBindingsListInstancesInput(v *ListInstancesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListParameterGroups struct { +} + +func (*awsRestjson1_serializeOpListParameterGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListParameterGroups) 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.(*ListParameterGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups") + 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 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_serializeOpHttpBindingsListParameterGroupsInput(v *ListParameterGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpRebootInstance struct { +} + +func (*awsRestjson1_serializeOpRebootInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRebootInstance) 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.(*RebootInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}:reboot") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRebootInstanceInput(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_serializeOpHttpBindingsRebootInstanceInput(v *RebootInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpRestoreInstance struct { +} + +func (*awsRestjson1_serializeOpRestoreInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRestoreInstance) 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.(*RestoreInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances:restore") + 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_serializeOpDocumentRestoreInstanceInput(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_serializeOpHttpBindingsRestoreInstanceInput(v *RestoreInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRestoreInstanceInput(v *RestoreInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AvailabilityZone) > 0 { + ok := object.Key("availabilityZone") + ok.String(string(v.AvailabilityZone)) + } + + if v.BackupId != nil { + ok := object.Key("backupId") + ok.String(*v.BackupId) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DiskSize != nil { + ok := object.Key("diskSize") + ok.Integer(*v.DiskSize) + } + + if v.FirewallGroupName != nil { + ok := object.Key("firewallGroupName") + ok.String(*v.FirewallGroupName) + } + + if v.InstanceId != nil { + ok := object.Key("instanceId") + ok.String(*v.InstanceId) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + if v.NetworkConfig != nil { + ok := object.Key("networkConfig") + if err := awsRestjson1_serializeDocumentRequestNetworkConfig(v.NetworkConfig, ok); err != nil { + return err + } + } + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + return nil +} + +type awsRestjson1_serializeOpRevokeFirewallRules struct { +} + +func (*awsRestjson1_serializeOpRevokeFirewallRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRevokeFirewallRules) 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.(*RevokeFirewallRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups/{FirewallGroupName}/rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRevokeFirewallRulesInput(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_serializeOpHttpBindingsRevokeFirewallRulesInput(v *RevokeFirewallRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FirewallGroupName == nil || len(*v.FirewallGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FirewallGroupName must not be empty")} + } + if v.FirewallGroupName != nil { + if err := encoder.SetURI("FirewallGroupName").String(*v.FirewallGroupName); err != nil { + return err + } + } + + if v.Ids != nil { + encoder.SetQuery("ids").String(*v.Ids) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateBackupRule struct { +} + +func (*awsRestjson1_serializeOpUpdateBackupRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateBackupRule) 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.(*UpdateBackupRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/backupRules/{BackupRuleName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateBackupRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateBackupRuleInput(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_serializeOpHttpBindingsUpdateBackupRuleInput(v *UpdateBackupRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BackupRuleName == nil || len(*v.BackupRuleName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member BackupRuleName must not be empty")} + } + if v.BackupRuleName != nil { + if err := encoder.SetURI("BackupRuleName").String(*v.BackupRuleName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateBackupRuleInput(v *UpdateBackupRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangedBackupRuleName != nil { + ok := object.Key("changedBackupRuleName") + ok.String(*v.ChangedBackupRuleName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateFirewallGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateFirewallGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateFirewallGroup) 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.(*UpdateFirewallGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/firewallGroups/{FirewallGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateFirewallGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateFirewallGroupInput(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_serializeOpHttpBindingsUpdateFirewallGroupInput(v *UpdateFirewallGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.FirewallGroupName == nil || len(*v.FirewallGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member FirewallGroupName must not be empty")} + } + if v.FirewallGroupName != nil { + if err := encoder.SetURI("FirewallGroupName").String(*v.FirewallGroupName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateFirewallGroupInput(v *UpdateFirewallGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangedFirewallGroupName != nil { + ok := object.Key("changedFirewallGroupName") + ok.String(*v.ChangedFirewallGroupName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateInstance struct { +} + +func (*awsRestjson1_serializeOpUpdateInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateInstance) 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.(*UpdateInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateInstanceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateInstanceInput(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_serializeOpHttpBindingsUpdateInstanceInput(v *UpdateInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateInstanceInput(v *UpdateInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.FirewallGroupName != nil { + ok := object.Key("firewallGroupName") + ok.String(*v.FirewallGroupName) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateNetworkInterface struct { +} + +func (*awsRestjson1_serializeOpUpdateNetworkInterface) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateNetworkInterface) 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.(*UpdateNetworkInterfaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}:updateNetworkInterface") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateNetworkInterfaceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateNetworkInterfaceInput(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_serializeOpHttpBindingsUpdateNetworkInterfaceInput(v *UpdateNetworkInterfaceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateNetworkInterfaceInput(v *UpdateNetworkInterfaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NetworkConfig != nil { + ok := object.Key("networkConfig") + if err := awsRestjson1_serializeDocumentRequestNetworkConfig(v.NetworkConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateParameterGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateParameterGroup) 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.(*UpdateParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateParameterGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateParameterGroupInput(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_serializeOpHttpBindingsUpdateParameterGroupInput(v *UpdateParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateParameterGroupInput(v *UpdateParameterGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangedParameterGroupName != nil { + ok := object.Key("changedParameterGroupName") + ok.String(*v.ChangedParameterGroupName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Parameters != nil { + ok := object.Key("parameters") + if err := awsRestjson1_serializeDocumentRequestParameters(v.Parameters, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpgradeInstance struct { +} + +func (*awsRestjson1_serializeOpUpgradeInstance) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpgradeInstance) 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.(*UpgradeInstanceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/instances/{InstanceId}:upgrade") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpgradeInstanceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpgradeInstanceInput(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_serializeOpHttpBindingsUpgradeInstanceInput(v *UpgradeInstanceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpgradeInstanceInput(v *UpgradeInstanceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GitlabVersion != nil { + ok := object.Key("gitlabVersion") + ok.String(*v.GitlabVersion) + } + + return nil +} + +func awsRestjson1_serializeDocumentListOfRequestRules(v []types.RequestRules, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRequestRules(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRequestNetworkConfig(v *types.RequestNetworkConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NetworkId != nil { + ok := object.Key("networkId") + ok.String(*v.NetworkId) + } + + if v.PrivateAddress != nil { + ok := object.Key("privateAddress") + ok.String(*v.PrivateAddress) + } + + return nil +} + +func awsRestjson1_serializeDocumentRequestParameters(v *types.RequestParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GitlabEmailFrom != nil { + ok := object.Key("gitlab_email_from") + ok.String(*v.GitlabEmailFrom) + } + + if v.GitlabEmailReplyTo != nil { + ok := object.Key("gitlab_email_reply_to") + ok.String(*v.GitlabEmailReplyTo) + } + + if v.LdapEnabled != nil { + ok := object.Key("ldap_enabled") + ok.String(*v.LdapEnabled) + } + + if v.LdapServersActiveDirectory != nil { + ok := object.Key("ldap_servers_active_directory") + ok.String(*v.LdapServersActiveDirectory) + } + + if v.LdapServersAllowUsernameOrEmailLogin != nil { + ok := object.Key("ldap_servers_allow_username_or_email_login") + ok.String(*v.LdapServersAllowUsernameOrEmailLogin) + } + + if v.LdapServersAttributesEmail != nil { + ok := object.Key("ldap_servers_attributes_email") + ok.String(*v.LdapServersAttributesEmail) + } + + if v.LdapServersAttributesFirstName != nil { + ok := object.Key("ldap_servers_attributes_first_name") + ok.String(*v.LdapServersAttributesFirstName) + } + + if v.LdapServersAttributesLastName != nil { + ok := object.Key("ldap_servers_attributes_last_name") + ok.String(*v.LdapServersAttributesLastName) + } + + if v.LdapServersAttributesName != nil { + ok := object.Key("ldap_servers_attributes_name") + ok.String(*v.LdapServersAttributesName) + } + + if v.LdapServersAttributesUsername != nil { + ok := object.Key("ldap_servers_attributes_username") + ok.String(*v.LdapServersAttributesUsername) + } + + if v.LdapServersBase != nil { + ok := object.Key("ldap_servers_base") + ok.String(*v.LdapServersBase) + } + + if v.LdapServersBindDn != nil { + ok := object.Key("ldap_servers_bind_dn") + ok.String(*v.LdapServersBindDn) + } + + if v.LdapServersBlockAutoCreatedUsers != nil { + ok := object.Key("ldap_servers_block_auto_created_users") + ok.String(*v.LdapServersBlockAutoCreatedUsers) + } + + if v.LdapServersEncryption != nil { + ok := object.Key("ldap_servers_encryption") + ok.String(*v.LdapServersEncryption) + } + + if v.LdapServersHost != nil { + ok := object.Key("ldap_servers_host") + ok.String(*v.LdapServersHost) + } + + if v.LdapServersLabel != nil { + ok := object.Key("ldap_servers_label") + ok.String(*v.LdapServersLabel) + } + + if v.LdapServersLowercaseUsernames != nil { + ok := object.Key("ldap_servers_lowercase_usernames") + ok.String(*v.LdapServersLowercaseUsernames) + } + + if v.LdapServersName != nil { + ok := object.Key("ldap_servers_name") + ok.String(*v.LdapServersName) + } + + if v.LdapServersPassword != nil { + ok := object.Key("ldap_servers_password") + ok.String(*v.LdapServersPassword) + } + + if v.LdapServersPort != nil { + ok := object.Key("ldap_servers_port") + ok.String(*v.LdapServersPort) + } + + if v.LdapServersTimeout != nil { + ok := object.Key("ldap_servers_timeout") + ok.String(*v.LdapServersTimeout) + } + + if v.LdapServersUid != nil { + ok := object.Key("ldap_servers_uid") + ok.String(*v.LdapServersUid) + } + + if v.LdapServersUserFilter != nil { + ok := object.Key("ldap_servers_user_filter") + ok.String(*v.LdapServersUserFilter) + } + + if v.LdapServersVerifyCertificates != nil { + ok := object.Key("ldap_servers_verify_certificates") + ok.String(*v.LdapServersVerifyCertificates) + } + + if v.OmniauthAllowSingleSignOn != nil { + ok := object.Key("omniauth_allow_single_sign_on") + ok.String(*v.OmniauthAllowSingleSignOn) + } + + if v.OmniauthAutoLinkSamlUser != nil { + ok := object.Key("omniauth_auto_link_saml_user") + ok.String(*v.OmniauthAutoLinkSamlUser) + } + + if v.OmniauthAutoSignInWithProvider != nil { + ok := object.Key("omniauth_auto_sign_in_with_provider") + ok.String(*v.OmniauthAutoSignInWithProvider) + } + + if v.OmniauthBlockAutoCreatedUsers != nil { + ok := object.Key("omniauth_block_auto_created_users") + ok.String(*v.OmniauthBlockAutoCreatedUsers) + } + + if v.OmniauthProvidersSamlAdminGroups != nil { + ok := object.Key("omniauth_providers_saml_admin_groups") + ok.String(*v.OmniauthProvidersSamlAdminGroups) + } + + if v.OmniauthProvidersSamlAssertionConsumerServiceUrl != nil { + ok := object.Key("omniauth_providers_saml_assertion_consumer_service_url") + ok.String(*v.OmniauthProvidersSamlAssertionConsumerServiceUrl) + } + + if v.OmniauthProvidersSamlAuditorGroups != nil { + ok := object.Key("omniauth_providers_saml_auditor_groups") + ok.String(*v.OmniauthProvidersSamlAuditorGroups) + } + + if v.OmniauthProvidersSamlExternalGroups != nil { + ok := object.Key("omniauth_providers_saml_external_groups") + ok.String(*v.OmniauthProvidersSamlExternalGroups) + } + + if v.OmniauthProvidersSamlGroupsAttribute != nil { + ok := object.Key("omniauth_providers_saml_groups_attribute") + ok.String(*v.OmniauthProvidersSamlGroupsAttribute) + } + + if v.OmniauthProvidersSamlIdpCertFingerprint != nil { + ok := object.Key("omniauth_providers_saml_idp_cert_fingerprint") + ok.String(*v.OmniauthProvidersSamlIdpCertFingerprint) + } + + if v.OmniauthProvidersSamlIdpSsoTargetUrl != nil { + ok := object.Key("omniauth_providers_saml_idp_sso_target_url") + ok.String(*v.OmniauthProvidersSamlIdpSsoTargetUrl) + } + + if v.OmniauthProvidersSamlIssuer != nil { + ok := object.Key("omniauth_providers_saml_issuer") + ok.String(*v.OmniauthProvidersSamlIssuer) + } + + if v.OmniauthProvidersSamlLabel != nil { + ok := object.Key("omniauth_providers_saml_label") + ok.String(*v.OmniauthProvidersSamlLabel) + } + + if v.OmniauthProvidersSamlName != nil { + ok := object.Key("omniauth_providers_saml_name") + ok.String(*v.OmniauthProvidersSamlName) + } + + if v.OmniauthProvidersSamlNameIdentifierFormat != nil { + ok := object.Key("omniauth_providers_saml_name_identifier_format") + ok.String(*v.OmniauthProvidersSamlNameIdentifierFormat) + } + + if v.OmniauthProvidersSamlRequiredGroups != nil { + ok := object.Key("omniauth_providers_saml_required_groups") + ok.String(*v.OmniauthProvidersSamlRequiredGroups) + } + + if v.SmtpPassword != nil { + ok := object.Key("smtp_password") + ok.String(*v.SmtpPassword) + } + + if v.SmtpUserName != nil { + ok := object.Key("smtp_user_name") + ok.String(*v.SmtpUserName) + } + + return nil +} + +func awsRestjson1_serializeDocumentRequestRules(v *types.RequestRules, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.CidrIp) > 0 { + ok := object.Key("cidrIp") + ok.String(string(v.CidrIp)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Port != nil { + ok := object.Key("port") + ok.Integer(*v.Port) + } + + if len(v.Protocol) > 0 { + ok := object.Key("protocol") + ok.String(string(v.Protocol)) + } + + return nil +} diff --git a/service/devops/types/enums.go b/service/devops/types/enums.go new file mode 100644 index 0000000..c0fa274 --- /dev/null +++ b/service/devops/types/enums.go @@ -0,0 +1,384 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package types + +type AvailabilityZoneOfCreateFirewallGroupRequest string + +// Enum values for AvailabilityZoneOfCreateFirewallGroupRequest +const ( + AvailabilityZoneOfCreateFirewallGroupRequestEast11 AvailabilityZoneOfCreateFirewallGroupRequest = "east-11" + AvailabilityZoneOfCreateFirewallGroupRequestEast12 AvailabilityZoneOfCreateFirewallGroupRequest = "east-12" + AvailabilityZoneOfCreateFirewallGroupRequestEast13 AvailabilityZoneOfCreateFirewallGroupRequest = "east-13" + AvailabilityZoneOfCreateFirewallGroupRequestEast14 AvailabilityZoneOfCreateFirewallGroupRequest = "east-14" + AvailabilityZoneOfCreateFirewallGroupRequestEast31 AvailabilityZoneOfCreateFirewallGroupRequest = "east-31" + AvailabilityZoneOfCreateFirewallGroupRequestWest12 AvailabilityZoneOfCreateFirewallGroupRequest = "west-12" + AvailabilityZoneOfCreateFirewallGroupRequestWest13 AvailabilityZoneOfCreateFirewallGroupRequest = "west-13" + AvailabilityZoneOfCreateFirewallGroupRequestJpWest21 AvailabilityZoneOfCreateFirewallGroupRequest = "jp-west-21" +) + +// Values returns all known values for +// AvailabilityZoneOfCreateFirewallGroupRequest. 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 (AvailabilityZoneOfCreateFirewallGroupRequest) Values() []AvailabilityZoneOfCreateFirewallGroupRequest { + return []AvailabilityZoneOfCreateFirewallGroupRequest{ + "east-11", + "east-12", + "east-13", + "east-14", + "east-31", + "west-12", + "west-13", + "jp-west-21", + } +} + +type AvailabilityZoneOfCreateInstanceRequest string + +// Enum values for AvailabilityZoneOfCreateInstanceRequest +const ( + AvailabilityZoneOfCreateInstanceRequestEast11 AvailabilityZoneOfCreateInstanceRequest = "east-11" + AvailabilityZoneOfCreateInstanceRequestEast12 AvailabilityZoneOfCreateInstanceRequest = "east-12" + AvailabilityZoneOfCreateInstanceRequestEast13 AvailabilityZoneOfCreateInstanceRequest = "east-13" + AvailabilityZoneOfCreateInstanceRequestEast14 AvailabilityZoneOfCreateInstanceRequest = "east-14" + AvailabilityZoneOfCreateInstanceRequestEast31 AvailabilityZoneOfCreateInstanceRequest = "east-31" + AvailabilityZoneOfCreateInstanceRequestWest12 AvailabilityZoneOfCreateInstanceRequest = "west-12" + AvailabilityZoneOfCreateInstanceRequestWest13 AvailabilityZoneOfCreateInstanceRequest = "west-13" + AvailabilityZoneOfCreateInstanceRequestJpWest21 AvailabilityZoneOfCreateInstanceRequest = "jp-west-21" +) + +// Values returns all known values for AvailabilityZoneOfCreateInstanceRequest. +// 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 (AvailabilityZoneOfCreateInstanceRequest) Values() []AvailabilityZoneOfCreateInstanceRequest { + return []AvailabilityZoneOfCreateInstanceRequest{ + "east-11", + "east-12", + "east-13", + "east-14", + "east-31", + "west-12", + "west-13", + "jp-west-21", + } +} + +type AvailabilityZoneOfRestoreInstanceRequest string + +// Enum values for AvailabilityZoneOfRestoreInstanceRequest +const ( + AvailabilityZoneOfRestoreInstanceRequestEast11 AvailabilityZoneOfRestoreInstanceRequest = "east-11" + AvailabilityZoneOfRestoreInstanceRequestEast12 AvailabilityZoneOfRestoreInstanceRequest = "east-12" + AvailabilityZoneOfRestoreInstanceRequestEast13 AvailabilityZoneOfRestoreInstanceRequest = "east-13" + AvailabilityZoneOfRestoreInstanceRequestEast14 AvailabilityZoneOfRestoreInstanceRequest = "east-14" + AvailabilityZoneOfRestoreInstanceRequestEast31 AvailabilityZoneOfRestoreInstanceRequest = "east-31" + AvailabilityZoneOfRestoreInstanceRequestWest12 AvailabilityZoneOfRestoreInstanceRequest = "west-12" + AvailabilityZoneOfRestoreInstanceRequestWest13 AvailabilityZoneOfRestoreInstanceRequest = "west-13" + AvailabilityZoneOfRestoreInstanceRequestJpWest21 AvailabilityZoneOfRestoreInstanceRequest = "jp-west-21" +) + +// Values returns all known values for AvailabilityZoneOfRestoreInstanceRequest. +// 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 (AvailabilityZoneOfRestoreInstanceRequest) Values() []AvailabilityZoneOfRestoreInstanceRequest { + return []AvailabilityZoneOfRestoreInstanceRequest{ + "east-11", + "east-12", + "east-13", + "east-14", + "east-31", + "west-12", + "west-13", + "jp-west-21", + } +} + +type CidrIpOfrulesForAuthorizeFirewallRules string + +// Enum values for CidrIpOfrulesForAuthorizeFirewallRules +const ( + CidrIpOfrulesForAuthorizeFirewallRulesIpv4ip CidrIpOfrulesForAuthorizeFirewallRules = "IPv4IP" + CidrIpOfrulesForAuthorizeFirewallRulesCidr CidrIpOfrulesForAuthorizeFirewallRules = "CIDR" +) + +// Values returns all known values for CidrIpOfrulesForAuthorizeFirewallRules. +// 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 (CidrIpOfrulesForAuthorizeFirewallRules) Values() []CidrIpOfrulesForAuthorizeFirewallRules { + return []CidrIpOfrulesForAuthorizeFirewallRules{ + "IPv4IP", + "CIDR", + } +} + +type InstanceTypeOfCreateInstanceRequest string + +// Enum values for InstanceTypeOfCreateInstanceRequest +const ( + InstanceTypeOfCreateInstanceRequestCLarge InstanceTypeOfCreateInstanceRequest = "c-large" + InstanceTypeOfCreateInstanceRequestCLarge8 InstanceTypeOfCreateInstanceRequest = "c-large8" + InstanceTypeOfCreateInstanceRequestELarge InstanceTypeOfCreateInstanceRequest = "e-large" + InstanceTypeOfCreateInstanceRequestELarge8 InstanceTypeOfCreateInstanceRequest = "e-large8" + InstanceTypeOfCreateInstanceRequestELarge16 InstanceTypeOfCreateInstanceRequest = "e-large16" + InstanceTypeOfCreateInstanceRequestELarge24 InstanceTypeOfCreateInstanceRequest = "e-large24" + InstanceTypeOfCreateInstanceRequestELarge32 InstanceTypeOfCreateInstanceRequest = "e-large32" + InstanceTypeOfCreateInstanceRequestEExtraLarge8 InstanceTypeOfCreateInstanceRequest = "e-extra-large8" + InstanceTypeOfCreateInstanceRequestEExtraLarge16 InstanceTypeOfCreateInstanceRequest = "e-extra-large16" + InstanceTypeOfCreateInstanceRequestEExtraLarge24 InstanceTypeOfCreateInstanceRequest = "e-extra-large24" + InstanceTypeOfCreateInstanceRequestEExtraLarge32 InstanceTypeOfCreateInstanceRequest = "e-extra-large32" + InstanceTypeOfCreateInstanceRequestEExtraLarge48 InstanceTypeOfCreateInstanceRequest = "e-extra-large48" + InstanceTypeOfCreateInstanceRequestEDoubleLarge16 InstanceTypeOfCreateInstanceRequest = "e-double-large16" + InstanceTypeOfCreateInstanceRequestEDoubleLarge24 InstanceTypeOfCreateInstanceRequest = "e-double-large24" + InstanceTypeOfCreateInstanceRequestEDoubleLarge32 InstanceTypeOfCreateInstanceRequest = "e-double-large32" + InstanceTypeOfCreateInstanceRequestEDoubleLarge48 InstanceTypeOfCreateInstanceRequest = "e-double-large48" + InstanceTypeOfCreateInstanceRequestEDoubleLarge64 InstanceTypeOfCreateInstanceRequest = "e-double-large64" + InstanceTypeOfCreateInstanceRequestEDoubleLarge96 InstanceTypeOfCreateInstanceRequest = "e-double-large96" + InstanceTypeOfCreateInstanceRequestH2Large InstanceTypeOfCreateInstanceRequest = "h2-large" + InstanceTypeOfCreateInstanceRequestH2Large8 InstanceTypeOfCreateInstanceRequest = "h2-large8" + InstanceTypeOfCreateInstanceRequestH2Large16 InstanceTypeOfCreateInstanceRequest = "h2-large16" + InstanceTypeOfCreateInstanceRequestH2Large24 InstanceTypeOfCreateInstanceRequest = "h2-large24" + InstanceTypeOfCreateInstanceRequestH2Large32 InstanceTypeOfCreateInstanceRequest = "h2-large32" + InstanceTypeOfCreateInstanceRequestH2ExtraLarge8 InstanceTypeOfCreateInstanceRequest = "h2-extra-large8" + InstanceTypeOfCreateInstanceRequestH2ExtraLarge16 InstanceTypeOfCreateInstanceRequest = "h2-extra-large16" + InstanceTypeOfCreateInstanceRequestH2ExtraLarge24 InstanceTypeOfCreateInstanceRequest = "h2-extra-large24" + InstanceTypeOfCreateInstanceRequestH2ExtraLarge32 InstanceTypeOfCreateInstanceRequest = "h2-extra-large32" + InstanceTypeOfCreateInstanceRequestH2ExtraLarge48 InstanceTypeOfCreateInstanceRequest = "h2-extra-large48" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge16 InstanceTypeOfCreateInstanceRequest = "h2-double-large16" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge24 InstanceTypeOfCreateInstanceRequest = "h2-double-large24" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge32 InstanceTypeOfCreateInstanceRequest = "h2-double-large32" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge48 InstanceTypeOfCreateInstanceRequest = "h2-double-large48" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge64 InstanceTypeOfCreateInstanceRequest = "h2-double-large64" + InstanceTypeOfCreateInstanceRequestH2DoubleLarge96 InstanceTypeOfCreateInstanceRequest = "h2-double-large96" +) + +// Values returns all known values for InstanceTypeOfCreateInstanceRequest. 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 (InstanceTypeOfCreateInstanceRequest) Values() []InstanceTypeOfCreateInstanceRequest { + return []InstanceTypeOfCreateInstanceRequest{ + "c-large", + "c-large8", + "e-large", + "e-large8", + "e-large16", + "e-large24", + "e-large32", + "e-extra-large8", + "e-extra-large16", + "e-extra-large24", + "e-extra-large32", + "e-extra-large48", + "e-double-large16", + "e-double-large24", + "e-double-large32", + "e-double-large48", + "e-double-large64", + "e-double-large96", + "h2-large", + "h2-large8", + "h2-large16", + "h2-large24", + "h2-large32", + "h2-extra-large8", + "h2-extra-large16", + "h2-extra-large24", + "h2-extra-large32", + "h2-extra-large48", + "h2-double-large16", + "h2-double-large24", + "h2-double-large32", + "h2-double-large48", + "h2-double-large64", + "h2-double-large96", + } +} + +type InstanceTypeOfRestoreInstanceRequest string + +// Enum values for InstanceTypeOfRestoreInstanceRequest +const ( + InstanceTypeOfRestoreInstanceRequestCLarge InstanceTypeOfRestoreInstanceRequest = "c-large" + InstanceTypeOfRestoreInstanceRequestCLarge8 InstanceTypeOfRestoreInstanceRequest = "c-large8" + InstanceTypeOfRestoreInstanceRequestELarge InstanceTypeOfRestoreInstanceRequest = "e-large" + InstanceTypeOfRestoreInstanceRequestELarge8 InstanceTypeOfRestoreInstanceRequest = "e-large8" + InstanceTypeOfRestoreInstanceRequestELarge16 InstanceTypeOfRestoreInstanceRequest = "e-large16" + InstanceTypeOfRestoreInstanceRequestELarge24 InstanceTypeOfRestoreInstanceRequest = "e-large24" + InstanceTypeOfRestoreInstanceRequestELarge32 InstanceTypeOfRestoreInstanceRequest = "e-large32" + InstanceTypeOfRestoreInstanceRequestEExtraLarge8 InstanceTypeOfRestoreInstanceRequest = "e-extra-large8" + InstanceTypeOfRestoreInstanceRequestEExtraLarge16 InstanceTypeOfRestoreInstanceRequest = "e-extra-large16" + InstanceTypeOfRestoreInstanceRequestEExtraLarge24 InstanceTypeOfRestoreInstanceRequest = "e-extra-large24" + InstanceTypeOfRestoreInstanceRequestEExtraLarge32 InstanceTypeOfRestoreInstanceRequest = "e-extra-large32" + InstanceTypeOfRestoreInstanceRequestEExtraLarge48 InstanceTypeOfRestoreInstanceRequest = "e-extra-large48" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge16 InstanceTypeOfRestoreInstanceRequest = "e-double-large16" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge24 InstanceTypeOfRestoreInstanceRequest = "e-double-large24" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge32 InstanceTypeOfRestoreInstanceRequest = "e-double-large32" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge48 InstanceTypeOfRestoreInstanceRequest = "e-double-large48" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge64 InstanceTypeOfRestoreInstanceRequest = "e-double-large64" + InstanceTypeOfRestoreInstanceRequestEDoubleLarge96 InstanceTypeOfRestoreInstanceRequest = "e-double-large96" + InstanceTypeOfRestoreInstanceRequestH2Large InstanceTypeOfRestoreInstanceRequest = "h2-large" + InstanceTypeOfRestoreInstanceRequestH2Large8 InstanceTypeOfRestoreInstanceRequest = "h2-large8" + InstanceTypeOfRestoreInstanceRequestH2Large16 InstanceTypeOfRestoreInstanceRequest = "h2-large16" + InstanceTypeOfRestoreInstanceRequestH2Large24 InstanceTypeOfRestoreInstanceRequest = "h2-large24" + InstanceTypeOfRestoreInstanceRequestH2Large32 InstanceTypeOfRestoreInstanceRequest = "h2-large32" + InstanceTypeOfRestoreInstanceRequestH2ExtraLarge8 InstanceTypeOfRestoreInstanceRequest = "h2-extra-large8" + InstanceTypeOfRestoreInstanceRequestH2ExtraLarge16 InstanceTypeOfRestoreInstanceRequest = "h2-extra-large16" + InstanceTypeOfRestoreInstanceRequestH2ExtraLarge24 InstanceTypeOfRestoreInstanceRequest = "h2-extra-large24" + InstanceTypeOfRestoreInstanceRequestH2ExtraLarge32 InstanceTypeOfRestoreInstanceRequest = "h2-extra-large32" + InstanceTypeOfRestoreInstanceRequestH2ExtraLarge48 InstanceTypeOfRestoreInstanceRequest = "h2-extra-large48" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge16 InstanceTypeOfRestoreInstanceRequest = "h2-double-large16" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge24 InstanceTypeOfRestoreInstanceRequest = "h2-double-large24" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge32 InstanceTypeOfRestoreInstanceRequest = "h2-double-large32" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge48 InstanceTypeOfRestoreInstanceRequest = "h2-double-large48" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge64 InstanceTypeOfRestoreInstanceRequest = "h2-double-large64" + InstanceTypeOfRestoreInstanceRequestH2DoubleLarge96 InstanceTypeOfRestoreInstanceRequest = "h2-double-large96" +) + +// Values returns all known values for InstanceTypeOfRestoreInstanceRequest. 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 (InstanceTypeOfRestoreInstanceRequest) Values() []InstanceTypeOfRestoreInstanceRequest { + return []InstanceTypeOfRestoreInstanceRequest{ + "c-large", + "c-large8", + "e-large", + "e-large8", + "e-large16", + "e-large24", + "e-large32", + "e-extra-large8", + "e-extra-large16", + "e-extra-large24", + "e-extra-large32", + "e-extra-large48", + "e-double-large16", + "e-double-large24", + "e-double-large32", + "e-double-large48", + "e-double-large64", + "e-double-large96", + "h2-large", + "h2-large8", + "h2-large16", + "h2-large24", + "h2-large32", + "h2-extra-large8", + "h2-extra-large16", + "h2-extra-large24", + "h2-extra-large32", + "h2-extra-large48", + "h2-double-large16", + "h2-double-large24", + "h2-double-large32", + "h2-double-large48", + "h2-double-large64", + "h2-double-large96", + } +} + +type InstanceTypeOfUpdateInstanceRequest string + +// Enum values for InstanceTypeOfUpdateInstanceRequest +const ( + InstanceTypeOfUpdateInstanceRequestCLarge InstanceTypeOfUpdateInstanceRequest = "c-large" + InstanceTypeOfUpdateInstanceRequestCLarge8 InstanceTypeOfUpdateInstanceRequest = "c-large8" + InstanceTypeOfUpdateInstanceRequestELarge InstanceTypeOfUpdateInstanceRequest = "e-large" + InstanceTypeOfUpdateInstanceRequestELarge8 InstanceTypeOfUpdateInstanceRequest = "e-large8" + InstanceTypeOfUpdateInstanceRequestELarge16 InstanceTypeOfUpdateInstanceRequest = "e-large16" + InstanceTypeOfUpdateInstanceRequestELarge24 InstanceTypeOfUpdateInstanceRequest = "e-large24" + InstanceTypeOfUpdateInstanceRequestELarge32 InstanceTypeOfUpdateInstanceRequest = "e-large32" + InstanceTypeOfUpdateInstanceRequestEExtraLarge8 InstanceTypeOfUpdateInstanceRequest = "e-extra-large8" + InstanceTypeOfUpdateInstanceRequestEExtraLarge16 InstanceTypeOfUpdateInstanceRequest = "e-extra-large16" + InstanceTypeOfUpdateInstanceRequestEExtraLarge24 InstanceTypeOfUpdateInstanceRequest = "e-extra-large24" + InstanceTypeOfUpdateInstanceRequestEExtraLarge32 InstanceTypeOfUpdateInstanceRequest = "e-extra-large32" + InstanceTypeOfUpdateInstanceRequestEExtraLarge48 InstanceTypeOfUpdateInstanceRequest = "e-extra-large48" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge16 InstanceTypeOfUpdateInstanceRequest = "e-double-large16" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge24 InstanceTypeOfUpdateInstanceRequest = "e-double-large24" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge32 InstanceTypeOfUpdateInstanceRequest = "e-double-large32" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge48 InstanceTypeOfUpdateInstanceRequest = "e-double-large48" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge64 InstanceTypeOfUpdateInstanceRequest = "e-double-large64" + InstanceTypeOfUpdateInstanceRequestEDoubleLarge96 InstanceTypeOfUpdateInstanceRequest = "e-double-large96" + InstanceTypeOfUpdateInstanceRequestH2Large InstanceTypeOfUpdateInstanceRequest = "h2-large" + InstanceTypeOfUpdateInstanceRequestH2Large8 InstanceTypeOfUpdateInstanceRequest = "h2-large8" + InstanceTypeOfUpdateInstanceRequestH2Large16 InstanceTypeOfUpdateInstanceRequest = "h2-large16" + InstanceTypeOfUpdateInstanceRequestH2Large24 InstanceTypeOfUpdateInstanceRequest = "h2-large24" + InstanceTypeOfUpdateInstanceRequestH2Large32 InstanceTypeOfUpdateInstanceRequest = "h2-large32" + InstanceTypeOfUpdateInstanceRequestH2ExtraLarge8 InstanceTypeOfUpdateInstanceRequest = "h2-extra-large8" + InstanceTypeOfUpdateInstanceRequestH2ExtraLarge16 InstanceTypeOfUpdateInstanceRequest = "h2-extra-large16" + InstanceTypeOfUpdateInstanceRequestH2ExtraLarge24 InstanceTypeOfUpdateInstanceRequest = "h2-extra-large24" + InstanceTypeOfUpdateInstanceRequestH2ExtraLarge32 InstanceTypeOfUpdateInstanceRequest = "h2-extra-large32" + InstanceTypeOfUpdateInstanceRequestH2ExtraLarge48 InstanceTypeOfUpdateInstanceRequest = "h2-extra-large48" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge16 InstanceTypeOfUpdateInstanceRequest = "h2-double-large16" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge24 InstanceTypeOfUpdateInstanceRequest = "h2-double-large24" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge32 InstanceTypeOfUpdateInstanceRequest = "h2-double-large32" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge48 InstanceTypeOfUpdateInstanceRequest = "h2-double-large48" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge64 InstanceTypeOfUpdateInstanceRequest = "h2-double-large64" + InstanceTypeOfUpdateInstanceRequestH2DoubleLarge96 InstanceTypeOfUpdateInstanceRequest = "h2-double-large96" +) + +// Values returns all known values for InstanceTypeOfUpdateInstanceRequest. 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 (InstanceTypeOfUpdateInstanceRequest) Values() []InstanceTypeOfUpdateInstanceRequest { + return []InstanceTypeOfUpdateInstanceRequest{ + "c-large", + "c-large8", + "e-large", + "e-large8", + "e-large16", + "e-large24", + "e-large32", + "e-extra-large8", + "e-extra-large16", + "e-extra-large24", + "e-extra-large32", + "e-extra-large48", + "e-double-large16", + "e-double-large24", + "e-double-large32", + "e-double-large48", + "e-double-large64", + "e-double-large96", + "h2-large", + "h2-large8", + "h2-large16", + "h2-large24", + "h2-large32", + "h2-extra-large8", + "h2-extra-large16", + "h2-extra-large24", + "h2-extra-large32", + "h2-extra-large48", + "h2-double-large16", + "h2-double-large24", + "h2-double-large32", + "h2-double-large48", + "h2-double-large64", + "h2-double-large96", + } +} + +type ProtocolOfrulesForAuthorizeFirewallRules string + +// Enum values for ProtocolOfrulesForAuthorizeFirewallRules +const ( + ProtocolOfrulesForAuthorizeFirewallRulesTcp ProtocolOfrulesForAuthorizeFirewallRules = "TCP" + ProtocolOfrulesForAuthorizeFirewallRulesIcmp ProtocolOfrulesForAuthorizeFirewallRules = "ICMP" +) + +// Values returns all known values for ProtocolOfrulesForAuthorizeFirewallRules. +// 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 (ProtocolOfrulesForAuthorizeFirewallRules) Values() []ProtocolOfrulesForAuthorizeFirewallRules { + return []ProtocolOfrulesForAuthorizeFirewallRules{ + "TCP", + "ICMP", + } +} diff --git a/service/devops/types/types.go b/service/devops/types/types.go new file mode 100644 index 0000000..1a713cf --- /dev/null +++ b/service/devops/types/types.go @@ -0,0 +1,383 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +type Backup struct { + + BackupId *string + + CreateTime *string + + FileName *string + + FileSize *int32 + + InstanceId *string + + Region *string + + noSmithyDocumentSerde +} + +type BackupRule struct { + + BackupRuleName *string + + BackupTime *string + + Description *string + + Generation *int32 + + InstanceId *string + + noSmithyDocumentSerde +} + +type BackupRules struct { + + BackupRuleName *string + + BackupTime *string + + Description *string + + Generation *int32 + + InstanceId *string + + noSmithyDocumentSerde +} + +type Backups struct { + + BackupId *string + + CreateTime *string + + FileName *string + + FileSize *int32 + + InstanceId *string + + Region *string + + noSmithyDocumentSerde +} + +type FirewallGroup struct { + + AvailabilityZone *string + + Description *string + + FirewallGroupName *string + + Region *string + + Rules []Rules + + State *string + + noSmithyDocumentSerde +} + +type FirewallGroups struct { + + AvailabilityZone *string + + Description *string + + FirewallGroupName *string + + Region *string + + Rules []Rules + + State *string + + noSmithyDocumentSerde +} + +type Instance struct { + + AvailabilityZone *string + + CreateTime *string + + Description *string + + DiskSize *int32 + + FirewallGroupName *string + + GitlabUrl *string + + GitlabVersion *string + + InstanceId *string + + InstanceType *string + + NetworkConfig *NetworkConfig + + ParameterGroupName *string + + PublicIpAddress *string + + Region *string + + RegistryUrl *string + + State *string + + Status *Status + + UpgradableGitlabVersions []string + + noSmithyDocumentSerde +} + +type Instances struct { + + AvailabilityZone *string + + CreateTime *string + + Description *string + + DiskSize *int32 + + FirewallGroupName *string + + GitlabUrl *string + + GitlabVersion *string + + InstanceId *string + + InstanceType *string + + NetworkConfig *NetworkConfig + + ParameterGroupName *string + + PublicIpAddress *string + + Region *string + + RegistryUrl *string + + State *string + + Status *Status + + UpgradableGitlabVersions []string + + noSmithyDocumentSerde +} + +type NetworkConfig struct { + + NetworkId *string + + PrivateAddress *string + + noSmithyDocumentSerde +} + +type ParameterGroup struct { + + Description *string + + InstanceId *string + + ParameterGroupName *string + + Parameters []Parameters + + Region *string + + noSmithyDocumentSerde +} + +type ParameterGroups struct { + + Description *string + + InstanceId *string + + ParameterGroupName *string + + Parameters []Parameters + + Region *string + + noSmithyDocumentSerde +} + +type Parameters struct { + + AllowedValues []string + + DataType *string + + Description *string + + IsModifiable *bool + + IsSecret *bool + + Name *string + + Value *string + + noSmithyDocumentSerde +} + +type RequestNetworkConfig struct { + + NetworkId *string + + PrivateAddress *string + + noSmithyDocumentSerde +} + +type RequestParameters struct { + + GitlabEmailFrom *string + + GitlabEmailReplyTo *string + + LdapEnabled *string + + LdapServersActiveDirectory *string + + LdapServersAllowUsernameOrEmailLogin *string + + LdapServersAttributesEmail *string + + LdapServersAttributesFirstName *string + + LdapServersAttributesLastName *string + + LdapServersAttributesName *string + + LdapServersAttributesUsername *string + + LdapServersBase *string + + LdapServersBindDn *string + + LdapServersBlockAutoCreatedUsers *string + + LdapServersEncryption *string + + LdapServersHost *string + + LdapServersLabel *string + + LdapServersLowercaseUsernames *string + + LdapServersName *string + + LdapServersPassword *string + + LdapServersPort *string + + LdapServersTimeout *string + + LdapServersUid *string + + LdapServersUserFilter *string + + LdapServersVerifyCertificates *string + + OmniauthAllowSingleSignOn *string + + OmniauthAutoLinkSamlUser *string + + OmniauthAutoSignInWithProvider *string + + OmniauthBlockAutoCreatedUsers *string + + OmniauthProvidersSamlAdminGroups *string + + OmniauthProvidersSamlAssertionConsumerServiceUrl *string + + OmniauthProvidersSamlAuditorGroups *string + + OmniauthProvidersSamlExternalGroups *string + + OmniauthProvidersSamlGroupsAttribute *string + + OmniauthProvidersSamlIdpCertFingerprint *string + + OmniauthProvidersSamlIdpSsoTargetUrl *string + + OmniauthProvidersSamlIssuer *string + + OmniauthProvidersSamlLabel *string + + OmniauthProvidersSamlName *string + + OmniauthProvidersSamlNameIdentifierFormat *string + + OmniauthProvidersSamlRequiredGroups *string + + SmtpPassword *string + + SmtpUserName *string + + noSmithyDocumentSerde +} + +type RequestRules struct { + + // This member is required. + CidrIp CidrIpOfrulesForAuthorizeFirewallRules + + // This member is required. + Protocol ProtocolOfrulesForAuthorizeFirewallRules + + Description *string + + Port *int32 + + noSmithyDocumentSerde +} + +type Rules struct { + + CidrIp *string + + Description *string + + Id *string + + Port *int32 + + Protocol *string + + State *string + + noSmithyDocumentSerde +} + +type Status struct { + + Code *int32 + + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/devops/validators.go b/service/devops/validators.go new file mode 100644 index 0000000..eeda1c9 --- /dev/null +++ b/service/devops/validators.go @@ -0,0 +1,1065 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devops + +import ( + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithy "github.com/aws/smithy-go" + "github.com/nifcloud/nifcloud-sdk-go/service/devops/types" +) + +type validateOpAuthorizeFirewallRules struct { +} + +func (*validateOpAuthorizeFirewallRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAuthorizeFirewallRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AuthorizeFirewallRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAuthorizeFirewallRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateBackupRule struct { +} + +func (*validateOpCreateBackupRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateBackupRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateBackupRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateBackupRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateFirewallGroup struct { +} + +func (*validateOpCreateFirewallGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateFirewallGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateFirewallGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateFirewallGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateInstance struct { +} + +func (*validateOpCreateInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateParameterGroup struct { +} + +func (*validateOpCreateParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteBackup struct { +} + +func (*validateOpDeleteBackup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteBackup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteBackupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteBackupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteBackupRule struct { +} + +func (*validateOpDeleteBackupRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteBackupRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteBackupRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteBackupRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteFirewallGroup struct { +} + +func (*validateOpDeleteFirewallGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteFirewallGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteFirewallGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteFirewallGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteInstance struct { +} + +func (*validateOpDeleteInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteParameterGroup struct { +} + +func (*validateOpDeleteParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpExtendDisk struct { +} + +func (*validateOpExtendDisk) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpExtendDisk) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ExtendDiskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpExtendDiskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetBackup struct { +} + +func (*validateOpGetBackup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetBackup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetBackupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetBackupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetBackupRule struct { +} + +func (*validateOpGetBackupRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetBackupRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetBackupRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetBackupRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetFirewallGroup struct { +} + +func (*validateOpGetFirewallGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetFirewallGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetFirewallGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetFirewallGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetInstance struct { +} + +func (*validateOpGetInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetParameterGroup struct { +} + +func (*validateOpGetParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRebootInstance struct { +} + +func (*validateOpRebootInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRebootInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RebootInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRebootInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreInstance struct { +} + +func (*validateOpRestoreInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRevokeFirewallRules struct { +} + +func (*validateOpRevokeFirewallRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRevokeFirewallRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RevokeFirewallRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRevokeFirewallRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateBackupRule struct { +} + +func (*validateOpUpdateBackupRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateBackupRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateBackupRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateBackupRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateFirewallGroup struct { +} + +func (*validateOpUpdateFirewallGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateFirewallGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateFirewallGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateFirewallGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateInstance struct { +} + +func (*validateOpUpdateInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateNetworkInterface struct { +} + +func (*validateOpUpdateNetworkInterface) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateNetworkInterface) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateNetworkInterfaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateNetworkInterfaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateParameterGroup struct { +} + +func (*validateOpUpdateParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpgradeInstance struct { +} + +func (*validateOpUpgradeInstance) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpgradeInstance) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpgradeInstanceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpgradeInstanceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAuthorizeFirewallRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAuthorizeFirewallRules{}, middleware.After) +} + +func addOpCreateBackupRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateBackupRule{}, middleware.After) +} + +func addOpCreateFirewallGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateFirewallGroup{}, middleware.After) +} + +func addOpCreateInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateInstance{}, middleware.After) +} + +func addOpCreateParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateParameterGroup{}, middleware.After) +} + +func addOpDeleteBackupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteBackup{}, middleware.After) +} + +func addOpDeleteBackupRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteBackupRule{}, middleware.After) +} + +func addOpDeleteFirewallGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteFirewallGroup{}, middleware.After) +} + +func addOpDeleteInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteInstance{}, middleware.After) +} + +func addOpDeleteParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteParameterGroup{}, middleware.After) +} + +func addOpExtendDiskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpExtendDisk{}, middleware.After) +} + +func addOpGetBackupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetBackup{}, middleware.After) +} + +func addOpGetBackupRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetBackupRule{}, middleware.After) +} + +func addOpGetFirewallGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetFirewallGroup{}, middleware.After) +} + +func addOpGetInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetInstance{}, middleware.After) +} + +func addOpGetParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetParameterGroup{}, middleware.After) +} + +func addOpRebootInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRebootInstance{}, middleware.After) +} + +func addOpRestoreInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreInstance{}, middleware.After) +} + +func addOpRevokeFirewallRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRevokeFirewallRules{}, middleware.After) +} + +func addOpUpdateBackupRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateBackupRule{}, middleware.After) +} + +func addOpUpdateFirewallGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateFirewallGroup{}, middleware.After) +} + +func addOpUpdateInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateInstance{}, middleware.After) +} + +func addOpUpdateNetworkInterfaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateNetworkInterface{}, middleware.After) +} + +func addOpUpdateParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateParameterGroup{}, middleware.After) +} + +func addOpUpgradeInstanceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpgradeInstance{}, middleware.After) +} + +func validateListOfRequestRules(v []types.RequestRules) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOfRequestRules"} + for i := range v { + if err := validateRequestRules(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRequestRules(v *types.RequestRules) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequestRules"} + if len(v.CidrIp) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("CidrIp")) + } + if len(v.Protocol) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Protocol")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAuthorizeFirewallRulesInput(v *AuthorizeFirewallRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AuthorizeFirewallRulesInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if v.Rules == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rules")) + } else if v.Rules != nil { + if err := validateListOfRequestRules(v.Rules); err != nil { + invalidParams.AddNested("Rules", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateBackupRuleInput(v *CreateBackupRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateBackupRuleInput"} + if v.BackupRuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupRuleName")) + } + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateFirewallGroupInput(v *CreateFirewallGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateFirewallGroupInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateInstanceInput(v *CreateInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateInstanceInput"} + if v.DiskSize == nil { + invalidParams.Add(smithy.NewErrParamRequired("DiskSize")) + } + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if v.InitialRootPassword == nil { + invalidParams.Add(smithy.NewErrParamRequired("InitialRootPassword")) + } + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if len(v.InstanceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) + } + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateParameterGroupInput(v *CreateParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteBackupInput(v *DeleteBackupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteBackupInput"} + if v.BackupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteBackupRuleInput(v *DeleteBackupRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteBackupRuleInput"} + if v.BackupRuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupRuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteFirewallGroupInput(v *DeleteFirewallGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteFirewallGroupInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteInstanceInput(v *DeleteInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteInstanceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteParameterGroupInput(v *DeleteParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpExtendDiskInput(v *ExtendDiskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExtendDiskInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetBackupInput(v *GetBackupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetBackupInput"} + if v.BackupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetBackupRuleInput(v *GetBackupRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetBackupRuleInput"} + if v.BackupRuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupRuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetFirewallGroupInput(v *GetFirewallGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetFirewallGroupInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetInstanceInput(v *GetInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetInstanceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetParameterGroupInput(v *GetParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRebootInstanceInput(v *RebootInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RebootInstanceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreInstanceInput(v *RestoreInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreInstanceInput"} + if v.BackupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupId")) + } + if v.DiskSize == nil { + invalidParams.Add(smithy.NewErrParamRequired("DiskSize")) + } + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if len(v.InstanceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) + } + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRevokeFirewallRulesInput(v *RevokeFirewallRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RevokeFirewallRulesInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if v.Ids == nil { + invalidParams.Add(smithy.NewErrParamRequired("Ids")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateBackupRuleInput(v *UpdateBackupRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateBackupRuleInput"} + if v.BackupRuleName == nil { + invalidParams.Add(smithy.NewErrParamRequired("BackupRuleName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateFirewallGroupInput(v *UpdateFirewallGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateFirewallGroupInput"} + if v.FirewallGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FirewallGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateInstanceInput(v *UpdateInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateInstanceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateNetworkInterfaceInput(v *UpdateNetworkInterfaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateNetworkInterfaceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateParameterGroupInput(v *UpdateParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpgradeInstanceInput(v *UpgradeInstanceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpgradeInstanceInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/devopsrunner/api_client.go b/service/devopsrunner/api_client.go new file mode 100644 index 0000000..7a25866 --- /dev/null +++ b/service/devopsrunner/api_client.go @@ -0,0 +1,439 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + "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" + 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" + smithyhttp "github.com/aws/smithy-go/transport/http" + internalConfig "github.com/nifcloud/nifcloud-sdk-go/internal/configsources" + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "net" + "net/http" + "time" +) + +const ServiceID = "devopsrunner" +const ServiceAPIVersion = "v1" + +// Client provides the API client to make operations call for the API. +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) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +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 + + // 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. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // 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. 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. 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 +} + +// 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...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// 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 (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) + } + + finalizeRetryMaxAttemptOptions(&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 noSmithyDocumentSerde = smithydocument.NoSerde + +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 nifcloud.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, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(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 nifcloud.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg nifcloud.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg nifcloud.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(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 nifcloud.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "devopsrunner", nifcloud.SDKVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +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 addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg nifcloud.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 nifcloud.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +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) +} diff --git a/service/devopsrunner/api_client_test.go b/service/devopsrunner/api_client_test.go new file mode 100644 index 0000000..e0d3f95 --- /dev/null +++ b/service/devopsrunner/api_client_test.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "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(nifcloud.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, + }) + + 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/devopsrunner/api_op_CreateRunner.go b/service/devopsrunner/api_op_CreateRunner.go new file mode 100644 index 0000000..4f55d8a --- /dev/null +++ b/service/devopsrunner/api_op_CreateRunner.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) CreateRunner(ctx context.Context, params *CreateRunnerInput, optFns ...func(*Options)) (*CreateRunnerOutput, error) { + if params == nil { + params = &CreateRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRunner", params, optFns, c.addOperationCreateRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRunnerInput struct { + + // This member is required. + InstanceType types.InstanceTypeOfCreateRunnerRequest + + // This member is required. + RunnerName *string + + AvailabilityZone types.AvailabilityZoneOfCreateRunnerRequest + + Concurrent *int32 + + Description *string + + NetworkConfig *types.RequestNetworkConfig + + noSmithyDocumentSerde +} + +type CreateRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateRunner", + } +} diff --git a/service/devopsrunner/api_op_CreateRunnerParameterGroup.go b/service/devopsrunner/api_op_CreateRunnerParameterGroup.go new file mode 100644 index 0000000..634a2c8 --- /dev/null +++ b/service/devopsrunner/api_op_CreateRunnerParameterGroup.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) CreateRunnerParameterGroup(ctx context.Context, params *CreateRunnerParameterGroupInput, optFns ...func(*Options)) (*CreateRunnerParameterGroupOutput, error) { + if params == nil { + params = &CreateRunnerParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateRunnerParameterGroup", params, optFns, c.addOperationCreateRunnerParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateRunnerParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateRunnerParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + Description *string + + noSmithyDocumentSerde +} + +type CreateRunnerParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateRunnerParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateRunnerParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateRunnerParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opCreateRunnerParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "CreateRunnerParameterGroup", + } +} diff --git a/service/devopsrunner/api_op_DeleteRunner.go b/service/devopsrunner/api_op_DeleteRunner.go new file mode 100644 index 0000000..ce8f0b8 --- /dev/null +++ b/service/devopsrunner/api_op_DeleteRunner.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) DeleteRunner(ctx context.Context, params *DeleteRunnerInput, optFns ...func(*Options)) (*DeleteRunnerOutput, error) { + if params == nil { + params = &DeleteRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRunner", params, optFns, c.addOperationDeleteRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRunnerInput struct { + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type DeleteRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteRunner", + } +} diff --git a/service/devopsrunner/api_op_DeleteRunnerParameterGroup.go b/service/devopsrunner/api_op_DeleteRunnerParameterGroup.go new file mode 100644 index 0000000..89248e2 --- /dev/null +++ b/service/devopsrunner/api_op_DeleteRunnerParameterGroup.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteRunnerParameterGroup(ctx context.Context, params *DeleteRunnerParameterGroupInput, optFns ...func(*Options)) (*DeleteRunnerParameterGroupOutput, error) { + if params == nil { + params = &DeleteRunnerParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRunnerParameterGroup", params, optFns, c.addOperationDeleteRunnerParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRunnerParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRunnerParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + noSmithyDocumentSerde +} + +type DeleteRunnerParameterGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteRunnerParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRunnerParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRunnerParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteRunnerParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "DeleteRunnerParameterGroup", + } +} diff --git a/service/devopsrunner/api_op_GetRunner.go b/service/devopsrunner/api_op_GetRunner.go new file mode 100644 index 0000000..33c5885 --- /dev/null +++ b/service/devopsrunner/api_op_GetRunner.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) GetRunner(ctx context.Context, params *GetRunnerInput, optFns ...func(*Options)) (*GetRunnerOutput, error) { + if params == nil { + params = &GetRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRunner", params, optFns, c.addOperationGetRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRunnerInput struct { + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type GetRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetRunner", + } +} diff --git a/service/devopsrunner/api_op_GetRunnerParameterGroup.go b/service/devopsrunner/api_op_GetRunnerParameterGroup.go new file mode 100644 index 0000000..882c54f --- /dev/null +++ b/service/devopsrunner/api_op_GetRunnerParameterGroup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) GetRunnerParameterGroup(ctx context.Context, params *GetRunnerParameterGroupInput, optFns ...func(*Options)) (*GetRunnerParameterGroupOutput, error) { + if params == nil { + params = &GetRunnerParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRunnerParameterGroup", params, optFns, c.addOperationGetRunnerParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRunnerParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRunnerParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + noSmithyDocumentSerde +} + +type GetRunnerParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRunnerParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetRunnerParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRunnerParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opGetRunnerParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "GetRunnerParameterGroup", + } +} diff --git a/service/devopsrunner/api_op_ListRunnerParameterGroups.go b/service/devopsrunner/api_op_ListRunnerParameterGroups.go new file mode 100644 index 0000000..9bf2647 --- /dev/null +++ b/service/devopsrunner/api_op_ListRunnerParameterGroups.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) ListRunnerParameterGroups(ctx context.Context, params *ListRunnerParameterGroupsInput, optFns ...func(*Options)) (*ListRunnerParameterGroupsOutput, error) { + if params == nil { + params = &ListRunnerParameterGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRunnerParameterGroups", params, optFns, c.addOperationListRunnerParameterGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRunnerParameterGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRunnerParameterGroupsInput struct { + noSmithyDocumentSerde +} + +type ListRunnerParameterGroupsOutput struct { + ParameterGroups []types.ParameterGroups + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRunnerParameterGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRunnerParameterGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRunnerParameterGroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRunnerParameterGroups(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListRunnerParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListRunnerParameterGroups", + } +} diff --git a/service/devopsrunner/api_op_ListRunnerRegistrations.go b/service/devopsrunner/api_op_ListRunnerRegistrations.go new file mode 100644 index 0000000..1801a7e --- /dev/null +++ b/service/devopsrunner/api_op_ListRunnerRegistrations.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) ListRunnerRegistrations(ctx context.Context, params *ListRunnerRegistrationsInput, optFns ...func(*Options)) (*ListRunnerRegistrationsOutput, error) { + if params == nil { + params = &ListRunnerRegistrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRunnerRegistrations", params, optFns, c.addOperationListRunnerRegistrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRunnerRegistrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRunnerRegistrationsInput struct { + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type ListRunnerRegistrationsOutput struct { + Registrations []types.Registrations + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRunnerRegistrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRunnerRegistrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRunnerRegistrations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListRunnerRegistrationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRunnerRegistrations(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListRunnerRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListRunnerRegistrations", + } +} diff --git a/service/devopsrunner/api_op_ListRunners.go b/service/devopsrunner/api_op_ListRunners.go new file mode 100644 index 0000000..e294a3d --- /dev/null +++ b/service/devopsrunner/api_op_ListRunners.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) ListRunners(ctx context.Context, params *ListRunnersInput, optFns ...func(*Options)) (*ListRunnersOutput, error) { + if params == nil { + params = &ListRunnersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRunners", params, optFns, c.addOperationListRunnersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRunnersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRunnersInput struct { + noSmithyDocumentSerde +} + +type ListRunnersOutput struct { + Runners []types.Runners + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRunnersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRunners{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRunners{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRunners(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opListRunners(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ListRunners", + } +} diff --git a/service/devopsrunner/api_op_ModifyRunnerInstanceType.go b/service/devopsrunner/api_op_ModifyRunnerInstanceType.go new file mode 100644 index 0000000..b6fb2ff --- /dev/null +++ b/service/devopsrunner/api_op_ModifyRunnerInstanceType.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) ModifyRunnerInstanceType(ctx context.Context, params *ModifyRunnerInstanceTypeInput, optFns ...func(*Options)) (*ModifyRunnerInstanceTypeOutput, error) { + if params == nil { + params = &ModifyRunnerInstanceTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ModifyRunnerInstanceType", params, optFns, c.addOperationModifyRunnerInstanceTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ModifyRunnerInstanceTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ModifyRunnerInstanceTypeInput struct { + + // This member is required. + InstanceType types.InstanceTypeOfModifyRunnerInstanceTypeRequest + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type ModifyRunnerInstanceTypeOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationModifyRunnerInstanceTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpModifyRunnerInstanceType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpModifyRunnerInstanceType{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpModifyRunnerInstanceTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opModifyRunnerInstanceType(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opModifyRunnerInstanceType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "ModifyRunnerInstanceType", + } +} diff --git a/service/devopsrunner/api_op_RegisterRunner.go b/service/devopsrunner/api_op_RegisterRunner.go new file mode 100644 index 0000000..2b5f796 --- /dev/null +++ b/service/devopsrunner/api_op_RegisterRunner.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) RegisterRunner(ctx context.Context, params *RegisterRunnerInput, optFns ...func(*Options)) (*RegisterRunnerOutput, error) { + if params == nil { + params = &RegisterRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterRunner", params, optFns, c.addOperationRegisterRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterRunnerInput struct { + + // This member is required. + GitlabUrl *string + + // This member is required. + RunnerName *string + + AccessLevel types.AccessLevelOfRegisterRunnerRequest + + AuthenticationToken *string + + DefaultDockerImage *string + + ExtraHosts []types.RequestExtraHosts + + Locked *bool + + MaximumTimeout *int32 + + ParameterGroupName *string + + Paused *bool + + Privileged *bool + + RegistrationToken *string + + RunUntagged *bool + + Tags []string + + noSmithyDocumentSerde +} + +type RegisterRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRegisterRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "RegisterRunner", + } +} diff --git a/service/devopsrunner/api_op_UnregisterRunner.go b/service/devopsrunner/api_op_UnregisterRunner.go new file mode 100644 index 0000000..b7b1bea --- /dev/null +++ b/service/devopsrunner/api_op_UnregisterRunner.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) UnregisterRunner(ctx context.Context, params *UnregisterRunnerInput, optFns ...func(*Options)) (*UnregisterRunnerOutput, error) { + if params == nil { + params = &UnregisterRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UnregisterRunner", params, optFns, c.addOperationUnregisterRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UnregisterRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UnregisterRunnerInput struct { + + // This member is required. + RegistrationId *string + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type UnregisterRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUnregisterRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUnregisterRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUnregisterRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUnregisterRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnregisterRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUnregisterRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UnregisterRunner", + } +} diff --git a/service/devopsrunner/api_op_UpdateRunner.go b/service/devopsrunner/api_op_UpdateRunner.go new file mode 100644 index 0000000..bac1d40 --- /dev/null +++ b/service/devopsrunner/api_op_UpdateRunner.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) UpdateRunner(ctx context.Context, params *UpdateRunnerInput, optFns ...func(*Options)) (*UpdateRunnerOutput, error) { + if params == nil { + params = &UpdateRunnerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRunner", params, optFns, c.addOperationUpdateRunnerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRunnerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRunnerInput struct { + + // This member is required. + RunnerName *string + + ChangedRunnerName *string + + Concurrent *int32 + + Description *string + + noSmithyDocumentSerde +} + +type UpdateRunnerOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRunnerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRunner{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRunner{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRunnerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRunner(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRunner(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateRunner", + } +} diff --git a/service/devopsrunner/api_op_UpdateRunnerParameter.go b/service/devopsrunner/api_op_UpdateRunnerParameter.go new file mode 100644 index 0000000..0a8abdb --- /dev/null +++ b/service/devopsrunner/api_op_UpdateRunnerParameter.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) UpdateRunnerParameter(ctx context.Context, params *UpdateRunnerParameterInput, optFns ...func(*Options)) (*UpdateRunnerParameterOutput, error) { + if params == nil { + params = &UpdateRunnerParameterInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRunnerParameter", params, optFns, c.addOperationUpdateRunnerParameterMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRunnerParameterOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRunnerParameterInput struct { + + // This member is required. + ParameterGroupName *string + + DockerParameters *types.RequestDockerParameters + + noSmithyDocumentSerde +} + +type UpdateRunnerParameterOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRunnerParameterMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRunnerParameter{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRunnerParameter{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRunnerParameterValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRunnerParameter(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRunnerParameter(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateRunnerParameter", + } +} diff --git a/service/devopsrunner/api_op_UpdateRunnerParameterGroup.go b/service/devopsrunner/api_op_UpdateRunnerParameterGroup.go new file mode 100644 index 0000000..9ad278f --- /dev/null +++ b/service/devopsrunner/api_op_UpdateRunnerParameterGroup.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) UpdateRunnerParameterGroup(ctx context.Context, params *UpdateRunnerParameterGroupInput, optFns ...func(*Options)) (*UpdateRunnerParameterGroupOutput, error) { + if params == nil { + params = &UpdateRunnerParameterGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRunnerParameterGroup", params, optFns, c.addOperationUpdateRunnerParameterGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRunnerParameterGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRunnerParameterGroupInput struct { + + // This member is required. + ParameterGroupName *string + + ChangedParameterGroupName *string + + Description *string + + noSmithyDocumentSerde +} + +type UpdateRunnerParameterGroupOutput struct { + ParameterGroup *types.ParameterGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRunnerParameterGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRunnerParameterGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRunnerParameterGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRunnerParameterGroup(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRunnerParameterGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateRunnerParameterGroup", + } +} diff --git a/service/devopsrunner/api_op_UpdateRunnerRegistration.go b/service/devopsrunner/api_op_UpdateRunnerRegistration.go new file mode 100644 index 0000000..04c4cba --- /dev/null +++ b/service/devopsrunner/api_op_UpdateRunnerRegistration.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +func (c *Client) UpdateRunnerRegistration(ctx context.Context, params *UpdateRunnerRegistrationInput, optFns ...func(*Options)) (*UpdateRunnerRegistrationOutput, error) { + if params == nil { + params = &UpdateRunnerRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateRunnerRegistration", params, optFns, c.addOperationUpdateRunnerRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateRunnerRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateRunnerRegistrationInput struct { + + // This member is required. + ParameterGroupName *string + + // This member is required. + RegistrationId *string + + // This member is required. + RunnerName *string + + noSmithyDocumentSerde +} + +type UpdateRunnerRegistrationOutput struct { + Runner *types.Runner + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateRunnerRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateRunnerRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateRunnerRegistration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateRunnerRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateRunnerRegistration(options.Region), middleware.Before); 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 + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateRunnerRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "devops", + OperationName: "UpdateRunnerRegistration", + } +} diff --git a/service/devopsrunner/deserializers.go b/service/devopsrunner/deserializers.go new file mode 100644 index 0000000..b133d02 --- /dev/null +++ b/service/devopsrunner/deserializers.go @@ -0,0 +1,3228 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + 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" + smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" + "io" + "io/ioutil" +) + +type awsRestjson1_deserializeOpCreateRunner struct { +} + +func (*awsRestjson1_deserializeOpCreateRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateRunner) 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_deserializeOpErrorCreateRunner(response, &metadata) + } + output := &CreateRunnerOutput{} + 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_deserializeOpDocumentCreateRunnerOutput(&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_deserializeOpErrorCreateRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateRunnerOutput(v **CreateRunnerOutput, 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 *CreateRunnerOutput + if *v == nil { + sv = &CreateRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateRunnerParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateRunnerParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateRunnerParameterGroup) 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_deserializeOpErrorCreateRunnerParameterGroup(response, &metadata) + } + output := &CreateRunnerParameterGroupOutput{} + 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_deserializeOpDocumentCreateRunnerParameterGroupOutput(&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_deserializeOpErrorCreateRunnerParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateRunnerParameterGroupOutput(v **CreateRunnerParameterGroupOutput, 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 *CreateRunnerParameterGroupOutput + if *v == nil { + sv = &CreateRunnerParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteRunner struct { +} + +func (*awsRestjson1_deserializeOpDeleteRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteRunner) 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_deserializeOpErrorDeleteRunner(response, &metadata) + } + output := &DeleteRunnerOutput{} + 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_deserializeOpDocumentDeleteRunnerOutput(&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_deserializeOpErrorDeleteRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteRunnerOutput(v **DeleteRunnerOutput, 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 *DeleteRunnerOutput + if *v == nil { + sv = &DeleteRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteRunnerParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteRunnerParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteRunnerParameterGroup) 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_deserializeOpErrorDeleteRunnerParameterGroup(response, &metadata) + } + output := &DeleteRunnerParameterGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteRunnerParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetRunner struct { +} + +func (*awsRestjson1_deserializeOpGetRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRunner) 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_deserializeOpErrorGetRunner(response, &metadata) + } + output := &GetRunnerOutput{} + 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_deserializeOpDocumentGetRunnerOutput(&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_deserializeOpErrorGetRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetRunnerOutput(v **GetRunnerOutput, 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 *GetRunnerOutput + if *v == nil { + sv = &GetRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetRunnerParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpGetRunnerParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetRunnerParameterGroup) 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_deserializeOpErrorGetRunnerParameterGroup(response, &metadata) + } + output := &GetRunnerParameterGroupOutput{} + 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_deserializeOpDocumentGetRunnerParameterGroupOutput(&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_deserializeOpErrorGetRunnerParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetRunnerParameterGroupOutput(v **GetRunnerParameterGroupOutput, 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 *GetRunnerParameterGroupOutput + if *v == nil { + sv = &GetRunnerParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRunnerParameterGroups struct { +} + +func (*awsRestjson1_deserializeOpListRunnerParameterGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRunnerParameterGroups) 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_deserializeOpErrorListRunnerParameterGroups(response, &metadata) + } + output := &ListRunnerParameterGroupsOutput{} + 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_deserializeOpDocumentListRunnerParameterGroupsOutput(&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_deserializeOpErrorListRunnerParameterGroups(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRunnerParameterGroupsOutput(v **ListRunnerParameterGroupsOutput, 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 *ListRunnerParameterGroupsOutput + if *v == nil { + sv = &ListRunnerParameterGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroups": + if err := awsRestjson1_deserializeDocumentListOfParameterGroups(&sv.ParameterGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRunnerRegistrations struct { +} + +func (*awsRestjson1_deserializeOpListRunnerRegistrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRunnerRegistrations) 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_deserializeOpErrorListRunnerRegistrations(response, &metadata) + } + output := &ListRunnerRegistrationsOutput{} + 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_deserializeOpDocumentListRunnerRegistrationsOutput(&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_deserializeOpErrorListRunnerRegistrations(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRunnerRegistrationsOutput(v **ListRunnerRegistrationsOutput, 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 *ListRunnerRegistrationsOutput + if *v == nil { + sv = &ListRunnerRegistrationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "registrations": + if err := awsRestjson1_deserializeDocumentListOfRegistrations(&sv.Registrations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListRunners struct { +} + +func (*awsRestjson1_deserializeOpListRunners) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListRunners) 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_deserializeOpErrorListRunners(response, &metadata) + } + output := &ListRunnersOutput{} + 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_deserializeOpDocumentListRunnersOutput(&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_deserializeOpErrorListRunners(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListRunnersOutput(v **ListRunnersOutput, 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 *ListRunnersOutput + if *v == nil { + sv = &ListRunnersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runners": + if err := awsRestjson1_deserializeDocumentListOfRunners(&sv.Runners, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpModifyRunnerInstanceType struct { +} + +func (*awsRestjson1_deserializeOpModifyRunnerInstanceType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpModifyRunnerInstanceType) 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_deserializeOpErrorModifyRunnerInstanceType(response, &metadata) + } + output := &ModifyRunnerInstanceTypeOutput{} + 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_deserializeOpDocumentModifyRunnerInstanceTypeOutput(&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_deserializeOpErrorModifyRunnerInstanceType(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentModifyRunnerInstanceTypeOutput(v **ModifyRunnerInstanceTypeOutput, 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 *ModifyRunnerInstanceTypeOutput + if *v == nil { + sv = &ModifyRunnerInstanceTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRegisterRunner struct { +} + +func (*awsRestjson1_deserializeOpRegisterRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterRunner) 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_deserializeOpErrorRegisterRunner(response, &metadata) + } + output := &RegisterRunnerOutput{} + 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_deserializeOpDocumentRegisterRunnerOutput(&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_deserializeOpErrorRegisterRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRegisterRunnerOutput(v **RegisterRunnerOutput, 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 *RegisterRunnerOutput + if *v == nil { + sv = &RegisterRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUnregisterRunner struct { +} + +func (*awsRestjson1_deserializeOpUnregisterRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUnregisterRunner) 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_deserializeOpErrorUnregisterRunner(response, &metadata) + } + output := &UnregisterRunnerOutput{} + 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_deserializeOpDocumentUnregisterRunnerOutput(&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_deserializeOpErrorUnregisterRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUnregisterRunnerOutput(v **UnregisterRunnerOutput, 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 *UnregisterRunnerOutput + if *v == nil { + sv = &UnregisterRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateRunner struct { +} + +func (*awsRestjson1_deserializeOpUpdateRunner) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRunner) 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_deserializeOpErrorUpdateRunner(response, &metadata) + } + output := &UpdateRunnerOutput{} + 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_deserializeOpDocumentUpdateRunnerOutput(&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_deserializeOpErrorUpdateRunner(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateRunnerOutput(v **UpdateRunnerOutput, 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 *UpdateRunnerOutput + if *v == nil { + sv = &UpdateRunnerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateRunnerParameter struct { +} + +func (*awsRestjson1_deserializeOpUpdateRunnerParameter) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRunnerParameter) 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_deserializeOpErrorUpdateRunnerParameter(response, &metadata) + } + output := &UpdateRunnerParameterOutput{} + 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_deserializeOpDocumentUpdateRunnerParameterOutput(&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_deserializeOpErrorUpdateRunnerParameter(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateRunnerParameterOutput(v **UpdateRunnerParameterOutput, 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 *UpdateRunnerParameterOutput + if *v == nil { + sv = &UpdateRunnerParameterOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateRunnerParameterGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateRunnerParameterGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRunnerParameterGroup) 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_deserializeOpErrorUpdateRunnerParameterGroup(response, &metadata) + } + output := &UpdateRunnerParameterGroupOutput{} + 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_deserializeOpDocumentUpdateRunnerParameterGroupOutput(&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_deserializeOpErrorUpdateRunnerParameterGroup(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateRunnerParameterGroupOutput(v **UpdateRunnerParameterGroupOutput, 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 *UpdateRunnerParameterGroupOutput + if *v == nil { + sv = &UpdateRunnerParameterGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterGroup": + if err := awsRestjson1_deserializeDocumentParameterGroup(&sv.ParameterGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateRunnerRegistration struct { +} + +func (*awsRestjson1_deserializeOpUpdateRunnerRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateRunnerRegistration) 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_deserializeOpErrorUpdateRunnerRegistration(response, &metadata) + } + output := &UpdateRunnerRegistrationOutput{} + 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_deserializeOpDocumentUpdateRunnerRegistrationOutput(&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_deserializeOpErrorUpdateRunnerRegistration(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, 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(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateRunnerRegistrationOutput(v **UpdateRunnerRegistrationOutput, 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 *UpdateRunnerRegistrationOutput + if *v == nil { + sv = &UpdateRunnerRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "runner": + if err := awsRestjson1_deserializeDocumentRunner(&sv.Runner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDockerParameters(v **types.DockerParameters, 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.DockerParameters + if *v == nil { + sv = &types.DockerParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "disableCache": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DisableCache = ptr.Bool(jtv) + } + + case "disableEntrypointOverwrite": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DisableEntrypointOverwrite = ptr.Bool(jtv) + } + + case "extraHosts": + if err := awsRestjson1_deserializeDocumentListOfExtraHosts(&sv.ExtraHosts, value); err != nil { + return err + } + + case "image": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Image = ptr.String(jtv) + } + + case "oomKillDisable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.OomKillDisable = ptr.Bool(jtv) + } + + case "privileged": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Privileged = ptr.Bool(jtv) + } + + case "shmSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ShmSize = ptr.Int32(int32(i64)) + } + + case "tlsVerify": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.TlsVerify = ptr.Bool(jtv) + } + + case "volumes": + if err := awsRestjson1_deserializeDocumentListOfVolumes(&sv.Volumes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentExtraHosts(v **types.ExtraHosts, 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.ExtraHosts + if *v == nil { + sv = &types.ExtraHosts{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "hostName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HostName = ptr.String(jtv) + } + + case "ipAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListOfExtraHosts(v *[]types.ExtraHosts, 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.ExtraHosts + if *v == nil { + cv = []types.ExtraHosts{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ExtraHosts + destAddr := &col + if err := awsRestjson1_deserializeDocumentExtraHosts(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfParameterGroups(v *[]types.ParameterGroups, 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.ParameterGroups + if *v == nil { + cv = []types.ParameterGroups{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ParameterGroups + destAddr := &col + if err := awsRestjson1_deserializeDocumentParameterGroups(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfRegistrations(v *[]types.Registrations, 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.Registrations + if *v == nil { + cv = []types.Registrations{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Registrations + destAddr := &col + if err := awsRestjson1_deserializeDocumentRegistrations(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfRunnerNames(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfRunners(v *[]types.Runners, 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.Runners + if *v == nil { + cv = []types.Runners{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Runners + destAddr := &col + if err := awsRestjson1_deserializeDocumentRunners(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentListOfVolumes(v *[]string, 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 []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNetworkConfig(v **types.NetworkConfig, 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.NetworkConfig + if *v == nil { + sv = &types.NetworkConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NetworkId = ptr.String(jtv) + } + + case "privateAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrivateAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterGroup(v **types.ParameterGroup, 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.ParameterGroup + if *v == nil { + sv = &types.ParameterGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "dockerParameters": + if err := awsRestjson1_deserializeDocumentDockerParameters(&sv.DockerParameters, value); err != nil { + return err + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "runnerNames": + if err := awsRestjson1_deserializeDocumentListOfRunnerNames(&sv.RunnerNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParameterGroups(v **types.ParameterGroups, 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.ParameterGroups + if *v == nil { + sv = &types.ParameterGroups{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "dockerParameters": + if err := awsRestjson1_deserializeDocumentDockerParameters(&sv.DockerParameters, value); err != nil { + return err + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "runnerNames": + if err := awsRestjson1_deserializeDocumentListOfRunnerNames(&sv.RunnerNames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRegistrations(v **types.Registrations, 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.Registrations + if *v == nil { + sv = &types.Registrations{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "gitlabUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.GitlabUrl = ptr.String(jtv) + } + + case "parameterGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ParameterGroupName = ptr.String(jtv) + } + + case "registrationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RegistrationId = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "token": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Token = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRunner(v **types.Runner, 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.Runner + if *v == nil { + sv = &types.Runner{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "concurrent": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Concurrent = ptr.Int32(int32(i64)) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "networkConfig": + if err := awsRestjson1_deserializeDocumentNetworkConfig(&sv.NetworkConfig, value); err != nil { + return err + } + + case "publicIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PublicIpAddress = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "runnerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RunnerName = ptr.String(jtv) + } + + case "runnerVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RunnerVersion = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "systemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SystemId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRunners(v **types.Runners, 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.Runners + if *v == nil { + sv = &types.Runners{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "concurrent": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Concurrent = ptr.Int32(int32(i64)) + } + + case "createTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CreateTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "instanceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.InstanceType = ptr.String(jtv) + } + + case "networkConfig": + if err := awsRestjson1_deserializeDocumentNetworkConfig(&sv.NetworkConfig, value); err != nil { + return err + } + + case "publicIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PublicIpAddress = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "runnerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RunnerName = ptr.String(jtv) + } + + case "runnerVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RunnerVersion = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentStatus(&sv.Status, value); err != nil { + return err + } + + case "systemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SystemId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStatus(v **types.Status, 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.Status + if *v == nil { + sv = &types.Status{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Code = ptr.Int32(int32(i64)) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/devopsrunner/doc.go b/service/devopsrunner/doc.go new file mode 100644 index 0000000..17e83e3 --- /dev/null +++ b/service/devopsrunner/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package devopsrunner provides the API client, operations, and parameter types +// for the API. +// +package devopsrunner + + diff --git a/service/devopsrunner/endpoints.go b/service/devopsrunner/endpoints.go new file mode 100644 index 0000000..9a64447 --- /dev/null +++ b/service/devopsrunner/endpoints.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + internalendpoints "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/internal/endpoints" + "net/url" + "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) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// 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, +) { + 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 { + 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 = "devops-runner" + } + 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 + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(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 EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +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 + } + } + +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { +} + +// 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, +) { + return endpoint, fmt.Errorf("no endpoint rules defined") +} diff --git a/service/devopsrunner/endpoints_test.go b/service/devopsrunner/endpoints_test.go new file mode 100644 index 0000000..00b3235 --- /dev/null +++ b/service/devopsrunner/endpoints_test.go @@ -0,0 +1,6 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devopsrunner + + diff --git a/service/devopsrunner/generated.json b/service/devopsrunner/generated.json new file mode 100644 index 0000000..ef7e948 --- /dev/null +++ b/service/devopsrunner/generated.json @@ -0,0 +1,43 @@ +{ + "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_CreateRunner.go", + "api_op_CreateRunnerParameterGroup.go", + "api_op_DeleteRunner.go", + "api_op_DeleteRunnerParameterGroup.go", + "api_op_GetRunner.go", + "api_op_GetRunnerParameterGroup.go", + "api_op_ListRunnerParameterGroups.go", + "api_op_ListRunnerRegistrations.go", + "api_op_ListRunners.go", + "api_op_ModifyRunnerInstanceType.go", + "api_op_RegisterRunner.go", + "api_op_UnregisterRunner.go", + "api_op_UpdateRunner.go", + "api_op_UpdateRunnerParameter.go", + "api_op_UpdateRunnerParameterGroup.go", + "api_op_UpdateRunnerRegistration.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner", + "unstable": false +} diff --git a/service/devopsrunner/internal/endpoints/endpoints.go b/service/devopsrunner/internal/endpoints/endpoints.go new file mode 100644 index 0000000..579fd6b --- /dev/null +++ b/service/devopsrunner/internal/endpoints/endpoints.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/logging" + endpoints "github.com/nifcloud/nifcloud-sdk-go/internal/endpoints/v2" + "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 devopsrunner 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 { + Nifcloud *regexp.Regexp +}{ + + Nifcloud: regexp.MustCompile("^(us|jp)\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "nifcloud", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + endpoints.DefaultKey{ + Variant: 0, + }: { + Hostname: "{region}.runner.devops.api.nifcloud.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4", "v3", "v2"}, + }, + }, + RegionRegex: partitionRegexp.Nifcloud, + IsRegionalized: true, + }, +} diff --git a/service/devopsrunner/internal/endpoints/endpoints_test.go b/service/devopsrunner/internal/endpoints/endpoints_test.go new file mode 100644 index 0000000..5fb0ff1 --- /dev/null +++ b/service/devopsrunner/internal/endpoints/endpoints_test.go @@ -0,0 +1,12 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/devopsrunner/protocol_test.go b/service/devopsrunner/protocol_test.go new file mode 100644 index 0000000..00b3235 --- /dev/null +++ b/service/devopsrunner/protocol_test.go @@ -0,0 +1,6 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devopsrunner + + diff --git a/service/devopsrunner/serializers.go b/service/devopsrunner/serializers.go new file mode 100644 index 0000000..c2d4cfb --- /dev/null +++ b/service/devopsrunner/serializers.go @@ -0,0 +1,1443 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package devopsrunner + +import ( + "bytes" + "context" + "fmt" + 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" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner/types" +) + +type awsRestjson1_serializeOpCreateRunner struct { +} + +func (*awsRestjson1_serializeOpCreateRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateRunner) 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.(*CreateRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners") + 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_serializeOpDocumentCreateRunnerInput(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_serializeOpHttpBindingsCreateRunnerInput(v *CreateRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateRunnerInput(v *CreateRunnerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AvailabilityZone) > 0 { + ok := object.Key("availabilityZone") + ok.String(string(v.AvailabilityZone)) + } + + if v.Concurrent != nil { + ok := object.Key("concurrent") + ok.Integer(*v.Concurrent) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + if v.NetworkConfig != nil { + ok := object.Key("networkConfig") + if err := awsRestjson1_serializeDocumentRequestNetworkConfig(v.NetworkConfig, ok); err != nil { + return err + } + } + + if v.RunnerName != nil { + ok := object.Key("runnerName") + ok.String(*v.RunnerName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateRunnerParameterGroup struct { +} + +func (*awsRestjson1_serializeOpCreateRunnerParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateRunnerParameterGroup) 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.(*CreateRunnerParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups") + 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_serializeOpDocumentCreateRunnerParameterGroupInput(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_serializeOpHttpBindingsCreateRunnerParameterGroupInput(v *CreateRunnerParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateRunnerParameterGroupInput(v *CreateRunnerParameterGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteRunner struct { +} + +func (*awsRestjson1_serializeOpDeleteRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteRunner) 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.(*DeleteRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteRunnerInput(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_serializeOpHttpBindingsDeleteRunnerInput(v *DeleteRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteRunnerParameterGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteRunnerParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteRunnerParameterGroup) 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.(*DeleteRunnerParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteRunnerParameterGroupInput(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_serializeOpHttpBindingsDeleteRunnerParameterGroupInput(v *DeleteRunnerParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetRunner struct { +} + +func (*awsRestjson1_serializeOpGetRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRunner) 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.(*GetRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}") + 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_serializeOpHttpBindingsGetRunnerInput(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_serializeOpHttpBindingsGetRunnerInput(v *GetRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetRunnerParameterGroup struct { +} + +func (*awsRestjson1_serializeOpGetRunnerParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRunnerParameterGroup) 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.(*GetRunnerParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + 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_serializeOpHttpBindingsGetRunnerParameterGroupInput(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_serializeOpHttpBindingsGetRunnerParameterGroupInput(v *GetRunnerParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListRunnerParameterGroups struct { +} + +func (*awsRestjson1_serializeOpListRunnerParameterGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRunnerParameterGroups) 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.(*ListRunnerParameterGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups") + 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 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_serializeOpHttpBindingsListRunnerParameterGroupsInput(v *ListRunnerParameterGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListRunnerRegistrations struct { +} + +func (*awsRestjson1_serializeOpListRunnerRegistrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRunnerRegistrations) 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.(*ListRunnerRegistrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}/registrations") + 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_serializeOpHttpBindingsListRunnerRegistrationsInput(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_serializeOpHttpBindingsListRunnerRegistrationsInput(v *ListRunnerRegistrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListRunners struct { +} + +func (*awsRestjson1_serializeOpListRunners) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRunners) 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.(*ListRunnersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners") + 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 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_serializeOpHttpBindingsListRunnersInput(v *ListRunnersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpModifyRunnerInstanceType struct { +} + +func (*awsRestjson1_serializeOpModifyRunnerInstanceType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpModifyRunnerInstanceType) 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.(*ModifyRunnerInstanceTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}:modifyInstanceType") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsModifyRunnerInstanceTypeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentModifyRunnerInstanceTypeInput(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_serializeOpHttpBindingsModifyRunnerInstanceTypeInput(v *ModifyRunnerInstanceTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentModifyRunnerInstanceTypeInput(v *ModifyRunnerInstanceTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.InstanceType) > 0 { + ok := object.Key("instanceType") + ok.String(string(v.InstanceType)) + } + + return nil +} + +type awsRestjson1_serializeOpRegisterRunner struct { +} + +func (*awsRestjson1_serializeOpRegisterRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterRunner) 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.(*RegisterRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}/registrations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRegisterRunnerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterRunnerInput(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_serializeOpHttpBindingsRegisterRunnerInput(v *RegisterRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterRunnerInput(v *RegisterRunnerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AccessLevel) > 0 { + ok := object.Key("accessLevel") + ok.String(string(v.AccessLevel)) + } + + if v.AuthenticationToken != nil { + ok := object.Key("authenticationToken") + ok.String(*v.AuthenticationToken) + } + + if v.DefaultDockerImage != nil { + ok := object.Key("defaultDockerImage") + ok.String(*v.DefaultDockerImage) + } + + if v.ExtraHosts != nil { + ok := object.Key("extraHosts") + if err := awsRestjson1_serializeDocumentListOfRequestExtraHosts(v.ExtraHosts, ok); err != nil { + return err + } + } + + if v.GitlabUrl != nil { + ok := object.Key("gitlabUrl") + ok.String(*v.GitlabUrl) + } + + if v.Locked != nil { + ok := object.Key("locked") + ok.Boolean(*v.Locked) + } + + if v.MaximumTimeout != nil { + ok := object.Key("maximumTimeout") + ok.Integer(*v.MaximumTimeout) + } + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + if v.Paused != nil { + ok := object.Key("paused") + ok.Boolean(*v.Paused) + } + + if v.Privileged != nil { + ok := object.Key("privileged") + ok.Boolean(*v.Privileged) + } + + if v.RegistrationToken != nil { + ok := object.Key("registrationToken") + ok.String(*v.RegistrationToken) + } + + if v.RunUntagged != nil { + ok := object.Key("runUntagged") + ok.Boolean(*v.RunUntagged) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentListOfRequestTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUnregisterRunner struct { +} + +func (*awsRestjson1_serializeOpUnregisterRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUnregisterRunner) 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.(*UnregisterRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}/registrations/{RegistrationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUnregisterRunnerInput(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_serializeOpHttpBindingsUnregisterRunnerInput(v *UnregisterRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RegistrationId == nil || len(*v.RegistrationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RegistrationId must not be empty")} + } + if v.RegistrationId != nil { + if err := encoder.SetURI("RegistrationId").String(*v.RegistrationId); err != nil { + return err + } + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRunner struct { +} + +func (*awsRestjson1_serializeOpUpdateRunner) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRunner) 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.(*UpdateRunnerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRunnerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRunnerInput(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_serializeOpHttpBindingsUpdateRunnerInput(v *UpdateRunnerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRunnerInput(v *UpdateRunnerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangedRunnerName != nil { + ok := object.Key("changedRunnerName") + ok.String(*v.ChangedRunnerName) + } + + if v.Concurrent != nil { + ok := object.Key("concurrent") + ok.Integer(*v.Concurrent) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRunnerParameter struct { +} + +func (*awsRestjson1_serializeOpUpdateRunnerParameter) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRunnerParameter) 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.(*UpdateRunnerParameterInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}:updateParameter") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRunnerParameterInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRunnerParameterInput(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_serializeOpHttpBindingsUpdateRunnerParameterInput(v *UpdateRunnerParameterInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRunnerParameterInput(v *UpdateRunnerParameterInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DockerParameters != nil { + ok := object.Key("dockerParameters") + if err := awsRestjson1_serializeDocumentRequestDockerParameters(v.DockerParameters, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRunnerParameterGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateRunnerParameterGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRunnerParameterGroup) 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.(*UpdateRunnerParameterGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/parameterGroups/{ParameterGroupName}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRunnerParameterGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRunnerParameterGroupInput(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_serializeOpHttpBindingsUpdateRunnerParameterGroupInput(v *UpdateRunnerParameterGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ParameterGroupName == nil || len(*v.ParameterGroupName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ParameterGroupName must not be empty")} + } + if v.ParameterGroupName != nil { + if err := encoder.SetURI("ParameterGroupName").String(*v.ParameterGroupName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRunnerParameterGroupInput(v *UpdateRunnerParameterGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangedParameterGroupName != nil { + ok := object.Key("changedParameterGroupName") + ok.String(*v.ChangedParameterGroupName) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateRunnerRegistration struct { +} + +func (*awsRestjson1_serializeOpUpdateRunnerRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateRunnerRegistration) 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.(*UpdateRunnerRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/runners/{RunnerName}/registrations/{RegistrationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateRunnerRegistrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateRunnerRegistrationInput(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_serializeOpHttpBindingsUpdateRunnerRegistrationInput(v *UpdateRunnerRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.RegistrationId == nil || len(*v.RegistrationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RegistrationId must not be empty")} + } + if v.RegistrationId != nil { + if err := encoder.SetURI("RegistrationId").String(*v.RegistrationId); err != nil { + return err + } + } + + if v.RunnerName == nil || len(*v.RunnerName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member RunnerName must not be empty")} + } + if v.RunnerName != nil { + if err := encoder.SetURI("RunnerName").String(*v.RunnerName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateRunnerRegistrationInput(v *UpdateRunnerRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ParameterGroupName != nil { + ok := object.Key("parameterGroupName") + ok.String(*v.ParameterGroupName) + } + + return nil +} + +func awsRestjson1_serializeDocumentListOfRequestExtraHosts(v []types.RequestExtraHosts, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentRequestExtraHosts(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentListOfRequestTags(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentListOfRequestVolumes(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentRequestDockerParameters(v *types.RequestDockerParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DisableCache != nil { + ok := object.Key("disableCache") + ok.Boolean(*v.DisableCache) + } + + if v.DisableEntrypointOverwrite != nil { + ok := object.Key("disableEntrypointOverwrite") + ok.Boolean(*v.DisableEntrypointOverwrite) + } + + if v.Image != nil { + ok := object.Key("image") + ok.String(*v.Image) + } + + if v.ListOfRequestExtraHosts != nil { + ok := object.Key("extraHosts") + if err := awsRestjson1_serializeDocumentListOfRequestExtraHosts(v.ListOfRequestExtraHosts, ok); err != nil { + return err + } + } + + if v.ListOfRequestVolumes != nil { + ok := object.Key("volumes") + if err := awsRestjson1_serializeDocumentListOfRequestVolumes(v.ListOfRequestVolumes, ok); err != nil { + return err + } + } + + if v.OomKillDisable != nil { + ok := object.Key("oomKillDisable") + ok.Boolean(*v.OomKillDisable) + } + + if v.Privileged != nil { + ok := object.Key("privileged") + ok.Boolean(*v.Privileged) + } + + if v.ShmSize != nil { + ok := object.Key("shmSize") + ok.Integer(*v.ShmSize) + } + + if v.TlsVerify != nil { + ok := object.Key("tlsVerify") + ok.Boolean(*v.TlsVerify) + } + + return nil +} + +func awsRestjson1_serializeDocumentRequestExtraHosts(v *types.RequestExtraHosts, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HostName != nil { + ok := object.Key("hostName") + ok.String(*v.HostName) + } + + if v.IpAddress != nil { + ok := object.Key("ipAddress") + ok.String(*v.IpAddress) + } + + return nil +} + +func awsRestjson1_serializeDocumentRequestNetworkConfig(v *types.RequestNetworkConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NetworkId != nil { + ok := object.Key("networkId") + ok.String(*v.NetworkId) + } + + if v.PrivateAddress != nil { + ok := object.Key("privateAddress") + ok.String(*v.PrivateAddress) + } + + return nil +} diff --git a/service/devopsrunner/types/enums.go b/service/devopsrunner/types/enums.go new file mode 100644 index 0000000..367ebea --- /dev/null +++ b/service/devopsrunner/types/enums.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package types + +type AccessLevelOfRegisterRunnerRequest string + +// Enum values for AccessLevelOfRegisterRunnerRequest +const ( + AccessLevelOfRegisterRunnerRequestNotProtected AccessLevelOfRegisterRunnerRequest = "not_protected" + AccessLevelOfRegisterRunnerRequestRefProtected AccessLevelOfRegisterRunnerRequest = "ref_protected" +) + +// Values returns all known values for AccessLevelOfRegisterRunnerRequest. 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 (AccessLevelOfRegisterRunnerRequest) Values() []AccessLevelOfRegisterRunnerRequest { + return []AccessLevelOfRegisterRunnerRequest{ + "not_protected", + "ref_protected", + } +} + +type AvailabilityZoneOfCreateRunnerRequest string + +// Enum values for AvailabilityZoneOfCreateRunnerRequest +const ( + AvailabilityZoneOfCreateRunnerRequestEast11 AvailabilityZoneOfCreateRunnerRequest = "east-11" + AvailabilityZoneOfCreateRunnerRequestEast12 AvailabilityZoneOfCreateRunnerRequest = "east-12" + AvailabilityZoneOfCreateRunnerRequestEast13 AvailabilityZoneOfCreateRunnerRequest = "east-13" + AvailabilityZoneOfCreateRunnerRequestEast14 AvailabilityZoneOfCreateRunnerRequest = "east-14" + AvailabilityZoneOfCreateRunnerRequestEast31 AvailabilityZoneOfCreateRunnerRequest = "east-31" + AvailabilityZoneOfCreateRunnerRequestWest11 AvailabilityZoneOfCreateRunnerRequest = "west-11" + AvailabilityZoneOfCreateRunnerRequestWest12 AvailabilityZoneOfCreateRunnerRequest = "west-12" + AvailabilityZoneOfCreateRunnerRequestWest13 AvailabilityZoneOfCreateRunnerRequest = "west-13" + AvailabilityZoneOfCreateRunnerRequestJpWest21 AvailabilityZoneOfCreateRunnerRequest = "jp-west-21" +) + +// Values returns all known values for AvailabilityZoneOfCreateRunnerRequest. 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 (AvailabilityZoneOfCreateRunnerRequest) Values() []AvailabilityZoneOfCreateRunnerRequest { + return []AvailabilityZoneOfCreateRunnerRequest{ + "east-11", + "east-12", + "east-13", + "east-14", + "east-31", + "west-11", + "west-12", + "west-13", + "jp-west-21", + } +} + +type InstanceTypeOfCreateRunnerRequest string + +// Enum values for InstanceTypeOfCreateRunnerRequest +const ( + InstanceTypeOfCreateRunnerRequestCSmall InstanceTypeOfCreateRunnerRequest = "c-small" + InstanceTypeOfCreateRunnerRequestCSmall2 InstanceTypeOfCreateRunnerRequest = "c-small2" + InstanceTypeOfCreateRunnerRequestCSmall4 InstanceTypeOfCreateRunnerRequest = "c-small4" + InstanceTypeOfCreateRunnerRequestCMedium InstanceTypeOfCreateRunnerRequest = "c-medium" + InstanceTypeOfCreateRunnerRequestCMedium4 InstanceTypeOfCreateRunnerRequest = "c-medium4" + InstanceTypeOfCreateRunnerRequestCMedium8 InstanceTypeOfCreateRunnerRequest = "c-medium8" + InstanceTypeOfCreateRunnerRequestCLarge InstanceTypeOfCreateRunnerRequest = "c-large" + InstanceTypeOfCreateRunnerRequestCLarge8 InstanceTypeOfCreateRunnerRequest = "c-large8" + InstanceTypeOfCreateRunnerRequestESmall InstanceTypeOfCreateRunnerRequest = "e-small" + InstanceTypeOfCreateRunnerRequestESmall2 InstanceTypeOfCreateRunnerRequest = "e-small2" + InstanceTypeOfCreateRunnerRequestESmall4 InstanceTypeOfCreateRunnerRequest = "e-small4" + InstanceTypeOfCreateRunnerRequestESmall8 InstanceTypeOfCreateRunnerRequest = "e-small8" + InstanceTypeOfCreateRunnerRequestESmall16 InstanceTypeOfCreateRunnerRequest = "e-small16" + InstanceTypeOfCreateRunnerRequestEMedium InstanceTypeOfCreateRunnerRequest = "e-medium" + InstanceTypeOfCreateRunnerRequestEMedium4 InstanceTypeOfCreateRunnerRequest = "e-medium4" + InstanceTypeOfCreateRunnerRequestEMedium8 InstanceTypeOfCreateRunnerRequest = "e-medium8" + InstanceTypeOfCreateRunnerRequestEMedium16 InstanceTypeOfCreateRunnerRequest = "e-medium16" + InstanceTypeOfCreateRunnerRequestEMedium24 InstanceTypeOfCreateRunnerRequest = "e-medium24" + InstanceTypeOfCreateRunnerRequestELarge InstanceTypeOfCreateRunnerRequest = "e-large" + InstanceTypeOfCreateRunnerRequestELarge8 InstanceTypeOfCreateRunnerRequest = "e-large8" + InstanceTypeOfCreateRunnerRequestELarge16 InstanceTypeOfCreateRunnerRequest = "e-large16" + InstanceTypeOfCreateRunnerRequestELarge24 InstanceTypeOfCreateRunnerRequest = "e-large24" + InstanceTypeOfCreateRunnerRequestEExtraLarge8 InstanceTypeOfCreateRunnerRequest = "e-extra-large8" + InstanceTypeOfCreateRunnerRequestEExtraLarge16 InstanceTypeOfCreateRunnerRequest = "e-extra-large16" + InstanceTypeOfCreateRunnerRequestEExtraLarge24 InstanceTypeOfCreateRunnerRequest = "e-extra-large24" + InstanceTypeOfCreateRunnerRequestEDoubleLarge16 InstanceTypeOfCreateRunnerRequest = "e-double-large16" + InstanceTypeOfCreateRunnerRequestEDoubleLarge24 InstanceTypeOfCreateRunnerRequest = "e-double-large24" + InstanceTypeOfCreateRunnerRequestH2Small InstanceTypeOfCreateRunnerRequest = "h2-small" + InstanceTypeOfCreateRunnerRequestH2Small2 InstanceTypeOfCreateRunnerRequest = "h2-small2" + InstanceTypeOfCreateRunnerRequestH2Small4 InstanceTypeOfCreateRunnerRequest = "h2-small4" + InstanceTypeOfCreateRunnerRequestH2Small8 InstanceTypeOfCreateRunnerRequest = "h2-small8" + InstanceTypeOfCreateRunnerRequestH2Small16 InstanceTypeOfCreateRunnerRequest = "h2-small16" + InstanceTypeOfCreateRunnerRequestH2Medium InstanceTypeOfCreateRunnerRequest = "h2-medium" + InstanceTypeOfCreateRunnerRequestH2Medium4 InstanceTypeOfCreateRunnerRequest = "h2-medium4" + InstanceTypeOfCreateRunnerRequestH2Medium8 InstanceTypeOfCreateRunnerRequest = "h2-medium8" + InstanceTypeOfCreateRunnerRequestH2Medium16 InstanceTypeOfCreateRunnerRequest = "h2-medium16" + InstanceTypeOfCreateRunnerRequestH2Medium24 InstanceTypeOfCreateRunnerRequest = "h2-medium24" + InstanceTypeOfCreateRunnerRequestH2Large InstanceTypeOfCreateRunnerRequest = "h2-large" + InstanceTypeOfCreateRunnerRequestH2Large8 InstanceTypeOfCreateRunnerRequest = "h2-large8" + InstanceTypeOfCreateRunnerRequestH2Large16 InstanceTypeOfCreateRunnerRequest = "h2-large16" + InstanceTypeOfCreateRunnerRequestH2Large24 InstanceTypeOfCreateRunnerRequest = "h2-large24" + InstanceTypeOfCreateRunnerRequestH2ExtraLarge8 InstanceTypeOfCreateRunnerRequest = "h2-extra-large8" + InstanceTypeOfCreateRunnerRequestH2ExtraLarge16 InstanceTypeOfCreateRunnerRequest = "h2-extra-large16" + InstanceTypeOfCreateRunnerRequestH2ExtraLarge24 InstanceTypeOfCreateRunnerRequest = "h2-extra-large24" + InstanceTypeOfCreateRunnerRequestH2DoubleLarge16 InstanceTypeOfCreateRunnerRequest = "h2-double-large16" + InstanceTypeOfCreateRunnerRequestH2DoubleLarge24 InstanceTypeOfCreateRunnerRequest = "h2-double-large24" +) + +// Values returns all known values for InstanceTypeOfCreateRunnerRequest. 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 (InstanceTypeOfCreateRunnerRequest) Values() []InstanceTypeOfCreateRunnerRequest { + return []InstanceTypeOfCreateRunnerRequest{ + "c-small", + "c-small2", + "c-small4", + "c-medium", + "c-medium4", + "c-medium8", + "c-large", + "c-large8", + "e-small", + "e-small2", + "e-small4", + "e-small8", + "e-small16", + "e-medium", + "e-medium4", + "e-medium8", + "e-medium16", + "e-medium24", + "e-large", + "e-large8", + "e-large16", + "e-large24", + "e-extra-large8", + "e-extra-large16", + "e-extra-large24", + "e-double-large16", + "e-double-large24", + "h2-small", + "h2-small2", + "h2-small4", + "h2-small8", + "h2-small16", + "h2-medium", + "h2-medium4", + "h2-medium8", + "h2-medium16", + "h2-medium24", + "h2-large", + "h2-large8", + "h2-large16", + "h2-large24", + "h2-extra-large8", + "h2-extra-large16", + "h2-extra-large24", + "h2-double-large16", + "h2-double-large24", + } +} + +type InstanceTypeOfModifyRunnerInstanceTypeRequest string + +// Enum values for InstanceTypeOfModifyRunnerInstanceTypeRequest +const ( + InstanceTypeOfModifyRunnerInstanceTypeRequestCSmall InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-small" + InstanceTypeOfModifyRunnerInstanceTypeRequestCSmall2 InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-small2" + InstanceTypeOfModifyRunnerInstanceTypeRequestCSmall4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-small4" + InstanceTypeOfModifyRunnerInstanceTypeRequestCMedium InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-medium" + InstanceTypeOfModifyRunnerInstanceTypeRequestCMedium4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-medium4" + InstanceTypeOfModifyRunnerInstanceTypeRequestCMedium8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-medium8" + InstanceTypeOfModifyRunnerInstanceTypeRequestCLarge InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-large" + InstanceTypeOfModifyRunnerInstanceTypeRequestCLarge8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "c-large8" + InstanceTypeOfModifyRunnerInstanceTypeRequestESmall InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-small" + InstanceTypeOfModifyRunnerInstanceTypeRequestESmall2 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-small2" + InstanceTypeOfModifyRunnerInstanceTypeRequestESmall4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-small4" + InstanceTypeOfModifyRunnerInstanceTypeRequestESmall8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-small8" + InstanceTypeOfModifyRunnerInstanceTypeRequestESmall16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-small16" + InstanceTypeOfModifyRunnerInstanceTypeRequestEMedium InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-medium" + InstanceTypeOfModifyRunnerInstanceTypeRequestEMedium4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-medium4" + InstanceTypeOfModifyRunnerInstanceTypeRequestEMedium8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-medium8" + InstanceTypeOfModifyRunnerInstanceTypeRequestEMedium16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-medium16" + InstanceTypeOfModifyRunnerInstanceTypeRequestEMedium24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-medium24" + InstanceTypeOfModifyRunnerInstanceTypeRequestELarge InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-large" + InstanceTypeOfModifyRunnerInstanceTypeRequestELarge8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-large8" + InstanceTypeOfModifyRunnerInstanceTypeRequestELarge16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestELarge24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-large24" + InstanceTypeOfModifyRunnerInstanceTypeRequestEExtraLarge8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-extra-large8" + InstanceTypeOfModifyRunnerInstanceTypeRequestEExtraLarge16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-extra-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestEExtraLarge24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-extra-large24" + InstanceTypeOfModifyRunnerInstanceTypeRequestEDoubleLarge16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-double-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestEDoubleLarge24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "e-double-large24" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Small InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-small" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Small2 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-small2" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Small4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-small4" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Small8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-small8" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Small16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-small16" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Medium InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-medium" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Medium4 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-medium4" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Medium8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-medium8" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Medium16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-medium16" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Medium24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-medium24" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Large InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-large" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Large8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-large8" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Large16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2Large24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-large24" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2ExtraLarge8 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-extra-large8" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2ExtraLarge16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-extra-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2ExtraLarge24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-extra-large24" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2DoubleLarge16 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-double-large16" + InstanceTypeOfModifyRunnerInstanceTypeRequestH2DoubleLarge24 InstanceTypeOfModifyRunnerInstanceTypeRequest = "h2-double-large24" +) + +// Values returns all known values for +// InstanceTypeOfModifyRunnerInstanceTypeRequest. 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 (InstanceTypeOfModifyRunnerInstanceTypeRequest) Values() []InstanceTypeOfModifyRunnerInstanceTypeRequest { + return []InstanceTypeOfModifyRunnerInstanceTypeRequest{ + "c-small", + "c-small2", + "c-small4", + "c-medium", + "c-medium4", + "c-medium8", + "c-large", + "c-large8", + "e-small", + "e-small2", + "e-small4", + "e-small8", + "e-small16", + "e-medium", + "e-medium4", + "e-medium8", + "e-medium16", + "e-medium24", + "e-large", + "e-large8", + "e-large16", + "e-large24", + "e-extra-large8", + "e-extra-large16", + "e-extra-large24", + "e-double-large16", + "e-double-large24", + "h2-small", + "h2-small2", + "h2-small4", + "h2-small8", + "h2-small16", + "h2-medium", + "h2-medium4", + "h2-medium8", + "h2-medium16", + "h2-medium24", + "h2-large", + "h2-large8", + "h2-large16", + "h2-large24", + "h2-extra-large8", + "h2-extra-large16", + "h2-extra-large24", + "h2-double-large16", + "h2-double-large24", + } +} diff --git a/service/devopsrunner/types/types.go b/service/devopsrunner/types/types.go new file mode 100644 index 0000000..3cf1a20 --- /dev/null +++ b/service/devopsrunner/types/types.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" +) + +type DockerParameters struct { + + DisableCache *bool + + DisableEntrypointOverwrite *bool + + ExtraHosts []ExtraHosts + + Image *string + + OomKillDisable *bool + + Privileged *bool + + ShmSize *int32 + + TlsVerify *bool + + Volumes []string + + noSmithyDocumentSerde +} + +type ExtraHosts struct { + + HostName *string + + IpAddress *string + + noSmithyDocumentSerde +} + +type NetworkConfig struct { + + NetworkId *string + + PrivateAddress *string + + noSmithyDocumentSerde +} + +type ParameterGroup struct { + + CreateTime *string + + Description *string + + DockerParameters *DockerParameters + + ParameterGroupName *string + + Region *string + + RunnerNames []string + + noSmithyDocumentSerde +} + +type ParameterGroups struct { + + CreateTime *string + + Description *string + + DockerParameters *DockerParameters + + ParameterGroupName *string + + Region *string + + RunnerNames []string + + noSmithyDocumentSerde +} + +type Registrations struct { + + GitlabUrl *string + + ParameterGroupName *string + + RegistrationId *string + + Status *Status + + Token *string + + noSmithyDocumentSerde +} + +type RequestDockerParameters struct { + + DisableCache *bool + + DisableEntrypointOverwrite *bool + + Image *string + + ListOfRequestExtraHosts []RequestExtraHosts + + ListOfRequestVolumes []string + + OomKillDisable *bool + + Privileged *bool + + ShmSize *int32 + + TlsVerify *bool + + noSmithyDocumentSerde +} + +type RequestExtraHosts struct { + + HostName *string + + IpAddress *string + + noSmithyDocumentSerde +} + +type RequestNetworkConfig struct { + + NetworkId *string + + PrivateAddress *string + + noSmithyDocumentSerde +} + +type Runner struct { + + AvailabilityZone *string + + Concurrent *int32 + + CreateTime *string + + Description *string + + InstanceType *string + + NetworkConfig *NetworkConfig + + PublicIpAddress *string + + Region *string + + RunnerName *string + + RunnerVersion *string + + Status *Status + + SystemId *string + + noSmithyDocumentSerde +} + +type Runners struct { + + AvailabilityZone *string + + Concurrent *int32 + + CreateTime *string + + Description *string + + InstanceType *string + + NetworkConfig *NetworkConfig + + PublicIpAddress *string + + Region *string + + RunnerName *string + + RunnerVersion *string + + Status *Status + + SystemId *string + + noSmithyDocumentSerde +} + +type Status struct { + + Code *int32 + + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/devopsrunner/validators.go b/service/devopsrunner/validators.go new file mode 100644 index 0000000..afff7da --- /dev/null +++ b/service/devopsrunner/validators.go @@ -0,0 +1,575 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + + +package devopsrunner + +import ( + "context" + "fmt" + "github.com/aws/smithy-go/middleware" + smithy "github.com/aws/smithy-go" +) + +type validateOpCreateRunner struct { +} + +func (*validateOpCreateRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateRunnerParameterGroup struct { +} + +func (*validateOpCreateRunnerParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateRunnerParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateRunnerParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateRunnerParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteRunner struct { +} + +func (*validateOpDeleteRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteRunnerParameterGroup struct { +} + +func (*validateOpDeleteRunnerParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRunnerParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRunnerParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRunnerParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRunner struct { +} + +func (*validateOpGetRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRunnerParameterGroup struct { +} + +func (*validateOpGetRunnerParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRunnerParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRunnerParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRunnerParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListRunnerRegistrations struct { +} + +func (*validateOpListRunnerRegistrations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRunnerRegistrations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRunnerRegistrationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRunnerRegistrationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpModifyRunnerInstanceType struct { +} + +func (*validateOpModifyRunnerInstanceType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpModifyRunnerInstanceType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ModifyRunnerInstanceTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpModifyRunnerInstanceTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterRunner struct { +} + +func (*validateOpRegisterRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUnregisterRunner struct { +} + +func (*validateOpUnregisterRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUnregisterRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UnregisterRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUnregisterRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRunner struct { +} + +func (*validateOpUpdateRunner) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRunner) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRunnerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRunnerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRunnerParameterGroup struct { +} + +func (*validateOpUpdateRunnerParameterGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRunnerParameterGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRunnerParameterGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRunnerParameterGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRunnerParameter struct { +} + +func (*validateOpUpdateRunnerParameter) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRunnerParameter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRunnerParameterInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRunnerParameterInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateRunnerRegistration struct { +} + +func (*validateOpUpdateRunnerRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateRunnerRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateRunnerRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateRunnerRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRunner{}, middleware.After) +} + +func addOpCreateRunnerParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateRunnerParameterGroup{}, middleware.After) +} + +func addOpDeleteRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRunner{}, middleware.After) +} + +func addOpDeleteRunnerParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRunnerParameterGroup{}, middleware.After) +} + +func addOpGetRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRunner{}, middleware.After) +} + +func addOpGetRunnerParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRunnerParameterGroup{}, middleware.After) +} + +func addOpListRunnerRegistrationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRunnerRegistrations{}, middleware.After) +} + +func addOpModifyRunnerInstanceTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpModifyRunnerInstanceType{}, middleware.After) +} + +func addOpRegisterRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterRunner{}, middleware.After) +} + +func addOpUnregisterRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUnregisterRunner{}, middleware.After) +} + +func addOpUpdateRunnerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRunner{}, middleware.After) +} + +func addOpUpdateRunnerParameterGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRunnerParameterGroup{}, middleware.After) +} + +func addOpUpdateRunnerParameterValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRunnerParameter{}, middleware.After) +} + +func addOpUpdateRunnerRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateRunnerRegistration{}, middleware.After) +} + +func validateOpCreateRunnerInput(v *CreateRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRunnerInput"} + if len(v.InstanceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) + } + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateRunnerParameterGroupInput(v *CreateRunnerParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateRunnerParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteRunnerInput(v *DeleteRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRunnerInput"} + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteRunnerParameterGroupInput(v *DeleteRunnerParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRunnerParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRunnerInput(v *GetRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRunnerInput"} + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRunnerParameterGroupInput(v *GetRunnerParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRunnerParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListRunnerRegistrationsInput(v *ListRunnerRegistrationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRunnerRegistrationsInput"} + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpModifyRunnerInstanceTypeInput(v *ModifyRunnerInstanceTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ModifyRunnerInstanceTypeInput"} + if len(v.InstanceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) + } + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterRunnerInput(v *RegisterRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterRunnerInput"} + if v.GitlabUrl == nil { + invalidParams.Add(smithy.NewErrParamRequired("GitlabUrl")) + } + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUnregisterRunnerInput(v *UnregisterRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UnregisterRunnerInput"} + if v.RegistrationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationId")) + } + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRunnerInput(v *UpdateRunnerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRunnerInput"} + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRunnerParameterGroupInput(v *UpdateRunnerParameterGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRunnerParameterGroupInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRunnerParameterInput(v *UpdateRunnerParameterInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRunnerParameterInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateRunnerRegistrationInput(v *UpdateRunnerRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateRunnerRegistrationInput"} + if v.ParameterGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParameterGroupName")) + } + if v.RegistrationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RegistrationId")) + } + if v.RunnerName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RunnerName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/internal/integrationtest/devops/smoke_test.go b/service/internal/integrationtest/devops/smoke_test.go new file mode 100644 index 0000000..ad4b004 --- /dev/null +++ b/service/internal/integrationtest/devops/smoke_test.go @@ -0,0 +1,45 @@ +//go:build integration +// +build integration + +package devops + +import ( + "context" + "testing" + "time" + + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "github.com/nifcloud/nifcloud-sdk-go/service/internal/integrationtest" + "github.com/nifcloud/nifcloud-sdk-go/service/devops" +) + +func TestInteg_00_ListFirewallGroups(t *testing.T) { + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + + cfg := integrationtest.LoadConfigWithDefaultRegion("jp-east-1") + client := devops.NewFromConfig(cfg) + + params := &devops.ListFirewallGroupsInput{} + _, err := client.ListFirewallGroups(ctx, params) + if err != nil { + t.Errorf("expect no error, got %v", err) + } +} + +func TestInteg_01_GetInstance(t *testing.T) { + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + + cfg := integrationtest.LoadConfigWithDefaultRegion("jp-east-1") + client := devops.NewFromConfig(cfg) + + params := &devops.GetInstanceInput{ + InstanceId: nifcloud.String("fake-id"), + } + + _, err := client.GetInstance(ctx, params) + if err == nil { + t.Fatalf("expect request to fail") + } +} diff --git a/service/internal/integrationtest/devops_runner/smoke_test.go b/service/internal/integrationtest/devops_runner/smoke_test.go new file mode 100644 index 0000000..09bdc23 --- /dev/null +++ b/service/internal/integrationtest/devops_runner/smoke_test.go @@ -0,0 +1,45 @@ +//go:build integration +// +build integration + +package devopsrunner + +import ( + "context" + "testing" + "time" + + "github.com/nifcloud/nifcloud-sdk-go/nifcloud" + "github.com/nifcloud/nifcloud-sdk-go/service/internal/integrationtest" + "github.com/nifcloud/nifcloud-sdk-go/service/devopsrunner" +) + +func TestInteg_00_ListParameterGroups(t *testing.T) { + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + + cfg := integrationtest.LoadConfigWithDefaultRegion("jp-east-1") + client := devopsrunner.NewFromConfig(cfg) + + params := &devopsrunner.ListParameterGroupsInput{} + _, err := client.ListParameterGroups(ctx, params) + if err != nil { + t.Errorf("expect no error, got %v", err) + } +} + +func TestInteg_01_GetRunner(t *testing.T) { + ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second) + defer cancelFn() + + cfg := integrationtest.LoadConfigWithDefaultRegion("jp-east-1") + client := devopsrunner.NewFromConfig(cfg) + + params := &devopsrunner.GetRunnerInput{ + RunnerName: nifcloud.String("fake-name"), + } + + _, err := client.GetRunner(ctx, params) + if err == nil { + t.Fatalf("expect request to fail") + } +}