From 2902dda759f234410d1d7e5ff7eb329f15c5ef3a Mon Sep 17 00:00:00 2001 From: Sean McGrail Date: Tue, 15 Dec 2020 18:47:02 -0800 Subject: [PATCH] Regenerated Clients with Union Documentation (#957) --- .../protocoltest/awsrestjson/types/types.go | 11 + .../awsrestjson/types/types_exported_test.go | 48 ++++ internal/protocoltest/jsonrpc/types/types.go | 11 + .../jsonrpc/types/types_exported_test.go | 48 ++++ .../protocoltest/jsonrpc10/types/types.go | 11 + .../jsonrpc10/types/types_exported_test.go | 48 ++++ service/appmesh/types/types.go | 53 ++++ service/appmesh/types/types_exported_test.go | 251 ++++++++++++++++++ service/groundstation/types/types.go | 8 + .../types/types_exported_test.go | 39 +++ service/rdsdata/types/types.go | 28 ++ service/rdsdata/types/types_exported_test.go | 113 ++++++++ service/redshiftdata/types/types.go | 8 + .../redshiftdata/types/types_exported_test.go | 39 +++ 14 files changed, 716 insertions(+) create mode 100644 internal/protocoltest/awsrestjson/types/types_exported_test.go create mode 100644 internal/protocoltest/jsonrpc/types/types_exported_test.go create mode 100644 internal/protocoltest/jsonrpc10/types/types_exported_test.go create mode 100644 service/appmesh/types/types_exported_test.go create mode 100644 service/groundstation/types/types_exported_test.go create mode 100644 service/rdsdata/types/types_exported_test.go create mode 100644 service/redshiftdata/types/types_exported_test.go diff --git a/internal/protocoltest/awsrestjson/types/types.go b/internal/protocoltest/awsrestjson/types/types.go index 1bce5386794..9eb3db46075 100644 --- a/internal/protocoltest/awsrestjson/types/types.go +++ b/internal/protocoltest/awsrestjson/types/types.go @@ -11,6 +11,17 @@ type ComplexNestedErrorData struct { } // A union with a representative set of types for members. +// +// The following types satisfy this interface: +// MyUnionMemberStringValue +// MyUnionMemberBooleanValue +// MyUnionMemberNumberValue +// MyUnionMemberBlobValue +// MyUnionMemberTimestampValue +// MyUnionMemberEnumValue +// MyUnionMemberListValue +// MyUnionMemberMapValue +// MyUnionMemberStructureValue type MyUnion interface { isMyUnion() } diff --git a/internal/protocoltest/awsrestjson/types/types_exported_test.go b/internal/protocoltest/awsrestjson/types/types_exported_test.go new file mode 100644 index 00000000000..bab3f37f60c --- /dev/null +++ b/internal/protocoltest/awsrestjson/types/types_exported_test.go @@ -0,0 +1,48 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/internal/protocoltest/awsrestjson/types" +) + +func ExampleMyUnion_outputUsage() { + var union types.MyUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MyUnionMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.MyUnionMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.MyUnionMemberEnumValue: + _ = v.Value // Value is FooEnum + + case *types.MyUnionMemberListValue: + _ = v.Value // Value is StringList + + case *types.MyUnionMemberMapValue: + _ = v.Value // Value is StringMap + + case *types.MyUnionMemberNumberValue: + _ = v.Value // Value is int32 + + case *types.MyUnionMemberStringValue: + _ = v.Value // Value is string + + case *types.MyUnionMemberStructureValue: + _ = v.Value // Value is GreetingStruct + + case *types.MyUnionMemberTimestampValue: + _ = v.Value // Value is Time + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/internal/protocoltest/jsonrpc/types/types.go b/internal/protocoltest/jsonrpc/types/types.go index 045ad1d22c6..ff7dfb73596 100644 --- a/internal/protocoltest/jsonrpc/types/types.go +++ b/internal/protocoltest/jsonrpc/types/types.go @@ -68,6 +68,17 @@ type KitchenSink struct { } // A union with a representative set of types for members. +// +// The following types satisfy this interface: +// MyUnionMemberStringValue +// MyUnionMemberBooleanValue +// MyUnionMemberNumberValue +// MyUnionMemberBlobValue +// MyUnionMemberTimestampValue +// MyUnionMemberEnumValue +// MyUnionMemberListValue +// MyUnionMemberMapValue +// MyUnionMemberStructureValue type MyUnion interface { isMyUnion() } diff --git a/internal/protocoltest/jsonrpc/types/types_exported_test.go b/internal/protocoltest/jsonrpc/types/types_exported_test.go new file mode 100644 index 00000000000..70cec8d8117 --- /dev/null +++ b/internal/protocoltest/jsonrpc/types/types_exported_test.go @@ -0,0 +1,48 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/internal/protocoltest/jsonrpc/types" +) + +func ExampleMyUnion_outputUsage() { + var union types.MyUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MyUnionMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.MyUnionMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.MyUnionMemberEnumValue: + _ = v.Value // Value is FooEnum + + case *types.MyUnionMemberListValue: + _ = v.Value // Value is StringList + + case *types.MyUnionMemberMapValue: + _ = v.Value // Value is StringMap + + case *types.MyUnionMemberNumberValue: + _ = v.Value // Value is int32 + + case *types.MyUnionMemberStringValue: + _ = v.Value // Value is string + + case *types.MyUnionMemberStructureValue: + _ = v.Value // Value is GreetingStruct + + case *types.MyUnionMemberTimestampValue: + _ = v.Value // Value is Time + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/internal/protocoltest/jsonrpc10/types/types.go b/internal/protocoltest/jsonrpc10/types/types.go index f7ec6390704..dfc69cd6906 100644 --- a/internal/protocoltest/jsonrpc10/types/types.go +++ b/internal/protocoltest/jsonrpc10/types/types.go @@ -11,6 +11,17 @@ type ComplexNestedErrorData struct { } // A union with a representative set of types for members. +// +// The following types satisfy this interface: +// MyUnionMemberStringValue +// MyUnionMemberBooleanValue +// MyUnionMemberNumberValue +// MyUnionMemberBlobValue +// MyUnionMemberTimestampValue +// MyUnionMemberEnumValue +// MyUnionMemberListValue +// MyUnionMemberMapValue +// MyUnionMemberStructureValue type MyUnion interface { isMyUnion() } diff --git a/internal/protocoltest/jsonrpc10/types/types_exported_test.go b/internal/protocoltest/jsonrpc10/types/types_exported_test.go new file mode 100644 index 00000000000..cac38ec9293 --- /dev/null +++ b/internal/protocoltest/jsonrpc10/types/types_exported_test.go @@ -0,0 +1,48 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/internal/protocoltest/jsonrpc10/types" +) + +func ExampleMyUnion_outputUsage() { + var union types.MyUnion + // type switches can be used to check the union value + switch v := union.(type) { + case *types.MyUnionMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.MyUnionMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.MyUnionMemberEnumValue: + _ = v.Value // Value is FooEnum + + case *types.MyUnionMemberListValue: + _ = v.Value // Value is StringList + + case *types.MyUnionMemberMapValue: + _ = v.Value // Value is StringMap + + case *types.MyUnionMemberNumberValue: + _ = v.Value // Value is int32 + + case *types.MyUnionMemberStringValue: + _ = v.Value // Value is string + + case *types.MyUnionMemberStructureValue: + _ = v.Value // Value is GreetingStruct + + case *types.MyUnionMemberTimestampValue: + _ = v.Value // Value is Time + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/service/appmesh/types/types.go b/service/appmesh/types/types.go index a35c691cbbe..d93ba9c0d06 100644 --- a/service/appmesh/types/types.go +++ b/service/appmesh/types/types.go @@ -7,6 +7,9 @@ import ( ) // An object that represents the access logging information for a virtual node. +// +// The following types satisfy this interface: +// AccessLogMemberFile type AccessLog interface { isAccessLog() } @@ -58,6 +61,9 @@ type AwsCloudMapServiceDiscovery struct { // An object that represents the backends that a virtual node is expected to send // outbound traffic to. +// +// The following types satisfy this interface: +// BackendMemberVirtualService type Backend interface { isBackend() } @@ -406,6 +412,13 @@ type GrpcRouteMetadata struct { } // An object that represents the match method. Specify one of the match values. +// +// The following types satisfy this interface: +// GrpcRouteMetadataMatchMethodMemberExact +// GrpcRouteMetadataMatchMethodMemberRegex +// GrpcRouteMetadataMatchMethodMemberRange +// GrpcRouteMetadataMatchMethodMemberPrefix +// GrpcRouteMetadataMatchMethodMemberSuffix type GrpcRouteMetadataMatchMethod interface { isGrpcRouteMetadataMatchMethod() } @@ -463,6 +476,13 @@ type GrpcTimeout struct { // An object that represents the method and value to match with the header value // sent in a request. Specify one match method. +// +// The following types satisfy this interface: +// HeaderMatchMethodMemberExact +// HeaderMatchMethodMemberRegex +// HeaderMatchMethodMemberRange +// HeaderMatchMethodMemberPrefix +// HeaderMatchMethodMemberSuffix type HeaderMatchMethod interface { isHeaderMatchMethod() } @@ -714,6 +734,12 @@ type Listener struct { } // An object that represents timeouts for different protocols. +// +// The following types satisfy this interface: +// ListenerTimeoutMemberTcp +// ListenerTimeoutMemberHttp +// ListenerTimeoutMemberHttp2 +// ListenerTimeoutMemberGrpc type ListenerTimeout interface { isListenerTimeout() } @@ -784,6 +810,10 @@ type ListenerTlsAcmCertificate struct { // An object that represents a listener's Transport Layer Security (TLS) // certificate. +// +// The following types satisfy this interface: +// ListenerTlsCertificateMemberAcm +// ListenerTlsCertificateMemberFile type ListenerTlsCertificate interface { isListenerTlsCertificate() } @@ -1108,6 +1138,10 @@ type RouteStatus struct { } // An object that represents the service discovery information for a virtual node. +// +// The following types satisfy this interface: +// ServiceDiscoveryMemberDns +// ServiceDiscoveryMemberAwsCloudMap type ServiceDiscovery interface { isServiceDiscovery() } @@ -1204,6 +1238,10 @@ type TlsValidationContextFileTrust struct { // An object that represents a Transport Layer Security (TLS) validation context // trust. +// +// The following types satisfy this interface: +// TlsValidationContextTrustMemberAcm +// TlsValidationContextTrustMemberFile type TlsValidationContextTrust interface { isTlsValidationContextTrust() } @@ -1224,6 +1262,9 @@ type TlsValidationContextTrustMemberFile struct { func (*TlsValidationContextTrustMemberFile) isTlsValidationContextTrust() {} // The access log configuration for a virtual gateway. +// +// The following types satisfy this interface: +// VirtualGatewayAccessLogMemberFile type VirtualGatewayAccessLog interface { isVirtualGatewayAccessLog() } @@ -1405,6 +1446,10 @@ type VirtualGatewayListenerTlsAcmCertificate struct { // An object that represents a listener's Transport Layer Security (TLS) // certificate. +// +// The following types satisfy this interface: +// VirtualGatewayListenerTlsCertificateMemberAcm +// VirtualGatewayListenerTlsCertificateMemberFile type VirtualGatewayListenerTlsCertificate interface { isVirtualGatewayListenerTlsCertificate() } @@ -1571,6 +1616,10 @@ type VirtualGatewayTlsValidationContextFileTrust struct { // An object that represents a Transport Layer Security (TLS) validation context // trust. +// +// The following types satisfy this interface: +// VirtualGatewayTlsValidationContextTrustMemberAcm +// VirtualGatewayTlsValidationContextTrustMemberFile type VirtualGatewayTlsValidationContextTrust interface { isVirtualGatewayTlsValidationContextTrust() } @@ -1869,6 +1918,10 @@ type VirtualServiceData struct { } // An object that represents the provider for a virtual service. +// +// The following types satisfy this interface: +// VirtualServiceProviderMemberVirtualNode +// VirtualServiceProviderMemberVirtualRouter type VirtualServiceProvider interface { isVirtualServiceProvider() } diff --git a/service/appmesh/types/types_exported_test.go b/service/appmesh/types/types_exported_test.go new file mode 100644 index 00000000000..16a128a2605 --- /dev/null +++ b/service/appmesh/types/types_exported_test.go @@ -0,0 +1,251 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/appmesh/types" +) + +func ExampleAccessLog_outputUsage() { + var union types.AccessLog + // type switches can be used to check the union value + switch v := union.(type) { + case *types.AccessLogMemberFile: + _ = v.Value // Value is FileAccessLog + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleBackend_outputUsage() { + var union types.Backend + // type switches can be used to check the union value + switch v := union.(type) { + case *types.BackendMemberVirtualService: + _ = v.Value // Value is VirtualServiceBackend + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleGrpcRouteMetadataMatchMethod_outputUsage() { + var union types.GrpcRouteMetadataMatchMethod + // type switches can be used to check the union value + switch v := union.(type) { + case *types.GrpcRouteMetadataMatchMethodMemberExact: + _ = v.Value // Value is string + + case *types.GrpcRouteMetadataMatchMethodMemberPrefix: + _ = v.Value // Value is string + + case *types.GrpcRouteMetadataMatchMethodMemberRange: + _ = v.Value // Value is MatchRange + + case *types.GrpcRouteMetadataMatchMethodMemberRegex: + _ = v.Value // Value is string + + case *types.GrpcRouteMetadataMatchMethodMemberSuffix: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleHeaderMatchMethod_outputUsage() { + var union types.HeaderMatchMethod + // type switches can be used to check the union value + switch v := union.(type) { + case *types.HeaderMatchMethodMemberExact: + _ = v.Value // Value is string + + case *types.HeaderMatchMethodMemberPrefix: + _ = v.Value // Value is string + + case *types.HeaderMatchMethodMemberRange: + _ = v.Value // Value is MatchRange + + case *types.HeaderMatchMethodMemberRegex: + _ = v.Value // Value is string + + case *types.HeaderMatchMethodMemberSuffix: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleListenerTimeout_outputUsage() { + var union types.ListenerTimeout + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ListenerTimeoutMemberGrpc: + _ = v.Value // Value is GrpcTimeout + + case *types.ListenerTimeoutMemberHttp: + _ = v.Value // Value is HttpTimeout + + case *types.ListenerTimeoutMemberHttp2: + _ = v.Value // Value is HttpTimeout + + case *types.ListenerTimeoutMemberTcp: + _ = v.Value // Value is TcpTimeout + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleListenerTlsCertificate_outputUsage() { + var union types.ListenerTlsCertificate + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ListenerTlsCertificateMemberAcm: + _ = v.Value // Value is ListenerTlsAcmCertificate + + case *types.ListenerTlsCertificateMemberFile: + _ = v.Value // Value is ListenerTlsFileCertificate + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleServiceDiscovery_outputUsage() { + var union types.ServiceDiscovery + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ServiceDiscoveryMemberAwsCloudMap: + _ = v.Value // Value is AwsCloudMapServiceDiscovery + + case *types.ServiceDiscoveryMemberDns: + _ = v.Value // Value is DnsServiceDiscovery + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleTlsValidationContextTrust_outputUsage() { + var union types.TlsValidationContextTrust + // type switches can be used to check the union value + switch v := union.(type) { + case *types.TlsValidationContextTrustMemberAcm: + _ = v.Value // Value is TlsValidationContextAcmTrust + + case *types.TlsValidationContextTrustMemberFile: + _ = v.Value // Value is TlsValidationContextFileTrust + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleVirtualGatewayAccessLog_outputUsage() { + var union types.VirtualGatewayAccessLog + // type switches can be used to check the union value + switch v := union.(type) { + case *types.VirtualGatewayAccessLogMemberFile: + _ = v.Value // Value is VirtualGatewayFileAccessLog + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleVirtualGatewayListenerTlsCertificate_outputUsage() { + var union types.VirtualGatewayListenerTlsCertificate + // type switches can be used to check the union value + switch v := union.(type) { + case *types.VirtualGatewayListenerTlsCertificateMemberAcm: + _ = v.Value // Value is VirtualGatewayListenerTlsAcmCertificate + + case *types.VirtualGatewayListenerTlsCertificateMemberFile: + _ = v.Value // Value is VirtualGatewayListenerTlsFileCertificate + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleVirtualGatewayTlsValidationContextTrust_outputUsage() { + var union types.VirtualGatewayTlsValidationContextTrust + // type switches can be used to check the union value + switch v := union.(type) { + case *types.VirtualGatewayTlsValidationContextTrustMemberAcm: + _ = v.Value // Value is VirtualGatewayTlsValidationContextAcmTrust + + case *types.VirtualGatewayTlsValidationContextTrustMemberFile: + _ = v.Value // Value is VirtualGatewayTlsValidationContextFileTrust + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleVirtualServiceProvider_outputUsage() { + var union types.VirtualServiceProvider + // type switches can be used to check the union value + switch v := union.(type) { + case *types.VirtualServiceProviderMemberVirtualNode: + _ = v.Value // Value is VirtualNodeServiceProvider + + case *types.VirtualServiceProviderMemberVirtualRouter: + _ = v.Value // Value is VirtualRouterServiceProvider + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/service/groundstation/types/types.go b/service/groundstation/types/types.go index 8e0a4ce0768..215780d5c0d 100644 --- a/service/groundstation/types/types.go +++ b/service/groundstation/types/types.go @@ -70,6 +70,14 @@ type ConfigListItem struct { // Object containing the parameters of a Config. See the subtype definitions for // what each type of Config contains. +// +// The following types satisfy this interface: +// ConfigTypeDataMemberAntennaDownlinkConfig +// ConfigTypeDataMemberAntennaDownlinkDemodDecodeConfig +// ConfigTypeDataMemberAntennaUplinkConfig +// ConfigTypeDataMemberDataflowEndpointConfig +// ConfigTypeDataMemberTrackingConfig +// ConfigTypeDataMemberUplinkEchoConfig type ConfigTypeData interface { isConfigTypeData() } diff --git a/service/groundstation/types/types_exported_test.go b/service/groundstation/types/types_exported_test.go new file mode 100644 index 00000000000..3ef783b53d1 --- /dev/null +++ b/service/groundstation/types/types_exported_test.go @@ -0,0 +1,39 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/groundstation/types" +) + +func ExampleConfigTypeData_outputUsage() { + var union types.ConfigTypeData + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ConfigTypeDataMemberAntennaDownlinkConfig: + _ = v.Value // Value is AntennaDownlinkConfig + + case *types.ConfigTypeDataMemberAntennaDownlinkDemodDecodeConfig: + _ = v.Value // Value is AntennaDownlinkDemodDecodeConfig + + case *types.ConfigTypeDataMemberAntennaUplinkConfig: + _ = v.Value // Value is AntennaUplinkConfig + + case *types.ConfigTypeDataMemberDataflowEndpointConfig: + _ = v.Value // Value is DataflowEndpointConfig + + case *types.ConfigTypeDataMemberTrackingConfig: + _ = v.Value // Value is TrackingConfig + + case *types.ConfigTypeDataMemberUplinkEchoConfig: + _ = v.Value // Value is UplinkEchoConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/service/rdsdata/types/types.go b/service/rdsdata/types/types.go index 673a2385595..80d45595475 100644 --- a/service/rdsdata/types/types.go +++ b/service/rdsdata/types/types.go @@ -3,6 +3,13 @@ package types // Contains an array. +// +// The following types satisfy this interface: +// ArrayValueMemberArrayValues +// ArrayValueMemberBooleanValues +// ArrayValueMemberDoubleValues +// ArrayValueMemberLongValues +// ArrayValueMemberStringValues type ArrayValue interface { isArrayValue() } @@ -89,6 +96,15 @@ type ColumnMetadata struct { } // Contains a value. +// +// The following types satisfy this interface: +// FieldMemberArrayValue +// FieldMemberBlobValue +// FieldMemberBooleanValue +// FieldMemberDoubleValue +// FieldMemberIsNull +// FieldMemberLongValue +// FieldMemberStringValue type Field interface { isField() } @@ -235,6 +251,18 @@ type UpdateResult struct { } // Contains the value of a column. This data type is deprecated. +// +// The following types satisfy this interface: +// ValueMemberArrayValues +// ValueMemberBigIntValue +// ValueMemberBitValue +// ValueMemberBlobValue +// ValueMemberDoubleValue +// ValueMemberIntValue +// ValueMemberIsNull +// ValueMemberRealValue +// ValueMemberStringValue +// ValueMemberStructValue type Value interface { isValue() } diff --git a/service/rdsdata/types/types_exported_test.go b/service/rdsdata/types/types_exported_test.go new file mode 100644 index 00000000000..e1fd39a102a --- /dev/null +++ b/service/rdsdata/types/types_exported_test.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/rdsdata/types" +) + +func ExampleArrayValue_outputUsage() { + var union types.ArrayValue + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ArrayValueMemberArrayValues: + _ = v.Value // Value is ArrayOfArray + + case *types.ArrayValueMemberBooleanValues: + _ = v.Value // Value is BooleanArray + + case *types.ArrayValueMemberDoubleValues: + _ = v.Value // Value is DoubleArray + + case *types.ArrayValueMemberLongValues: + _ = v.Value // Value is LongArray + + case *types.ArrayValueMemberStringValues: + _ = v.Value // Value is StringArray + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleField_outputUsage() { + var union types.Field + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FieldMemberArrayValue: + _ = v.Value // Value is ArrayValue + + case *types.FieldMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.FieldMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.FieldMemberDoubleValue: + _ = v.Value // Value is float64 + + case *types.FieldMemberIsNull: + _ = v.Value // Value is bool + + case *types.FieldMemberLongValue: + _ = v.Value // Value is int64 + + case *types.FieldMemberStringValue: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +func ExampleValue_outputUsage() { + var union types.Value + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ValueMemberArrayValues: + _ = v.Value // Value is ArrayValueList + + case *types.ValueMemberBigIntValue: + _ = v.Value // Value is int64 + + case *types.ValueMemberBitValue: + _ = v.Value // Value is bool + + case *types.ValueMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.ValueMemberDoubleValue: + _ = v.Value // Value is float64 + + case *types.ValueMemberIntValue: + _ = v.Value // Value is int32 + + case *types.ValueMemberIsNull: + _ = v.Value // Value is bool + + case *types.ValueMemberRealValue: + _ = v.Value // Value is float32 + + case *types.ValueMemberStringValue: + _ = v.Value // Value is string + + case *types.ValueMemberStructValue: + _ = v.Value // Value is StructValue + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} diff --git a/service/redshiftdata/types/types.go b/service/redshiftdata/types/types.go index bc9f388f52f..290dc94878f 100644 --- a/service/redshiftdata/types/types.go +++ b/service/redshiftdata/types/types.go @@ -50,6 +50,14 @@ type ColumnMetadata struct { } // A data value in a column. +// +// The following types satisfy this interface: +// FieldMemberIsNull +// FieldMemberBooleanValue +// FieldMemberLongValue +// FieldMemberDoubleValue +// FieldMemberStringValue +// FieldMemberBlobValue type Field interface { isField() } diff --git a/service/redshiftdata/types/types_exported_test.go b/service/redshiftdata/types/types_exported_test.go new file mode 100644 index 00000000000..967166106cc --- /dev/null +++ b/service/redshiftdata/types/types_exported_test.go @@ -0,0 +1,39 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/redshiftdata/types" +) + +func ExampleField_outputUsage() { + var union types.Field + // type switches can be used to check the union value + switch v := union.(type) { + case *types.FieldMemberBlobValue: + _ = v.Value // Value is []byte + + case *types.FieldMemberBooleanValue: + _ = v.Value // Value is bool + + case *types.FieldMemberDoubleValue: + _ = v.Value // Value is float64 + + case *types.FieldMemberIsNull: + _ = v.Value // Value is bool + + case *types.FieldMemberLongValue: + _ = v.Value // Value is int64 + + case *types.FieldMemberStringValue: + _ = v.Value // Value is string + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +}