index int64 0 0 | repo_id stringlengths 26 205 | file_path stringlengths 51 246 | content stringlengths 8 433k | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/auth-scheme-params.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.services.query.auth.scheme.internal.DefaultQueryAuthSchemeParams;
/**
* The parameters object used to resolve the auth schemes for the Query service.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryAuthSchemeParams {
/**
* Get a new builder for creating a {@link QueryAuthSchemeParams}.
*/
static Builder builder() {
return DefaultQueryAuthSchemeParams.builder();
}
/**
* Returns the operation for which to resolve the auth scheme.
*/
String operation();
/**
* Returns the region. The region is optional. The region parameter may be used with "aws.auth#sigv4" auth scheme.
* By default, the region will be empty.
*/
Optional<String> region();
/**
* A builder for a {@link QueryAuthSchemeParams}.
*/
interface Builder {
/**
* Set the operation for which to resolve the auth scheme.
*/
Builder operation(String operation);
/**
* Set the region. The region parameter may be used with the "aws.auth#sigv4" auth scheme.
*/
Builder region(String region);
/**
* Returns a {@link QueryAuthSchemeParams} object that is created from the properties that have been set on the builder.
*/
QueryAuthSchemeParams build();
}
}
| 3,100 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-auth-scheme-params-with-allowlist.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.query.auth.scheme.internal.DefaultQueryAuthSchemeParams;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* The parameters object used to resolve the auth schemes for the Query service.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryAuthSchemeParams extends ToCopyableBuilder<QueryAuthSchemeParams.Builder, QueryAuthSchemeParams> {
/**
* Get a new builder for creating a {@link QueryAuthSchemeParams}.
*/
static Builder builder() {
return DefaultQueryAuthSchemeParams.builder();
}
/**
* Returns the operation for which to resolve the auth scheme.
*/
String operation();
/**
* Returns the region. The region parameter may be used with the "aws.auth#sigv4" auth scheme.
*/
Region region();
/**
* A param that defauls to true
*/
Boolean defaultTrueParam();
String defaultStringParam();
@Deprecated
String deprecatedParam();
Boolean booleanContextParam();
String stringContextParam();
String operationContextParam();
/**
* Returns a {@link Builder} to customize the parameters.
*/
Builder toBuilder();
/**
* A builder for a {@link QueryAuthSchemeParams}.
*/
interface Builder extends CopyableBuilder<Builder, QueryAuthSchemeParams> {
/**
* Set the operation for which to resolve the auth scheme.
*/
Builder operation(String operation);
/**
* Set the region. The region parameter may be used with the "aws.auth#sigv4" auth scheme.
*/
Builder region(Region region);
/**
* A param that defauls to true
*/
Builder defaultTrueParam(Boolean defaultTrueParam);
Builder defaultStringParam(String defaultStringParam);
@Deprecated
Builder deprecatedParam(String deprecatedParam);
Builder booleanContextParam(Boolean booleanContextParam);
Builder stringContextParam(String stringContextParam);
Builder operationContextParam(String operationContextParam);
/**
* Returns a {@link QueryAuthSchemeParams} object that is created from the properties that have been set on the
* builder.
*/
QueryAuthSchemeParams build();
}
}
| 3,101 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-auth-scheme-default-params-without-allowlist.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme.internal;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeParams implements QueryAuthSchemeParams {
private final String operation;
private final Region region;
private final Boolean useDualStackEndpoint;
private final Boolean useFIPSEndpoint;
private final String endpointId;
private final Boolean defaultTrueParam;
private final String defaultStringParam;
private final String deprecatedParam;
private final Boolean booleanContextParam;
private final String stringContextParam;
private final String operationContextParam;
private DefaultQueryAuthSchemeParams(Builder builder) {
this.operation = Validate.paramNotNull(builder.operation, "operation");
this.region = builder.region;
this.useDualStackEndpoint = builder.useDualStackEndpoint;
this.useFIPSEndpoint = builder.useFIPSEndpoint;
this.endpointId = builder.endpointId;
this.defaultTrueParam = Validate.paramNotNull(builder.defaultTrueParam, "defaultTrueParam");
this.defaultStringParam = Validate.paramNotNull(builder.defaultStringParam, "defaultStringParam");
this.deprecatedParam = builder.deprecatedParam;
this.booleanContextParam = builder.booleanContextParam;
this.stringContextParam = builder.stringContextParam;
this.operationContextParam = builder.operationContextParam;
}
public static QueryAuthSchemeParams.Builder builder() {
return new Builder();
}
@Override
public String operation() {
return operation;
}
@Override
public Region region() {
return region;
}
@Override
public Boolean useDualStackEndpoint() {
return useDualStackEndpoint;
}
@Override
public Boolean useFipsEndpoint() {
return useFIPSEndpoint;
}
@Override
public String endpointId() {
return endpointId;
}
@Override
public Boolean defaultTrueParam() {
return defaultTrueParam;
}
@Override
public String defaultStringParam() {
return defaultStringParam;
}
@Deprecated
@Override
public String deprecatedParam() {
return deprecatedParam;
}
@Override
public Boolean booleanContextParam() {
return booleanContextParam;
}
@Override
public String stringContextParam() {
return stringContextParam;
}
@Override
public String operationContextParam() {
return operationContextParam;
}
@Override
public QueryAuthSchemeParams.Builder toBuilder() {
return new Builder(this);
}
private static final class Builder implements QueryAuthSchemeParams.Builder {
private String operation;
private Region region;
private Boolean useDualStackEndpoint;
private Boolean useFIPSEndpoint;
private String endpointId;
private Boolean defaultTrueParam = true;
private String defaultStringParam = "hello endpoints";
private String deprecatedParam;
private Boolean booleanContextParam;
private String stringContextParam;
private String operationContextParam;
Builder() {
}
Builder(DefaultQueryAuthSchemeParams params) {
this.operation = params.operation;
this.region = params.region;
this.useDualStackEndpoint = params.useDualStackEndpoint;
this.useFIPSEndpoint = params.useFIPSEndpoint;
this.endpointId = params.endpointId;
this.defaultTrueParam = params.defaultTrueParam;
this.defaultStringParam = params.defaultStringParam;
this.deprecatedParam = params.deprecatedParam;
this.booleanContextParam = params.booleanContextParam;
this.stringContextParam = params.stringContextParam;
this.operationContextParam = params.operationContextParam;
}
@Override
public Builder operation(String operation) {
this.operation = operation;
return this;
}
@Override
public Builder region(Region region) {
this.region = region;
return this;
}
@Override
public Builder useDualStackEndpoint(Boolean useDualStackEndpoint) {
this.useDualStackEndpoint = useDualStackEndpoint;
return this;
}
@Override
public Builder useFipsEndpoint(Boolean useFIPSEndpoint) {
this.useFIPSEndpoint = useFIPSEndpoint;
return this;
}
@Override
public Builder endpointId(String endpointId) {
this.endpointId = endpointId;
return this;
}
@Override
public Builder defaultTrueParam(Boolean defaultTrueParam) {
this.defaultTrueParam = defaultTrueParam;
if (this.defaultTrueParam == null) {
this.defaultTrueParam = true;
}
return this;
}
@Override
public Builder defaultStringParam(String defaultStringParam) {
this.defaultStringParam = defaultStringParam;
if (this.defaultStringParam == null) {
this.defaultStringParam = "hello endpoints";
}
return this;
}
@Deprecated
@Override
public Builder deprecatedParam(String deprecatedParam) {
this.deprecatedParam = deprecatedParam;
return this;
}
@Override
public Builder booleanContextParam(Boolean booleanContextParam) {
this.booleanContextParam = booleanContextParam;
return this;
}
@Override
public Builder stringContextParam(String stringContextParam) {
this.stringContextParam = stringContextParam;
return this;
}
@Override
public Builder operationContextParam(String operationContextParam) {
this.operationContextParam = operationContextParam;
return this;
}
@Override
public QueryAuthSchemeParams build() {
return new DefaultQueryAuthSchemeParams(this);
}
}
}
| 3,102 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/ops-with-no-auth-auth-scheme-default-provider.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.database.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeParams;
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeProvider;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultDatabaseAuthSchemeProvider implements DatabaseAuthSchemeProvider {
private static final DefaultDatabaseAuthSchemeProvider DEFAULT = new DefaultDatabaseAuthSchemeProvider();
private DefaultDatabaseAuthSchemeProvider() {
}
public static DefaultDatabaseAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(DatabaseAuthSchemeParams params) {
List<AuthSchemeOption> options = new ArrayList<>();
switch (params.operation()) {
case "GetDatabaseVersion":
options.add(AuthSchemeOption.builder().schemeId("smithy.api#noAuth").build());
break;
case "GetRow":
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "database-service")
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build());
options.add(AuthSchemeOption.builder().schemeId("smithy.api#httpBearerAuth").build());
options.add(AuthSchemeOption.builder().schemeId("smithy.api#noAuth").build());
break;
default:
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "database-service")
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build());
options.add(AuthSchemeOption.builder().schemeId("smithy.api#httpBearerAuth").build());
break;
}
return Collections.unmodifiableList(options);
}
}
| 3,103 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-auth-scheme-default-provider.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeProvider;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeProvider implements QueryAuthSchemeProvider {
private static final DefaultQueryAuthSchemeProvider DEFAULT = new DefaultQueryAuthSchemeProvider();
private DefaultQueryAuthSchemeProvider() {
}
public static DefaultQueryAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(QueryAuthSchemeParams params) {
List<AuthSchemeOption> options = new ArrayList<>();
switch (params.operation()) {
case "BearerAuthOperation":
options.add(AuthSchemeOption.builder().schemeId("smithy.api#httpBearerAuth").build());
break;
case "OperationWithNoneAuthType":
options.add(AuthSchemeOption.builder().schemeId("smithy.api#noAuth").build());
break;
default:
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "query-service")
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build());
break;
}
return Collections.unmodifiableList(options);
}
}
| 3,104 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-auth-scheme-endpoint-provider.java | package software.amazon.awssdk.services.query.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.endpoints.AwsEndpointAttribute;
import software.amazon.awssdk.awscore.endpoints.authscheme.EndpointAuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4AuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4aAuthScheme;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4aHttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.RegionSet;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeProvider;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
import software.amazon.awssdk.utils.CompletableFutureUtils;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeProvider implements QueryAuthSchemeProvider {
private static final DefaultQueryAuthSchemeProvider DEFAULT = new DefaultQueryAuthSchemeProvider();
private static final QueryAuthSchemeProvider MODELED_RESOLVER = ModeledQueryAuthSchemeProvider.create();
private static final QueryEndpointProvider DELEGATE = QueryEndpointProvider.defaultProvider();
private DefaultQueryAuthSchemeProvider() {
}
public static QueryAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(QueryAuthSchemeParams params) {
QueryEndpointParams endpointParameters = QueryEndpointParams.builder().region(params.region())
.defaultTrueParam(params.defaultTrueParam()).defaultStringParam(params.defaultStringParam())
.deprecatedParam(params.deprecatedParam()).booleanContextParam(params.booleanContextParam())
.stringContextParam(params.stringContextParam()).operationContextParam(params.operationContextParam()).build();
Endpoint endpoint = CompletableFutureUtils.joinLikeSync(DELEGATE.resolveEndpoint(endpointParameters));
List<EndpointAuthScheme> authSchemes = endpoint.attribute(AwsEndpointAttribute.AUTH_SCHEMES);
if (authSchemes == null) {
return MODELED_RESOLVER.resolveAuthScheme(params);
}
List<AuthSchemeOption> options = new ArrayList<>();
for (EndpointAuthScheme authScheme : authSchemes) {
String name = authScheme.name();
switch (name) {
case "sigv4":
SigV4AuthScheme sigv4AuthScheme = Validate.isInstanceOf(SigV4AuthScheme.class, authScheme,
"Expecting auth scheme of class SigV4AuthScheme, got instead object of class %s", authScheme.getClass()
.getName());
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, sigv4AuthScheme.signingName())
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, sigv4AuthScheme.signingRegion())
.putSignerProperty(AwsV4HttpSigner.DOUBLE_URL_ENCODE, !sigv4AuthScheme.disableDoubleEncoding()).build());
break;
case "sigv4a":
SigV4aAuthScheme sigv4aAuthScheme = Validate.isInstanceOf(SigV4aAuthScheme.class, authScheme,
"Expecting auth scheme of class SigV4AuthScheme, got instead object of class %s", authScheme.getClass()
.getName());
RegionSet regionSet = RegionSet.create(sigv4aAuthScheme.signingRegionSet());
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4a")
.putSignerProperty(AwsV4aHttpSigner.SERVICE_SIGNING_NAME, sigv4aAuthScheme.signingName())
.putSignerProperty(AwsV4aHttpSigner.REGION_SET, regionSet)
.putSignerProperty(AwsV4aHttpSigner.DOUBLE_URL_ENCODE, !sigv4aAuthScheme.disableDoubleEncoding()).build());
break;
default:
throw new IllegalArgumentException("Unknown auth scheme: " + name);
}
}
return Collections.unmodifiableList(options);
}
}
| 3,105 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-auth-scheme-default-params.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme.internal;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeParams implements QueryAuthSchemeParams {
private final String operation;
private final Region region;
private DefaultQueryAuthSchemeParams(Builder builder) {
this.operation = Validate.paramNotNull(builder.operation, "operation");
this.region = builder.region;
}
public static QueryAuthSchemeParams.Builder builder() {
return new Builder();
}
@Override
public String operation() {
return operation;
}
@Override
public Region region() {
return region;
}
@Override
public QueryAuthSchemeParams.Builder toBuilder() {
return new Builder(this);
}
private static final class Builder implements QueryAuthSchemeParams.Builder {
private String operation;
private Region region;
Builder() {
}
Builder(DefaultQueryAuthSchemeParams params) {
this.operation = params.operation;
this.region = params.region;
}
@Override
public Builder operation(String operation) {
this.operation = operation;
return this;
}
@Override
public Builder region(Region region) {
this.region = region;
return this;
}
@Override
public QueryAuthSchemeParams build() {
return new DefaultQueryAuthSchemeParams(this);
}
}
}
| 3,106 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/default-auth-scheme-provider.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme.internal;
import java.util.ArrayList;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeProvider;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeProvider implements QueryAuthSchemeProvider {
private static final DefaultQueryAuthSchemeProvider DEFAULT = new DefaultQueryAuthSchemeProvider();
private DefaultQueryAuthSchemeProvider() {
}
public static DefaultQueryAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(QueryAuthSchemeParams authSchemeParams) {
return new ArrayList<>();
}
}
| 3,107 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-auth-scheme-params-without-allowlist.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.query.auth.scheme;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.query.auth.scheme.internal.DefaultQueryAuthSchemeParams;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
* The parameters object used to resolve the auth schemes for the Query service.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryAuthSchemeParams extends ToCopyableBuilder<QueryAuthSchemeParams.Builder, QueryAuthSchemeParams> {
/**
* Get a new builder for creating a {@link QueryAuthSchemeParams}.
*/
static Builder builder() {
return DefaultQueryAuthSchemeParams.builder();
}
/**
* Returns the operation for which to resolve the auth scheme.
*/
String operation();
/**
* Returns the region. The region parameter may be used with the "aws.auth#sigv4" auth scheme.
*/
Region region();
Boolean useDualStackEndpoint();
Boolean useFipsEndpoint();
String endpointId();
/**
* A param that defauls to true
*/
Boolean defaultTrueParam();
String defaultStringParam();
@Deprecated
String deprecatedParam();
Boolean booleanContextParam();
String stringContextParam();
String operationContextParam();
/**
* Returns a {@link Builder} to customize the parameters.
*/
Builder toBuilder();
/**
* A builder for a {@link QueryAuthSchemeParams}.
*/
interface Builder extends CopyableBuilder<Builder, QueryAuthSchemeParams> {
/**
* Set the operation for which to resolve the auth scheme.
*/
Builder operation(String operation);
/**
* Set the region. The region parameter may be used with the "aws.auth#sigv4" auth scheme.
*/
Builder region(Region region);
Builder useDualStackEndpoint(Boolean useDualStackEndpoint);
Builder useFipsEndpoint(Boolean useFIPSEndpoint);
Builder endpointId(String endpointId);
/**
* A param that defauls to true
*/
Builder defaultTrueParam(Boolean defaultTrueParam);
Builder defaultStringParam(String defaultStringParam);
@Deprecated
Builder deprecatedParam(String deprecatedParam);
Builder booleanContextParam(Boolean booleanContextParam);
Builder stringContextParam(String stringContextParam);
Builder operationContextParam(String operationContextParam);
/**
* Returns a {@link QueryAuthSchemeParams} object that is created from the properties that have been set on the
* builder.
*/
QueryAuthSchemeParams build();
}
}
| 3,108 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/all-ops-auth-same-value-auth-scheme-default-provider.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.database.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeParams;
import software.amazon.awssdk.services.database.auth.scheme.DatabaseAuthSchemeProvider;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultDatabaseAuthSchemeProvider implements DatabaseAuthSchemeProvider {
private static final DefaultDatabaseAuthSchemeProvider DEFAULT = new DefaultDatabaseAuthSchemeProvider();
private DefaultDatabaseAuthSchemeProvider() {
}
public static DefaultDatabaseAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(DatabaseAuthSchemeParams params) {
List<AuthSchemeOption> options = new ArrayList<>();
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "database-service")
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id()).build());
options.add(AuthSchemeOption.builder().schemeId("smithy.api#httpBearerAuth").build());
return Collections.unmodifiableList(options);
}
}
| 3,109 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/mini-s3-auth-scheme-default-provider.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.services.minis3.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.minis3.auth.scheme.MiniS3AuthSchemeParams;
import software.amazon.awssdk.services.minis3.auth.scheme.MiniS3AuthSchemeProvider;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultMiniS3AuthSchemeProvider implements MiniS3AuthSchemeProvider {
private static final DefaultMiniS3AuthSchemeProvider DEFAULT = new DefaultMiniS3AuthSchemeProvider();
private DefaultMiniS3AuthSchemeProvider() {
}
public static DefaultMiniS3AuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(MiniS3AuthSchemeParams params) {
List<AuthSchemeOption> options = new ArrayList<>();
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "mini-s3-service")
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, params.region().id())
.putSignerProperty(AwsV4HttpSigner.DOUBLE_URL_ENCODE, false)
.putSignerProperty(AwsV4HttpSigner.NORMALIZE_PATH, false)
.putSignerProperty(AwsV4HttpSigner.PAYLOAD_SIGNING_ENABLED, false).build());
return Collections.unmodifiableList(options);
}
}
| 3,110 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-auth-scheme-endpoint-provider-without-allowlist.java | package software.amazon.awssdk.services.query.auth.scheme.internal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.endpoints.AwsEndpointAttribute;
import software.amazon.awssdk.awscore.endpoints.authscheme.EndpointAuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4AuthScheme;
import software.amazon.awssdk.awscore.endpoints.authscheme.SigV4aAuthScheme;
import software.amazon.awssdk.endpoints.Endpoint;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.AwsV4aHttpSigner;
import software.amazon.awssdk.http.auth.aws.signer.RegionSet;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeProvider;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointProvider;
import software.amazon.awssdk.utils.CompletableFutureUtils;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class DefaultQueryAuthSchemeProvider implements QueryAuthSchemeProvider {
private static final DefaultQueryAuthSchemeProvider DEFAULT = new DefaultQueryAuthSchemeProvider();
private static final QueryAuthSchemeProvider MODELED_RESOLVER = ModeledQueryAuthSchemeProvider.create();
private static final QueryEndpointProvider DELEGATE = QueryEndpointProvider.defaultProvider();
private DefaultQueryAuthSchemeProvider() {
}
public static QueryAuthSchemeProvider create() {
return DEFAULT;
}
@Override
public List<AuthSchemeOption> resolveAuthScheme(QueryAuthSchemeParams params) {
QueryEndpointParams endpointParameters = QueryEndpointParams.builder().region(params.region())
.useDualStackEndpoint(params.useDualStackEndpoint()).useFipsEndpoint(params.useFipsEndpoint())
.endpointId(params.endpointId()).defaultTrueParam(params.defaultTrueParam())
.defaultStringParam(params.defaultStringParam()).deprecatedParam(params.deprecatedParam())
.booleanContextParam(params.booleanContextParam()).stringContextParam(params.stringContextParam())
.operationContextParam(params.operationContextParam()).build();
Endpoint endpoint = CompletableFutureUtils.joinLikeSync(DELEGATE.resolveEndpoint(endpointParameters));
List<EndpointAuthScheme> authSchemes = endpoint.attribute(AwsEndpointAttribute.AUTH_SCHEMES);
if (authSchemes == null) {
return MODELED_RESOLVER.resolveAuthScheme(params);
}
List<AuthSchemeOption> options = new ArrayList<>();
for (EndpointAuthScheme authScheme : authSchemes) {
String name = authScheme.name();
switch (name) {
case "sigv4":
SigV4AuthScheme sigv4AuthScheme = Validate.isInstanceOf(SigV4AuthScheme.class, authScheme,
"Expecting auth scheme of class SigV4AuthScheme, got instead object of class %s", authScheme.getClass()
.getName());
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4")
.putSignerProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, sigv4AuthScheme.signingName())
.putSignerProperty(AwsV4HttpSigner.REGION_NAME, sigv4AuthScheme.signingRegion())
.putSignerProperty(AwsV4HttpSigner.DOUBLE_URL_ENCODE, !sigv4AuthScheme.disableDoubleEncoding()).build());
break;
case "sigv4a":
SigV4aAuthScheme sigv4aAuthScheme = Validate.isInstanceOf(SigV4aAuthScheme.class, authScheme,
"Expecting auth scheme of class SigV4AuthScheme, got instead object of class %s", authScheme.getClass()
.getName());
RegionSet regionSet = RegionSet.create(sigv4aAuthScheme.signingRegionSet());
options.add(AuthSchemeOption.builder().schemeId("aws.auth#sigv4a")
.putSignerProperty(AwsV4aHttpSigner.SERVICE_SIGNING_NAME, sigv4aAuthScheme.signingName())
.putSignerProperty(AwsV4aHttpSigner.REGION_SET, regionSet)
.putSignerProperty(AwsV4aHttpSigner.DOUBLE_URL_ENCODE, !sigv4aAuthScheme.disableDoubleEncoding()).build());
break;
default:
throw new IllegalArgumentException("Unknown auth scheme: " + name);
}
}
return Collections.unmodifiableList(options);
}
}
| 3,111 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/auth/scheme/query-endpoint-auth-params-without-allowlist-auth-scheme-interceptor.java | package software.amazon.awssdk.services.query.auth.scheme.internal;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.SelectedAuthScheme;
import software.amazon.awssdk.core.exception.SdkException;
import software.amazon.awssdk.core.interceptor.Context;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.core.interceptor.SdkExecutionAttribute;
import software.amazon.awssdk.core.interceptor.SdkInternalExecutionAttribute;
import software.amazon.awssdk.core.internal.util.MetricUtils;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeOption;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.Identity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.identity.spi.IdentityProviders;
import software.amazon.awssdk.identity.spi.ResolveIdentityRequest;
import software.amazon.awssdk.identity.spi.TokenIdentity;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.SdkMetric;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeParams;
import software.amazon.awssdk.services.query.auth.scheme.QueryAuthSchemeProvider;
import software.amazon.awssdk.services.query.endpoints.QueryEndpointParams;
import software.amazon.awssdk.services.query.endpoints.internal.AuthSchemeUtils;
import software.amazon.awssdk.services.query.endpoints.internal.QueryResolveEndpointInterceptor;
import software.amazon.awssdk.utils.Logger;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public final class QueryAuthSchemeInterceptor implements ExecutionInterceptor {
private static Logger LOG = Logger.loggerFor(QueryAuthSchemeInterceptor.class);
@Override
public void beforeExecution(Context.BeforeExecution context, ExecutionAttributes executionAttributes) {
List<AuthSchemeOption> authOptions = resolveAuthOptions(context, executionAttributes);
SelectedAuthScheme<? extends Identity> selectedAuthScheme = selectAuthScheme(authOptions, executionAttributes);
AuthSchemeUtils.putSelectedAuthScheme(executionAttributes, selectedAuthScheme);
}
private List<AuthSchemeOption> resolveAuthOptions(Context.BeforeExecution context, ExecutionAttributes executionAttributes) {
QueryAuthSchemeProvider authSchemeProvider = Validate.isInstanceOf(QueryAuthSchemeProvider.class,
executionAttributes.getAttribute(SdkInternalExecutionAttribute.AUTH_SCHEME_RESOLVER),
"Expected an instance of QueryAuthSchemeProvider");
QueryAuthSchemeParams params = authSchemeParams(context.request(), executionAttributes);
return authSchemeProvider.resolveAuthScheme(params);
}
private SelectedAuthScheme<? extends Identity> selectAuthScheme(List<AuthSchemeOption> authOptions,
ExecutionAttributes executionAttributes) {
MetricCollector metricCollector = executionAttributes.getAttribute(SdkExecutionAttribute.API_CALL_METRIC_COLLECTOR);
Map<String, AuthScheme<?>> authSchemes = executionAttributes.getAttribute(SdkInternalExecutionAttribute.AUTH_SCHEMES);
IdentityProviders identityProviders = executionAttributes
.getAttribute(SdkInternalExecutionAttribute.IDENTITY_PROVIDERS);
List<Supplier<String>> discardedReasons = new ArrayList<>();
for (AuthSchemeOption authOption : authOptions) {
AuthScheme<?> authScheme = authSchemes.get(authOption.schemeId());
SelectedAuthScheme<? extends Identity> selectedAuthScheme = trySelectAuthScheme(authOption, authScheme,
identityProviders, discardedReasons, metricCollector);
if (selectedAuthScheme != null) {
if (!discardedReasons.isEmpty()) {
LOG.debug(() -> String.format("%s auth will be used, discarded: '%s'", authOption.schemeId(),
discardedReasons.stream().map(Supplier::get).collect(Collectors.joining(", "))));
}
return selectedAuthScheme;
}
}
throw SdkException
.builder()
.message(
"Failed to determine how to authenticate the user: "
+ discardedReasons.stream().map(Supplier::get).collect(Collectors.joining(", "))).build();
}
private QueryAuthSchemeParams authSchemeParams(SdkRequest request, ExecutionAttributes executionAttributes) {
QueryEndpointParams endpointParams = QueryResolveEndpointInterceptor.ruleParams(request, executionAttributes);
QueryAuthSchemeParams.Builder builder = QueryAuthSchemeParams.builder();
builder.region(endpointParams.region());
builder.useDualStackEndpoint(endpointParams.useDualStackEndpoint());
builder.useFipsEndpoint(endpointParams.useFipsEndpoint());
builder.endpointId(endpointParams.endpointId());
builder.defaultTrueParam(endpointParams.defaultTrueParam());
builder.defaultStringParam(endpointParams.defaultStringParam());
builder.deprecatedParam(endpointParams.deprecatedParam());
builder.booleanContextParam(endpointParams.booleanContextParam());
builder.stringContextParam(endpointParams.stringContextParam());
builder.operationContextParam(endpointParams.operationContextParam());
String operation = executionAttributes.getAttribute(SdkExecutionAttribute.OPERATION_NAME);
builder.operation(operation);
return builder.build();
}
private <T extends Identity> SelectedAuthScheme<T> trySelectAuthScheme(AuthSchemeOption authOption, AuthScheme<T> authScheme,
IdentityProviders identityProviders, List<Supplier<String>> discardedReasons,
MetricCollector metricCollector) {
if (authScheme == null) {
discardedReasons.add(() -> String.format("'%s' is not enabled for this request.", authOption.schemeId()));
return null;
}
IdentityProvider<T> identityProvider = authScheme.identityProvider(identityProviders);
if (identityProvider == null) {
discardedReasons
.add(() -> String.format("'%s' does not have an identity provider configured.", authOption.schemeId()));
return null;
}
ResolveIdentityRequest.Builder identityRequestBuilder = ResolveIdentityRequest.builder();
authOption.forEachIdentityProperty(identityRequestBuilder::putProperty);
CompletableFuture<? extends T> identity;
SdkMetric<Duration> metric = getIdentityMetric(identityProvider);
if (metric == null) {
identity = identityProvider.resolveIdentity(identityRequestBuilder.build());
} else {
identity = MetricUtils.reportDuration(() -> identityProvider.resolveIdentity(identityRequestBuilder.build()),
metricCollector, metric);
}
return new SelectedAuthScheme<>(identity, authScheme.signer(), authOption);
}
private SdkMetric<Duration> getIdentityMetric(IdentityProvider<?> identityProvider) {
Class<?> identityType = identityProvider.identityType();
if (identityType == AwsCredentialsIdentity.class) {
return CoreMetric.CREDENTIALS_FETCH_DURATION;
}
if (identityType == TokenIdentity.class) {
return CoreMetric.TOKEN_FETCH_DURATION;
}
return null;
}
}
| 3,112 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/plugins/InternalTestPlugin2.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.codegen.poet.plugins;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkServiceClientConfiguration;
public class InternalTestPlugin2 implements SdkPlugin {
@Override
public void configureClient(SdkServiceClientConfiguration.Builder config) {
}
} | 3,113 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/plugins/InternalTestPlugin1.java | /*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package software.amazon.awssdk.codegen.poet.plugins;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkServiceClientConfiguration;
public class InternalTestPlugin1 implements SdkPlugin {
@Override
public void configureClient(SdkServiceClientConfiguration.Builder config) {
}
} | 3,114 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/endpointdiscovery/test-sync-cache-loader.java | package software.amazon.awssdk.services.endpointdiscoverytest;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryCacheLoader;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryEndpoint;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRequest;
import software.amazon.awssdk.services.endpointdiscoverytest.model.DescribeEndpointsResponse;
import software.amazon.awssdk.services.endpointdiscoverytest.model.Endpoint;
import software.amazon.awssdk.utils.Validate;
@SdkInternalApi
@Generated("software.amazon.awssdk:codegen")
class EndpointDiscoveryTestEndpointDiscoveryCacheLoader implements EndpointDiscoveryCacheLoader {
private final EndpointDiscoveryTestClient client;
private EndpointDiscoveryTestEndpointDiscoveryCacheLoader(EndpointDiscoveryTestClient client) {
this.client = client;
}
public static EndpointDiscoveryTestEndpointDiscoveryCacheLoader create(EndpointDiscoveryTestClient client) {
return new EndpointDiscoveryTestEndpointDiscoveryCacheLoader(client);
}
@Override
public CompletableFuture<EndpointDiscoveryEndpoint> discoverEndpoint(EndpointDiscoveryRequest endpointDiscoveryRequest) {
return CompletableFuture.supplyAsync(() -> {
AwsRequestOverrideConfiguration requestConfig = AwsRequestOverrideConfiguration.from(endpointDiscoveryRequest
.overrideConfiguration().orElse(null));
DescribeEndpointsResponse response = client
.describeEndpoints(software.amazon.awssdk.services.endpointdiscoverytest.model.DescribeEndpointsRequest
.builder().overrideConfiguration(requestConfig).build());
List<Endpoint> endpoints = response.endpoints();
Validate.notEmpty(endpoints, "Endpoints returned by service for endpoint discovery must not be empty.");
Endpoint endpoint = endpoints.get(0);
return EndpointDiscoveryEndpoint.builder()
.endpoint(toUri(endpoint.address(), endpointDiscoveryRequest.defaultEndpoint()))
.expirationTime(Instant.now().plus(endpoint.cachePeriodInMinutes(), ChronoUnit.MINUTES)).build();
});
}
}
| 3,115 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/endpointdiscovery/test-async-cache-loader.java | package software.amazon.awssdk.services.endpointdiscoverytest;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryCacheLoader;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryEndpoint;
import software.amazon.awssdk.core.endpointdiscovery.EndpointDiscoveryRequest;
import software.amazon.awssdk.services.endpointdiscoverytest.model.Endpoint;
import software.amazon.awssdk.utils.Validate;
@SdkInternalApi
@Generated("software.amazon.awssdk:codegen")
class EndpointDiscoveryTestAsyncEndpointDiscoveryCacheLoader implements EndpointDiscoveryCacheLoader {
private final EndpointDiscoveryTestAsyncClient client;
EndpointDiscoveryTestAsyncEndpointDiscoveryCacheLoader(EndpointDiscoveryTestAsyncClient client) {
this.client = client;
}
public static EndpointDiscoveryTestAsyncEndpointDiscoveryCacheLoader create(EndpointDiscoveryTestAsyncClient client) {
return new EndpointDiscoveryTestAsyncEndpointDiscoveryCacheLoader(client);
}
@Override
public CompletableFuture<EndpointDiscoveryEndpoint> discoverEndpoint(EndpointDiscoveryRequest endpointDiscoveryRequest) {
AwsRequestOverrideConfiguration requestConfig = AwsRequestOverrideConfiguration.from(endpointDiscoveryRequest
.overrideConfiguration().orElse(null));
return client.describeEndpoints(
software.amazon.awssdk.services.endpointdiscoverytest.model.DescribeEndpointsRequest.builder()
.overrideConfiguration(requestConfig).build()).thenApply(
r -> {
List<Endpoint> endpoints = r.endpoints();
Validate.notEmpty(endpoints, "Endpoints returned by service for endpoint discovery must not be empty.");
Endpoint endpoint = endpoints.get(0);
return EndpointDiscoveryEndpoint.builder()
.endpoint(toUri(endpoint.address(), endpointDiscoveryRequest.defaultEndpoint()))
.expirationTime(Instant.now().plus(endpoint.cachePeriodInMinutes(), ChronoUnit.MINUTES)).build();
});
}
}
| 3,116 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/waiters/query-async-waiter-class.java | package software.amazon.awssdk.services.query.waiters;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.internal.waiters.WaiterAttribute;
import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
import software.amazon.awssdk.core.waiters.AsyncWaiter;
import software.amazon.awssdk.core.waiters.WaiterAcceptor;
import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration;
import software.amazon.awssdk.core.waiters.WaiterResponse;
import software.amazon.awssdk.core.waiters.WaiterState;
import software.amazon.awssdk.services.query.QueryAsyncClient;
import software.amazon.awssdk.services.query.model.APostOperationRequest;
import software.amazon.awssdk.services.query.model.APostOperationResponse;
import software.amazon.awssdk.services.query.model.QueryRequest;
import software.amazon.awssdk.services.query.waiters.internal.WaitersRuntime;
import software.amazon.awssdk.utils.AttributeMap;
import software.amazon.awssdk.utils.SdkAutoCloseable;
import software.amazon.awssdk.utils.ThreadFactoryBuilder;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
@ThreadSafe
final class DefaultQueryAsyncWaiter implements QueryAsyncWaiter {
private static final WaiterAttribute<SdkAutoCloseable> CLIENT_ATTRIBUTE = new WaiterAttribute<>(SdkAutoCloseable.class);
private static final WaiterAttribute<ScheduledExecutorService> SCHEDULED_EXECUTOR_SERVICE_ATTRIBUTE = new WaiterAttribute<>(
ScheduledExecutorService.class);
private final QueryAsyncClient client;
private final AttributeMap managedResources;
private final AsyncWaiter<APostOperationResponse> postOperationSuccessWaiter;
private final ScheduledExecutorService executorService;
private DefaultQueryAsyncWaiter(DefaultBuilder builder) {
AttributeMap.Builder attributeMapBuilder = AttributeMap.builder();
if (builder.client == null) {
this.client = QueryAsyncClient.builder().build();
attributeMapBuilder.put(CLIENT_ATTRIBUTE, this.client);
} else {
this.client = builder.client;
}
if (builder.executorService == null) {
this.executorService = Executors.newScheduledThreadPool(1,
new ThreadFactoryBuilder().threadNamePrefix("waiters-ScheduledExecutor").build());
attributeMapBuilder.put(SCHEDULED_EXECUTOR_SERVICE_ATTRIBUTE, this.executorService);
} else {
this.executorService = builder.executorService;
}
managedResources = attributeMapBuilder.build();
this.postOperationSuccessWaiter = AsyncWaiter.builder(APostOperationResponse.class)
.acceptors(postOperationSuccessWaiterAcceptors())
.overrideConfiguration(postOperationSuccessWaiterConfig(builder.overrideConfiguration))
.scheduledExecutorService(executorService).build();
}
private static String errorCode(Throwable error) {
if (error instanceof AwsServiceException) {
return ((AwsServiceException) error).awsErrorDetails().errorCode();
}
return null;
}
@Override
public CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
APostOperationRequest aPostOperationRequest) {
return postOperationSuccessWaiter.runAsync(() -> client.aPostOperation(applyWaitersUserAgent(aPostOperationRequest)));
}
@Override
public CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
APostOperationRequest aPostOperationRequest, WaiterOverrideConfiguration overrideConfig) {
return postOperationSuccessWaiter.runAsync(() -> client.aPostOperation(applyWaitersUserAgent(aPostOperationRequest)),
postOperationSuccessWaiterConfig(overrideConfig));
}
private static List<WaiterAcceptor<? super APostOperationResponse>> postOperationSuccessWaiterAcceptors() {
List<WaiterAcceptor<? super APostOperationResponse>> result = new ArrayList<>();
result.add(new WaitersRuntime.ResponseStatusAcceptor(200, WaiterState.SUCCESS));
result.add(new WaitersRuntime.ResponseStatusAcceptor(404, WaiterState.RETRY));
result.add(WaiterAcceptor.successOnResponseAcceptor(response -> {
WaitersRuntime.Value input = new WaitersRuntime.Value(response);
List<Object> resultValues = input.field("foo").field("bar").values();
return !resultValues.isEmpty() && resultValues.stream().anyMatch(v -> Objects.equals(v, "baz"));
}));
result.addAll(WaitersRuntime.DEFAULT_ACCEPTORS);
return result;
}
private static WaiterOverrideConfiguration postOperationSuccessWaiterConfig(WaiterOverrideConfiguration overrideConfig) {
Optional<WaiterOverrideConfiguration> optionalOverrideConfig = Optional.ofNullable(overrideConfig);
int maxAttempts = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::maxAttempts).orElse(40);
BackoffStrategy backoffStrategy = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::backoffStrategy).orElse(
FixedDelayBackoffStrategy.create(Duration.ofSeconds(1)));
Duration waitTimeout = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::waitTimeout).orElse(null);
return WaiterOverrideConfiguration.builder().maxAttempts(maxAttempts).backoffStrategy(backoffStrategy)
.waitTimeout(waitTimeout).build();
}
@Override
public void close() {
managedResources.close();
}
public static QueryAsyncWaiter.Builder builder() {
return new DefaultBuilder();
}
private <T extends QueryRequest> T applyWaitersUserAgent(T request) {
Consumer<AwsRequestOverrideConfiguration.Builder> userAgentApplier = b -> b.addApiName(ApiName.builder()
.version("waiter").name("hll").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
public static final class DefaultBuilder implements QueryAsyncWaiter.Builder {
private QueryAsyncClient client;
private WaiterOverrideConfiguration overrideConfiguration;
private ScheduledExecutorService executorService;
private DefaultBuilder() {
}
@Override
public QueryAsyncWaiter.Builder scheduledExecutorService(ScheduledExecutorService executorService) {
this.executorService = executorService;
return this;
}
@Override
public QueryAsyncWaiter.Builder overrideConfiguration(WaiterOverrideConfiguration overrideConfiguration) {
this.overrideConfiguration = overrideConfiguration;
return this;
}
@Override
public QueryAsyncWaiter.Builder client(QueryAsyncClient client) {
this.client = client;
return this;
}
public QueryAsyncWaiter build() {
return new DefaultQueryAsyncWaiter(this);
}
}
}
| 3,117 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/waiters/query-sync-waiter-interface.java | package software.amazon.awssdk.services.query.waiters;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration;
import software.amazon.awssdk.core.waiters.WaiterResponse;
import software.amazon.awssdk.services.query.QueryClient;
import software.amazon.awssdk.services.query.model.APostOperationRequest;
import software.amazon.awssdk.services.query.model.APostOperationResponse;
import software.amazon.awssdk.utils.SdkAutoCloseable;
/**
* Waiter utility class that polls a resource until a desired state is reached or until it is determined that the
* resource will never enter into the desired state. This can be created using the static {@link #builder()} method
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryWaiter extends SdkAutoCloseable {
/**
* Polls {@link QueryClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is met, or
* until it is determined that the resource will never enter into the desired state
*
* @param aPostOperationRequest
* the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(APostOperationRequest aPostOperationRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link QueryClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is met, or
* until it is determined that the resource will never enter into the desired state.
* <p>
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link APostOperationRequest#builder()}
*
* @param aPostOperationRequest
* The consumer that will configure the request to be used for polling
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(
Consumer<APostOperationRequest.Builder> aPostOperationRequest) {
return waitUntilPostOperationSuccess(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build());
}
/**
* Polls {@link QueryClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is met, or
* until it is determined that the resource will never enter into the desired state
*
* @param aPostOperationRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(APostOperationRequest aPostOperationRequest,
WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link QueryClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is met, or
* until it is determined that the resource will never enter into the desired state.
* <p>
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param aPostOperationRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(
Consumer<APostOperationRequest.Builder> aPostOperationRequest,
Consumer<WaiterOverrideConfiguration.Builder> overrideConfig) {
return waitUntilPostOperationSuccess(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Create a builder that can be used to configure and create a {@link QueryWaiter}.
*
* @return a builder
*/
static Builder builder() {
return DefaultQueryWaiter.builder();
}
/**
* Create an instance of {@link QueryWaiter} with the default configuration.
* <p>
* <b>A default {@link QueryClient} will be created to poll resources. It is recommended to share a single instance
* of the waiter created via this method. If it is not desirable to share a waiter instance, invoke {@link #close()}
* to release the resources once the waiter is not needed.</b>
*
* @return an instance of {@link QueryWaiter}
*/
static QueryWaiter create() {
return DefaultQueryWaiter.builder().build();
}
interface Builder {
/**
* Defines overrides to the default SDK waiter configuration that should be used for waiters created from this
* builder
*
* @param overrideConfiguration
* the override configuration to set
* @return a reference to this object so that method calls can be chained together.
*/
Builder overrideConfiguration(WaiterOverrideConfiguration overrideConfiguration);
/**
* This is a convenient method to pass the override configuration without the need to create an instance
* manually via {@link WaiterOverrideConfiguration#builder()}
*
* @param overrideConfiguration
* The consumer that will configure the overrideConfiguration
* @return a reference to this object so that method calls can be chained together.
* @see #overrideConfiguration(WaiterOverrideConfiguration)
*/
default Builder overrideConfiguration(Consumer<WaiterOverrideConfiguration.Builder> overrideConfiguration) {
WaiterOverrideConfiguration.Builder builder = WaiterOverrideConfiguration.builder();
overrideConfiguration.accept(builder);
return overrideConfiguration(builder.build());
}
/**
* Sets a custom {@link QueryClient} that will be used to poll the resource
* <p>
* This SDK client must be closed by the caller when it is ready to be disposed. The SDK will not close the
* client when the waiter is closed
*
* @param client
* the client to send the request
* @return a reference to this object so that method calls can be chained together.
*/
Builder client(QueryClient client);
/**
* Builds an instance of {@link QueryWaiter} based on the configurations supplied to this builder
*
* @return An initialized {@link QueryWaiter}
*/
QueryWaiter build();
}
}
| 3,118 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/waiters/query-async-waiter-interface.java | package software.amazon.awssdk.services.query.waiters;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration;
import software.amazon.awssdk.core.waiters.WaiterResponse;
import software.amazon.awssdk.services.query.QueryAsyncClient;
import software.amazon.awssdk.services.query.model.APostOperationRequest;
import software.amazon.awssdk.services.query.model.APostOperationResponse;
import software.amazon.awssdk.utils.SdkAutoCloseable;
/**
* Waiter utility class that polls a resource until a desired state is reached or until it is determined that the
* resource will never enter into the desired state. This can be created using the static {@link #builder()} method
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface QueryAsyncWaiter extends SdkAutoCloseable {
/**
* Polls {@link QueryAsyncClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is
* met, or until it is determined that the resource will never enter into the desired state
*
* @param aPostOperationRequest
* the request to be used for polling
* @return CompletableFuture containing the WaiterResponse. It completes successfully when the resource enters into
* a desired state or exceptionally when it is determined that the resource will never enter into the
* desired state.
*/
default CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
APostOperationRequest aPostOperationRequest) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link QueryAsyncClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is
* met, or until it is determined that the resource will never enter into the desired state.
* <p>
* This is a convenience method to create an instance of the request builder without the need to create one manually
* using {@link APostOperationRequest#builder()}
*
* @param aPostOperationRequest
* The consumer that will configure the request to be used for polling
* @return CompletableFuture of the WaiterResponse containing either a response or an exception that has matched
* with the waiter success condition
*/
default CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
Consumer<APostOperationRequest.Builder> aPostOperationRequest) {
return waitUntilPostOperationSuccess(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build());
}
/**
* Polls {@link QueryAsyncClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is
* met, or until it is determined that the resource will never enter into the desired state
*
* @param aPostOperationRequest
* The request to be used for polling
* @param overrideConfig
* Per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
APostOperationRequest aPostOperationRequest, WaiterOverrideConfiguration overrideConfig) {
throw new UnsupportedOperationException();
}
/**
* Polls {@link QueryAsyncClient#aPostOperation} API until the desired condition {@code PostOperationSuccess} is
* met, or until it is determined that the resource will never enter into the desired state.
* <p>
* This is a convenience method to create an instance of the request builder and instance of the override config
* builder
*
* @param aPostOperationRequest
* The consumer that will configure the request to be used for polling
* @param overrideConfig
* The consumer that will configure the per request override configuration for waiters
* @return WaiterResponse containing either a response or an exception that has matched with the waiter success
* condition
*/
default CompletableFuture<WaiterResponse<APostOperationResponse>> waitUntilPostOperationSuccess(
Consumer<APostOperationRequest.Builder> aPostOperationRequest,
Consumer<WaiterOverrideConfiguration.Builder> overrideConfig) {
return waitUntilPostOperationSuccess(APostOperationRequest.builder().applyMutation(aPostOperationRequest).build(),
WaiterOverrideConfiguration.builder().applyMutation(overrideConfig).build());
}
/**
* Create a builder that can be used to configure and create a {@link QueryAsyncWaiter}.
*
* @return a builder
*/
static Builder builder() {
return DefaultQueryAsyncWaiter.builder();
}
/**
* Create an instance of {@link QueryAsyncWaiter} with the default configuration.
* <p>
* <b>A default {@link QueryAsyncClient} will be created to poll resources. It is recommended to share a single
* instance of the waiter created via this method. If it is not desirable to share a waiter instance, invoke
* {@link #close()} to release the resources once the waiter is not needed.</b>
*
* @return an instance of {@link QueryAsyncWaiter}
*/
static QueryAsyncWaiter create() {
return DefaultQueryAsyncWaiter.builder().build();
}
interface Builder {
/**
* Sets a custom {@link ScheduledExecutorService} that will be used to schedule async polling attempts
* <p>
* This executorService must be closed by the caller when it is ready to be disposed. The SDK will not close the
* executorService when the waiter is closed
*
* @param executorService
* the executorService to set
* @return a reference to this object so that method calls can be chained together.
*/
Builder scheduledExecutorService(ScheduledExecutorService executorService);
/**
* Defines overrides to the default SDK waiter configuration that should be used for waiters created from this
* builder
*
* @param overrideConfiguration
* the override configuration to set
* @return a reference to this object so that method calls can be chained together.
*/
Builder overrideConfiguration(WaiterOverrideConfiguration overrideConfiguration);
/**
* This is a convenient method to pass the override configuration without the need to create an instance
* manually via {@link WaiterOverrideConfiguration#builder()}
*
* @param overrideConfiguration
* The consumer that will configure the overrideConfiguration
* @return a reference to this object so that method calls can be chained together.
* @see #overrideConfiguration(WaiterOverrideConfiguration)
*/
default Builder overrideConfiguration(Consumer<WaiterOverrideConfiguration.Builder> overrideConfiguration) {
WaiterOverrideConfiguration.Builder builder = WaiterOverrideConfiguration.builder();
overrideConfiguration.accept(builder);
return overrideConfiguration(builder.build());
}
/**
* Sets a custom {@link QueryAsyncClient} that will be used to poll the resource
* <p>
* This SDK client must be closed by the caller when it is ready to be disposed. The SDK will not close the
* client when the waiter is closed
*
* @param client
* the client to send the request
* @return a reference to this object so that method calls can be chained together.
*/
Builder client(QueryAsyncClient client);
/**
* Builds an instance of {@link QueryAsyncWaiter} based on the configurations supplied to this builder
*
* @return An initialized {@link QueryAsyncWaiter}
*/
QueryAsyncWaiter build();
}
}
| 3,119 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/waiters/query-sync-waiter-class.java | package software.amazon.awssdk.services.query.waiters;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.annotations.ThreadSafe;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.internal.waiters.WaiterAttribute;
import software.amazon.awssdk.core.retry.backoff.BackoffStrategy;
import software.amazon.awssdk.core.retry.backoff.FixedDelayBackoffStrategy;
import software.amazon.awssdk.core.waiters.Waiter;
import software.amazon.awssdk.core.waiters.WaiterAcceptor;
import software.amazon.awssdk.core.waiters.WaiterOverrideConfiguration;
import software.amazon.awssdk.core.waiters.WaiterResponse;
import software.amazon.awssdk.core.waiters.WaiterState;
import software.amazon.awssdk.services.query.QueryClient;
import software.amazon.awssdk.services.query.model.APostOperationRequest;
import software.amazon.awssdk.services.query.model.APostOperationResponse;
import software.amazon.awssdk.services.query.model.QueryRequest;
import software.amazon.awssdk.services.query.waiters.internal.WaitersRuntime;
import software.amazon.awssdk.utils.AttributeMap;
import software.amazon.awssdk.utils.SdkAutoCloseable;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
@ThreadSafe
final class DefaultQueryWaiter implements QueryWaiter {
private static final WaiterAttribute<SdkAutoCloseable> CLIENT_ATTRIBUTE = new WaiterAttribute<>(SdkAutoCloseable.class);
private final QueryClient client;
private final AttributeMap managedResources;
private final Waiter<APostOperationResponse> postOperationSuccessWaiter;
private DefaultQueryWaiter(DefaultBuilder builder) {
AttributeMap.Builder attributeMapBuilder = AttributeMap.builder();
if (builder.client == null) {
this.client = QueryClient.builder().build();
attributeMapBuilder.put(CLIENT_ATTRIBUTE, this.client);
} else {
this.client = builder.client;
}
managedResources = attributeMapBuilder.build();
this.postOperationSuccessWaiter = Waiter.builder(APostOperationResponse.class)
.acceptors(postOperationSuccessWaiterAcceptors())
.overrideConfiguration(postOperationSuccessWaiterConfig(builder.overrideConfiguration)).build();
}
private static String errorCode(Throwable error) {
if (error instanceof AwsServiceException) {
return ((AwsServiceException) error).awsErrorDetails().errorCode();
}
return null;
}
@Override
public WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(APostOperationRequest aPostOperationRequest) {
return postOperationSuccessWaiter.run(() -> client.aPostOperation(applyWaitersUserAgent(aPostOperationRequest)));
}
@Override
public WaiterResponse<APostOperationResponse> waitUntilPostOperationSuccess(APostOperationRequest aPostOperationRequest,
WaiterOverrideConfiguration overrideConfig) {
return postOperationSuccessWaiter.run(() -> client.aPostOperation(applyWaitersUserAgent(aPostOperationRequest)),
postOperationSuccessWaiterConfig(overrideConfig));
}
private static List<WaiterAcceptor<? super APostOperationResponse>> postOperationSuccessWaiterAcceptors() {
List<WaiterAcceptor<? super APostOperationResponse>> result = new ArrayList<>();
result.add(new WaitersRuntime.ResponseStatusAcceptor(200, WaiterState.SUCCESS));
result.add(new WaitersRuntime.ResponseStatusAcceptor(404, WaiterState.RETRY));
result.add(WaiterAcceptor.successOnResponseAcceptor(response -> {
WaitersRuntime.Value input = new WaitersRuntime.Value(response);
List<Object> resultValues = input.field("foo").field("bar").values();
return !resultValues.isEmpty() && resultValues.stream().anyMatch(v -> Objects.equals(v, "baz"));
}));
result.addAll(WaitersRuntime.DEFAULT_ACCEPTORS);
return result;
}
private static WaiterOverrideConfiguration postOperationSuccessWaiterConfig(WaiterOverrideConfiguration overrideConfig) {
Optional<WaiterOverrideConfiguration> optionalOverrideConfig = Optional.ofNullable(overrideConfig);
int maxAttempts = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::maxAttempts).orElse(40);
BackoffStrategy backoffStrategy = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::backoffStrategy).orElse(
FixedDelayBackoffStrategy.create(Duration.ofSeconds(1)));
Duration waitTimeout = optionalOverrideConfig.flatMap(WaiterOverrideConfiguration::waitTimeout).orElse(null);
return WaiterOverrideConfiguration.builder().maxAttempts(maxAttempts).backoffStrategy(backoffStrategy)
.waitTimeout(waitTimeout).build();
}
@Override
public void close() {
managedResources.close();
}
public static QueryWaiter.Builder builder() {
return new DefaultBuilder();
}
private <T extends QueryRequest> T applyWaitersUserAgent(T request) {
Consumer<AwsRequestOverrideConfiguration.Builder> userAgentApplier = b -> b.addApiName(ApiName.builder()
.version("waiter").name("hll").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
public static final class DefaultBuilder implements QueryWaiter.Builder {
private QueryClient client;
private WaiterOverrideConfiguration overrideConfiguration;
private DefaultBuilder() {
}
@Override
public QueryWaiter.Builder overrideConfiguration(WaiterOverrideConfiguration overrideConfiguration) {
this.overrideConfiguration = overrideConfiguration;
return this;
}
@Override
public QueryWaiter.Builder client(QueryClient client) {
this.client = client;
return this;
}
public QueryWaiter build() {
return new DefaultQueryWaiter(this);
}
}
}
| 3,120 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/common/test-user-agent-class.java | package software.amazon.awssdk.services.json.internal;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.services.json.model.JsonRequest;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public class UserAgentUtils {
private UserAgentUtils() {
}
public static <T extends JsonRequest> T applyUserAgentInfo(T request,
Consumer<AwsRequestOverrideConfiguration.Builder> userAgentApplier) {
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
public static <T extends JsonRequest> T applyPaginatorUserAgent(T request) {
return applyUserAgentInfo(request,
b -> b.addApiName(ApiName.builder().version(VersionInfo.SDK_VERSION).name("PAGINATED").build()));
}
} | 3,121 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/common/test-enum-class.java | package software.amazon.awssdk.codegen.poet.common.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Some comment on the class itself
*/
@Generated("software.amazon.awssdk:codegen")
public enum TestEnumClass {
AVAILABLE("available"),
PERMANENT_FAILURE("permanent-failure"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, TestEnumClass> VALUE_MAP = EnumUtils.uniqueIndex(TestEnumClass.class, TestEnumClass::toString);
private final String value;
private TestEnumClass(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return TestEnumClass corresponding to the value
*/
public static TestEnumClass fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will return
* all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link TestEnumClass}s
*/
public static Set<TestEnumClass> knownValues() {
Set<TestEnumClass> knownValues = EnumSet.allOf(TestEnumClass.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
| 3,122 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listoflistofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfListOfStringsCopier {
static List<List<String>> copy(Collection<? extends Collection<String>> listOfListOfStringsParam) {
List<List<String>> list;
if (listOfListOfStringsParam == null || listOfListOfStringsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<String>> modifiableList = new ArrayList<>();
listOfListOfStringsParam.forEach(entry -> {
List<String> list1;
if (entry == null || entry instanceof SdkAutoConstructList) {
list1 = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList1 = new ArrayList<>();
entry.forEach(entry1 -> {
modifiableList1.add(entry1);
});
list1 = Collections.unmodifiableList(modifiableList1);
}
modifiableList.add(list1);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,123 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithnoinputoroutputresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithNoInputOrOutputResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<OperationWithNoInputOrOutputResponse.Builder, OperationWithNoInputOrOutputResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private OperationWithNoInputOrOutputResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithNoInputOrOutputResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithNoInputOrOutputResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithNoInputOrOutputResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(OperationWithNoInputOrOutputResponse model) {
super(model);
}
@Override
public OperationWithNoInputOrOutputResponse build() {
return new OperationWithNoInputOrOutputResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,124 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/documentinputoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class DocumentInputOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<DocumentInputOperationResponse.Builder, DocumentInputOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private DocumentInputOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DocumentInputOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DocumentInputOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, DocumentInputOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(DocumentInputOperationResponse model) {
super(model);
}
@Override
public DocumentInputOperationResponse build() {
return new DocumentInputOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
} | 3,125 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/simplestruct.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class SimpleStruct implements SdkPojo, Serializable, ToCopyableBuilder<SimpleStruct.Builder, SimpleStruct> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(SimpleStruct::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String stringMember;
private SimpleStruct(BuilderImpl builder) {
this.stringMember = builder.stringMember;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SimpleStruct)) {
return false;
}
SimpleStruct other = (SimpleStruct) obj;
return Objects.equals(stringMember(), other.stringMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("SimpleStruct").add("StringMember", stringMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<SimpleStruct, T> g) {
return obj -> g.apply((SimpleStruct) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, SimpleStruct> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
}
static final class BuilderImpl implements Builder {
private String stringMember;
private BuilderImpl() {
}
private BuilderImpl(SimpleStruct model) {
stringMember(model.stringMember);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
@Override
public SimpleStruct build() {
return new SimpleStruct(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,126 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToEnumCopier {
static Map<String, String> copy(Map<String, String> mapOfEnumToEnumParam) {
Map<String, String> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<EnumType, EnumType> mapOfEnumToEnumParam) {
Map<String, String> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
String result = key.toString();
String result1 = value.toString();
modifiableMap.put(result, result1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, EnumType> copyStringToEnum(Map<String, String> mapOfEnumToEnumParam) {
Map<EnumType, EnumType> map;
if (mapOfEnumToEnumParam == null || mapOfEnumToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, EnumType> modifiableMap = new LinkedHashMap<>();
mapOfEnumToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
EnumType result1 = EnumType.fromValue(value);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, result1);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,127 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/emptymodeledexception.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EmptyModeledException extends JsonProtocolTestsException implements
ToCopyableBuilder<EmptyModeledException.Builder, EmptyModeledException> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private static final long serialVersionUID = 1L;
private EmptyModeledException(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EmptyModeledException>, JsonProtocolTestsException.Builder {
@Override
Builder awsErrorDetails(AwsErrorDetails awsErrorDetails);
@Override
Builder message(String message);
@Override
Builder requestId(String requestId);
@Override
Builder statusCode(int statusCode);
@Override
Builder cause(Throwable cause);
@Override
Builder writableStackTrace(Boolean writableStackTrace);
}
static final class BuilderImpl extends JsonProtocolTestsException.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EmptyModeledException model) {
super(model);
}
@Override
public BuilderImpl awsErrorDetails(AwsErrorDetails awsErrorDetails) {
this.awsErrorDetails = awsErrorDetails;
return this;
}
@Override
public BuilderImpl message(String message) {
this.message = message;
return this;
}
@Override
public BuilderImpl requestId(String requestId) {
this.requestId = requestId;
return this;
}
@Override
public BuilderImpl statusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
@Override
public BuilderImpl cause(Throwable cause) {
this.cause = cause;
return this;
}
@Override
public BuilderImpl writableStackTrace(Boolean writableStackTrace) {
this.writableStackTrace = writableStackTrace;
return this;
}
@Override
public EmptyModeledException build() {
return new EmptyModeledException(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,128 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/existencechecknamingresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<ExistenceCheckNamingResponse.Builder, ExistenceCheckNamingResponse> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingResponse::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingResponse::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingResponse::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingResponse::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingResponse(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* For responses, this returns true if the service returned a value for the Build property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBuild} method.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* For responses, this returns true if the service returned a value for the Super property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSuperValue} method.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* For responses, this returns true if the service returned a value for the ToString property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasToStringValue} method.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* For responses, this returns true if the service returned a value for the Equals property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasEqualsValue} method.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasBuild() ? build() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSuperValue() ? superValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasToStringValue() ? toStringValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasEqualsValue() ? equalsValue() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingResponse)) {
return false;
}
ExistenceCheckNamingResponse other = (ExistenceCheckNamingResponse) obj;
return hasBuild() == other.hasBuild() && Objects.equals(build(), other.build())
&& hasSuperValue() == other.hasSuperValue() && Objects.equals(superValue(), other.superValue())
&& hasToStringValue() == other.hasToStringValue() && Objects.equals(toStringValue(), other.toStringValue())
&& hasEqualsValue() == other.hasEqualsValue() && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingResponse").add("Build", hasBuild() ? build() : null)
.add("Super", hasSuperValue() ? superValue() : null).add("ToString", hasToStringValue() ? toStringValue() : null)
.add("Equals", hasEqualsValue() ? equalsValue() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingResponse, T> g) {
return obj -> g.apply((ExistenceCheckNamingResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingResponse> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<String> build = DefaultSdkAutoConstructList.getInstance();
private List<String> superValue = DefaultSdkAutoConstructList.getInstance();
private Map<String, String> toStringValue = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> equalsValue = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingResponse model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
if (build instanceof SdkAutoConstructList) {
return null;
}
return build;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final Collection<String> getSuperValue() {
if (superValue instanceof SdkAutoConstructList) {
return null;
}
return superValue;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final Map<String, String> getToStringValue() {
if (toStringValue instanceof SdkAutoConstructMap) {
return null;
}
return toStringValue;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final Map<String, String> getEqualsValue() {
if (equalsValue instanceof SdkAutoConstructMap) {
return null;
}
return equalsValue;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
@Override
public ExistenceCheckNamingResponse build() {
return new ExistenceCheckNamingResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,129 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<EventStreamOperationWithOnlyInputResponse.Builder, EventStreamOperationWithOnlyInputResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationWithOnlyInputResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationWithOnlyInputResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationWithOnlyInputResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationWithOnlyInputResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationWithOnlyInputResponse model) {
super(model);
}
@Override
public EventStreamOperationWithOnlyInputResponse build() {
return new EventStreamOperationWithOnlyInputResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,130 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtolistofenumscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToListOfEnumsCopier {
static Map<String, List<String>> copy(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnumsParam) {
Map<String, List<String>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
List<String> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
value.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, List<String>> copyEnumToString(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnumsParam) {
Map<String, List<String>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
String result = key.toString();
List<String> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
value.forEach(entry -> {
String result1 = entry.toString();
modifiableList.add(result1);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(result, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, List<EnumType>> copyStringToEnum(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnumsParam) {
Map<EnumType, List<EnumType>> map;
if (mapOfEnumToListOfEnumsParam == null || mapOfEnumToListOfEnumsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, List<EnumType>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToListOfEnumsParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
List<EnumType> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<EnumType> modifiableList = new ArrayList<>();
value.forEach(entry -> {
EnumType result1 = EnumType.fromValue(entry);
modifiableList.add(result1);
});
list = Collections.unmodifiableList(modifiableList);
}
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, list);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,131 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsResponse;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsResponse extends AwsResponse {
private final JsonProtocolTestsResponseMetadata responseMetadata;
protected JsonProtocolTestsResponse(Builder builder) {
super(builder);
this.responseMetadata = builder.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
public interface Builder extends AwsResponse.Builder {
@Override
JsonProtocolTestsResponse build();
@Override
JsonProtocolTestsResponseMetadata responseMetadata();
@Override
Builder responseMetadata(AwsResponseMetadata metadata);
}
protected abstract static class BuilderImpl extends AwsResponse.BuilderImpl implements Builder {
private JsonProtocolTestsResponseMetadata responseMetadata;
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsResponse response) {
super(response);
this.responseMetadata = response.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
@Override
public Builder responseMetadata(AwsResponseMetadata responseMetadata) {
this.responseMetadata = JsonProtocolTestsResponseMetadata.create(responseMetadata);
return this;
}
}
}
| 3,132 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenamerequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<DeprecatedRenameRequest.Builder, DeprecatedRenameRequest> {
private static final SdkField<String> NEW_NAME_NO_DEPRECATION_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NewNameNoDeprecation").getter(getter(DeprecatedRenameRequest::newNameNoDeprecation))
.setter(setter(Builder::newNameNoDeprecation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
.build();
private static final SdkField<String> NEW_NAME_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NewName").getter(getter(DeprecatedRenameRequest::newName)).setter(setter(Builder::newName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NEW_NAME_NO_DEPRECATION_FIELD,
NEW_NAME_FIELD));
private final String newNameNoDeprecation;
private final String newName;
private DeprecatedRenameRequest(BuilderImpl builder) {
super(builder);
this.newNameNoDeprecation = builder.newNameNoDeprecation;
this.newName = builder.newName;
}
/**
* Returns the value of the NewNameNoDeprecation property for this object.
*
* @return The value of the NewNameNoDeprecation property for this object.
*/
public final String newNameNoDeprecation() {
return newNameNoDeprecation;
}
/**
* Returns the value of the NewName property for this object.
*
* @return The value of the NewName property for this object.
* @deprecated Use {@link #newName()}
*/
@Deprecated
public final String originalNameDeprecated() {
return newName;
}
/**
* Returns the value of the NewName property for this object.
*
* @return The value of the NewName property for this object.
*/
public final String newName() {
return newName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(newNameNoDeprecation());
hashCode = 31 * hashCode + Objects.hashCode(newName());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeprecatedRenameRequest)) {
return false;
}
DeprecatedRenameRequest other = (DeprecatedRenameRequest) obj;
return Objects.equals(newNameNoDeprecation(), other.newNameNoDeprecation()) && Objects.equals(newName(), other.newName());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameRequest").add("NewNameNoDeprecation", newNameNoDeprecation())
.add("NewName", newName()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NewNameNoDeprecation":
return Optional.ofNullable(clazz.cast(newNameNoDeprecation()));
case "NewName":
return Optional.ofNullable(clazz.cast(newName()));
case "OriginalNameDeprecated":
return Optional.ofNullable(clazz.cast(newName()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DeprecatedRenameRequest, T> g) {
return obj -> g.apply((DeprecatedRenameRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, DeprecatedRenameRequest> {
/**
* Sets the value of the NewNameNoDeprecation property for this object.
*
* @param newNameNoDeprecation
* The new value for the NewNameNoDeprecation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder newNameNoDeprecation(String newNameNoDeprecation);
/**
* Sets the value of the NewName property for this object.
*
* @param newName
* The new value for the NewName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder newName(String newName);
/**
* Sets the value of the NewName property for this object.
*
* @param newName
* The new value for the NewName property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated Use {@link #newName(String)}
*/
@Deprecated
Builder originalNameDeprecated(String newName);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String newNameNoDeprecation;
private String newName;
private BuilderImpl() {
}
private BuilderImpl(DeprecatedRenameRequest model) {
super(model);
newNameNoDeprecation(model.newNameNoDeprecation);
newName(model.newName);
}
public final String getNewNameNoDeprecation() {
return newNameNoDeprecation;
}
public final void setNewNameNoDeprecation(String newNameNoDeprecation) {
this.newNameNoDeprecation = newNameNoDeprecation;
}
@Override
public final Builder newNameNoDeprecation(String newNameNoDeprecation) {
this.newNameNoDeprecation = newNameNoDeprecation;
return this;
}
public final String getNewName() {
return newName;
}
public final void setNewName(String newName) {
this.newName = newName;
}
/**
* @deprecated Use {@link #setNewName} instead
*/
@Deprecated
public final void setOriginalNameDeprecated(String newName) {
this.newName = newName;
}
@Override
public final Builder newName(String newName) {
this.newName = newName;
return this;
}
@Override
public final Builder originalNameDeprecated(String newName) {
this.newName = newName;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DeprecatedRenameRequest build() {
return new DeprecatedRenameRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,133 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/deprecatedrenameresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DeprecatedRenameResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<DeprecatedRenameResponse.Builder, DeprecatedRenameResponse> {
private static final SdkField<String> ORIGINAL_NAME_NO_DEPRECATION_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("OriginalNameNoDeprecation").getter(getter(DeprecatedRenameResponse::originalNameNoDeprecation))
.setter(setter(Builder::originalNameNoDeprecation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameNoDeprecation").build())
.build();
private static final SdkField<String> ORIGINAL_NAME_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("OriginalNameDeprecated").getter(getter(DeprecatedRenameResponse::originalNameDeprecated))
.setter(setter(Builder::originalNameDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OriginalNameDeprecated").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
ORIGINAL_NAME_NO_DEPRECATION_FIELD, ORIGINAL_NAME_DEPRECATED_FIELD));
private final String originalNameNoDeprecation;
private final String originalNameDeprecated;
private DeprecatedRenameResponse(BuilderImpl builder) {
super(builder);
this.originalNameNoDeprecation = builder.originalNameNoDeprecation;
this.originalNameDeprecated = builder.originalNameDeprecated;
}
/**
* Returns the value of the OriginalNameNoDeprecation property for this object.
*
* @return The value of the OriginalNameNoDeprecation property for this object.
*/
public final String originalNameNoDeprecation() {
return originalNameNoDeprecation;
}
/**
* Returns the value of the OriginalNameDeprecated property for this object.
*
* @return The value of the OriginalNameDeprecated property for this object.
*/
public final String originalNameDeprecated() {
return originalNameDeprecated;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(originalNameNoDeprecation());
hashCode = 31 * hashCode + Objects.hashCode(originalNameDeprecated());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DeprecatedRenameResponse)) {
return false;
}
DeprecatedRenameResponse other = (DeprecatedRenameResponse) obj;
return Objects.equals(originalNameNoDeprecation(), other.originalNameNoDeprecation())
&& Objects.equals(originalNameDeprecated(), other.originalNameDeprecated());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DeprecatedRenameResponse").add("OriginalNameNoDeprecation", originalNameNoDeprecation())
.add("OriginalNameDeprecated", originalNameDeprecated()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "OriginalNameNoDeprecation":
return Optional.ofNullable(clazz.cast(originalNameNoDeprecation()));
case "OriginalNameDeprecated":
return Optional.ofNullable(clazz.cast(originalNameDeprecated()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DeprecatedRenameResponse, T> g) {
return obj -> g.apply((DeprecatedRenameResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, DeprecatedRenameResponse> {
/**
* Sets the value of the OriginalNameNoDeprecation property for this object.
*
* @param originalNameNoDeprecation
* The new value for the OriginalNameNoDeprecation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder originalNameNoDeprecation(String originalNameNoDeprecation);
/**
* Sets the value of the OriginalNameDeprecated property for this object.
*
* @param originalNameDeprecated
* The new value for the OriginalNameDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder originalNameDeprecated(String originalNameDeprecated);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String originalNameNoDeprecation;
private String originalNameDeprecated;
private BuilderImpl() {
}
private BuilderImpl(DeprecatedRenameResponse model) {
super(model);
originalNameNoDeprecation(model.originalNameNoDeprecation);
originalNameDeprecated(model.originalNameDeprecated);
}
public final String getOriginalNameNoDeprecation() {
return originalNameNoDeprecation;
}
public final void setOriginalNameNoDeprecation(String originalNameNoDeprecation) {
this.originalNameNoDeprecation = originalNameNoDeprecation;
}
@Override
public final Builder originalNameNoDeprecation(String originalNameNoDeprecation) {
this.originalNameNoDeprecation = originalNameNoDeprecation;
return this;
}
public final String getOriginalNameDeprecated() {
return originalNameDeprecated;
}
public final void setOriginalNameDeprecated(String originalNameDeprecated) {
this.originalNameDeprecated = originalNameDeprecated;
}
@Override
public final Builder originalNameDeprecated(String originalNameDeprecated) {
this.originalNameDeprecated = originalNameDeprecated;
return this;
}
@Override
public DeprecatedRenameResponse build() {
return new DeprecatedRenameResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,134 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithnoinputoroutputrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithNoInputOrOutputRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<OperationWithNoInputOrOutputRequest.Builder, OperationWithNoInputOrOutputRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private OperationWithNoInputOrOutputRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithNoInputOrOutputRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithNoInputOrOutputRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithNoInputOrOutputRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(OperationWithNoInputOrOutputRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public OperationWithNoInputOrOutputRequest build() {
return new OperationWithNoInputOrOutputRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,135 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streamingoutputoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamingOutputOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<StreamingOutputOperationResponse.Builder, StreamingOutputOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingOutputOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingOutputOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingOutputOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingOutputOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingOutputOperationResponse model) {
super(model);
}
@Override
public StreamingOutputOperationResponse build() {
return new StreamingOutputOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,136 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streaminginputoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamingInputOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<StreamingInputOperationResponse.Builder, StreamingInputOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingInputOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingInputOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingInputOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingInputOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingInputOperationResponse model) {
super(model);
}
@Override
public StreamingInputOperationResponse build() {
return new StreamingInputOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,137 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtosimplestructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToSimpleStructCopier {
static Map<String, SimpleStruct> copy(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyFromBuilder(Map<String, ? extends SimpleStruct.Builder> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct.Builder> copyToBuilder(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct.Builder> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyEnumToString(Map<EnumType, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, SimpleStruct> copyStringToEnum(Map<String, ? extends SimpleStruct> mapOfEnumToSimpleStructParam) {
Map<EnumType, SimpleStruct> map;
if (mapOfEnumToSimpleStructParam == null || mapOfEnumToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfEnumToSimpleStructParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,138 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedcontainersresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<NestedContainersResponse.Builder, NestedContainersResponse> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersResponse::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersResponse::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersResponse(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfStrings property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfListOfStrings property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToListOfListOfStrings
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToListOfListOfStrings}
* method.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfStrings() ? listOfListOfStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersResponse)) {
return false;
}
NestedContainersResponse other = (NestedContainersResponse) obj;
return hasListOfListOfStrings() == other.hasListOfListOfStrings()
&& Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& hasListOfListOfListOfStrings() == other.hasListOfListOfListOfStrings()
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& hasMapOfStringToListOfListOfStrings() == other.hasMapOfStringToListOfListOfStrings()
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("NestedContainersResponse")
.add("ListOfListOfStrings", hasListOfListOfStrings() ? listOfListOfStrings() : null)
.add("ListOfListOfListOfStrings", hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null)
.add("MapOfStringToListOfListOfStrings",
hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersResponse, T> g) {
return obj -> g.apply((NestedContainersResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, NestedContainersResponse> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private List<List<List<String>>> listOfListOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(NestedContainersResponse model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
if (listOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfStrings;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
if (listOfListOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfListOfStrings;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
if (mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToListOfListOfStrings;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
@Override
public NestedContainersResponse build() {
return new NestedContainersResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,139 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtointegerlistcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToIntegerListCopier {
static Map<String, List<Integer>> copy(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerListParam) {
Map<String, List<Integer>> map;
if (mapOfStringToIntegerListParam == null || mapOfStringToIntegerListParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<Integer>> modifiableMap = new LinkedHashMap<>();
mapOfStringToIntegerListParam.forEach((key, value) -> {
List<Integer> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Integer> modifiableList = new ArrayList<>();
value.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,140 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivelisttypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class RecursiveListTypeCopier {
static List<RecursiveStructType> copy(Collection<? extends RecursiveStructType> recursiveListTypeParam) {
List<RecursiveStructType> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<RecursiveStructType> copyFromBuilder(Collection<? extends RecursiveStructType.Builder> recursiveListTypeParam) {
List<RecursiveStructType> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
RecursiveStructType member = entry == null ? null : entry.build();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<RecursiveStructType.Builder> copyToBuilder(Collection<? extends RecursiveStructType> recursiveListTypeParam) {
List<RecursiveStructType.Builder> list;
if (recursiveListTypeParam == null || recursiveListTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<RecursiveStructType.Builder> modifiableList = new ArrayList<>();
recursiveListTypeParam.forEach(entry -> {
RecursiveStructType.Builder member = entry == null ? null : entry.toBuilder();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,141 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class InputEventTwo implements SdkPojo, Serializable, ToCopyableBuilder<InputEventTwo.Builder, InputEventTwo>,
InputEventStreamTwo {
private static final SdkField<SdkBytes> IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD = SdkField
.<SdkBytes> builder(MarshallingType.SDK_BYTES).memberName("ImplicitPayloadMemberOne")
.getter(getter(InputEventTwo::implicitPayloadMemberOne)).setter(setter(Builder::implicitPayloadMemberOne))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberOne").build())
.build();
private static final SdkField<String> IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("ImplicitPayloadMemberTwo").getter(getter(InputEventTwo::implicitPayloadMemberTwo))
.setter(setter(Builder::implicitPayloadMemberTwo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ImplicitPayloadMemberTwo").build())
.build();
private static final SdkField<String> EVENT_HEADER_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EventHeaderMember").getter(getter(InputEventTwo::eventHeaderMember))
.setter(setter(Builder::eventHeaderMember))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("EventHeaderMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
IMPLICIT_PAYLOAD_MEMBER_ONE_FIELD, IMPLICIT_PAYLOAD_MEMBER_TWO_FIELD, EVENT_HEADER_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes implicitPayloadMemberOne;
private final String implicitPayloadMemberTwo;
private final String eventHeaderMember;
protected InputEventTwo(BuilderImpl builder) {
this.implicitPayloadMemberOne = builder.implicitPayloadMemberOne;
this.implicitPayloadMemberTwo = builder.implicitPayloadMemberTwo;
this.eventHeaderMember = builder.eventHeaderMember;
}
/**
* Returns the value of the ImplicitPayloadMemberOne property for this object.
*
* @return The value of the ImplicitPayloadMemberOne property for this object.
*/
public final SdkBytes implicitPayloadMemberOne() {
return implicitPayloadMemberOne;
}
/**
* Returns the value of the ImplicitPayloadMemberTwo property for this object.
*
* @return The value of the ImplicitPayloadMemberTwo property for this object.
*/
public final String implicitPayloadMemberTwo() {
return implicitPayloadMemberTwo;
}
/**
* Returns the value of the EventHeaderMember property for this object.
*
* @return The value of the EventHeaderMember property for this object.
*/
public final String eventHeaderMember() {
return eventHeaderMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(implicitPayloadMemberOne());
hashCode = 31 * hashCode + Objects.hashCode(implicitPayloadMemberTwo());
hashCode = 31 * hashCode + Objects.hashCode(eventHeaderMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof InputEventTwo)) {
return false;
}
InputEventTwo other = (InputEventTwo) obj;
return Objects.equals(implicitPayloadMemberOne(), other.implicitPayloadMemberOne())
&& Objects.equals(implicitPayloadMemberTwo(), other.implicitPayloadMemberTwo())
&& Objects.equals(eventHeaderMember(), other.eventHeaderMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("InputEventTwo").add("ImplicitPayloadMemberOne", implicitPayloadMemberOne())
.add("ImplicitPayloadMemberTwo", implicitPayloadMemberTwo()).add("EventHeaderMember", eventHeaderMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ImplicitPayloadMemberOne":
return Optional.ofNullable(clazz.cast(implicitPayloadMemberOne()));
case "ImplicitPayloadMemberTwo":
return Optional.ofNullable(clazz.cast(implicitPayloadMemberTwo()));
case "EventHeaderMember":
return Optional.ofNullable(clazz.cast(eventHeaderMember()));
default:
return Optional.empty();
}
}
@Override
public final InputEventTwo copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<InputEventTwo, T> g) {
return obj -> g.apply((InputEventTwo) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, InputEventTwo> {
/**
* Sets the value of the ImplicitPayloadMemberOne property for this object.
*
* @param implicitPayloadMemberOne
* The new value for the ImplicitPayloadMemberOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder implicitPayloadMemberOne(SdkBytes implicitPayloadMemberOne);
/**
* Sets the value of the ImplicitPayloadMemberTwo property for this object.
*
* @param implicitPayloadMemberTwo
* The new value for the ImplicitPayloadMemberTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder implicitPayloadMemberTwo(String implicitPayloadMemberTwo);
/**
* Sets the value of the EventHeaderMember property for this object.
*
* @param eventHeaderMember
* The new value for the EventHeaderMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder eventHeaderMember(String eventHeaderMember);
}
protected static class BuilderImpl implements Builder {
private SdkBytes implicitPayloadMemberOne;
private String implicitPayloadMemberTwo;
private String eventHeaderMember;
protected BuilderImpl() {
}
protected BuilderImpl(InputEventTwo model) {
implicitPayloadMemberOne(model.implicitPayloadMemberOne);
implicitPayloadMemberTwo(model.implicitPayloadMemberTwo);
eventHeaderMember(model.eventHeaderMember);
}
public final ByteBuffer getImplicitPayloadMemberOne() {
return implicitPayloadMemberOne == null ? null : implicitPayloadMemberOne.asByteBuffer();
}
public final void setImplicitPayloadMemberOne(ByteBuffer implicitPayloadMemberOne) {
implicitPayloadMemberOne(implicitPayloadMemberOne == null ? null : SdkBytes.fromByteBuffer(implicitPayloadMemberOne));
}
@Override
public final Builder implicitPayloadMemberOne(SdkBytes implicitPayloadMemberOne) {
this.implicitPayloadMemberOne = implicitPayloadMemberOne;
return this;
}
public final String getImplicitPayloadMemberTwo() {
return implicitPayloadMemberTwo;
}
public final void setImplicitPayloadMemberTwo(String implicitPayloadMemberTwo) {
this.implicitPayloadMemberTwo = implicitPayloadMemberTwo;
}
@Override
public final Builder implicitPayloadMemberTwo(String implicitPayloadMemberTwo) {
this.implicitPayloadMemberTwo = implicitPayloadMemberTwo;
return this;
}
public final String getEventHeaderMember() {
return eventHeaderMember;
}
public final void setEventHeaderMember(String eventHeaderMember) {
this.eventHeaderMember = eventHeaderMember;
}
@Override
public final Builder eventHeaderMember(String eventHeaderMember) {
this.eventHeaderMember = eventHeaderMember;
return this;
}
@Override
public InputEventTwo build() {
return new InputEventTwo(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,142 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofblobstypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfBlobsTypeCopier {
static List<SdkBytes> copy(Collection<SdkBytes> listOfBlobsTypeParam) {
List<SdkBytes> list;
if (listOfBlobsTypeParam == null || listOfBlobsTypeParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SdkBytes> modifiableList = new ArrayList<>();
listOfBlobsTypeParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,143 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToStringCopier {
static Map<String, String> copy(Map<String, String> mapOfStringToStringParam) {
Map<String, String> map;
if (mapOfStringToStringParam == null || mapOfStringToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToStringParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,144 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/documentinputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DocumentInputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<DocumentInputOperationRequest.Builder, DocumentInputOperationRequest> {
private static final SdkField<Document> DOCUMENT_MEMBER_FIELD = SdkField
.<Document> builder(MarshallingType.DOCUMENT)
.memberName("DocumentMember")
.getter(getter(DocumentInputOperationRequest::documentMember))
.setter(setter(Builder::documentMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DocumentMember").build(),
PayloadTrait.create()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DOCUMENT_MEMBER_FIELD));
private final Document documentMember;
private DocumentInputOperationRequest(BuilderImpl builder) {
super(builder);
this.documentMember = builder.documentMember;
}
/**
* Returns the value of the DocumentMember property for this object.
*
* @return The value of the DocumentMember property for this object.
*/
public final Document documentMember() {
return documentMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(documentMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof DocumentInputOperationRequest)) {
return false;
}
DocumentInputOperationRequest other = (DocumentInputOperationRequest) obj;
return Objects.equals(documentMember(), other.documentMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("DocumentInputOperationRequest").add("DocumentMember", documentMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "DocumentMember":
return Optional.ofNullable(clazz.cast(documentMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<DocumentInputOperationRequest, T> g) {
return obj -> g.apply((DocumentInputOperationRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, DocumentInputOperationRequest> {
/**
* Sets the value of the DocumentMember property for this object.
*
* @param documentMember
* The new value for the DocumentMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder documentMember(Document documentMember);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private Document documentMember;
private BuilderImpl() {
}
private BuilderImpl(DocumentInputOperationRequest model) {
super(model);
documentMember(model.documentMember);
}
public final Document getDocumentMember() {
return documentMember;
}
@Override
public final Builder documentMember(Document documentMember) {
this.documentMember = documentMember;
return this;
}
public final void setDocumentMember(Document documentMember) {
this.documentMember = documentMember;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public DocumentInputOperationRequest build() {
return new DocumentInputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
} | 3,145 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventone.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class EventOne implements SdkPojo, Serializable, ToCopyableBuilder<EventOne.Builder, EventOne>, EventStream {
private static final SdkField<String> FOO_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Foo")
.getter(getter(EventOne::foo)).setter(setter(Builder::foo))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Foo").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FOO_FIELD));
private static final long serialVersionUID = 1L;
private final String foo;
protected EventOne(BuilderImpl builder) {
this.foo = builder.foo;
}
/**
* Returns the value of the Foo property for this object.
*
* @return The value of the Foo property for this object.
*/
public final String foo() {
return foo;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(foo());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventOne)) {
return false;
}
EventOne other = (EventOne) obj;
return Objects.equals(foo(), other.foo());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventOne").add("Foo", foo()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Foo":
return Optional.ofNullable(clazz.cast(foo()));
default:
return Optional.empty();
}
}
@Override
public final EventOne copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<EventOne, T> g) {
return obj -> g.apply((EventOne) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventOne}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EventOne> {
/**
* Sets the value of the Foo property for this object.
*
* @param foo
* The new value for the Foo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder foo(String foo);
}
protected static class BuilderImpl implements Builder {
private String foo;
protected BuilderImpl() {
}
protected BuilderImpl(EventOne model) {
foo(model.foo);
}
public final String getFoo() {
return foo;
}
public final void setFoo(String foo) {
this.foo = foo;
}
@Override
public final Builder foo(String foo) {
this.foo = foo;
return this;
}
@Override
public EventOne build() {
return new EventOne(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,146 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventstream.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.services.jsonprotocoltests.model.inputeventstream.DefaultInputEvent;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in InputEventStream.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface InputEventStream {
/**
* Create a builder for the {@code InputEvent} event type for this stream.
*/
static InputEvent.Builder inputEventBuilder() {
return DefaultInputEvent.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* The known possible types of events for {@code InputEventStream}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
INPUT_EVENT("InputEvent"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,147 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToStringCopier {
static Map<String, String> copy(Map<String, String> mapOfEnumToStringParam) {
Map<String, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<EnumType, String> mapOfEnumToStringParam) {
Map<String, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, String> copyStringToEnum(Map<String, String> mapOfEnumToStringParam) {
Map<EnumType, String> map;
if (mapOfEnumToStringParam == null || mapOfEnumToStringParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, String> modifiableMap = new LinkedHashMap<>();
mapOfEnumToStringParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,148 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/subtypeone.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class SubTypeOne implements SdkPojo, Serializable, ToCopyableBuilder<SubTypeOne.Builder, SubTypeOne> {
private static final SdkField<String> SUB_TYPE_ONE_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("SubTypeOneMember").getter(getter(SubTypeOne::subTypeOneMember))
.setter(setter(Builder::subTypeOneMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SubTypeOneMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(SUB_TYPE_ONE_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String subTypeOneMember;
private SubTypeOne(BuilderImpl builder) {
this.subTypeOneMember = builder.subTypeOneMember;
}
/**
* Returns the value of the SubTypeOneMember property for this object.
*
* @return The value of the SubTypeOneMember property for this object.
*/
public final String subTypeOneMember() {
return subTypeOneMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(subTypeOneMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof SubTypeOne)) {
return false;
}
SubTypeOne other = (SubTypeOne) obj;
return Objects.equals(subTypeOneMember(), other.subTypeOneMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("SubTypeOne").add("SubTypeOneMember", subTypeOneMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "SubTypeOneMember":
return Optional.ofNullable(clazz.cast(subTypeOneMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<SubTypeOne, T> g) {
return obj -> g.apply((SubTypeOne) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, SubTypeOne> {
/**
* Sets the value of the SubTypeOneMember property for this object.
*
* @param subTypeOneMember
* The new value for the SubTypeOneMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder subTypeOneMember(String subTypeOneMember);
}
static final class BuilderImpl implements Builder {
private String subTypeOneMember;
private BuilderImpl() {
}
private BuilderImpl(SubTypeOne model) {
subTypeOneMember(model.subTypeOneMember);
}
public final String getSubTypeOneMember() {
return subTypeOneMember;
}
public final void setSubTypeOneMember(String subTypeOneMember) {
this.subTypeOneMember = subTypeOneMember;
}
@Override
public final Builder subTypeOneMember(String subTypeOneMember) {
this.subTypeOneMember = subTypeOneMember;
return this;
}
@Override
public SubTypeOne build() {
return new SubTypeOne(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,149 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtolistoflistofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToListOfListOfStringsCopier {
static Map<String, List<List<String>>> copy(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStringsParam) {
Map<String, List<List<String>>> map;
if (mapOfStringToListOfListOfStringsParam == null || mapOfStringToListOfListOfStringsParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, List<List<String>>> modifiableMap = new LinkedHashMap<>();
mapOfStringToListOfListOfStringsParam.forEach((key, value) -> {
List<List<String>> list;
if (value == null || value instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<String>> modifiableList = new ArrayList<>();
value.forEach(entry -> {
List<String> list1;
if (entry == null || entry instanceof SdkAutoConstructList) {
list1 = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList1 = new ArrayList<>();
entry.forEach(entry1 -> {
modifiableList1.add(entry1);
});
list1 = Collections.unmodifiableList(modifiableList1);
}
modifiableList.add(list1);
});
list = Collections.unmodifiableList(modifiableList);
}
modifiableMap.put(key, list);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,150 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithdeprecatedmemberrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithDeprecatedMemberRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<OperationWithDeprecatedMemberRequest.Builder, OperationWithDeprecatedMemberRequest> {
private static final SdkField<String> MEMBER_MODELED_AS_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("MemberModeledAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberRequest::memberModeledAsDeprecated))
.setter(setter(Builder::memberModeledAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModeledAsDeprecated").build())
.build();
private static final SdkField<String> MEMBER_MODIFIED_AS_DEPRECATED_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("MemberModifiedAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberRequest::memberModifiedAsDeprecated))
.setter(setter(Builder::memberModifiedAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModifiedAsDeprecated").build())
.build();
private static final SdkField<String> UNDEPRECATED_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("UndeprecatedMember").getter(getter(OperationWithDeprecatedMemberRequest::undeprecatedMember))
.setter(setter(Builder::undeprecatedMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UndeprecatedMember").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
MEMBER_MODELED_AS_DEPRECATED_FIELD, MEMBER_MODIFIED_AS_DEPRECATED_FIELD, UNDEPRECATED_MEMBER_FIELD));
private final String memberModeledAsDeprecated;
private final String memberModifiedAsDeprecated;
private final String undeprecatedMember;
private OperationWithDeprecatedMemberRequest(BuilderImpl builder) {
super(builder);
this.memberModeledAsDeprecated = builder.memberModeledAsDeprecated;
this.memberModifiedAsDeprecated = builder.memberModifiedAsDeprecated;
this.undeprecatedMember = builder.undeprecatedMember;
}
/**
* Returns the value of the MemberModeledAsDeprecated property for this object.
*
* @return The value of the MemberModeledAsDeprecated property for this object.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
public final String memberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
/**
* Returns the value of the MemberModifiedAsDeprecated property for this object.
*
* @return The value of the MemberModifiedAsDeprecated property for this object.
* @deprecated This field is modified as deprecated.
*/
@Deprecated
public final String memberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
/**
* Returns the value of the UndeprecatedMember property for this object.
*
* @return The value of the UndeprecatedMember property for this object.
*/
public final String undeprecatedMember() {
return undeprecatedMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(memberModeledAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(memberModifiedAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(undeprecatedMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithDeprecatedMemberRequest)) {
return false;
}
OperationWithDeprecatedMemberRequest other = (OperationWithDeprecatedMemberRequest) obj;
return Objects.equals(memberModeledAsDeprecated(), other.memberModeledAsDeprecated())
&& Objects.equals(memberModifiedAsDeprecated(), other.memberModifiedAsDeprecated())
&& Objects.equals(undeprecatedMember(), other.undeprecatedMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithDeprecatedMemberRequest")
.add("MemberModeledAsDeprecated", memberModeledAsDeprecated())
.add("MemberModifiedAsDeprecated", memberModifiedAsDeprecated()).add("UndeprecatedMember", undeprecatedMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "MemberModeledAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModeledAsDeprecated()));
case "MemberModifiedAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModifiedAsDeprecated()));
case "UndeprecatedMember":
return Optional.ofNullable(clazz.cast(undeprecatedMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<OperationWithDeprecatedMemberRequest, T> g) {
return obj -> g.apply((OperationWithDeprecatedMemberRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithDeprecatedMemberRequest> {
/**
* Sets the value of the MemberModeledAsDeprecated property for this object.
*
* @param memberModeledAsDeprecated
* The new value for the MemberModeledAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
Builder memberModeledAsDeprecated(String memberModeledAsDeprecated);
/**
* Sets the value of the MemberModifiedAsDeprecated property for this object.
*
* @param memberModifiedAsDeprecated
* The new value for the MemberModifiedAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modified as deprecated.
*/
@Deprecated
Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated);
/**
* Sets the value of the UndeprecatedMember property for this object.
*
* @param undeprecatedMember
* The new value for the UndeprecatedMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder undeprecatedMember(String undeprecatedMember);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String memberModeledAsDeprecated;
private String memberModifiedAsDeprecated;
private String undeprecatedMember;
private BuilderImpl() {
}
private BuilderImpl(OperationWithDeprecatedMemberRequest model) {
super(model);
memberModeledAsDeprecated(model.memberModeledAsDeprecated);
memberModifiedAsDeprecated(model.memberModifiedAsDeprecated);
undeprecatedMember(model.undeprecatedMember);
}
@Deprecated
public final String getMemberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
@Deprecated
public final void setMemberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
return this;
}
@Deprecated
public final String getMemberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
@Deprecated
public final void setMemberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
return this;
}
public final String getUndeprecatedMember() {
return undeprecatedMember;
}
public final void setUndeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
}
@Override
public final Builder undeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public OperationWithDeprecatedMemberRequest build() {
return new OperationWithDeprecatedMemberRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,151 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToEnumCopier {
static Map<String, String> copy(Map<String, String> mapOfStringToEnumParam) {
Map<String, String> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, String> copyEnumToString(Map<String, EnumType> mapOfStringToEnumParam) {
Map<String, String> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
String result = value.toString();
modifiableMap.put(key, result);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, EnumType> copyStringToEnum(Map<String, String> mapOfStringToEnumParam) {
Map<String, EnumType> map;
if (mapOfStringToEnumParam == null || mapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, EnumType> modifiableMap = new LinkedHashMap<>();
mapOfStringToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(value);
modifiableMap.put(key, result);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,152 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequest;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsRequest extends AwsRequest {
protected JsonProtocolTestsRequest(Builder builder) {
super(builder);
}
@Override
public abstract Builder toBuilder();
public interface Builder extends AwsRequest.Builder {
@Override
JsonProtocolTestsRequest build();
}
protected abstract static class BuilderImpl extends AwsRequest.BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsRequest request) {
super(request);
}
}
}
| 3,153 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<EventStreamOperationResponse.Builder, EventStreamOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationResponse model) {
super(model);
}
@Override
public EventStreamOperationResponse build() {
return new EventStreamOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,154 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedqueryparameteroperation.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.RequiredTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedQueryParameterOperation implements SdkPojo, Serializable,
ToCopyableBuilder<NestedQueryParameterOperation.Builder, NestedQueryParameterOperation> {
private static final SdkField<String> QUERY_PARAM_ONE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamOne")
.getter(getter(NestedQueryParameterOperation::queryParamOne))
.setter(setter(Builder::queryParamOne))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamOne").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_TWO_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamTwo").getter(getter(NestedQueryParameterOperation::queryParamTwo))
.setter(setter(Builder::queryParamTwo))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamTwo").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(QUERY_PARAM_ONE_FIELD,
QUERY_PARAM_TWO_FIELD));
private static final long serialVersionUID = 1L;
private final String queryParamOne;
private final String queryParamTwo;
private NestedQueryParameterOperation(BuilderImpl builder) {
this.queryParamOne = builder.queryParamOne;
this.queryParamTwo = builder.queryParamTwo;
}
/**
* Returns the value of the QueryParamOne property for this object.
*
* @return The value of the QueryParamOne property for this object.
*/
public final String queryParamOne() {
return queryParamOne;
}
/**
* Returns the value of the QueryParamTwo property for this object.
*
* @return The value of the QueryParamTwo property for this object.
*/
public final String queryParamTwo() {
return queryParamTwo;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(queryParamOne());
hashCode = 31 * hashCode + Objects.hashCode(queryParamTwo());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedQueryParameterOperation)) {
return false;
}
NestedQueryParameterOperation other = (NestedQueryParameterOperation) obj;
return Objects.equals(queryParamOne(), other.queryParamOne()) && Objects.equals(queryParamTwo(), other.queryParamTwo());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("NestedQueryParameterOperation").add("QueryParamOne", queryParamOne())
.add("QueryParamTwo", queryParamTwo()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "QueryParamOne":
return Optional.ofNullable(clazz.cast(queryParamOne()));
case "QueryParamTwo":
return Optional.ofNullable(clazz.cast(queryParamTwo()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedQueryParameterOperation, T> g) {
return obj -> g.apply((NestedQueryParameterOperation) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, NestedQueryParameterOperation> {
/**
* Sets the value of the QueryParamOne property for this object.
*
* @param queryParamOne
* The new value for the QueryParamOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamOne(String queryParamOne);
/**
* Sets the value of the QueryParamTwo property for this object.
*
* @param queryParamTwo
* The new value for the QueryParamTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamTwo(String queryParamTwo);
}
static final class BuilderImpl implements Builder {
private String queryParamOne;
private String queryParamTwo;
private BuilderImpl() {
}
private BuilderImpl(NestedQueryParameterOperation model) {
queryParamOne(model.queryParamOne);
queryParamTwo(model.queryParamTwo);
}
public final String getQueryParamOne() {
return queryParamOne;
}
public final void setQueryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
}
@Override
public final Builder queryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
return this;
}
public final String getQueryParamTwo() {
return queryParamTwo;
}
public final void setQueryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
}
@Override
public final Builder queryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
return this;
}
@Override
public NestedQueryParameterOperation build() {
return new NestedQueryParameterOperation(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,155 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/blobmaptypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class BlobMapTypeCopier {
static Map<String, SdkBytes> copy(Map<String, SdkBytes> blobMapTypeParam) {
Map<String, SdkBytes> map;
if (blobMapTypeParam == null || blobMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SdkBytes> modifiableMap = new LinkedHashMap<>();
blobMapTypeParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,156 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/queryparameteroperationresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class QueryParameterOperationResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<QueryParameterOperationResponse.Builder, QueryParameterOperationResponse> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private QueryParameterOperationResponse(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof QueryParameterOperationResponse)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("QueryParameterOperationResponse").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, QueryParameterOperationResponse> {
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(QueryParameterOperationResponse model) {
super(model);
}
@Override
public QueryParameterOperationResponse build() {
return new QueryParameterOperationResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,157 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/structwithnestedblobtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StructWithNestedBlobType implements SdkPojo, Serializable,
ToCopyableBuilder<StructWithNestedBlobType.Builder, StructWithNestedBlobType> {
private static final SdkField<SdkBytes> NESTED_BLOB_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("NestedBlob").getter(getter(StructWithNestedBlobType::nestedBlob)).setter(setter(Builder::nestedBlob))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedBlob").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NESTED_BLOB_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes nestedBlob;
private StructWithNestedBlobType(BuilderImpl builder) {
this.nestedBlob = builder.nestedBlob;
}
/**
* Returns the value of the NestedBlob property for this object.
*
* @return The value of the NestedBlob property for this object.
*/
public final SdkBytes nestedBlob() {
return nestedBlob;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(nestedBlob());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StructWithNestedBlobType)) {
return false;
}
StructWithNestedBlobType other = (StructWithNestedBlobType) obj;
return Objects.equals(nestedBlob(), other.nestedBlob());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StructWithNestedBlobType").add("NestedBlob", nestedBlob()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NestedBlob":
return Optional.ofNullable(clazz.cast(nestedBlob()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<StructWithNestedBlobType, T> g) {
return obj -> g.apply((StructWithNestedBlobType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, StructWithNestedBlobType> {
/**
* Sets the value of the NestedBlob property for this object.
*
* @param nestedBlob
* The new value for the NestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedBlob(SdkBytes nestedBlob);
}
static final class BuilderImpl implements Builder {
private SdkBytes nestedBlob;
private BuilderImpl() {
}
private BuilderImpl(StructWithNestedBlobType model) {
nestedBlob(model.nestedBlob);
}
public final ByteBuffer getNestedBlob() {
return nestedBlob == null ? null : nestedBlob.asByteBuffer();
}
public final void setNestedBlob(ByteBuffer nestedBlob) {
nestedBlob(nestedBlob == null ? null : SdkBytes.fromByteBuffer(nestedBlob));
}
@Override
public final Builder nestedBlob(SdkBytes nestedBlob) {
this.nestedBlob = nestedBlob;
return this;
}
@Override
public StructWithNestedBlobType build() {
return new StructWithNestedBlobType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,158 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofintegerscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfIntegersCopier {
static List<Integer> copy(Collection<Integer> listOfIntegersParam) {
List<Integer> list;
if (listOfIntegersParam == null || listOfIntegersParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Integer> modifiableList = new ArrayList<>();
listOfIntegersParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,159 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputevent.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class InputEvent implements SdkPojo, Serializable, ToCopyableBuilder<InputEvent.Builder, InputEvent>, InputEventStream {
private static final SdkField<SdkBytes> EXPLICIT_PAYLOAD_MEMBER_FIELD = SdkField
.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("ExplicitPayloadMember")
.getter(getter(InputEvent::explicitPayloadMember))
.setter(setter(Builder::explicitPayloadMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ExplicitPayloadMember").build(),
PayloadTrait.create()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections
.unmodifiableList(Arrays.asList(EXPLICIT_PAYLOAD_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final SdkBytes explicitPayloadMember;
protected InputEvent(BuilderImpl builder) {
this.explicitPayloadMember = builder.explicitPayloadMember;
}
/**
* Returns the value of the ExplicitPayloadMember property for this object.
*
* @return The value of the ExplicitPayloadMember property for this object.
*/
public final SdkBytes explicitPayloadMember() {
return explicitPayloadMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(explicitPayloadMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof InputEvent)) {
return false;
}
InputEvent other = (InputEvent) obj;
return Objects.equals(explicitPayloadMember(), other.explicitPayloadMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("InputEvent").add("ExplicitPayloadMember", explicitPayloadMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ExplicitPayloadMember":
return Optional.ofNullable(clazz.cast(explicitPayloadMember()));
default:
return Optional.empty();
}
}
@Override
public final InputEvent copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<InputEvent, T> g) {
return obj -> g.apply((InputEvent) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, InputEvent> {
/**
* Sets the value of the ExplicitPayloadMember property for this object.
*
* @param explicitPayloadMember
* The new value for the ExplicitPayloadMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder explicitPayloadMember(SdkBytes explicitPayloadMember);
}
protected static class BuilderImpl implements Builder {
private SdkBytes explicitPayloadMember;
protected BuilderImpl() {
}
protected BuilderImpl(InputEvent model) {
explicitPayloadMember(model.explicitPayloadMember);
}
public final ByteBuffer getExplicitPayloadMember() {
return explicitPayloadMember == null ? null : explicitPayloadMember.asByteBuffer();
}
public final void setExplicitPayloadMember(ByteBuffer explicitPayloadMember) {
explicitPayloadMember(explicitPayloadMember == null ? null : SdkBytes.fromByteBuffer(explicitPayloadMember));
}
@Override
public final Builder explicitPayloadMember(SdkBytes explicitPayloadMember) {
this.explicitPayloadMember = explicitPayloadMember;
return this;
}
@Override
public InputEvent build() {
return new InputEvent(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,160 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/queryparameteroperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.PayloadTrait;
import software.amazon.awssdk.core.traits.RequiredTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class QueryParameterOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<QueryParameterOperationRequest.Builder, QueryParameterOperationRequest> {
private static final SdkField<String> PATH_PARAM_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("PathParam")
.getter(getter(QueryParameterOperationRequest::pathParam))
.setter(setter(Builder::pathParam))
.traits(LocationTrait.builder().location(MarshallLocation.PATH).locationName("PathParam").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_ONE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamOne")
.getter(getter(QueryParameterOperationRequest::queryParamOne))
.setter(setter(Builder::queryParamOne))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamOne").build(),
RequiredTrait.create()).build();
private static final SdkField<String> QUERY_PARAM_TWO_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("QueryParamTwo").getter(getter(QueryParameterOperationRequest::queryParamTwo))
.setter(setter(Builder::queryParamTwo))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("QueryParamTwo").build()).build();
private static final SdkField<String> STRING_HEADER_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("StringHeaderMember")
.getter(getter(QueryParameterOperationRequest::stringHeaderMember))
.setter(setter(Builder::stringHeaderMember))
.traits(LocationTrait.builder().location(MarshallLocation.HEADER).locationName("x-amz-header-string").build(),
RequiredTrait.create()).build();
private static final SdkField<NestedQueryParameterOperation> NESTED_QUERY_PARAMETER_OPERATION_FIELD = SdkField
.<NestedQueryParameterOperation> builder(MarshallingType.SDK_POJO)
.memberName("NestedQueryParameterOperation")
.getter(getter(QueryParameterOperationRequest::nestedQueryParameterOperation))
.setter(setter(Builder::nestedQueryParameterOperation))
.constructor(NestedQueryParameterOperation::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedQueryParameterOperation")
.build(), PayloadTrait.create()).build();
private static final SdkField<List<Integer>> REQUIRED_LIST_QUERY_PARAMS_FIELD = SdkField
.<List<Integer>> builder(MarshallingType.LIST)
.memberName("RequiredListQueryParams")
.getter(getter(QueryParameterOperationRequest::requiredListQueryParams))
.setter(setter(Builder::requiredListQueryParams))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("RequiredListQueryParams")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build(), RequiredTrait.create())
.build();
private static final SdkField<List<Integer>> OPTIONAL_LIST_QUERY_PARAMS_FIELD = SdkField
.<List<Integer>> builder(MarshallingType.LIST)
.memberName("OptionalListQueryParams")
.getter(getter(QueryParameterOperationRequest::optionalListQueryParams))
.setter(setter(Builder::optionalListQueryParams))
.traits(LocationTrait.builder().location(MarshallLocation.QUERY_PARAM).locationName("OptionalListQueryParams")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(PATH_PARAM_FIELD,
QUERY_PARAM_ONE_FIELD, QUERY_PARAM_TWO_FIELD, STRING_HEADER_MEMBER_FIELD, NESTED_QUERY_PARAMETER_OPERATION_FIELD,
REQUIRED_LIST_QUERY_PARAMS_FIELD, OPTIONAL_LIST_QUERY_PARAMS_FIELD));
private final String pathParam;
private final String queryParamOne;
private final String queryParamTwo;
private final String stringHeaderMember;
private final NestedQueryParameterOperation nestedQueryParameterOperation;
private final List<Integer> requiredListQueryParams;
private final List<Integer> optionalListQueryParams;
private QueryParameterOperationRequest(BuilderImpl builder) {
super(builder);
this.pathParam = builder.pathParam;
this.queryParamOne = builder.queryParamOne;
this.queryParamTwo = builder.queryParamTwo;
this.stringHeaderMember = builder.stringHeaderMember;
this.nestedQueryParameterOperation = builder.nestedQueryParameterOperation;
this.requiredListQueryParams = builder.requiredListQueryParams;
this.optionalListQueryParams = builder.optionalListQueryParams;
}
/**
* Returns the value of the PathParam property for this object.
*
* @return The value of the PathParam property for this object.
*/
public final String pathParam() {
return pathParam;
}
/**
* Returns the value of the QueryParamOne property for this object.
*
* @return The value of the QueryParamOne property for this object.
*/
public final String queryParamOne() {
return queryParamOne;
}
/**
* Returns the value of the QueryParamTwo property for this object.
*
* @return The value of the QueryParamTwo property for this object.
*/
public final String queryParamTwo() {
return queryParamTwo;
}
/**
* Returns the value of the StringHeaderMember property for this object.
*
* @return The value of the StringHeaderMember property for this object.
*/
public final String stringHeaderMember() {
return stringHeaderMember;
}
/**
* Returns the value of the NestedQueryParameterOperation property for this object.
*
* @return The value of the NestedQueryParameterOperation property for this object.
*/
public final NestedQueryParameterOperation nestedQueryParameterOperation() {
return nestedQueryParameterOperation;
}
/**
* For responses, this returns true if the service returned a value for the RequiredListQueryParams property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasRequiredListQueryParams() {
return requiredListQueryParams != null && !(requiredListQueryParams instanceof SdkAutoConstructList);
}
/**
* Returns the value of the RequiredListQueryParams property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRequiredListQueryParams} method.
* </p>
*
* @return The value of the RequiredListQueryParams property for this object.
*/
public final List<Integer> requiredListQueryParams() {
return requiredListQueryParams;
}
/**
* For responses, this returns true if the service returned a value for the OptionalListQueryParams property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasOptionalListQueryParams() {
return optionalListQueryParams != null && !(optionalListQueryParams instanceof SdkAutoConstructList);
}
/**
* Returns the value of the OptionalListQueryParams property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasOptionalListQueryParams} method.
* </p>
*
* @return The value of the OptionalListQueryParams property for this object.
*/
public final List<Integer> optionalListQueryParams() {
return optionalListQueryParams;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(pathParam());
hashCode = 31 * hashCode + Objects.hashCode(queryParamOne());
hashCode = 31 * hashCode + Objects.hashCode(queryParamTwo());
hashCode = 31 * hashCode + Objects.hashCode(stringHeaderMember());
hashCode = 31 * hashCode + Objects.hashCode(nestedQueryParameterOperation());
hashCode = 31 * hashCode + Objects.hashCode(hasRequiredListQueryParams() ? requiredListQueryParams() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasOptionalListQueryParams() ? optionalListQueryParams() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof QueryParameterOperationRequest)) {
return false;
}
QueryParameterOperationRequest other = (QueryParameterOperationRequest) obj;
return Objects.equals(pathParam(), other.pathParam()) && Objects.equals(queryParamOne(), other.queryParamOne())
&& Objects.equals(queryParamTwo(), other.queryParamTwo())
&& Objects.equals(stringHeaderMember(), other.stringHeaderMember())
&& Objects.equals(nestedQueryParameterOperation(), other.nestedQueryParameterOperation())
&& hasRequiredListQueryParams() == other.hasRequiredListQueryParams()
&& Objects.equals(requiredListQueryParams(), other.requiredListQueryParams())
&& hasOptionalListQueryParams() == other.hasOptionalListQueryParams()
&& Objects.equals(optionalListQueryParams(), other.optionalListQueryParams());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("QueryParameterOperationRequest").add("PathParam", pathParam())
.add("QueryParamOne", queryParamOne()).add("QueryParamTwo", queryParamTwo())
.add("StringHeaderMember", stringHeaderMember())
.add("NestedQueryParameterOperation", nestedQueryParameterOperation())
.add("RequiredListQueryParams", hasRequiredListQueryParams() ? requiredListQueryParams() : null)
.add("OptionalListQueryParams", hasOptionalListQueryParams() ? optionalListQueryParams() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "PathParam":
return Optional.ofNullable(clazz.cast(pathParam()));
case "QueryParamOne":
return Optional.ofNullable(clazz.cast(queryParamOne()));
case "QueryParamTwo":
return Optional.ofNullable(clazz.cast(queryParamTwo()));
case "StringHeaderMember":
return Optional.ofNullable(clazz.cast(stringHeaderMember()));
case "NestedQueryParameterOperation":
return Optional.ofNullable(clazz.cast(nestedQueryParameterOperation()));
case "RequiredListQueryParams":
return Optional.ofNullable(clazz.cast(requiredListQueryParams()));
case "OptionalListQueryParams":
return Optional.ofNullable(clazz.cast(optionalListQueryParams()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<QueryParameterOperationRequest, T> g) {
return obj -> g.apply((QueryParameterOperationRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, QueryParameterOperationRequest> {
/**
* Sets the value of the PathParam property for this object.
*
* @param pathParam
* The new value for the PathParam property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder pathParam(String pathParam);
/**
* Sets the value of the QueryParamOne property for this object.
*
* @param queryParamOne
* The new value for the QueryParamOne property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamOne(String queryParamOne);
/**
* Sets the value of the QueryParamTwo property for this object.
*
* @param queryParamTwo
* The new value for the QueryParamTwo property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder queryParamTwo(String queryParamTwo);
/**
* Sets the value of the StringHeaderMember property for this object.
*
* @param stringHeaderMember
* The new value for the StringHeaderMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringHeaderMember(String stringHeaderMember);
/**
* Sets the value of the NestedQueryParameterOperation property for this object.
*
* @param nestedQueryParameterOperation
* The new value for the NestedQueryParameterOperation property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedQueryParameterOperation(NestedQueryParameterOperation nestedQueryParameterOperation);
/**
* Sets the value of the NestedQueryParameterOperation property for this object.
*
* This is a convenience method that creates an instance of the {@link NestedQueryParameterOperation.Builder}
* avoiding the need to create one manually via {@link NestedQueryParameterOperation#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link NestedQueryParameterOperation.Builder#build()} is called
* immediately and its result is passed to {@link #nestedQueryParameterOperation(NestedQueryParameterOperation)}.
*
* @param nestedQueryParameterOperation
* a consumer that will call methods on {@link NestedQueryParameterOperation.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #nestedQueryParameterOperation(NestedQueryParameterOperation)
*/
default Builder nestedQueryParameterOperation(
Consumer<NestedQueryParameterOperation.Builder> nestedQueryParameterOperation) {
return nestedQueryParameterOperation(NestedQueryParameterOperation.builder()
.applyMutation(nestedQueryParameterOperation).build());
}
/**
* Sets the value of the RequiredListQueryParams property for this object.
*
* @param requiredListQueryParams
* The new value for the RequiredListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requiredListQueryParams(Collection<Integer> requiredListQueryParams);
/**
* Sets the value of the RequiredListQueryParams property for this object.
*
* @param requiredListQueryParams
* The new value for the RequiredListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder requiredListQueryParams(Integer... requiredListQueryParams);
/**
* Sets the value of the OptionalListQueryParams property for this object.
*
* @param optionalListQueryParams
* The new value for the OptionalListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder optionalListQueryParams(Collection<Integer> optionalListQueryParams);
/**
* Sets the value of the OptionalListQueryParams property for this object.
*
* @param optionalListQueryParams
* The new value for the OptionalListQueryParams property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder optionalListQueryParams(Integer... optionalListQueryParams);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String pathParam;
private String queryParamOne;
private String queryParamTwo;
private String stringHeaderMember;
private NestedQueryParameterOperation nestedQueryParameterOperation;
private List<Integer> requiredListQueryParams = DefaultSdkAutoConstructList.getInstance();
private List<Integer> optionalListQueryParams = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(QueryParameterOperationRequest model) {
super(model);
pathParam(model.pathParam);
queryParamOne(model.queryParamOne);
queryParamTwo(model.queryParamTwo);
stringHeaderMember(model.stringHeaderMember);
nestedQueryParameterOperation(model.nestedQueryParameterOperation);
requiredListQueryParams(model.requiredListQueryParams);
optionalListQueryParams(model.optionalListQueryParams);
}
public final String getPathParam() {
return pathParam;
}
public final void setPathParam(String pathParam) {
this.pathParam = pathParam;
}
@Override
public final Builder pathParam(String pathParam) {
this.pathParam = pathParam;
return this;
}
public final String getQueryParamOne() {
return queryParamOne;
}
public final void setQueryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
}
@Override
public final Builder queryParamOne(String queryParamOne) {
this.queryParamOne = queryParamOne;
return this;
}
public final String getQueryParamTwo() {
return queryParamTwo;
}
public final void setQueryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
}
@Override
public final Builder queryParamTwo(String queryParamTwo) {
this.queryParamTwo = queryParamTwo;
return this;
}
public final String getStringHeaderMember() {
return stringHeaderMember;
}
public final void setStringHeaderMember(String stringHeaderMember) {
this.stringHeaderMember = stringHeaderMember;
}
@Override
public final Builder stringHeaderMember(String stringHeaderMember) {
this.stringHeaderMember = stringHeaderMember;
return this;
}
public final NestedQueryParameterOperation.Builder getNestedQueryParameterOperation() {
return nestedQueryParameterOperation != null ? nestedQueryParameterOperation.toBuilder() : null;
}
public final void setNestedQueryParameterOperation(NestedQueryParameterOperation.BuilderImpl nestedQueryParameterOperation) {
this.nestedQueryParameterOperation = nestedQueryParameterOperation != null ? nestedQueryParameterOperation.build()
: null;
}
@Override
public final Builder nestedQueryParameterOperation(NestedQueryParameterOperation nestedQueryParameterOperation) {
this.nestedQueryParameterOperation = nestedQueryParameterOperation;
return this;
}
public final Collection<Integer> getRequiredListQueryParams() {
if (requiredListQueryParams instanceof SdkAutoConstructList) {
return null;
}
return requiredListQueryParams;
}
public final void setRequiredListQueryParams(Collection<Integer> requiredListQueryParams) {
this.requiredListQueryParams = ListOfIntegersCopier.copy(requiredListQueryParams);
}
@Override
public final Builder requiredListQueryParams(Collection<Integer> requiredListQueryParams) {
this.requiredListQueryParams = ListOfIntegersCopier.copy(requiredListQueryParams);
return this;
}
@Override
@SafeVarargs
public final Builder requiredListQueryParams(Integer... requiredListQueryParams) {
requiredListQueryParams(Arrays.asList(requiredListQueryParams));
return this;
}
public final Collection<Integer> getOptionalListQueryParams() {
if (optionalListQueryParams instanceof SdkAutoConstructList) {
return null;
}
return optionalListQueryParams;
}
public final void setOptionalListQueryParams(Collection<Integer> optionalListQueryParams) {
this.optionalListQueryParams = ListOfIntegersCopier.copy(optionalListQueryParams);
}
@Override
public final Builder optionalListQueryParams(Collection<Integer> optionalListQueryParams) {
this.optionalListQueryParams = ListOfIntegersCopier.copy(optionalListQueryParams);
return this;
}
@Override
@SafeVarargs
public final Builder optionalListQueryParams(Integer... optionalListQueryParams) {
optionalListQueryParams(Arrays.asList(optionalListQueryParams));
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public QueryParameterOperationRequest build() {
return new QueryParameterOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,161 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/structwithtimestamp.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StructWithTimestamp implements SdkPojo, Serializable,
ToCopyableBuilder<StructWithTimestamp.Builder, StructWithTimestamp> {
private static final SdkField<Instant> NESTED_TIMESTAMP_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("NestedTimestamp").getter(getter(StructWithTimestamp::nestedTimestamp))
.setter(setter(Builder::nestedTimestamp))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NestedTimestamp").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NESTED_TIMESTAMP_FIELD));
private static final long serialVersionUID = 1L;
private final Instant nestedTimestamp;
private StructWithTimestamp(BuilderImpl builder) {
this.nestedTimestamp = builder.nestedTimestamp;
}
/**
* Returns the value of the NestedTimestamp property for this object.
*
* @return The value of the NestedTimestamp property for this object.
*/
public final Instant nestedTimestamp() {
return nestedTimestamp;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(nestedTimestamp());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StructWithTimestamp)) {
return false;
}
StructWithTimestamp other = (StructWithTimestamp) obj;
return Objects.equals(nestedTimestamp(), other.nestedTimestamp());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StructWithTimestamp").add("NestedTimestamp", nestedTimestamp()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NestedTimestamp":
return Optional.ofNullable(clazz.cast(nestedTimestamp()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<StructWithTimestamp, T> g) {
return obj -> g.apply((StructWithTimestamp) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, StructWithTimestamp> {
/**
* Sets the value of the NestedTimestamp property for this object.
*
* @param nestedTimestamp
* The new value for the NestedTimestamp property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder nestedTimestamp(Instant nestedTimestamp);
}
static final class BuilderImpl implements Builder {
private Instant nestedTimestamp;
private BuilderImpl() {
}
private BuilderImpl(StructWithTimestamp model) {
nestedTimestamp(model.nestedTimestamp);
}
public final Instant getNestedTimestamp() {
return nestedTimestamp;
}
public final void setNestedTimestamp(Instant nestedTimestamp) {
this.nestedTimestamp = nestedTimestamp;
}
@Override
public final Builder nestedTimestamp(Instant nestedTimestamp) {
this.nestedTimestamp = nestedTimestamp;
return this;
}
@Override
public StructWithTimestamp build() {
return new StructWithTimestamp(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,162 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapofenumtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapOfEnumToStringCopier {
static List<Map<String, String>> copy(Collection<? extends Map<String, String>> listOfMapOfEnumToStringParam) {
List<Map<String, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, String>> copyEnumToString(Collection<? extends Map<EnumType, String>> listOfMapOfEnumToStringParam) {
List<Map<String, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
String result = key.toString();
modifiableMap.put(result, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<EnumType, String>> copyStringToEnum(Collection<? extends Map<String, String>> listOfMapOfEnumToStringParam) {
List<Map<EnumType, String>> list;
if (listOfMapOfEnumToStringParam == null || listOfMapOfEnumToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<EnumType, String>> modifiableList = new ArrayList<>();
listOfMapOfEnumToStringParam.forEach(entry -> {
Map<EnumType, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, value);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,163 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofsimplestructscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfSimpleStructsCopier {
static List<SimpleStruct> copy(Collection<? extends SimpleStruct> listOfSimpleStructsParam) {
List<SimpleStruct> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<SimpleStruct> copyFromBuilder(Collection<? extends SimpleStruct.Builder> listOfSimpleStructsParam) {
List<SimpleStruct> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
SimpleStruct member = entry == null ? null : entry.build();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<SimpleStruct.Builder> copyToBuilder(Collection<? extends SimpleStruct> listOfSimpleStructsParam) {
List<SimpleStruct.Builder> list;
if (listOfSimpleStructsParam == null || listOfSimpleStructsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<SimpleStruct.Builder> modifiableList = new ArrayList<>();
listOfSimpleStructsParam.forEach(entry -> {
SimpleStruct.Builder member = entry == null ? null : entry.toBuilder();
modifiableList.add(member);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,164 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivestructtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class RecursiveStructType implements SdkPojo, Serializable,
ToCopyableBuilder<RecursiveStructType.Builder, RecursiveStructType> {
private static final SdkField<String> NO_RECURSE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("NoRecurse").getter(getter(RecursiveStructType::noRecurse)).setter(setter(Builder::noRecurse))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NoRecurse").build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(RecursiveStructType::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<List<RecursiveStructType>> RECURSIVE_LIST_FIELD = SdkField
.<List<RecursiveStructType>> builder(MarshallingType.LIST)
.memberName("RecursiveList")
.getter(getter(RecursiveStructType::recursiveList))
.setter(setter(Builder::recursiveList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, RecursiveStructType>> RECURSIVE_MAP_FIELD = SdkField
.<Map<String, RecursiveStructType>> builder(MarshallingType.MAP)
.memberName("RecursiveMap")
.getter(getter(RecursiveStructType::recursiveMap))
.setter(setter(Builder::recursiveMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<RecursiveStructType> builder(MarshallingType.SDK_POJO)
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NO_RECURSE_FIELD,
RECURSIVE_STRUCT_FIELD, RECURSIVE_LIST_FIELD, RECURSIVE_MAP_FIELD));
private static final long serialVersionUID = 1L;
private final String noRecurse;
private final RecursiveStructType recursiveStruct;
private final List<RecursiveStructType> recursiveList;
private final Map<String, RecursiveStructType> recursiveMap;
private RecursiveStructType(BuilderImpl builder) {
this.noRecurse = builder.noRecurse;
this.recursiveStruct = builder.recursiveStruct;
this.recursiveList = builder.recursiveList;
this.recursiveMap = builder.recursiveMap;
}
/**
* Returns the value of the NoRecurse property for this object.
*
* @return The value of the NoRecurse property for this object.
*/
public final String noRecurse() {
return noRecurse;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* For responses, this returns true if the service returned a value for the RecursiveList property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRecursiveList() {
return recursiveList != null && !(recursiveList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the RecursiveList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRecursiveList} method.
* </p>
*
* @return The value of the RecursiveList property for this object.
*/
public final List<RecursiveStructType> recursiveList() {
return recursiveList;
}
/**
* For responses, this returns true if the service returned a value for the RecursiveMap property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasRecursiveMap() {
return recursiveMap != null && !(recursiveMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the RecursiveMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasRecursiveMap} method.
* </p>
*
* @return The value of the RecursiveMap property for this object.
*/
public final Map<String, RecursiveStructType> recursiveMap() {
return recursiveMap;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(noRecurse());
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(hasRecursiveList() ? recursiveList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasRecursiveMap() ? recursiveMap() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof RecursiveStructType)) {
return false;
}
RecursiveStructType other = (RecursiveStructType) obj;
return Objects.equals(noRecurse(), other.noRecurse()) && Objects.equals(recursiveStruct(), other.recursiveStruct())
&& hasRecursiveList() == other.hasRecursiveList() && Objects.equals(recursiveList(), other.recursiveList())
&& hasRecursiveMap() == other.hasRecursiveMap() && Objects.equals(recursiveMap(), other.recursiveMap());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("RecursiveStructType").add("NoRecurse", noRecurse()).add("RecursiveStruct", recursiveStruct())
.add("RecursiveList", hasRecursiveList() ? recursiveList() : null)
.add("RecursiveMap", hasRecursiveMap() ? recursiveMap() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "NoRecurse":
return Optional.ofNullable(clazz.cast(noRecurse()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "RecursiveList":
return Optional.ofNullable(clazz.cast(recursiveList()));
case "RecursiveMap":
return Optional.ofNullable(clazz.cast(recursiveMap()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<RecursiveStructType, T> g) {
return obj -> g.apply((RecursiveStructType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, RecursiveStructType> {
/**
* Sets the value of the NoRecurse property for this object.
*
* @param noRecurse
* The new value for the NoRecurse property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder noRecurse(String noRecurse);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(Collection<RecursiveStructType> recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* @param recursiveList
* The new value for the RecursiveList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveList(RecursiveStructType... recursiveList);
/**
* Sets the value of the RecursiveList property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder} avoiding the need
* to create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder#build()} is called
* immediately and its result is passed to {@link #recursiveList(List<RecursiveStructType>)}.
*
* @param recursiveList
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveList(java.util.Collection<RecursiveStructType>)
*/
Builder recursiveList(Consumer<Builder>... recursiveList);
/**
* Sets the value of the RecursiveMap property for this object.
*
* @param recursiveMap
* The new value for the RecursiveMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap);
}
static final class BuilderImpl implements Builder {
private String noRecurse;
private RecursiveStructType recursiveStruct;
private List<RecursiveStructType> recursiveList = DefaultSdkAutoConstructList.getInstance();
private Map<String, RecursiveStructType> recursiveMap = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(RecursiveStructType model) {
noRecurse(model.noRecurse);
recursiveStruct(model.recursiveStruct);
recursiveList(model.recursiveList);
recursiveMap(model.recursiveMap);
}
public final String getNoRecurse() {
return noRecurse;
}
public final void setNoRecurse(String noRecurse) {
this.noRecurse = noRecurse;
}
@Override
public final Builder noRecurse(String noRecurse) {
this.noRecurse = noRecurse;
return this;
}
public final Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final List<Builder> getRecursiveList() {
List<Builder> result = RecursiveListTypeCopier.copyToBuilder(this.recursiveList);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setRecursiveList(Collection<BuilderImpl> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copyFromBuilder(recursiveList);
}
@Override
public final Builder recursiveList(Collection<RecursiveStructType> recursiveList) {
this.recursiveList = RecursiveListTypeCopier.copy(recursiveList);
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(RecursiveStructType... recursiveList) {
recursiveList(Arrays.asList(recursiveList));
return this;
}
@Override
@SafeVarargs
public final Builder recursiveList(Consumer<Builder>... recursiveList) {
recursiveList(Stream.of(recursiveList).map(c -> RecursiveStructType.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Map<String, Builder> getRecursiveMap() {
Map<String, Builder> result = RecursiveMapTypeCopier.copyToBuilder(this.recursiveMap);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setRecursiveMap(Map<String, BuilderImpl> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copyFromBuilder(recursiveMap);
}
@Override
public final Builder recursiveMap(Map<String, RecursiveStructType> recursiveMap) {
this.recursiveMap = RecursiveMapTypeCopier.copy(recursiveMap);
return this;
}
@Override
public RecursiveStructType build() {
return new RecursiveStructType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,165 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapstringtostringcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapStringToStringCopier {
static List<Map<String, String>> copy(Collection<? extends Map<String, String>> listOfMapStringToStringParam) {
List<Map<String, String>> list;
if (listOfMapStringToStringParam == null || listOfMapStringToStringParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, String>> modifiableList = new ArrayList<>();
listOfMapStringToStringParam.forEach(entry -> {
Map<String, String> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,166 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstream.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventOne;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventTwo;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultEventthree;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultSecondEventOne;
import software.amazon.awssdk.services.jsonprotocoltests.model.eventstream.DefaultSecondEventTwo;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in EventStream.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface EventStream extends SdkPojo {
/**
* Special type of {@link EventStream} for unknown types of events that this version of the SDK does not know about
*/
EventStream UNKNOWN = new EventStream() {
@Override
public List<SdkField<?>> sdkFields() {
return Collections.emptyList();
}
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
visitor.visitDefault(this);
}
};
/**
* Create a builder for the {@code EventOne} event type for this stream.
*/
static EventOne.Builder eventOneBuilder() {
return DefaultEventOne.builder();
}
/**
* Create a builder for the {@code SecondEventOne} event type for this stream.
*/
static EventOne.Builder secondEventOneBuilder() {
return DefaultSecondEventOne.builder();
}
/**
* Create a builder for the {@code EventTwo} event type for this stream.
*/
static EventTwo.Builder eventTwoBuilder() {
return DefaultEventTwo.builder();
}
/**
* Create a builder for the {@code SecondEventTwo} event type for this stream.
*/
static EventTwo.Builder secondEventTwoBuilder() {
return DefaultSecondEventTwo.builder();
}
/**
* Create a builder for the {@code eventthree} event type for this stream.
*/
static EventTwo.Builder eventthreeBuilder() {
return DefaultEventthree.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventStream}.
*
* @param visitor
* Visitor to invoke.
*/
void accept(EventStreamOperationResponseHandler.Visitor visitor);
/**
* The known possible types of events for {@code EventStream}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
EVENT_ONE("EventOne"),
SECOND_EVENT_ONE("SecondEventOne"),
EVENT_TWO("EventTwo"),
SECOND_EVENT_TWO("SecondEventTwo"),
EVENTTHREE("eventthree"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,167 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfStringsCopier {
static List<String> copy(Collection<String> listOfStringsParam) {
List<String> list;
if (listOfStringsParam == null || listOfStringsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfStringsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,168 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/nestedcontainersrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class NestedContainersRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<NestedContainersRequest.Builder, NestedContainersRequest> {
private static final SdkField<List<List<String>>> LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<String>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfStrings))
.setter(setter(Builder::listOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<List<List<String>>>> LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<List<List<List<String>>>> builder(MarshallingType.LIST)
.memberName("ListOfListOfListOfStrings")
.getter(getter(NestedContainersRequest::listOfListOfListOfStrings))
.setter(setter(Builder::listOfListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfListOfListOfStrings").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final SdkField<Map<String, List<List<String>>>> MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD = SdkField
.<Map<String, List<List<String>>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToListOfListOfStrings")
.getter(getter(NestedContainersRequest::mapOfStringToListOfListOfStrings))
.setter(setter(Builder::mapOfStringToListOfListOfStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToListOfListOfStrings")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<List<String>>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(
MarshallingType.STRING)
.traits(LocationTrait
.builder()
.location(
MarshallLocation.PAYLOAD)
.locationName(
"member")
.build())
.build()).build())
.build()).build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LIST_OF_LIST_OF_STRINGS_FIELD,
LIST_OF_LIST_OF_LIST_OF_STRINGS_FIELD, MAP_OF_STRING_TO_LIST_OF_LIST_OF_STRINGS_FIELD));
private final List<List<String>> listOfListOfStrings;
private final List<List<List<String>>> listOfListOfListOfStrings;
private final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings;
private NestedContainersRequest(BuilderImpl builder) {
super(builder);
this.listOfListOfStrings = builder.listOfListOfStrings;
this.listOfListOfListOfStrings = builder.listOfListOfListOfStrings;
this.mapOfStringToListOfListOfStrings = builder.mapOfStringToListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfStrings property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfListOfStrings() {
return listOfListOfStrings != null && !(listOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfStrings property for this object.
*/
public final List<List<String>> listOfListOfStrings() {
return listOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the ListOfListOfListOfStrings property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfListOfListOfStrings() {
return listOfListOfListOfStrings != null && !(listOfListOfListOfStrings instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfListOfListOfStrings} method.
* </p>
*
* @return The value of the ListOfListOfListOfStrings property for this object.
*/
public final List<List<List<String>>> listOfListOfListOfStrings() {
return listOfListOfListOfStrings;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToListOfListOfStrings
* property. This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()}
* method on the property). This is useful because the SDK will never return a null collection or map, but you may
* need to differentiate between the service returning nothing (or null) and the service returning an empty
* collection or map. For requests, this returns true if a value for the property was specified in the request
* builder, and false if a value was not specified.
*/
public final boolean hasMapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings != null && !(mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToListOfListOfStrings property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToListOfListOfStrings}
* method.
* </p>
*
* @return The value of the MapOfStringToListOfListOfStrings property for this object.
*/
public final Map<String, List<List<String>>> mapOfStringToListOfListOfStrings() {
return mapOfStringToListOfListOfStrings;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfStrings() ? listOfListOfStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof NestedContainersRequest)) {
return false;
}
NestedContainersRequest other = (NestedContainersRequest) obj;
return hasListOfListOfStrings() == other.hasListOfListOfStrings()
&& Objects.equals(listOfListOfStrings(), other.listOfListOfStrings())
&& hasListOfListOfListOfStrings() == other.hasListOfListOfListOfStrings()
&& Objects.equals(listOfListOfListOfStrings(), other.listOfListOfListOfStrings())
&& hasMapOfStringToListOfListOfStrings() == other.hasMapOfStringToListOfListOfStrings()
&& Objects.equals(mapOfStringToListOfListOfStrings(), other.mapOfStringToListOfListOfStrings());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("NestedContainersRequest")
.add("ListOfListOfStrings", hasListOfListOfStrings() ? listOfListOfStrings() : null)
.add("ListOfListOfListOfStrings", hasListOfListOfListOfStrings() ? listOfListOfListOfStrings() : null)
.add("MapOfStringToListOfListOfStrings",
hasMapOfStringToListOfListOfStrings() ? mapOfStringToListOfListOfStrings() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "ListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfStrings()));
case "ListOfListOfListOfStrings":
return Optional.ofNullable(clazz.cast(listOfListOfListOfStrings()));
case "MapOfStringToListOfListOfStrings":
return Optional.ofNullable(clazz.cast(mapOfStringToListOfListOfStrings()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<NestedContainersRequest, T> g) {
return obj -> g.apply((NestedContainersRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, NestedContainersRequest> {
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings);
/**
* Sets the value of the ListOfListOfStrings property for this object.
*
* @param listOfListOfStrings
* The new value for the ListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfStrings(Collection<String>... listOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings);
/**
* Sets the value of the ListOfListOfListOfStrings property for this object.
*
* @param listOfListOfListOfStrings
* The new value for the ListOfListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings);
/**
* Sets the value of the MapOfStringToListOfListOfStrings property for this object.
*
* @param mapOfStringToListOfListOfStrings
* The new value for the MapOfStringToListOfListOfStrings property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<List<String>> listOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private List<List<List<String>>> listOfListOfListOfStrings = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<List<String>>> mapOfStringToListOfListOfStrings = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(NestedContainersRequest model) {
super(model);
listOfListOfStrings(model.listOfListOfStrings);
listOfListOfListOfStrings(model.listOfListOfListOfStrings);
mapOfStringToListOfListOfStrings(model.mapOfStringToListOfListOfStrings);
}
public final Collection<? extends Collection<String>> getListOfListOfStrings() {
if (listOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfStrings;
}
public final void setListOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
}
@Override
public final Builder listOfListOfStrings(Collection<? extends Collection<String>> listOfListOfStrings) {
this.listOfListOfStrings = ListOfListOfStringsCopier.copy(listOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfStrings(Collection<String>... listOfListOfStrings) {
listOfListOfStrings(Arrays.asList(listOfListOfStrings));
return this;
}
public final Collection<? extends Collection<? extends Collection<String>>> getListOfListOfListOfStrings() {
if (listOfListOfListOfStrings instanceof SdkAutoConstructList) {
return null;
}
return listOfListOfListOfStrings;
}
public final void setListOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
}
@Override
public final Builder listOfListOfListOfStrings(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStrings) {
this.listOfListOfListOfStrings = ListOfListOfListOfStringsCopier.copy(listOfListOfListOfStrings);
return this;
}
@Override
@SafeVarargs
public final Builder listOfListOfListOfStrings(Collection<? extends Collection<String>>... listOfListOfListOfStrings) {
listOfListOfListOfStrings(Arrays.asList(listOfListOfListOfStrings));
return this;
}
public final Map<String, ? extends Collection<? extends Collection<String>>> getMapOfStringToListOfListOfStrings() {
if (mapOfStringToListOfListOfStrings instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToListOfListOfStrings;
}
public final void setMapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
}
@Override
public final Builder mapOfStringToListOfListOfStrings(
Map<String, ? extends Collection<? extends Collection<String>>> mapOfStringToListOfListOfStrings) {
this.mapOfStringToListOfListOfStrings = MapOfStringToListOfListOfStringsCopier.copy(mapOfStringToListOfListOfStrings);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public NestedContainersRequest build() {
return new NestedContainersRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,169 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/underscore_name_type.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class Underscore_Name_Type implements SdkPojo, Serializable,
ToCopyableBuilder<Underscore_Name_Type.Builder, Underscore_Name_Type> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private static final long serialVersionUID = 1L;
private Underscore_Name_Type(BuilderImpl builder) {
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof Underscore_Name_Type)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("Underscore_Name_Type").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, Underscore_Name_Type> {
}
static final class BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(Underscore_Name_Type model) {
}
@Override
public Underscore_Name_Type build() {
return new Underscore_Name_Type(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,170 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/enumtype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.utils.ToString;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EnumType {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EnumType(EnumType.BuilderImpl builder) {
}
@Override
public EnumType.Builder toBuilder() {
return new EnumType.BuilderImpl(this);
}
public static EnumType.Builder builder() {
return new EnumType.BuilderImpl();
}
public static Class<? extends EnumType.Builder> serializableBuilderClass() {
return EnumType.BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EnumType)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EnumType").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
| 3,171 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/recursivemaptypecopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class RecursiveMapTypeCopier {
static Map<String, RecursiveStructType> copy(Map<String, ? extends RecursiveStructType> recursiveMapTypeParam) {
Map<String, RecursiveStructType> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, RecursiveStructType> copyFromBuilder(
Map<String, ? extends RecursiveStructType.Builder> recursiveMapTypeParam) {
Map<String, RecursiveStructType> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
RecursiveStructType member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, RecursiveStructType.Builder> copyToBuilder(Map<String, ? extends RecursiveStructType> recursiveMapTypeParam) {
Map<String, RecursiveStructType.Builder> map;
if (recursiveMapTypeParam == null || recursiveMapTypeParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, RecursiveStructType.Builder> modifiableMap = new LinkedHashMap<>();
recursiveMapTypeParam.forEach((key, value) -> {
RecursiveStructType.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,172 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofenumtomapofstringtoenumcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfEnumToMapOfStringToEnumCopier {
static Map<String, Map<String, String>> copy(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnumParam) {
Map<String, Map<String, String>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, Map<String, String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
Map<String, String> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
modifiableMap1.put(key1, value1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
modifiableMap.put(key, map1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, Map<String, String>> copyEnumToString(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnumParam) {
Map<String, Map<String, String>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, Map<String, String>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
String result = key.toString();
Map<String, String> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, String> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
String result1 = value1.toString();
modifiableMap1.put(key1, result1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
modifiableMap.put(result, map1);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<EnumType, Map<String, EnumType>> copyStringToEnum(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnumParam) {
Map<EnumType, Map<String, EnumType>> map;
if (mapOfEnumToMapOfStringToEnumParam == null || mapOfEnumToMapOfStringToEnumParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<EnumType, Map<String, EnumType>> modifiableMap = new LinkedHashMap<>();
mapOfEnumToMapOfStringToEnumParam.forEach((key, value) -> {
EnumType result = EnumType.fromValue(key);
Map<String, EnumType> map1;
if (value == null || value instanceof SdkAutoConstructMap) {
map1 = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, EnumType> modifiableMap1 = new LinkedHashMap<>();
value.forEach((key1, value1) -> {
EnumType result1 = EnumType.fromValue(value1);
modifiableMap1.put(key1, result1);
});
map1 = Collections.unmodifiableMap(modifiableMap1);
}
if (result != EnumType.UNKNOWN_TO_SDK_VERSION) {
modifiableMap.put(result, map1);
}
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,173 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/inputeventstreamtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.services.jsonprotocoltests.model.inputeventstreamtwo.DefaultInputEventTwo;
import software.amazon.awssdk.utils.internal.EnumUtils;
/**
* Base interface for all event types in InputEventStreamTwo.
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public interface InputEventStreamTwo {
/**
* Create a builder for the {@code InputEventTwo} event type for this stream.
*/
static InputEventTwo.Builder inputEventTwoBuilder() {
return DefaultInputEventTwo.builder();
}
/**
* The type of this event. Corresponds to the {@code :event-type} header on the Message.
*/
default EventType sdkEventType() {
return EventType.UNKNOWN_TO_SDK_VERSION;
}
/**
* The known possible types of events for {@code InputEventStreamTwo}.
*/
@Generated("software.amazon.awssdk:codegen")
enum EventType {
INPUT_EVENT_TWO("InputEventTwo"),
UNKNOWN_TO_SDK_VERSION(null);
private static final Map<String, EventType> VALUE_MAP = EnumUtils.uniqueIndex(EventType.class, EventType::toString);
private final String value;
private EventType(String value) {
this.value = value;
}
@Override
public String toString() {
return String.valueOf(value);
}
/**
* Use this in place of valueOf to convert the raw string returned by the service into the enum value.
*
* @param value
* real value
* @return EventType corresponding to the value
*/
public static EventType fromValue(String value) {
if (value == null) {
return null;
}
return VALUE_MAP.getOrDefault(value, UNKNOWN_TO_SDK_VERSION);
}
/**
* Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will
* return all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}.
*
* @return a {@link Set} of known {@link EventType}s
*/
public static Set<EventType> knownValues() {
Set<EventType> knownValues = EnumSet.allOf(EventType.class);
knownValues.remove(UNKNOWN_TO_SDK_VERSION);
return knownValues;
}
}
}
| 3,174 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofmapofstringtostructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class ListOfMapOfStringToStructCopier {
static List<Map<String, SimpleStruct>> copy(
Collection<? extends Map<String, ? extends SimpleStruct>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, SimpleStruct>> copyFromBuilder(
Collection<? extends Map<String, ? extends SimpleStruct.Builder>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<Map<String, SimpleStruct.Builder>> copyToBuilder(
Collection<? extends Map<String, ? extends SimpleStruct>> listOfMapOfStringToStructParam) {
List<Map<String, SimpleStruct.Builder>> list;
if (listOfMapOfStringToStructParam == null || listOfMapOfStringToStructParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<Map<String, SimpleStruct.Builder>> modifiableList = new ArrayList<>();
listOfMapOfStringToStructParam.forEach(entry -> {
Map<String, SimpleStruct.Builder> map;
if (entry == null || entry instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
entry.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
modifiableList.add(map);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,175 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/serviceclientconfiguration.java | package software.amazon.awssdk.services.jsonprotocoltests;
import java.net.URI;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsServiceClientConfiguration;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.jsonprotocoltests.auth.scheme.JsonProtocolTestsAuthSchemeProvider;
import software.amazon.awssdk.services.jsonprotocoltests.internal.JsonProtocolTestsServiceClientConfigurationBuilder;
/**
* Class to expose the service client settings to the user. Implementation of {@link AwsServiceClientConfiguration}
*/
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsServiceClientConfiguration extends AwsServiceClientConfiguration {
private final JsonProtocolTestsAuthSchemeProvider authSchemeProvider;
public JsonProtocolTestsServiceClientConfiguration(Builder builder) {
super(builder);
this.authSchemeProvider = builder.authSchemeProvider();
}
public static Builder builder() {
return new JsonProtocolTestsServiceClientConfigurationBuilder();
}
/**
* Gets the value for auth scheme provider
*/
public JsonProtocolTestsAuthSchemeProvider authSchemeProvider() {
return authSchemeProvider;
}
/**
* A builder for creating a {@link JsonProtocolTestsServiceClientConfiguration}
*/
public interface Builder extends AwsServiceClientConfiguration.Builder {
/**
* Sets the value for client override configuration
*/
@Override
Builder overrideConfiguration(ClientOverrideConfiguration overrideConfiguration);
/**
* Gets the value for client override configuration
*/
@Override
ClientOverrideConfiguration overrideConfiguration();
/**
* Sets the value for endpoint override
*/
@Override
Builder endpointOverride(URI endpointOverride);
/**
* Gets the value for endpoint override
*/
@Override
URI endpointOverride();
/**
* Sets the value for endpoint provider
*/
@Override
Builder endpointProvider(EndpointProvider endpointProvider);
/**
* Gets the value for endpoint provider
*/
@Override
EndpointProvider endpointProvider();
/**
* Sets the value for AWS region
*/
@Override
Builder region(Region region);
/**
* Gets the value for AWS region
*/
@Override
Region region();
/**
* Sets the value for credentials provider
*/
@Override
Builder credentialsProvider(IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider);
/**
* Gets the value for credentials provider
*/
@Override
IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider();
@Override
Builder putAuthScheme(AuthScheme<?> authScheme);
/**
* Gets the value for auth schemes
*/
@Override
Map<String, AuthScheme<?>> authSchemes();
/**
* Sets the value for auth scheme provider
*/
Builder authSchemeProvider(JsonProtocolTestsAuthSchemeProvider authSchemeProvider);
/**
* Gets the value for auth scheme provider
*/
JsonProtocolTestsAuthSchemeProvider authSchemeProvider();
@Override
JsonProtocolTestsServiceClientConfiguration build();
}
}
| 3,176 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventtwo.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public class EventTwo implements SdkPojo, Serializable, ToCopyableBuilder<EventTwo.Builder, EventTwo>, EventStream {
private static final SdkField<String> BAR_FIELD = SdkField.<String> builder(MarshallingType.STRING).memberName("Bar")
.getter(getter(EventTwo::bar)).setter(setter(Builder::bar))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Bar").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BAR_FIELD));
private static final long serialVersionUID = 1L;
private final String bar;
protected EventTwo(BuilderImpl builder) {
this.bar = builder.bar;
}
/**
* Returns the value of the Bar property for this object.
*
* @return The value of the Bar property for this object.
*/
public final String bar() {
return bar;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(bar());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventTwo)) {
return false;
}
EventTwo other = (EventTwo) obj;
return Objects.equals(bar(), other.bar());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventTwo").add("Bar", bar()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Bar":
return Optional.ofNullable(clazz.cast(bar()));
default:
return Optional.empty();
}
}
@Override
public final EventTwo copy(Consumer<? super Builder> modifier) {
return ToCopyableBuilder.super.copy(modifier);
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<EventTwo, T> g) {
return obj -> g.apply((EventTwo) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
/**
* Calls the appropriate visit method depending on the subtype of {@link EventTwo}.
*
* @param visitor
* Visitor to invoke.
*/
@Override
public void accept(EventStreamOperationResponseHandler.Visitor visitor) {
throw new UnsupportedOperationException();
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, EventTwo> {
/**
* Sets the value of the Bar property for this object.
*
* @param bar
* The new value for the Bar property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder bar(String bar);
}
protected static class BuilderImpl implements Builder {
private String bar;
protected BuilderImpl() {
}
protected BuilderImpl(EventTwo model) {
bar(model.bar);
}
public final String getBar() {
return bar;
}
public final void setBar(String bar) {
this.bar = bar;
}
@Override
public final Builder bar(String bar) {
this.bar = bar;
return this;
}
@Override
public EventTwo build() {
return new EventTwo(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,177 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<AllTypesResponse.Builder, AllTypesResponse> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesResponse::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesResponse::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesResponse::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesResponse::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesResponse::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesResponse::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesResponse::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesResponse::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesResponse::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesResponse::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesResponse::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesResponse::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesResponse::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesResponse::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesResponse::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesResponse::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesResponse::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesResponse::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesResponse::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesResponse::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesResponse::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesResponse::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesResponse::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesResponse::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesResponse::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesResponse::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesResponse::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesResponse::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesResponse::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesResponse::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesResponse::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private AllTypesResponse(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesResponse)) {
return false;
}
AllTypesResponse other = (AllTypesResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesResponse")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesResponse, T> g) {
return obj -> g.apply((AllTypesResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesResponse> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<AllTypesUnionStructure.Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private BuilderImpl() {
}
private BuilderImpl(AllTypesResponse model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
this.shortMember = shortMember;
}
@Override
public final Builder shortMember(Short shortMember) {
this.shortMember = shortMember;
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = blobArg;
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type;
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
this.myDocument = myDocument;
}
@Override
public final Builder myDocument(Document myDocument) {
this.myDocument = myDocument;
return this;
}
public final AllTypesUnionStructure.Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(AllTypesUnionStructure.BuilderImpl allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure;
return this;
}
@Override
public AllTypesResponse build() {
return new AllTypesResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,178 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streaminginputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class StreamingInputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<StreamingInputOperationRequest.Builder, StreamingInputOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingInputOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingInputOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingInputOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingInputOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingInputOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamingInputOperationRequest build() {
return new StreamingInputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,179 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/basetype.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class BaseType implements SdkPojo, Serializable, ToCopyableBuilder<BaseType.Builder, BaseType> {
private static final SdkField<String> BASE_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("BaseMember").getter(getter(BaseType::baseMember)).setter(setter(Builder::baseMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaseMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BASE_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String baseMember;
private final String customShape1;
private final Integer customShape2;
private BaseType(BuilderImpl builder) {
this.baseMember = builder.baseMember;
this.customShape1 = builder.customShape1;
this.customShape2 = builder.customShape2;
}
/**
* Returns the value of the BaseMember property for this object.
*
* @return The value of the BaseMember property for this object.
*/
public final String baseMember() {
return baseMember;
}
/**
* Custom shape of type string
*
* @return Custom shape of type string
*/
public final String customShape1() {
return customShape1;
}
/**
* Custom shape of type integer
*
* @return Custom shape of type integer
*/
public final Integer customShape2() {
return customShape2;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(baseMember());
hashCode = 31 * hashCode + Objects.hashCode(customShape1());
hashCode = 31 * hashCode + Objects.hashCode(customShape2());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof BaseType)) {
return false;
}
BaseType other = (BaseType) obj;
return Objects.equals(baseMember(), other.baseMember()) && Objects.equals(customShape1(), other.customShape1())
&& Objects.equals(customShape2(), other.customShape2());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("BaseType").add("BaseMember", baseMember()).add("CustomShape1", customShape1())
.add("CustomShape2", customShape2()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "BaseMember":
return Optional.ofNullable(clazz.cast(baseMember()));
case "CustomShape1":
return Optional.ofNullable(clazz.cast(customShape1()));
case "CustomShape2":
return Optional.ofNullable(clazz.cast(customShape2()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<BaseType, T> g) {
return obj -> g.apply((BaseType) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, BaseType> {
/**
* Sets the value of the BaseMember property for this object.
*
* @param baseMember
* The new value for the BaseMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder baseMember(String baseMember);
/**
* Custom shape of type string
*
* @param customShape1
* Custom shape of type string
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customShape1(String customShape1);
/**
* Custom shape of type integer
*
* @param customShape2
* Custom shape of type integer
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder customShape2(Integer customShape2);
}
static final class BuilderImpl implements Builder {
private String baseMember;
private String customShape1;
private Integer customShape2;
private BuilderImpl() {
}
private BuilderImpl(BaseType model) {
baseMember(model.baseMember);
customShape1(model.customShape1);
customShape2(model.customShape2);
}
public final String getBaseMember() {
return baseMember;
}
public final void setBaseMember(String baseMember) {
this.baseMember = baseMember;
}
@Override
public final Builder baseMember(String baseMember) {
this.baseMember = baseMember;
return this;
}
public final String getCustomShape1() {
return customShape1;
}
public final void setCustomShape1(String customShape1) {
this.customShape1 = customShape1;
}
@Override
public final Builder customShape1(String customShape1) {
this.customShape1 = customShape1;
return this;
}
public final Integer getCustomShape2() {
return customShape2;
}
public final void setCustomShape2(Integer customShape2) {
this.customShape2 = customShape2;
}
@Override
public final Builder customShape2(Integer customShape2) {
this.customShape2 = customShape2;
return this;
}
@Override
public BaseType build() {
return new BaseType(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,180 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/streamingoutputoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class StreamingOutputOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<StreamingOutputOperationRequest.Builder, StreamingOutputOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private StreamingOutputOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof StreamingOutputOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("StreamingOutputOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, StreamingOutputOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(StreamingOutputOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public StreamingOutputOperationRequest build() {
return new StreamingOutputOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,181 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/mapofstringtosimplestructcopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toMap;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
@Generated("software.amazon.awssdk:codegen")
final class MapOfStringToSimpleStructCopier {
static Map<String, SimpleStruct> copy(Map<String, ? extends SimpleStruct> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
modifiableMap.put(key, value);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct> copyFromBuilder(Map<String, ? extends SimpleStruct.Builder> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
SimpleStruct member = value == null ? null : value.build();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
static Map<String, SimpleStruct.Builder> copyToBuilder(Map<String, ? extends SimpleStruct> mapOfStringToSimpleStructParam) {
Map<String, SimpleStruct.Builder> map;
if (mapOfStringToSimpleStructParam == null || mapOfStringToSimpleStructParam instanceof SdkAutoConstructMap) {
map = DefaultSdkAutoConstructMap.getInstance();
} else {
Map<String, SimpleStruct.Builder> modifiableMap = new LinkedHashMap<>();
mapOfStringToSimpleStructParam.forEach((key, value) -> {
SimpleStruct.Builder member = value == null ? null : value.toBuilder();
modifiableMap.put(key, member);
});
map = Collections.unmodifiableMap(modifiableMap);
}
return map;
}
}
| 3,182 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationwithonlyinputrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationWithOnlyInputRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<EventStreamOperationWithOnlyInputRequest.Builder, EventStreamOperationWithOnlyInputRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationWithOnlyInputRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationWithOnlyInputRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationWithOnlyInputRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationWithOnlyInputRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationWithOnlyInputRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public EventStreamOperationWithOnlyInputRequest build() {
return new EventStreamOperationWithOnlyInputRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,183 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listoflistoflistofstringscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfListOfListOfStringsCopier {
static List<List<List<String>>> copy(
Collection<? extends Collection<? extends Collection<String>>> listOfListOfListOfStringsParam) {
List<List<List<String>>> list;
if (listOfListOfListOfStringsParam == null || listOfListOfListOfStringsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<List<String>>> modifiableList = new ArrayList<>();
listOfListOfListOfStringsParam.forEach(entry -> {
List<List<String>> list1;
if (entry == null || entry instanceof SdkAutoConstructList) {
list1 = DefaultSdkAutoConstructList.getInstance();
} else {
List<List<String>> modifiableList1 = new ArrayList<>();
entry.forEach(entry1 -> {
List<String> list2;
if (entry1 == null || entry1 instanceof SdkAutoConstructList) {
list2 = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList2 = new ArrayList<>();
entry1.forEach(entry2 -> {
modifiableList2.add(entry2);
});
list2 = Collections.unmodifiableList(modifiableList2);
}
modifiableList1.add(list2);
});
list1 = Collections.unmodifiableList(modifiableList1);
}
modifiableList.add(list1);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,184 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/eventstreamoperationrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class EventStreamOperationRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<EventStreamOperationRequest.Builder, EventStreamOperationRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private EventStreamOperationRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EventStreamOperationRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("EventStreamOperationRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, EventStreamOperationRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(EventStreamOperationRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public EventStreamOperationRequest build() {
return new EventStreamOperationRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,185 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/jsonprotocoltestsresponsemetadata.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsResponseMetadata extends AwsResponseMetadata {
private JsonProtocolTestsResponseMetadata(AwsResponseMetadata responseMetadata) {
super(responseMetadata);
}
public static JsonProtocolTestsResponseMetadata create(AwsResponseMetadata responseMetadata) {
return new JsonProtocolTestsResponseMetadata(responseMetadata);
}
}
| 3,186 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesunionstructure.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.io.Serializable;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesUnionStructure implements SdkPojo, Serializable,
ToCopyableBuilder<AllTypesUnionStructure.Builder, AllTypesUnionStructure> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesUnionStructure::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesUnionStructure::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesUnionStructure::booleanMember))
.setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesUnionStructure::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesUnionStructure::doubleMember))
.setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesUnionStructure::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesUnionStructure::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesUnionStructure::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesUnionStructure::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesUnionStructure::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesUnionStructure::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesUnionStructure::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesUnionStructure::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesUnionStructure::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesUnionStructure::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesUnionStructure::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesUnionStructure::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesUnionStructure::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesUnionStructure::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesUnionStructure::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesUnionStructure::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesUnionStructure::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesUnionStructure::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesUnionStructure::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesUnionStructure::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesUnionStructure::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesUnionStructure::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesUnionStructure::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesUnionStructure::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesUnionStructure::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesUnionStructure::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesUnionStructure::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesUnionStructure::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesUnionStructure::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesUnionStructure::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private static final long serialVersionUID = 1L;
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private final Type type;
private AllTypesUnionStructure(BuilderImpl builder) {
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
this.type = builder.type;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesUnionStructure)) {
return false;
}
AllTypesUnionStructure other = (AllTypesUnionStructure) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesUnionStructure")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
/**
* Create an instance of this class with {@link #stringMember()} initialized to the given value.
*
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
*/
public static AllTypesUnionStructure fromStringMember(String stringMember) {
return builder().stringMember(stringMember).build();
}
/**
* Create an instance of this class with {@link #integerMember()} initialized to the given value.
*
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
*/
public static AllTypesUnionStructure fromIntegerMember(Integer integerMember) {
return builder().integerMember(integerMember).build();
}
/**
* Create an instance of this class with {@link #booleanMember()} initialized to the given value.
*
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
*/
public static AllTypesUnionStructure fromBooleanMember(Boolean booleanMember) {
return builder().booleanMember(booleanMember).build();
}
/**
* Create an instance of this class with {@link #floatMember()} initialized to the given value.
*
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
*/
public static AllTypesUnionStructure fromFloatMember(Float floatMember) {
return builder().floatMember(floatMember).build();
}
/**
* Create an instance of this class with {@link #doubleMember()} initialized to the given value.
*
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
*/
public static AllTypesUnionStructure fromDoubleMember(Double doubleMember) {
return builder().doubleMember(doubleMember).build();
}
/**
* Create an instance of this class with {@link #longMember()} initialized to the given value.
*
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
*/
public static AllTypesUnionStructure fromLongMember(Long longMember) {
return builder().longMember(longMember).build();
}
/**
* Create an instance of this class with {@link #shortMember()} initialized to the given value.
*
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
*/
public static AllTypesUnionStructure fromShortMember(Short shortMember) {
return builder().shortMember(shortMember).build();
}
/**
* Create an instance of this class with {@link #simpleList()} initialized to the given value.
*
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
*/
public static AllTypesUnionStructure fromSimpleList(List<String> simpleList) {
return builder().simpleList(simpleList).build();
}
/**
* Create an instance of this class with {@link #listOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromListOfEnumsWithStrings(List<String> listOfEnumsWithStrings) {
return builder().listOfEnumsWithStrings(listOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromListOfEnums(List<EnumType> listOfEnumsWithStrings) {
return builder().listOfEnums(listOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMaps()} initialized to the given value.
*
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
*/
public static AllTypesUnionStructure fromListOfMaps(List<Map<String, String>> listOfMaps) {
return builder().listOfMaps(listOfMaps).build();
}
/**
* Create an instance of this class with {@link #listOfStructs()} initialized to the given value.
*
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
*/
public static AllTypesUnionStructure fromListOfStructs(List<SimpleStruct> listOfStructs) {
return builder().listOfStructs(listOfStructs).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToStringWithStrings(
List<Map<String, String>> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToStringWithStrings(listOfMapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfEnumToString(
List<Map<EnumType, String>> listOfMapOfEnumToStringWithStrings) {
return builder().listOfMapOfEnumToString(listOfMapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #listOfMapOfStringToStruct()} initialized to the given value.
*
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
*/
public static AllTypesUnionStructure fromListOfMapOfStringToStruct(List<Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
return builder().listOfMapOfStringToStruct(listOfMapOfStringToStruct).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToIntegerList()} initialized to the given value.
*
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToIntegerList(Map<String, List<Integer>> mapOfStringToIntegerList) {
return builder().mapOfStringToIntegerList(mapOfStringToIntegerList).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToString()} initialized to the given value.
*
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToString(Map<String, String> mapOfStringToString) {
return builder().mapOfStringToString(mapOfStringToString).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToSimpleStruct()} initialized to the given value.
*
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
return builder().mapOfStringToSimpleStruct(mapOfStringToSimpleStruct).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnumWithStrings) {
return builder().mapOfEnumToEnumWithStrings(mapOfEnumToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnumWithStrings) {
return builder().mapOfEnumToEnum(mapOfEnumToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToStringWithStrings) {
return builder().mapOfEnumToStringWithStrings(mapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToStringAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToString(Map<EnumType, String> mapOfEnumToStringWithStrings) {
return builder().mapOfEnumToString(mapOfEnumToStringWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnumWithStrings) {
return builder().mapOfStringToEnumWithStrings(mapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfStringToEnumAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfStringToEnum(Map<String, EnumType> mapOfStringToEnumWithStrings) {
return builder().mapOfStringToEnum(mapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToSimpleStructAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStructWithStrings(
Map<String, SimpleStruct> mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStructWithStrings(mapOfEnumToSimpleStructWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToSimpleStructAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToSimpleStruct(
Map<EnumType, SimpleStruct> mapOfEnumToSimpleStructWithStrings) {
return builder().mapOfEnumToSimpleStruct(mapOfEnumToSimpleStructWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToListOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnumsWithStrings(
Map<String, List<String>> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnumsWithStrings(mapOfEnumToListOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToListOfEnumsAsStrings()} initialized to the given value.
*
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToListOfEnums(
Map<EnumType, List<EnumType>> mapOfEnumToListOfEnumsWithStrings) {
return builder().mapOfEnumToListOfEnums(mapOfEnumToListOfEnumsWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToMapOfStringToEnumAsStrings()} initialized to the given
* value.
*
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnumWithStrings(
Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnumWithStrings(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #mapOfEnumToMapOfStringToEnumAsStrings()} initialized to the given
* value.
*
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
*/
public static AllTypesUnionStructure fromMapOfEnumToMapOfStringToEnum(
Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnumWithStrings) {
return builder().mapOfEnumToMapOfStringToEnum(mapOfEnumToMapOfStringToEnumWithStrings).build();
}
/**
* Create an instance of this class with {@link #timestampMember()} initialized to the given value.
*
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
*/
public static AllTypesUnionStructure fromTimestampMember(Instant timestampMember) {
return builder().timestampMember(timestampMember).build();
}
/**
* Create an instance of this class with {@link #structWithNestedTimestampMember()} initialized to the given value.
*
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
return builder().structWithNestedTimestampMember(structWithNestedTimestampMember).build();
}
/**
* Create an instance of this class with {@link #structWithNestedTimestampMember()} initialized to the given value.
*
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedTimestampMember(
Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
StructWithTimestamp.Builder builder = StructWithTimestamp.builder();
structWithNestedTimestampMember.accept(builder);
return fromStructWithNestedTimestampMember(builder.build());
}
/**
* Create an instance of this class with {@link #blobArg()} initialized to the given value.
*
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
*/
public static AllTypesUnionStructure fromBlobArg(SdkBytes blobArg) {
return builder().blobArg(blobArg).build();
}
/**
* Create an instance of this class with {@link #structWithNestedBlob()} initialized to the given value.
*
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
return builder().structWithNestedBlob(structWithNestedBlob).build();
}
/**
* Create an instance of this class with {@link #structWithNestedBlob()} initialized to the given value.
*
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
*/
public static AllTypesUnionStructure fromStructWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
StructWithNestedBlobType.Builder builder = StructWithNestedBlobType.builder();
structWithNestedBlob.accept(builder);
return fromStructWithNestedBlob(builder.build());
}
/**
* Create an instance of this class with {@link #blobMap()} initialized to the given value.
*
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
*/
public static AllTypesUnionStructure fromBlobMap(Map<String, SdkBytes> blobMap) {
return builder().blobMap(blobMap).build();
}
/**
* Create an instance of this class with {@link #listOfBlobs()} initialized to the given value.
*
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
*/
public static AllTypesUnionStructure fromListOfBlobs(List<SdkBytes> listOfBlobs) {
return builder().listOfBlobs(listOfBlobs).build();
}
/**
* Create an instance of this class with {@link #recursiveStruct()} initialized to the given value.
*
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
*/
public static AllTypesUnionStructure fromRecursiveStruct(RecursiveStructType recursiveStruct) {
return builder().recursiveStruct(recursiveStruct).build();
}
/**
* Create an instance of this class with {@link #recursiveStruct()} initialized to the given value.
*
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
*/
public static AllTypesUnionStructure fromRecursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
RecursiveStructType.Builder builder = RecursiveStructType.builder();
recursiveStruct.accept(builder);
return fromRecursiveStruct(builder.build());
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
return builder().polymorphicTypeWithSubTypes(polymorphicTypeWithSubTypes).build();
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
BaseType.Builder builder = BaseType.builder();
polymorphicTypeWithSubTypes.accept(builder);
return fromPolymorphicTypeWithSubTypes(builder.build());
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithoutSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
return builder().polymorphicTypeWithoutSubTypes(polymorphicTypeWithoutSubTypes).build();
}
/**
* Create an instance of this class with {@link #polymorphicTypeWithoutSubTypes()} initialized to the given value.
*
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
*/
public static AllTypesUnionStructure fromPolymorphicTypeWithoutSubTypes(
Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
SubTypeOne.Builder builder = SubTypeOne.builder();
polymorphicTypeWithoutSubTypes.accept(builder);
return fromPolymorphicTypeWithoutSubTypes(builder.build());
}
/**
* Create an instance of this class with {@link #enumTypeAsString()} initialized to the given value.
*
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
*/
public static AllTypesUnionStructure fromEnumType(String enumType) {
return builder().enumType(enumType).build();
}
/**
* Create an instance of this class with {@link #enumTypeAsString()} initialized to the given value.
*
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
*/
public static AllTypesUnionStructure fromEnumType(EnumType enumType) {
return builder().enumType(enumType).build();
}
/**
* Create an instance of this class with {@link #underscore_Name_Type()} initialized to the given value.
*
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
*/
public static AllTypesUnionStructure fromUnderscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
return builder().underscore_Name_Type(underscore_Name_Type).build();
}
/**
* Create an instance of this class with {@link #underscore_Name_Type()} initialized to the given value.
*
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
*/
public static AllTypesUnionStructure fromUnderscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
Underscore_Name_Type.Builder builder = Underscore_Name_Type.builder();
underscore_Name_Type.accept(builder);
return fromUnderscore_Name_Type(builder.build());
}
/**
* Create an instance of this class with {@link #myDocument()} initialized to the given value.
*
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
*/
public static AllTypesUnionStructure fromMyDocument(Document myDocument) {
return builder().myDocument(myDocument).build();
}
/**
* Create an instance of this class with {@link #allTypesUnionStructure()} initialized to the given value.
*
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
*/
public static AllTypesUnionStructure fromAllTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
return builder().allTypesUnionStructure(allTypesUnionStructure).build();
}
/**
* Create an instance of this class with {@link #allTypesUnionStructure()} initialized to the given value.
*
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
*/
public static AllTypesUnionStructure fromAllTypesUnionStructure(Consumer<Builder> allTypesUnionStructure) {
Builder builder = AllTypesUnionStructure.builder();
allTypesUnionStructure.accept(builder);
return fromAllTypesUnionStructure(builder.build());
}
/**
* Retrieve an enum value representing which member of this object is populated.
*
* When this class is returned in a service response, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if the
* service returned a member that is only known to a newer SDK version.
*
* When this class is created directly in your code, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if zero
* members are set, and {@code null} if more than one member is set.
*/
public Type type() {
return type;
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesUnionStructure, T> g) {
return obj -> g.apply((AllTypesUnionStructure) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, AllTypesUnionStructure> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
}
static final class BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private Type type = Type.UNKNOWN_TO_SDK_VERSION;
private Set<Type> setTypes = EnumSet.noneOf(Type.class);
private BuilderImpl() {
}
private BuilderImpl(AllTypesUnionStructure model) {
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
Object oldValue = this.stringMember;
this.stringMember = stringMember;
handleUnionValueChange(Type.STRING_MEMBER, oldValue, this.stringMember);
}
@Override
public final Builder stringMember(String stringMember) {
Object oldValue = this.stringMember;
this.stringMember = stringMember;
handleUnionValueChange(Type.STRING_MEMBER, oldValue, this.stringMember);
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
Object oldValue = this.integerMember;
this.integerMember = integerMember;
handleUnionValueChange(Type.INTEGER_MEMBER, oldValue, this.integerMember);
}
@Override
public final Builder integerMember(Integer integerMember) {
Object oldValue = this.integerMember;
this.integerMember = integerMember;
handleUnionValueChange(Type.INTEGER_MEMBER, oldValue, this.integerMember);
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
Object oldValue = this.booleanMember;
this.booleanMember = booleanMember;
handleUnionValueChange(Type.BOOLEAN_MEMBER, oldValue, this.booleanMember);
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
Object oldValue = this.booleanMember;
this.booleanMember = booleanMember;
handleUnionValueChange(Type.BOOLEAN_MEMBER, oldValue, this.booleanMember);
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
Object oldValue = this.floatMember;
this.floatMember = floatMember;
handleUnionValueChange(Type.FLOAT_MEMBER, oldValue, this.floatMember);
}
@Override
public final Builder floatMember(Float floatMember) {
Object oldValue = this.floatMember;
this.floatMember = floatMember;
handleUnionValueChange(Type.FLOAT_MEMBER, oldValue, this.floatMember);
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
Object oldValue = this.doubleMember;
this.doubleMember = doubleMember;
handleUnionValueChange(Type.DOUBLE_MEMBER, oldValue, this.doubleMember);
}
@Override
public final Builder doubleMember(Double doubleMember) {
Object oldValue = this.doubleMember;
this.doubleMember = doubleMember;
handleUnionValueChange(Type.DOUBLE_MEMBER, oldValue, this.doubleMember);
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
Object oldValue = this.longMember;
this.longMember = longMember;
handleUnionValueChange(Type.LONG_MEMBER, oldValue, this.longMember);
}
@Override
public final Builder longMember(Long longMember) {
Object oldValue = this.longMember;
this.longMember = longMember;
handleUnionValueChange(Type.LONG_MEMBER, oldValue, this.longMember);
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
Object oldValue = this.shortMember;
this.shortMember = shortMember;
handleUnionValueChange(Type.SHORT_MEMBER, oldValue, this.shortMember);
}
@Override
public final Builder shortMember(Short shortMember) {
Object oldValue = this.shortMember;
this.shortMember = shortMember;
handleUnionValueChange(Type.SHORT_MEMBER, oldValue, this.shortMember);
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
Object oldValue = this.simpleList;
this.simpleList = ListOfStringsCopier.copy(simpleList);
handleUnionValueChange(Type.SIMPLE_LIST, oldValue, this.simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
Object oldValue = this.simpleList;
this.simpleList = ListOfStringsCopier.copy(simpleList);
handleUnionValueChange(Type.SIMPLE_LIST, oldValue, this.simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
Object oldValue = this.listOfEnums;
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
handleUnionValueChange(Type.LIST_OF_ENUMS, oldValue, this.listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
Object oldValue = this.listOfMaps;
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
handleUnionValueChange(Type.LIST_OF_MAPS, oldValue, this.listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
Object oldValue = this.listOfMaps;
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
handleUnionValueChange(Type.LIST_OF_MAPS, oldValue, this.listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
Object oldValue = this.listOfStructs;
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
handleUnionValueChange(Type.LIST_OF_STRUCTS, oldValue, this.listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
Object oldValue = this.listOfStructs;
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
handleUnionValueChange(Type.LIST_OF_STRUCTS, oldValue, this.listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
Object oldValue = this.listOfMapOfEnumToString;
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
handleUnionValueChange(Type.LIST_OF_MAP_OF_ENUM_TO_STRING, oldValue, this.listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
Object oldValue = this.listOfMapOfEnumToString;
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
handleUnionValueChange(Type.LIST_OF_MAP_OF_ENUM_TO_STRING, oldValue, this.listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
Object oldValue = this.listOfMapOfStringToStruct;
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
handleUnionValueChange(Type.LIST_OF_MAP_OF_STRING_TO_STRUCT, oldValue, this.listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
Object oldValue = this.listOfMapOfStringToStruct;
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
handleUnionValueChange(Type.LIST_OF_MAP_OF_STRING_TO_STRUCT, oldValue, this.listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
Object oldValue = this.mapOfStringToIntegerList;
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
handleUnionValueChange(Type.MAP_OF_STRING_TO_INTEGER_LIST, oldValue, this.mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
Object oldValue = this.mapOfStringToIntegerList;
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
handleUnionValueChange(Type.MAP_OF_STRING_TO_INTEGER_LIST, oldValue, this.mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
Object oldValue = this.mapOfStringToString;
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
handleUnionValueChange(Type.MAP_OF_STRING_TO_STRING, oldValue, this.mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
Object oldValue = this.mapOfStringToString;
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
handleUnionValueChange(Type.MAP_OF_STRING_TO_STRING, oldValue, this.mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
Object oldValue = this.mapOfStringToSimpleStruct;
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_STRING_TO_SIMPLE_STRUCT, oldValue, this.mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
Object oldValue = this.mapOfStringToSimpleStruct;
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_STRING_TO_SIMPLE_STRUCT, oldValue, this.mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
Object oldValue = this.mapOfEnumToEnum;
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_ENUM, oldValue, this.mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
Object oldValue = this.mapOfEnumToString;
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_STRING, oldValue, this.mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
Object oldValue = this.mapOfStringToEnum;
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
Object oldValue = this.mapOfEnumToSimpleStruct;
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_SIMPLE_STRUCT, oldValue, this.mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
Object oldValue = this.mapOfEnumToListOfEnums;
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_LIST_OF_ENUMS, oldValue, this.mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
Object oldValue = this.mapOfEnumToMapOfStringToEnum;
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
handleUnionValueChange(Type.MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM, oldValue, this.mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
Object oldValue = this.timestampMember;
this.timestampMember = timestampMember;
handleUnionValueChange(Type.TIMESTAMP_MEMBER, oldValue, this.timestampMember);
}
@Override
public final Builder timestampMember(Instant timestampMember) {
Object oldValue = this.timestampMember;
this.timestampMember = timestampMember;
handleUnionValueChange(Type.TIMESTAMP_MEMBER, oldValue, this.timestampMember);
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
Object oldValue = this.structWithNestedTimestampMember;
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_TIMESTAMP_MEMBER, oldValue, this.structWithNestedTimestampMember);
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
Object oldValue = this.structWithNestedTimestampMember;
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_TIMESTAMP_MEMBER, oldValue, this.structWithNestedTimestampMember);
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
Object oldValue = this.blobArg;
this.blobArg = blobArg;
handleUnionValueChange(Type.BLOB_ARG, oldValue, this.blobArg);
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
Object oldValue = this.structWithNestedBlob;
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_BLOB, oldValue, this.structWithNestedBlob);
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
Object oldValue = this.structWithNestedBlob;
this.structWithNestedBlob = structWithNestedBlob;
handleUnionValueChange(Type.STRUCT_WITH_NESTED_BLOB, oldValue, this.structWithNestedBlob);
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
Object oldValue = this.blobMap;
this.blobMap = BlobMapTypeCopier.copy(blobMap);
handleUnionValueChange(Type.BLOB_MAP, oldValue, this.blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
Object oldValue = this.listOfBlobs;
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
handleUnionValueChange(Type.LIST_OF_BLOBS, oldValue, this.listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
Object oldValue = this.recursiveStruct;
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
handleUnionValueChange(Type.RECURSIVE_STRUCT, oldValue, this.recursiveStruct);
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
Object oldValue = this.recursiveStruct;
this.recursiveStruct = recursiveStruct;
handleUnionValueChange(Type.RECURSIVE_STRUCT, oldValue, this.recursiveStruct);
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
Object oldValue = this.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITH_SUB_TYPES, oldValue, this.polymorphicTypeWithSubTypes);
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
Object oldValue = this.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITH_SUB_TYPES, oldValue, this.polymorphicTypeWithSubTypes);
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
Object oldValue = this.polymorphicTypeWithoutSubTypes;
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES, oldValue, this.polymorphicTypeWithoutSubTypes);
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
Object oldValue = this.polymorphicTypeWithoutSubTypes;
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
handleUnionValueChange(Type.POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES, oldValue, this.polymorphicTypeWithoutSubTypes);
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
Object oldValue = this.enumType;
this.enumType = enumType;
handleUnionValueChange(Type.ENUM_TYPE, oldValue, this.enumType);
}
@Override
public final Builder enumType(String enumType) {
Object oldValue = this.enumType;
this.enumType = enumType;
handleUnionValueChange(Type.ENUM_TYPE, oldValue, this.enumType);
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
Object oldValue = this.underscore_Name_Type;
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
handleUnionValueChange(Type.UNDERSCORE_NAME_TYPE, oldValue, this.underscore_Name_Type);
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
Object oldValue = this.underscore_Name_Type;
this.underscore_Name_Type = underscore_Name_Type;
handleUnionValueChange(Type.UNDERSCORE_NAME_TYPE, oldValue, this.underscore_Name_Type);
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
Object oldValue = this.myDocument;
this.myDocument = myDocument;
handleUnionValueChange(Type.MY_DOCUMENT, oldValue, this.myDocument);
}
@Override
public final Builder myDocument(Document myDocument) {
Object oldValue = this.myDocument;
this.myDocument = myDocument;
handleUnionValueChange(Type.MY_DOCUMENT, oldValue, this.myDocument);
return this;
}
public final Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(BuilderImpl allTypesUnionStructure) {
Object oldValue = this.allTypesUnionStructure;
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
handleUnionValueChange(Type.ALL_TYPES_UNION_STRUCTURE, oldValue, this.allTypesUnionStructure);
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
Object oldValue = this.allTypesUnionStructure;
this.allTypesUnionStructure = allTypesUnionStructure;
handleUnionValueChange(Type.ALL_TYPES_UNION_STRUCTURE, oldValue, this.allTypesUnionStructure);
return this;
}
@Override
public AllTypesUnionStructure build() {
return new AllTypesUnionStructure(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private final void handleUnionValueChange(Type type, Object oldValue, Object newValue) {
if (this.type == type || oldValue == newValue) {
return;
}
if (newValue == null || newValue instanceof SdkAutoConstructList || newValue instanceof SdkAutoConstructMap) {
setTypes.remove(type);
} else if (oldValue == null || oldValue instanceof SdkAutoConstructList || oldValue instanceof SdkAutoConstructMap) {
setTypes.add(type);
}
if (setTypes.size() == 1) {
this.type = setTypes.iterator().next();
} else if (setTypes.isEmpty()) {
this.type = Type.UNKNOWN_TO_SDK_VERSION;
} else {
this.type = null;
}
}
}
/**
* @see AllTypesUnionStructure#type()
*/
public enum Type {
STRING_MEMBER,
INTEGER_MEMBER,
BOOLEAN_MEMBER,
FLOAT_MEMBER,
DOUBLE_MEMBER,
LONG_MEMBER,
SHORT_MEMBER,
SIMPLE_LIST,
LIST_OF_ENUMS,
LIST_OF_MAPS,
LIST_OF_STRUCTS,
LIST_OF_MAP_OF_ENUM_TO_STRING,
LIST_OF_MAP_OF_STRING_TO_STRUCT,
MAP_OF_STRING_TO_INTEGER_LIST,
MAP_OF_STRING_TO_STRING,
MAP_OF_STRING_TO_SIMPLE_STRUCT,
MAP_OF_ENUM_TO_ENUM,
MAP_OF_ENUM_TO_STRING,
MAP_OF_STRING_TO_ENUM,
MAP_OF_ENUM_TO_SIMPLE_STRUCT,
MAP_OF_ENUM_TO_LIST_OF_ENUMS,
MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM,
TIMESTAMP_MEMBER,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER,
BLOB_ARG,
STRUCT_WITH_NESTED_BLOB,
BLOB_MAP,
LIST_OF_BLOBS,
RECURSIVE_STRUCT,
POLYMORPHIC_TYPE_WITH_SUB_TYPES,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES,
ENUM_TYPE,
UNDERSCORE_NAME_TYPE,
MY_DOCUMENT,
ALL_TYPES_UNION_STRUCTURE,
UNKNOWN_TO_SDK_VERSION
}
}
| 3,187 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/existencechecknamingrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class ExistenceCheckNamingRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<ExistenceCheckNamingRequest.Builder, ExistenceCheckNamingRequest> {
private static final SdkField<List<String>> BUILD_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("Build")
.getter(getter(ExistenceCheckNamingRequest::build))
.setter(setter(Builder::build))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Build").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> SUPER_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("super")
.getter(getter(ExistenceCheckNamingRequest::superValue))
.setter(setter(Builder::superValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("super").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<Map<String, String>> TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("toString")
.getter(getter(ExistenceCheckNamingRequest::toStringValue))
.setter(setter(Builder::toStringValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("toString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> EQUALS_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("equals")
.getter(getter(ExistenceCheckNamingRequest::equalsValue))
.setter(setter(Builder::equalsValue))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("equals").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(BUILD_FIELD, SUPER_FIELD,
TO_STRING_FIELD, EQUALS_FIELD));
private final List<String> build;
private final List<String> superValue;
private final Map<String, String> toStringValue;
private final Map<String, String> equalsValue;
private ExistenceCheckNamingRequest(BuilderImpl builder) {
super(builder);
this.build = builder.build;
this.superValue = builder.superValue;
this.toStringValue = builder.toStringValue;
this.equalsValue = builder.equalsValue;
}
/**
* For responses, this returns true if the service returned a value for the Build property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasBuild() {
return build != null && !(build instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Build property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBuild} method.
* </p>
*
* @return The value of the Build property for this object.
*/
public final List<String> build() {
return build;
}
/**
* For responses, this returns true if the service returned a value for the Super property. This DOES NOT check that
* the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is useful
* because the SDK will never return a null collection or map, but you may need to differentiate between the service
* returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true
* if a value for the property was specified in the request builder, and false if a value was not specified.
*/
public final boolean hasSuperValue() {
return superValue != null && !(superValue instanceof SdkAutoConstructList);
}
/**
* Returns the value of the Super property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSuperValue} method.
* </p>
*
* @return The value of the Super property for this object.
*/
public final List<String> superValue() {
return superValue;
}
/**
* For responses, this returns true if the service returned a value for the ToString property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasToStringValue() {
return toStringValue != null && !(toStringValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the ToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasToStringValue} method.
* </p>
*
* @return The value of the ToString property for this object.
*/
public final Map<String, String> toStringValue() {
return toStringValue;
}
/**
* For responses, this returns true if the service returned a value for the Equals property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasEqualsValue() {
return equalsValue != null && !(equalsValue instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the Equals property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasEqualsValue} method.
* </p>
*
* @return The value of the Equals property for this object.
*/
public final Map<String, String> equalsValue() {
return equalsValue;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hasBuild() ? build() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasSuperValue() ? superValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasToStringValue() ? toStringValue() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasEqualsValue() ? equalsValue() : null);
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof ExistenceCheckNamingRequest)) {
return false;
}
ExistenceCheckNamingRequest other = (ExistenceCheckNamingRequest) obj;
return hasBuild() == other.hasBuild() && Objects.equals(build(), other.build())
&& hasSuperValue() == other.hasSuperValue() && Objects.equals(superValue(), other.superValue())
&& hasToStringValue() == other.hasToStringValue() && Objects.equals(toStringValue(), other.toStringValue())
&& hasEqualsValue() == other.hasEqualsValue() && Objects.equals(equalsValue(), other.equalsValue());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("ExistenceCheckNamingRequest").add("Build", hasBuild() ? build() : null)
.add("Super", hasSuperValue() ? superValue() : null).add("ToString", hasToStringValue() ? toStringValue() : null)
.add("Equals", hasEqualsValue() ? equalsValue() : null).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Build":
return Optional.ofNullable(clazz.cast(build()));
case "super":
return Optional.ofNullable(clazz.cast(superValue()));
case "toString":
return Optional.ofNullable(clazz.cast(toStringValue()));
case "equals":
return Optional.ofNullable(clazz.cast(equalsValue()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<ExistenceCheckNamingRequest, T> g) {
return obj -> g.apply((ExistenceCheckNamingRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo,
CopyableBuilder<Builder, ExistenceCheckNamingRequest> {
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(Collection<String> build);
/**
* Sets the value of the Build property for this object.
*
* @param build
* The new value for the Build property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder build(String... build);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(Collection<String> superValue);
/**
* Sets the value of the Super property for this object.
*
* @param superValue
* The new value for the Super property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder superValue(String... superValue);
/**
* Sets the value of the ToString property for this object.
*
* @param toStringValue
* The new value for the ToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder toStringValue(Map<String, String> toStringValue);
/**
* Sets the value of the Equals property for this object.
*
* @param equalsValue
* The new value for the Equals property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder equalsValue(Map<String, String> equalsValue);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private List<String> build = DefaultSdkAutoConstructList.getInstance();
private List<String> superValue = DefaultSdkAutoConstructList.getInstance();
private Map<String, String> toStringValue = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> equalsValue = DefaultSdkAutoConstructMap.getInstance();
private BuilderImpl() {
}
private BuilderImpl(ExistenceCheckNamingRequest model) {
super(model);
build(model.build);
superValue(model.superValue);
toStringValue(model.toStringValue);
equalsValue(model.equalsValue);
}
public final Collection<String> getBuild() {
if (build instanceof SdkAutoConstructList) {
return null;
}
return build;
}
public final void setBuild(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
}
@Override
public final Builder build(Collection<String> build) {
this.build = ListOfStringsCopier.copy(build);
return this;
}
@Override
@SafeVarargs
public final Builder build(String... build) {
build(Arrays.asList(build));
return this;
}
public final Collection<String> getSuperValue() {
if (superValue instanceof SdkAutoConstructList) {
return null;
}
return superValue;
}
public final void setSuperValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
}
@Override
public final Builder superValue(Collection<String> superValue) {
this.superValue = ListOfStringsCopier.copy(superValue);
return this;
}
@Override
@SafeVarargs
public final Builder superValue(String... superValue) {
superValue(Arrays.asList(superValue));
return this;
}
public final Map<String, String> getToStringValue() {
if (toStringValue instanceof SdkAutoConstructMap) {
return null;
}
return toStringValue;
}
public final void setToStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
}
@Override
public final Builder toStringValue(Map<String, String> toStringValue) {
this.toStringValue = MapOfStringToStringCopier.copy(toStringValue);
return this;
}
public final Map<String, String> getEqualsValue() {
if (equalsValue instanceof SdkAutoConstructMap) {
return null;
}
return equalsValue;
}
public final void setEqualsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
}
@Override
public final Builder equalsValue(Map<String, String> equalsValue) {
this.equalsValue = MapOfStringToStringCopier.copy(equalsValue);
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public ExistenceCheckNamingRequest build() {
return new ExistenceCheckNamingRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,188 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/alltypesrequest.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.nio.ByteBuffer;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.document.Document;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class AllTypesRequest extends JsonProtocolTestsRequest implements
ToCopyableBuilder<AllTypesRequest.Builder, AllTypesRequest> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("StringMember").getter(getter(AllTypesRequest::stringMember)).setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField.<Integer> builder(MarshallingType.INTEGER)
.memberName("IntegerMember").getter(getter(AllTypesRequest::integerMember)).setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IntegerMember").build()).build();
private static final SdkField<Boolean> BOOLEAN_MEMBER_FIELD = SdkField.<Boolean> builder(MarshallingType.BOOLEAN)
.memberName("BooleanMember").getter(getter(AllTypesRequest::booleanMember)).setter(setter(Builder::booleanMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BooleanMember").build()).build();
private static final SdkField<Float> FLOAT_MEMBER_FIELD = SdkField.<Float> builder(MarshallingType.FLOAT)
.memberName("FloatMember").getter(getter(AllTypesRequest::floatMember)).setter(setter(Builder::floatMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FloatMember").build()).build();
private static final SdkField<Double> DOUBLE_MEMBER_FIELD = SdkField.<Double> builder(MarshallingType.DOUBLE)
.memberName("DoubleMember").getter(getter(AllTypesRequest::doubleMember)).setter(setter(Builder::doubleMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DoubleMember").build()).build();
private static final SdkField<Long> LONG_MEMBER_FIELD = SdkField.<Long> builder(MarshallingType.LONG)
.memberName("LongMember").getter(getter(AllTypesRequest::longMember)).setter(setter(Builder::longMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LongMember").build()).build();
private static final SdkField<Short> SHORT_MEMBER_FIELD = SdkField.<Short> builder(MarshallingType.SHORT)
.memberName("ShortMember").getter(getter(AllTypesRequest::shortMember)).setter(setter(Builder::shortMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ShortMember").build()).build();
private static final SdkField<List<String>> SIMPLE_LIST_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("SimpleList")
.getter(getter(AllTypesRequest::simpleList))
.setter(setter(Builder::simpleList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SimpleList").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<String>> LIST_OF_ENUMS_FIELD = SdkField
.<List<String>> builder(MarshallingType.LIST)
.memberName("ListOfEnums")
.getter(getter(AllTypesRequest::listOfEnumsAsStrings))
.setter(setter(Builder::listOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfEnums").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAPS_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMaps")
.getter(getter(AllTypesRequest::listOfMaps))
.setter(setter(Builder::listOfMaps))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMaps").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<SimpleStruct>> LIST_OF_STRUCTS_FIELD = SdkField
.<List<SimpleStruct>> builder(MarshallingType.LIST)
.memberName("ListOfStructs")
.getter(getter(AllTypesRequest::listOfStructs))
.setter(setter(Builder::listOfStructs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfStructs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<List<Map<String, String>>> LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<List<Map<String, String>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfEnumToString")
.getter(getter(AllTypesRequest::listOfMapOfEnumToStringAsStrings))
.setter(setter(Builder::listOfMapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfEnumToString").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<List<Map<String, SimpleStruct>>> LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD = SdkField
.<List<Map<String, SimpleStruct>>> builder(MarshallingType.LIST)
.memberName("ListOfMapOfStringToStruct")
.getter(getter(AllTypesRequest::listOfMapOfStringToStruct))
.setter(setter(Builder::listOfMapOfStringToStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfMapOfStringToStruct").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, List<Integer>>> MAP_OF_STRING_TO_INTEGER_LIST_FIELD = SdkField
.<Map<String, List<Integer>>> builder(MarshallingType.MAP)
.memberName("MapOfStringToIntegerList")
.getter(getter(AllTypesRequest::mapOfStringToIntegerList))
.setter(setter(Builder::mapOfStringToIntegerList))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToIntegerList").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<Integer>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<Integer> builder(MarshallingType.INTEGER)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToString")
.getter(getter(AllTypesRequest::mapOfStringToString))
.setter(setter(Builder::mapOfStringToString))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfStringToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfStringToSimpleStruct))
.setter(setter(Builder::mapOfStringToSimpleStruct))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_ENUM_TO_STRING_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToString")
.getter(getter(AllTypesRequest::mapOfEnumToStringAsStrings))
.setter(setter(Builder::mapOfEnumToStringWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToString").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, String>> MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, String>> builder(MarshallingType.MAP)
.memberName("MapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfStringToEnum").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, SimpleStruct>> MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD = SdkField
.<Map<String, SimpleStruct>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToSimpleStruct")
.getter(getter(AllTypesRequest::mapOfEnumToSimpleStructAsStrings))
.setter(setter(Builder::mapOfEnumToSimpleStructWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToSimpleStruct").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SimpleStruct> builder(MarshallingType.SDK_POJO)
.constructor(SimpleStruct::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<Map<String, List<String>>> MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD = SdkField
.<Map<String, List<String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToListOfEnums")
.getter(getter(AllTypesRequest::mapOfEnumToListOfEnumsAsStrings))
.setter(setter(Builder::mapOfEnumToListOfEnumsWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToListOfEnums").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<List<String>> builder(MarshallingType.LIST)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build())
.build()).build()).build()).build();
private static final SdkField<Map<String, Map<String, String>>> MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD = SdkField
.<Map<String, Map<String, String>>> builder(MarshallingType.MAP)
.memberName("MapOfEnumToMapOfStringToEnum")
.getter(getter(AllTypesRequest::mapOfEnumToMapOfStringToEnumAsStrings))
.setter(setter(Builder::mapOfEnumToMapOfStringToEnumWithStrings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MapOfEnumToMapOfStringToEnum")
.build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<Map<String, String>> builder(MarshallingType.MAP)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<String> builder(MarshallingType.STRING)
.traits(LocationTrait.builder()
.location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build())
.build()).build()).build()).build();
private static final SdkField<Instant> TIMESTAMP_MEMBER_FIELD = SdkField.<Instant> builder(MarshallingType.INSTANT)
.memberName("TimestampMember").getter(getter(AllTypesRequest::timestampMember))
.setter(setter(Builder::timestampMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimestampMember").build()).build();
private static final SdkField<StructWithTimestamp> STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD = SdkField
.<StructWithTimestamp> builder(MarshallingType.SDK_POJO)
.memberName("StructWithNestedTimestampMember")
.getter(getter(AllTypesRequest::structWithNestedTimestampMember))
.setter(setter(Builder::structWithNestedTimestampMember))
.constructor(StructWithTimestamp::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedTimestampMember")
.build()).build();
private static final SdkField<SdkBytes> BLOB_ARG_FIELD = SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.memberName("BlobArg").getter(getter(AllTypesRequest::blobArg)).setter(setter(Builder::blobArg))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobArg").build()).build();
private static final SdkField<StructWithNestedBlobType> STRUCT_WITH_NESTED_BLOB_FIELD = SdkField
.<StructWithNestedBlobType> builder(MarshallingType.SDK_POJO).memberName("StructWithNestedBlob")
.getter(getter(AllTypesRequest::structWithNestedBlob)).setter(setter(Builder::structWithNestedBlob))
.constructor(StructWithNestedBlobType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StructWithNestedBlob").build())
.build();
private static final SdkField<Map<String, SdkBytes>> BLOB_MAP_FIELD = SdkField
.<Map<String, SdkBytes>> builder(MarshallingType.MAP)
.memberName("BlobMap")
.getter(getter(AllTypesRequest::blobMap))
.setter(setter(Builder::blobMap))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BlobMap").build(),
MapTrait.builder()
.keyLocationName("key")
.valueLocationName("value")
.valueFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("value").build()).build()).build()).build();
private static final SdkField<List<SdkBytes>> LIST_OF_BLOBS_FIELD = SdkField
.<List<SdkBytes>> builder(MarshallingType.LIST)
.memberName("ListOfBlobs")
.getter(getter(AllTypesRequest::listOfBlobs))
.setter(setter(Builder::listOfBlobs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ListOfBlobs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField.<SdkBytes> builder(MarshallingType.SDK_BYTES)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField<RecursiveStructType> RECURSIVE_STRUCT_FIELD = SdkField
.<RecursiveStructType> builder(MarshallingType.SDK_POJO).memberName("RecursiveStruct")
.getter(getter(AllTypesRequest::recursiveStruct)).setter(setter(Builder::recursiveStruct))
.constructor(RecursiveStructType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RecursiveStruct").build()).build();
private static final SdkField<BaseType> POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD = SdkField
.<BaseType> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithSubTypes))
.setter(setter(Builder::polymorphicTypeWithSubTypes))
.constructor(BaseType::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithSubTypes")
.build()).build();
private static final SdkField<SubTypeOne> POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD = SdkField
.<SubTypeOne> builder(MarshallingType.SDK_POJO)
.memberName("PolymorphicTypeWithoutSubTypes")
.getter(getter(AllTypesRequest::polymorphicTypeWithoutSubTypes))
.setter(setter(Builder::polymorphicTypeWithoutSubTypes))
.constructor(SubTypeOne::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PolymorphicTypeWithoutSubTypes")
.build()).build();
private static final SdkField<String> ENUM_TYPE_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("EnumType").getter(getter(AllTypesRequest::enumTypeAsString)).setter(setter(Builder::enumType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnumType").build()).build();
private static final SdkField<Underscore_Name_Type> UNDERSCORE_NAME_TYPE_FIELD = SdkField
.<Underscore_Name_Type> builder(MarshallingType.SDK_POJO).memberName("Underscore_Name_Type")
.getter(getter(AllTypesRequest::underscore_Name_Type)).setter(setter(Builder::underscore_Name_Type))
.constructor(Underscore_Name_Type::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Underscore_Name_Type").build())
.build();
private static final SdkField<Document> MY_DOCUMENT_FIELD = SdkField.<Document> builder(MarshallingType.DOCUMENT)
.memberName("MyDocument").getter(getter(AllTypesRequest::myDocument)).setter(setter(Builder::myDocument))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MyDocument").build()).build();
private static final SdkField<AllTypesUnionStructure> ALL_TYPES_UNION_STRUCTURE_FIELD = SdkField
.<AllTypesUnionStructure> builder(MarshallingType.SDK_POJO).memberName("AllTypesUnionStructure")
.getter(getter(AllTypesRequest::allTypesUnionStructure)).setter(setter(Builder::allTypesUnionStructure))
.constructor(AllTypesUnionStructure::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AllTypesUnionStructure").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, BOOLEAN_MEMBER_FIELD, FLOAT_MEMBER_FIELD, DOUBLE_MEMBER_FIELD, LONG_MEMBER_FIELD,
SHORT_MEMBER_FIELD, SIMPLE_LIST_FIELD, LIST_OF_ENUMS_FIELD, LIST_OF_MAPS_FIELD, LIST_OF_STRUCTS_FIELD,
LIST_OF_MAP_OF_ENUM_TO_STRING_FIELD, LIST_OF_MAP_OF_STRING_TO_STRUCT_FIELD, MAP_OF_STRING_TO_INTEGER_LIST_FIELD,
MAP_OF_STRING_TO_STRING_FIELD, MAP_OF_STRING_TO_SIMPLE_STRUCT_FIELD, MAP_OF_ENUM_TO_ENUM_FIELD,
MAP_OF_ENUM_TO_STRING_FIELD, MAP_OF_STRING_TO_ENUM_FIELD, MAP_OF_ENUM_TO_SIMPLE_STRUCT_FIELD,
MAP_OF_ENUM_TO_LIST_OF_ENUMS_FIELD, MAP_OF_ENUM_TO_MAP_OF_STRING_TO_ENUM_FIELD, TIMESTAMP_MEMBER_FIELD,
STRUCT_WITH_NESTED_TIMESTAMP_MEMBER_FIELD, BLOB_ARG_FIELD, STRUCT_WITH_NESTED_BLOB_FIELD, BLOB_MAP_FIELD,
LIST_OF_BLOBS_FIELD, RECURSIVE_STRUCT_FIELD, POLYMORPHIC_TYPE_WITH_SUB_TYPES_FIELD,
POLYMORPHIC_TYPE_WITHOUT_SUB_TYPES_FIELD, ENUM_TYPE_FIELD, UNDERSCORE_NAME_TYPE_FIELD, MY_DOCUMENT_FIELD,
ALL_TYPES_UNION_STRUCTURE_FIELD));
private final String stringMember;
private final Integer integerMember;
private final Boolean booleanMember;
private final Float floatMember;
private final Double doubleMember;
private final Long longMember;
private final Short shortMember;
private final List<String> simpleList;
private final List<String> listOfEnums;
private final List<Map<String, String>> listOfMaps;
private final List<SimpleStruct> listOfStructs;
private final List<Map<String, String>> listOfMapOfEnumToString;
private final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct;
private final Map<String, List<Integer>> mapOfStringToIntegerList;
private final Map<String, String> mapOfStringToString;
private final Map<String, SimpleStruct> mapOfStringToSimpleStruct;
private final Map<String, String> mapOfEnumToEnum;
private final Map<String, String> mapOfEnumToString;
private final Map<String, String> mapOfStringToEnum;
private final Map<String, SimpleStruct> mapOfEnumToSimpleStruct;
private final Map<String, List<String>> mapOfEnumToListOfEnums;
private final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum;
private final Instant timestampMember;
private final StructWithTimestamp structWithNestedTimestampMember;
private final SdkBytes blobArg;
private final StructWithNestedBlobType structWithNestedBlob;
private final Map<String, SdkBytes> blobMap;
private final List<SdkBytes> listOfBlobs;
private final RecursiveStructType recursiveStruct;
private final BaseType polymorphicTypeWithSubTypes;
private final SubTypeOne polymorphicTypeWithoutSubTypes;
private final String enumType;
private final Underscore_Name_Type underscore_Name_Type;
private final Document myDocument;
private final AllTypesUnionStructure allTypesUnionStructure;
private AllTypesRequest(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.booleanMember = builder.booleanMember;
this.floatMember = builder.floatMember;
this.doubleMember = builder.doubleMember;
this.longMember = builder.longMember;
this.shortMember = builder.shortMember;
this.simpleList = builder.simpleList;
this.listOfEnums = builder.listOfEnums;
this.listOfMaps = builder.listOfMaps;
this.listOfStructs = builder.listOfStructs;
this.listOfMapOfEnumToString = builder.listOfMapOfEnumToString;
this.listOfMapOfStringToStruct = builder.listOfMapOfStringToStruct;
this.mapOfStringToIntegerList = builder.mapOfStringToIntegerList;
this.mapOfStringToString = builder.mapOfStringToString;
this.mapOfStringToSimpleStruct = builder.mapOfStringToSimpleStruct;
this.mapOfEnumToEnum = builder.mapOfEnumToEnum;
this.mapOfEnumToString = builder.mapOfEnumToString;
this.mapOfStringToEnum = builder.mapOfStringToEnum;
this.mapOfEnumToSimpleStruct = builder.mapOfEnumToSimpleStruct;
this.mapOfEnumToListOfEnums = builder.mapOfEnumToListOfEnums;
this.mapOfEnumToMapOfStringToEnum = builder.mapOfEnumToMapOfStringToEnum;
this.timestampMember = builder.timestampMember;
this.structWithNestedTimestampMember = builder.structWithNestedTimestampMember;
this.blobArg = builder.blobArg;
this.structWithNestedBlob = builder.structWithNestedBlob;
this.blobMap = builder.blobMap;
this.listOfBlobs = builder.listOfBlobs;
this.recursiveStruct = builder.recursiveStruct;
this.polymorphicTypeWithSubTypes = builder.polymorphicTypeWithSubTypes;
this.polymorphicTypeWithoutSubTypes = builder.polymorphicTypeWithoutSubTypes;
this.enumType = builder.enumType;
this.underscore_Name_Type = builder.underscore_Name_Type;
this.myDocument = builder.myDocument;
this.allTypesUnionStructure = builder.allTypesUnionStructure;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the BooleanMember property for this object.
*
* @return The value of the BooleanMember property for this object.
*/
public final Boolean booleanMember() {
return booleanMember;
}
/**
* Returns the value of the FloatMember property for this object.
*
* @return The value of the FloatMember property for this object.
*/
public final Float floatMember() {
return floatMember;
}
/**
* Returns the value of the DoubleMember property for this object.
*
* @return The value of the DoubleMember property for this object.
*/
public final Double doubleMember() {
return doubleMember;
}
/**
* Returns the value of the LongMember property for this object.
*
* @return The value of the LongMember property for this object.
*/
public final Long longMember() {
return longMember;
}
/**
* Returns the value of the ShortMember property for this object.
*
* @return The value of the ShortMember property for this object.
*/
public final Short shortMember() {
return shortMember;
}
/**
* For responses, this returns true if the service returned a value for the SimpleList property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasSimpleList() {
return simpleList != null && !(simpleList instanceof SdkAutoConstructList);
}
/**
* Returns the value of the SimpleList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasSimpleList} method.
* </p>
*
* @return The value of the SimpleList property for this object.
*/
public final List<String> simpleList() {
return simpleList;
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<EnumType> listOfEnums() {
return ListOfEnumsCopier.copyStringToEnum(listOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the ListOfEnums property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfEnums() {
return listOfEnums != null && !(listOfEnums instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfEnums} method.
* </p>
*
* @return The value of the ListOfEnums property for this object.
*/
public final List<String> listOfEnumsAsStrings() {
return listOfEnums;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMaps property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasListOfMaps() {
return listOfMaps != null && !(listOfMaps instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMaps property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMaps} method.
* </p>
*
* @return The value of the ListOfMaps property for this object.
*/
public final List<Map<String, String>> listOfMaps() {
return listOfMaps;
}
/**
* For responses, this returns true if the service returned a value for the ListOfStructs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfStructs() {
return listOfStructs != null && !(listOfStructs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfStructs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfStructs} method.
* </p>
*
* @return The value of the ListOfStructs property for this object.
*/
public final List<SimpleStruct> listOfStructs() {
return listOfStructs;
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<EnumType, String>> listOfMapOfEnumToString() {
return ListOfMapOfEnumToStringCopier.copyStringToEnum(listOfMapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfEnumToString property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfEnumToString() {
return listOfMapOfEnumToString != null && !(listOfMapOfEnumToString instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfEnumToString} method.
* </p>
*
* @return The value of the ListOfMapOfEnumToString property for this object.
*/
public final List<Map<String, String>> listOfMapOfEnumToStringAsStrings() {
return listOfMapOfEnumToString;
}
/**
* For responses, this returns true if the service returned a value for the ListOfMapOfStringToStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasListOfMapOfStringToStruct() {
return listOfMapOfStringToStruct != null && !(listOfMapOfStringToStruct instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfMapOfStringToStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfMapOfStringToStruct} method.
* </p>
*
* @return The value of the ListOfMapOfStringToStruct property for this object.
*/
public final List<Map<String, SimpleStruct>> listOfMapOfStringToStruct() {
return listOfMapOfStringToStruct;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToIntegerList property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToIntegerList() {
return mapOfStringToIntegerList != null && !(mapOfStringToIntegerList instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToIntegerList property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToIntegerList} method.
* </p>
*
* @return The value of the MapOfStringToIntegerList property for this object.
*/
public final Map<String, List<Integer>> mapOfStringToIntegerList() {
return mapOfStringToIntegerList;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToString() {
return mapOfStringToString != null && !(mapOfStringToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToString} method.
* </p>
*
* @return The value of the MapOfStringToString property for this object.
*/
public final Map<String, String> mapOfStringToString() {
return mapOfStringToString;
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct != null && !(mapOfStringToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfStringToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfStringToSimpleStruct() {
return mapOfStringToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<EnumType, EnumType> mapOfEnumToEnum() {
return MapOfEnumToEnumCopier.copyStringToEnum(mapOfEnumToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToEnum property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToEnum() {
return mapOfEnumToEnum != null && !(mapOfEnumToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToEnum property for this object.
*/
public final Map<String, String> mapOfEnumToEnumAsStrings() {
return mapOfEnumToEnum;
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<EnumType, String> mapOfEnumToString() {
return MapOfEnumToStringCopier.copyStringToEnum(mapOfEnumToString);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToString property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfEnumToString() {
return mapOfEnumToString != null && !(mapOfEnumToString instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToString property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToString} method.
* </p>
*
* @return The value of the MapOfEnumToString property for this object.
*/
public final Map<String, String> mapOfEnumToStringAsStrings() {
return mapOfEnumToString;
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, EnumType> mapOfStringToEnum() {
return MapOfStringToEnumCopier.copyStringToEnum(mapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfStringToEnum property. This DOES
* NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasMapOfStringToEnum() {
return mapOfStringToEnum != null && !(mapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfStringToEnum property for this object.
*/
public final Map<String, String> mapOfStringToEnumAsStrings() {
return mapOfStringToEnum;
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct() {
return MapOfEnumToSimpleStructCopier.copyStringToEnum(mapOfEnumToSimpleStruct);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToSimpleStruct property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToSimpleStruct() {
return mapOfEnumToSimpleStruct != null && !(mapOfEnumToSimpleStruct instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToSimpleStruct property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToSimpleStruct} method.
* </p>
*
* @return The value of the MapOfEnumToSimpleStruct property for this object.
*/
public final Map<String, SimpleStruct> mapOfEnumToSimpleStructAsStrings() {
return mapOfEnumToSimpleStruct;
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<EnumType, List<EnumType>> mapOfEnumToListOfEnums() {
return MapOfEnumToListOfEnumsCopier.copyStringToEnum(mapOfEnumToListOfEnums);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToListOfEnums property. This
* DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToListOfEnums() {
return mapOfEnumToListOfEnums != null && !(mapOfEnumToListOfEnums instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToListOfEnums property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToListOfEnums} method.
* </p>
*
* @return The value of the MapOfEnumToListOfEnums property for this object.
*/
public final Map<String, List<String>> mapOfEnumToListOfEnumsAsStrings() {
return mapOfEnumToListOfEnums;
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<EnumType, Map<String, EnumType>> mapOfEnumToMapOfStringToEnum() {
return MapOfEnumToMapOfStringToEnumCopier.copyStringToEnum(mapOfEnumToMapOfStringToEnum);
}
/**
* For responses, this returns true if the service returned a value for the MapOfEnumToMapOfStringToEnum property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasMapOfEnumToMapOfStringToEnum() {
return mapOfEnumToMapOfStringToEnum != null && !(mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the MapOfEnumToMapOfStringToEnum property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasMapOfEnumToMapOfStringToEnum} method.
* </p>
*
* @return The value of the MapOfEnumToMapOfStringToEnum property for this object.
*/
public final Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnumAsStrings() {
return mapOfEnumToMapOfStringToEnum;
}
/**
* Returns the value of the TimestampMember property for this object.
*
* @return The value of the TimestampMember property for this object.
*/
public final Instant timestampMember() {
return timestampMember;
}
/**
* Returns the value of the StructWithNestedTimestampMember property for this object.
*
* @return The value of the StructWithNestedTimestampMember property for this object.
*/
public final StructWithTimestamp structWithNestedTimestampMember() {
return structWithNestedTimestampMember;
}
/**
* Returns the value of the BlobArg property for this object.
*
* @return The value of the BlobArg property for this object.
*/
public final SdkBytes blobArg() {
return blobArg;
}
/**
* Returns the value of the StructWithNestedBlob property for this object.
*
* @return The value of the StructWithNestedBlob property for this object.
*/
public final StructWithNestedBlobType structWithNestedBlob() {
return structWithNestedBlob;
}
/**
* For responses, this returns true if the service returned a value for the BlobMap property. This DOES NOT check
* that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property). This is
* useful because the SDK will never return a null collection or map, but you may need to differentiate between the
* service returning nothing (or null) and the service returning an empty collection or map. For requests, this
* returns true if a value for the property was specified in the request builder, and false if a value was not
* specified.
*/
public final boolean hasBlobMap() {
return blobMap != null && !(blobMap instanceof SdkAutoConstructMap);
}
/**
* Returns the value of the BlobMap property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasBlobMap} method.
* </p>
*
* @return The value of the BlobMap property for this object.
*/
public final Map<String, SdkBytes> blobMap() {
return blobMap;
}
/**
* For responses, this returns true if the service returned a value for the ListOfBlobs property. This DOES NOT
* check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the property).
* This is useful because the SDK will never return a null collection or map, but you may need to differentiate
* between the service returning nothing (or null) and the service returning an empty collection or map. For
* requests, this returns true if a value for the property was specified in the request builder, and false if a
* value was not specified.
*/
public final boolean hasListOfBlobs() {
return listOfBlobs != null && !(listOfBlobs instanceof SdkAutoConstructList);
}
/**
* Returns the value of the ListOfBlobs property for this object.
* <p>
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
* </p>
* <p>
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasListOfBlobs} method.
* </p>
*
* @return The value of the ListOfBlobs property for this object.
*/
public final List<SdkBytes> listOfBlobs() {
return listOfBlobs;
}
/**
* Returns the value of the RecursiveStruct property for this object.
*
* @return The value of the RecursiveStruct property for this object.
*/
public final RecursiveStructType recursiveStruct() {
return recursiveStruct;
}
/**
* Returns the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithSubTypes property for this object.
*/
public final BaseType polymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes;
}
/**
* Returns the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @return The value of the PolymorphicTypeWithoutSubTypes property for this object.
*/
public final SubTypeOne polymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes;
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final EnumType enumType() {
return EnumType.fromValue(enumType);
}
/**
* Returns the value of the EnumType property for this object.
* <p>
* If the service returns an enum value that is not available in the current SDK version, {@link #enumType} will
* return {@link EnumType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #enumTypeAsString}.
* </p>
*
* @return The value of the EnumType property for this object.
* @see EnumType
*/
public final String enumTypeAsString() {
return enumType;
}
/**
* Returns the value of the Underscore_Name_Type property for this object.
*
* @return The value of the Underscore_Name_Type property for this object.
*/
public final Underscore_Name_Type underscore_Name_Type() {
return underscore_Name_Type;
}
/**
* Returns the value of the MyDocument property for this object.
*
* @return The value of the MyDocument property for this object.
*/
public final Document myDocument() {
return myDocument;
}
/**
* Returns the value of the AllTypesUnionStructure property for this object.
*
* @return The value of the AllTypesUnionStructure property for this object.
*/
public final AllTypesUnionStructure allTypesUnionStructure() {
return allTypesUnionStructure;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(booleanMember());
hashCode = 31 * hashCode + Objects.hashCode(floatMember());
hashCode = 31 * hashCode + Objects.hashCode(doubleMember());
hashCode = 31 * hashCode + Objects.hashCode(longMember());
hashCode = 31 * hashCode + Objects.hashCode(shortMember());
hashCode = 31 * hashCode + Objects.hashCode(hasSimpleList() ? simpleList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfEnums() ? listOfEnumsAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMaps() ? listOfMaps() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfStructs() ? listOfStructs() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToString() ? mapOfStringToString() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null);
hashCode = 31 * hashCode
+ Objects.hashCode(hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null);
hashCode = 31 * hashCode + Objects.hashCode(timestampMember());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedTimestampMember());
hashCode = 31 * hashCode + Objects.hashCode(blobArg());
hashCode = 31 * hashCode + Objects.hashCode(structWithNestedBlob());
hashCode = 31 * hashCode + Objects.hashCode(hasBlobMap() ? blobMap() : null);
hashCode = 31 * hashCode + Objects.hashCode(hasListOfBlobs() ? listOfBlobs() : null);
hashCode = 31 * hashCode + Objects.hashCode(recursiveStruct());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(polymorphicTypeWithoutSubTypes());
hashCode = 31 * hashCode + Objects.hashCode(enumTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(underscore_Name_Type());
hashCode = 31 * hashCode + Objects.hashCode(myDocument());
hashCode = 31 * hashCode + Objects.hashCode(allTypesUnionStructure());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof AllTypesRequest)) {
return false;
}
AllTypesRequest other = (AllTypesRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(booleanMember(), other.booleanMember()) && Objects.equals(floatMember(), other.floatMember())
&& Objects.equals(doubleMember(), other.doubleMember()) && Objects.equals(longMember(), other.longMember())
&& Objects.equals(shortMember(), other.shortMember()) && hasSimpleList() == other.hasSimpleList()
&& Objects.equals(simpleList(), other.simpleList()) && hasListOfEnums() == other.hasListOfEnums()
&& Objects.equals(listOfEnumsAsStrings(), other.listOfEnumsAsStrings())
&& hasListOfMaps() == other.hasListOfMaps() && Objects.equals(listOfMaps(), other.listOfMaps())
&& hasListOfStructs() == other.hasListOfStructs() && Objects.equals(listOfStructs(), other.listOfStructs())
&& hasListOfMapOfEnumToString() == other.hasListOfMapOfEnumToString()
&& Objects.equals(listOfMapOfEnumToStringAsStrings(), other.listOfMapOfEnumToStringAsStrings())
&& hasListOfMapOfStringToStruct() == other.hasListOfMapOfStringToStruct()
&& Objects.equals(listOfMapOfStringToStruct(), other.listOfMapOfStringToStruct())
&& hasMapOfStringToIntegerList() == other.hasMapOfStringToIntegerList()
&& Objects.equals(mapOfStringToIntegerList(), other.mapOfStringToIntegerList())
&& hasMapOfStringToString() == other.hasMapOfStringToString()
&& Objects.equals(mapOfStringToString(), other.mapOfStringToString())
&& hasMapOfStringToSimpleStruct() == other.hasMapOfStringToSimpleStruct()
&& Objects.equals(mapOfStringToSimpleStruct(), other.mapOfStringToSimpleStruct())
&& hasMapOfEnumToEnum() == other.hasMapOfEnumToEnum()
&& Objects.equals(mapOfEnumToEnumAsStrings(), other.mapOfEnumToEnumAsStrings())
&& hasMapOfEnumToString() == other.hasMapOfEnumToString()
&& Objects.equals(mapOfEnumToStringAsStrings(), other.mapOfEnumToStringAsStrings())
&& hasMapOfStringToEnum() == other.hasMapOfStringToEnum()
&& Objects.equals(mapOfStringToEnumAsStrings(), other.mapOfStringToEnumAsStrings())
&& hasMapOfEnumToSimpleStruct() == other.hasMapOfEnumToSimpleStruct()
&& Objects.equals(mapOfEnumToSimpleStructAsStrings(), other.mapOfEnumToSimpleStructAsStrings())
&& hasMapOfEnumToListOfEnums() == other.hasMapOfEnumToListOfEnums()
&& Objects.equals(mapOfEnumToListOfEnumsAsStrings(), other.mapOfEnumToListOfEnumsAsStrings())
&& hasMapOfEnumToMapOfStringToEnum() == other.hasMapOfEnumToMapOfStringToEnum()
&& Objects.equals(mapOfEnumToMapOfStringToEnumAsStrings(), other.mapOfEnumToMapOfStringToEnumAsStrings())
&& Objects.equals(timestampMember(), other.timestampMember())
&& Objects.equals(structWithNestedTimestampMember(), other.structWithNestedTimestampMember())
&& Objects.equals(blobArg(), other.blobArg())
&& Objects.equals(structWithNestedBlob(), other.structWithNestedBlob()) && hasBlobMap() == other.hasBlobMap()
&& Objects.equals(blobMap(), other.blobMap()) && hasListOfBlobs() == other.hasListOfBlobs()
&& Objects.equals(listOfBlobs(), other.listOfBlobs())
&& Objects.equals(recursiveStruct(), other.recursiveStruct())
&& Objects.equals(polymorphicTypeWithSubTypes(), other.polymorphicTypeWithSubTypes())
&& Objects.equals(polymorphicTypeWithoutSubTypes(), other.polymorphicTypeWithoutSubTypes())
&& Objects.equals(enumTypeAsString(), other.enumTypeAsString())
&& Objects.equals(underscore_Name_Type(), other.underscore_Name_Type())
&& Objects.equals(myDocument(), other.myDocument())
&& Objects.equals(allTypesUnionStructure(), other.allTypesUnionStructure());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString
.builder("AllTypesRequest")
.add("StringMember", stringMember())
.add("IntegerMember", integerMember())
.add("BooleanMember", booleanMember())
.add("FloatMember", floatMember())
.add("DoubleMember", doubleMember())
.add("LongMember", longMember())
.add("ShortMember", shortMember())
.add("SimpleList", hasSimpleList() ? simpleList() : null)
.add("ListOfEnums", hasListOfEnums() ? listOfEnumsAsStrings() : null)
.add("ListOfMaps", hasListOfMaps() ? listOfMaps() : null)
.add("ListOfStructs", hasListOfStructs() ? listOfStructs() : null)
.add("ListOfMapOfEnumToString", hasListOfMapOfEnumToString() ? listOfMapOfEnumToStringAsStrings() : null)
.add("ListOfMapOfStringToStruct", hasListOfMapOfStringToStruct() ? listOfMapOfStringToStruct() : null)
.add("MapOfStringToIntegerList", hasMapOfStringToIntegerList() ? mapOfStringToIntegerList() : null)
.add("MapOfStringToString", hasMapOfStringToString() ? mapOfStringToString() : null)
.add("MapOfStringToSimpleStruct", hasMapOfStringToSimpleStruct() ? mapOfStringToSimpleStruct() : null)
.add("MapOfEnumToEnum", hasMapOfEnumToEnum() ? mapOfEnumToEnumAsStrings() : null)
.add("MapOfEnumToString", hasMapOfEnumToString() ? mapOfEnumToStringAsStrings() : null)
.add("MapOfStringToEnum", hasMapOfStringToEnum() ? mapOfStringToEnumAsStrings() : null)
.add("MapOfEnumToSimpleStruct", hasMapOfEnumToSimpleStruct() ? mapOfEnumToSimpleStructAsStrings() : null)
.add("MapOfEnumToListOfEnums", hasMapOfEnumToListOfEnums() ? mapOfEnumToListOfEnumsAsStrings() : null)
.add("MapOfEnumToMapOfStringToEnum",
hasMapOfEnumToMapOfStringToEnum() ? mapOfEnumToMapOfStringToEnumAsStrings() : null)
.add("TimestampMember", timestampMember())
.add("StructWithNestedTimestampMember", structWithNestedTimestampMember()).add("BlobArg", blobArg())
.add("StructWithNestedBlob", structWithNestedBlob()).add("BlobMap", hasBlobMap() ? blobMap() : null)
.add("ListOfBlobs", hasListOfBlobs() ? listOfBlobs() : null).add("RecursiveStruct", recursiveStruct())
.add("PolymorphicTypeWithSubTypes", polymorphicTypeWithSubTypes())
.add("PolymorphicTypeWithoutSubTypes", polymorphicTypeWithoutSubTypes()).add("EnumType", enumTypeAsString())
.add("Underscore_Name_Type", underscore_Name_Type()).add("MyDocument", myDocument())
.add("AllTypesUnionStructure", allTypesUnionStructure()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "StringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "IntegerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "BooleanMember":
return Optional.ofNullable(clazz.cast(booleanMember()));
case "FloatMember":
return Optional.ofNullable(clazz.cast(floatMember()));
case "DoubleMember":
return Optional.ofNullable(clazz.cast(doubleMember()));
case "LongMember":
return Optional.ofNullable(clazz.cast(longMember()));
case "ShortMember":
return Optional.ofNullable(clazz.cast(shortMember()));
case "SimpleList":
return Optional.ofNullable(clazz.cast(simpleList()));
case "ListOfEnums":
return Optional.ofNullable(clazz.cast(listOfEnumsAsStrings()));
case "ListOfMaps":
return Optional.ofNullable(clazz.cast(listOfMaps()));
case "ListOfStructs":
return Optional.ofNullable(clazz.cast(listOfStructs()));
case "ListOfMapOfEnumToString":
return Optional.ofNullable(clazz.cast(listOfMapOfEnumToStringAsStrings()));
case "ListOfMapOfStringToStruct":
return Optional.ofNullable(clazz.cast(listOfMapOfStringToStruct()));
case "MapOfStringToIntegerList":
return Optional.ofNullable(clazz.cast(mapOfStringToIntegerList()));
case "MapOfStringToString":
return Optional.ofNullable(clazz.cast(mapOfStringToString()));
case "MapOfStringToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfStringToSimpleStruct()));
case "MapOfEnumToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToEnumAsStrings()));
case "MapOfEnumToString":
return Optional.ofNullable(clazz.cast(mapOfEnumToStringAsStrings()));
case "MapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfStringToEnumAsStrings()));
case "MapOfEnumToSimpleStruct":
return Optional.ofNullable(clazz.cast(mapOfEnumToSimpleStructAsStrings()));
case "MapOfEnumToListOfEnums":
return Optional.ofNullable(clazz.cast(mapOfEnumToListOfEnumsAsStrings()));
case "MapOfEnumToMapOfStringToEnum":
return Optional.ofNullable(clazz.cast(mapOfEnumToMapOfStringToEnumAsStrings()));
case "TimestampMember":
return Optional.ofNullable(clazz.cast(timestampMember()));
case "StructWithNestedTimestampMember":
return Optional.ofNullable(clazz.cast(structWithNestedTimestampMember()));
case "BlobArg":
return Optional.ofNullable(clazz.cast(blobArg()));
case "StructWithNestedBlob":
return Optional.ofNullable(clazz.cast(structWithNestedBlob()));
case "BlobMap":
return Optional.ofNullable(clazz.cast(blobMap()));
case "ListOfBlobs":
return Optional.ofNullable(clazz.cast(listOfBlobs()));
case "RecursiveStruct":
return Optional.ofNullable(clazz.cast(recursiveStruct()));
case "PolymorphicTypeWithSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithSubTypes()));
case "PolymorphicTypeWithoutSubTypes":
return Optional.ofNullable(clazz.cast(polymorphicTypeWithoutSubTypes()));
case "EnumType":
return Optional.ofNullable(clazz.cast(enumTypeAsString()));
case "Underscore_Name_Type":
return Optional.ofNullable(clazz.cast(underscore_Name_Type()));
case "MyDocument":
return Optional.ofNullable(clazz.cast(myDocument()));
case "AllTypesUnionStructure":
return Optional.ofNullable(clazz.cast(allTypesUnionStructure()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<AllTypesRequest, T> g) {
return obj -> g.apply((AllTypesRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsRequest.Builder, SdkPojo, CopyableBuilder<Builder, AllTypesRequest> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the BooleanMember property for this object.
*
* @param booleanMember
* The new value for the BooleanMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder booleanMember(Boolean booleanMember);
/**
* Sets the value of the FloatMember property for this object.
*
* @param floatMember
* The new value for the FloatMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder floatMember(Float floatMember);
/**
* Sets the value of the DoubleMember property for this object.
*
* @param doubleMember
* The new value for the DoubleMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder doubleMember(Double doubleMember);
/**
* Sets the value of the LongMember property for this object.
*
* @param longMember
* The new value for the LongMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder longMember(Long longMember);
/**
* Sets the value of the ShortMember property for this object.
*
* @param shortMember
* The new value for the ShortMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder shortMember(Short shortMember);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(Collection<String> simpleList);
/**
* Sets the value of the SimpleList property for this object.
*
* @param simpleList
* The new value for the SimpleList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder simpleList(String... simpleList);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(Collection<String> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnumsWithStrings(String... listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(Collection<EnumType> listOfEnums);
/**
* Sets the value of the ListOfEnums property for this object.
*
* @param listOfEnums
* The new value for the ListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfEnums(EnumType... listOfEnums);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps);
/**
* Sets the value of the ListOfMaps property for this object.
*
* @param listOfMaps
* The new value for the ListOfMaps property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMaps(Map<String, String>... listOfMaps);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(Collection<SimpleStruct> listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* @param listOfStructs
* The new value for the ListOfStructs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfStructs(SimpleStruct... listOfStructs);
/**
* Sets the value of the ListOfStructs property for this object.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder} avoiding the need to
* create one manually via
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct#builder()}.
*
* <p>
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder#build()} is called
* immediately and its result is passed to {@link #listOfStructs(List<SimpleStruct>)}.
*
* @param listOfStructs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.jsonprotocoltests.model.SimpleStruct.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #listOfStructs(java.util.Collection<SimpleStruct>)
*/
Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfEnumToString property for this object.
*
* @param listOfMapOfEnumToString
* The new value for the ListOfMapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct);
/**
* Sets the value of the ListOfMapOfStringToStruct property for this object.
*
* @param listOfMapOfStringToStruct
* The new value for the ListOfMapOfStringToStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct);
/**
* Sets the value of the MapOfStringToIntegerList property for this object.
*
* @param mapOfStringToIntegerList
* The new value for the MapOfStringToIntegerList property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList);
/**
* Sets the value of the MapOfStringToString property for this object.
*
* @param mapOfStringToString
* The new value for the MapOfStringToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToString(Map<String, String> mapOfStringToString);
/**
* Sets the value of the MapOfStringToSimpleStruct property for this object.
*
* @param mapOfStringToSimpleStruct
* The new value for the MapOfStringToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToEnum property for this object.
*
* @param mapOfEnumToEnum
* The new value for the MapOfEnumToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString);
/**
* Sets the value of the MapOfEnumToString property for this object.
*
* @param mapOfEnumToString
* The new value for the MapOfEnumToString property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum);
/**
* Sets the value of the MapOfStringToEnum property for this object.
*
* @param mapOfStringToEnum
* The new value for the MapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToSimpleStruct property for this object.
*
* @param mapOfEnumToSimpleStruct
* The new value for the MapOfEnumToSimpleStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToListOfEnums property for this object.
*
* @param mapOfEnumToListOfEnums
* The new value for the MapOfEnumToListOfEnums property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnumWithStrings(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the MapOfEnumToMapOfStringToEnum property for this object.
*
* @param mapOfEnumToMapOfStringToEnum
* The new value for the MapOfEnumToMapOfStringToEnum property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder mapOfEnumToMapOfStringToEnum(Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum);
/**
* Sets the value of the TimestampMember property for this object.
*
* @param timestampMember
* The new value for the TimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder timestampMember(Instant timestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* @param structWithNestedTimestampMember
* The new value for the StructWithNestedTimestampMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember);
/**
* Sets the value of the StructWithNestedTimestampMember property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithTimestamp.Builder} avoiding the
* need to create one manually via {@link StructWithTimestamp#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithTimestamp.Builder#build()} is called immediately and
* its result is passed to {@link #structWithNestedTimestampMember(StructWithTimestamp)}.
*
* @param structWithNestedTimestampMember
* a consumer that will call methods on {@link StructWithTimestamp.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedTimestampMember(StructWithTimestamp)
*/
default Builder structWithNestedTimestampMember(Consumer<StructWithTimestamp.Builder> structWithNestedTimestampMember) {
return structWithNestedTimestampMember(StructWithTimestamp.builder().applyMutation(structWithNestedTimestampMember)
.build());
}
/**
* Sets the value of the BlobArg property for this object.
*
* @param blobArg
* The new value for the BlobArg property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobArg(SdkBytes blobArg);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* @param structWithNestedBlob
* The new value for the StructWithNestedBlob property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob);
/**
* Sets the value of the StructWithNestedBlob property for this object.
*
* This is a convenience method that creates an instance of the {@link StructWithNestedBlobType.Builder}
* avoiding the need to create one manually via {@link StructWithNestedBlobType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link StructWithNestedBlobType.Builder#build()} is called immediately
* and its result is passed to {@link #structWithNestedBlob(StructWithNestedBlobType)}.
*
* @param structWithNestedBlob
* a consumer that will call methods on {@link StructWithNestedBlobType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #structWithNestedBlob(StructWithNestedBlobType)
*/
default Builder structWithNestedBlob(Consumer<StructWithNestedBlobType.Builder> structWithNestedBlob) {
return structWithNestedBlob(StructWithNestedBlobType.builder().applyMutation(structWithNestedBlob).build());
}
/**
* Sets the value of the BlobMap property for this object.
*
* @param blobMap
* The new value for the BlobMap property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder blobMap(Map<String, SdkBytes> blobMap);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(Collection<SdkBytes> listOfBlobs);
/**
* Sets the value of the ListOfBlobs property for this object.
*
* @param listOfBlobs
* The new value for the ListOfBlobs property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder listOfBlobs(SdkBytes... listOfBlobs);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* @param recursiveStruct
* The new value for the RecursiveStruct property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder recursiveStruct(RecursiveStructType recursiveStruct);
/**
* Sets the value of the RecursiveStruct property for this object.
*
* This is a convenience method that creates an instance of the {@link RecursiveStructType.Builder} avoiding the
* need to create one manually via {@link RecursiveStructType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link RecursiveStructType.Builder#build()} is called immediately and
* its result is passed to {@link #recursiveStruct(RecursiveStructType)}.
*
* @param recursiveStruct
* a consumer that will call methods on {@link RecursiveStructType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #recursiveStruct(RecursiveStructType)
*/
default Builder recursiveStruct(Consumer<RecursiveStructType.Builder> recursiveStruct) {
return recursiveStruct(RecursiveStructType.builder().applyMutation(recursiveStruct).build());
}
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* @param polymorphicTypeWithSubTypes
* The new value for the PolymorphicTypeWithSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes);
/**
* Sets the value of the PolymorphicTypeWithSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link BaseType.Builder} avoiding the need to
* create one manually via {@link BaseType#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link BaseType.Builder#build()} is called immediately and its result is
* passed to {@link #polymorphicTypeWithSubTypes(BaseType)}.
*
* @param polymorphicTypeWithSubTypes
* a consumer that will call methods on {@link BaseType.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithSubTypes(BaseType)
*/
default Builder polymorphicTypeWithSubTypes(Consumer<BaseType.Builder> polymorphicTypeWithSubTypes) {
return polymorphicTypeWithSubTypes(BaseType.builder().applyMutation(polymorphicTypeWithSubTypes).build());
}
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* @param polymorphicTypeWithoutSubTypes
* The new value for the PolymorphicTypeWithoutSubTypes property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes);
/**
* Sets the value of the PolymorphicTypeWithoutSubTypes property for this object.
*
* This is a convenience method that creates an instance of the {@link SubTypeOne.Builder} avoiding the need to
* create one manually via {@link SubTypeOne#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link SubTypeOne.Builder#build()} is called immediately and its result
* is passed to {@link #polymorphicTypeWithoutSubTypes(SubTypeOne)}.
*
* @param polymorphicTypeWithoutSubTypes
* a consumer that will call methods on {@link SubTypeOne.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #polymorphicTypeWithoutSubTypes(SubTypeOne)
*/
default Builder polymorphicTypeWithoutSubTypes(Consumer<SubTypeOne.Builder> polymorphicTypeWithoutSubTypes) {
return polymorphicTypeWithoutSubTypes(SubTypeOne.builder().applyMutation(polymorphicTypeWithoutSubTypes).build());
}
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(String enumType);
/**
* Sets the value of the EnumType property for this object.
*
* @param enumType
* The new value for the EnumType property for this object.
* @see EnumType
* @return Returns a reference to this object so that method calls can be chained together.
* @see EnumType
*/
Builder enumType(EnumType enumType);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* @param underscore_Name_Type
* The new value for the Underscore_Name_Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type);
/**
* Sets the value of the Underscore_Name_Type property for this object.
*
* This is a convenience method that creates an instance of the {@link Underscore_Name_Type.Builder} avoiding
* the need to create one manually via {@link Underscore_Name_Type#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link Underscore_Name_Type.Builder#build()} is called immediately and
* its result is passed to {@link #underscore_Name_Type(Underscore_Name_Type)}.
*
* @param underscore_Name_Type
* a consumer that will call methods on {@link Underscore_Name_Type.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #underscore_Name_Type(Underscore_Name_Type)
*/
default Builder underscore_Name_Type(Consumer<Underscore_Name_Type.Builder> underscore_Name_Type) {
return underscore_Name_Type(Underscore_Name_Type.builder().applyMutation(underscore_Name_Type).build());
}
/**
* Sets the value of the MyDocument property for this object.
*
* @param myDocument
* The new value for the MyDocument property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder myDocument(Document myDocument);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* @param allTypesUnionStructure
* The new value for the AllTypesUnionStructure property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure);
/**
* Sets the value of the AllTypesUnionStructure property for this object.
*
* This is a convenience method that creates an instance of the {@link AllTypesUnionStructure.Builder} avoiding
* the need to create one manually via {@link AllTypesUnionStructure#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link AllTypesUnionStructure.Builder#build()} is called immediately and
* its result is passed to {@link #allTypesUnionStructure(AllTypesUnionStructure)}.
*
* @param allTypesUnionStructure
* a consumer that will call methods on {@link AllTypesUnionStructure.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #allTypesUnionStructure(AllTypesUnionStructure)
*/
default Builder allTypesUnionStructure(Consumer<AllTypesUnionStructure.Builder> allTypesUnionStructure) {
return allTypesUnionStructure(AllTypesUnionStructure.builder().applyMutation(allTypesUnionStructure).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends JsonProtocolTestsRequest.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private Boolean booleanMember;
private Float floatMember;
private Double doubleMember;
private Long longMember;
private Short shortMember;
private List<String> simpleList = DefaultSdkAutoConstructList.getInstance();
private List<String> listOfEnums = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMaps = DefaultSdkAutoConstructList.getInstance();
private List<SimpleStruct> listOfStructs = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, String>> listOfMapOfEnumToString = DefaultSdkAutoConstructList.getInstance();
private List<Map<String, SimpleStruct>> listOfMapOfStringToStruct = DefaultSdkAutoConstructList.getInstance();
private Map<String, List<Integer>> mapOfStringToIntegerList = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfStringToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfEnumToString = DefaultSdkAutoConstructMap.getInstance();
private Map<String, String> mapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Map<String, SimpleStruct> mapOfEnumToSimpleStruct = DefaultSdkAutoConstructMap.getInstance();
private Map<String, List<String>> mapOfEnumToListOfEnums = DefaultSdkAutoConstructMap.getInstance();
private Map<String, Map<String, String>> mapOfEnumToMapOfStringToEnum = DefaultSdkAutoConstructMap.getInstance();
private Instant timestampMember;
private StructWithTimestamp structWithNestedTimestampMember;
private SdkBytes blobArg;
private StructWithNestedBlobType structWithNestedBlob;
private Map<String, SdkBytes> blobMap = DefaultSdkAutoConstructMap.getInstance();
private List<SdkBytes> listOfBlobs = DefaultSdkAutoConstructList.getInstance();
private RecursiveStructType recursiveStruct;
private BaseType polymorphicTypeWithSubTypes;
private SubTypeOne polymorphicTypeWithoutSubTypes;
private String enumType;
private Underscore_Name_Type underscore_Name_Type;
private Document myDocument;
private AllTypesUnionStructure allTypesUnionStructure;
private BuilderImpl() {
}
private BuilderImpl(AllTypesRequest model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
booleanMember(model.booleanMember);
floatMember(model.floatMember);
doubleMember(model.doubleMember);
longMember(model.longMember);
shortMember(model.shortMember);
simpleList(model.simpleList);
listOfEnumsWithStrings(model.listOfEnums);
listOfMaps(model.listOfMaps);
listOfStructs(model.listOfStructs);
listOfMapOfEnumToStringWithStrings(model.listOfMapOfEnumToString);
listOfMapOfStringToStruct(model.listOfMapOfStringToStruct);
mapOfStringToIntegerList(model.mapOfStringToIntegerList);
mapOfStringToString(model.mapOfStringToString);
mapOfStringToSimpleStruct(model.mapOfStringToSimpleStruct);
mapOfEnumToEnumWithStrings(model.mapOfEnumToEnum);
mapOfEnumToStringWithStrings(model.mapOfEnumToString);
mapOfStringToEnumWithStrings(model.mapOfStringToEnum);
mapOfEnumToSimpleStructWithStrings(model.mapOfEnumToSimpleStruct);
mapOfEnumToListOfEnumsWithStrings(model.mapOfEnumToListOfEnums);
mapOfEnumToMapOfStringToEnumWithStrings(model.mapOfEnumToMapOfStringToEnum);
timestampMember(model.timestampMember);
structWithNestedTimestampMember(model.structWithNestedTimestampMember);
blobArg(model.blobArg);
structWithNestedBlob(model.structWithNestedBlob);
blobMap(model.blobMap);
listOfBlobs(model.listOfBlobs);
recursiveStruct(model.recursiveStruct);
polymorphicTypeWithSubTypes(model.polymorphicTypeWithSubTypes);
polymorphicTypeWithoutSubTypes(model.polymorphicTypeWithoutSubTypes);
enumType(model.enumType);
underscore_Name_Type(model.underscore_Name_Type);
myDocument(model.myDocument);
allTypesUnionStructure(model.allTypesUnionStructure);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final Boolean getBooleanMember() {
return booleanMember;
}
public final void setBooleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
}
@Override
public final Builder booleanMember(Boolean booleanMember) {
this.booleanMember = booleanMember;
return this;
}
public final Float getFloatMember() {
return floatMember;
}
public final void setFloatMember(Float floatMember) {
this.floatMember = floatMember;
}
@Override
public final Builder floatMember(Float floatMember) {
this.floatMember = floatMember;
return this;
}
public final Double getDoubleMember() {
return doubleMember;
}
public final void setDoubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
}
@Override
public final Builder doubleMember(Double doubleMember) {
this.doubleMember = doubleMember;
return this;
}
public final Long getLongMember() {
return longMember;
}
public final void setLongMember(Long longMember) {
this.longMember = longMember;
}
@Override
public final Builder longMember(Long longMember) {
this.longMember = longMember;
return this;
}
public final Short getShortMember() {
return shortMember;
}
public final void setShortMember(Short shortMember) {
this.shortMember = shortMember;
}
@Override
public final Builder shortMember(Short shortMember) {
this.shortMember = shortMember;
return this;
}
public final Collection<String> getSimpleList() {
if (simpleList instanceof SdkAutoConstructList) {
return null;
}
return simpleList;
}
public final void setSimpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
}
@Override
public final Builder simpleList(Collection<String> simpleList) {
this.simpleList = ListOfStringsCopier.copy(simpleList);
return this;
}
@Override
@SafeVarargs
public final Builder simpleList(String... simpleList) {
simpleList(Arrays.asList(simpleList));
return this;
}
public final Collection<String> getListOfEnums() {
if (listOfEnums instanceof SdkAutoConstructList) {
return null;
}
return listOfEnums;
}
public final void setListOfEnums(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
}
@Override
public final Builder listOfEnumsWithStrings(Collection<String> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copy(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnumsWithStrings(String... listOfEnums) {
listOfEnumsWithStrings(Arrays.asList(listOfEnums));
return this;
}
@Override
public final Builder listOfEnums(Collection<EnumType> listOfEnums) {
this.listOfEnums = ListOfEnumsCopier.copyEnumToString(listOfEnums);
return this;
}
@Override
@SafeVarargs
public final Builder listOfEnums(EnumType... listOfEnums) {
listOfEnums(Arrays.asList(listOfEnums));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMaps() {
if (listOfMaps instanceof SdkAutoConstructList) {
return null;
}
return listOfMaps;
}
public final void setListOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
}
@Override
public final Builder listOfMaps(Collection<? extends Map<String, String>> listOfMaps) {
this.listOfMaps = ListOfMapStringToStringCopier.copy(listOfMaps);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMaps(Map<String, String>... listOfMaps) {
listOfMaps(Arrays.asList(listOfMaps));
return this;
}
public final List<SimpleStruct.Builder> getListOfStructs() {
List<SimpleStruct.Builder> result = ListOfSimpleStructsCopier.copyToBuilder(this.listOfStructs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfStructs(Collection<SimpleStruct.BuilderImpl> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copyFromBuilder(listOfStructs);
}
@Override
public final Builder listOfStructs(Collection<SimpleStruct> listOfStructs) {
this.listOfStructs = ListOfSimpleStructsCopier.copy(listOfStructs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(SimpleStruct... listOfStructs) {
listOfStructs(Arrays.asList(listOfStructs));
return this;
}
@Override
@SafeVarargs
public final Builder listOfStructs(Consumer<SimpleStruct.Builder>... listOfStructs) {
listOfStructs(Stream.of(listOfStructs).map(c -> SimpleStruct.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final Collection<? extends Map<String, String>> getListOfMapOfEnumToString() {
if (listOfMapOfEnumToString instanceof SdkAutoConstructList) {
return null;
}
return listOfMapOfEnumToString;
}
public final void setListOfMapOfEnumToString(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
}
@Override
public final Builder listOfMapOfEnumToStringWithStrings(Collection<? extends Map<String, String>> listOfMapOfEnumToString) {
this.listOfMapOfEnumToString = ListOfMapOfEnumToStringCopier.copy(listOfMapOfEnumToString);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfEnumToStringWithStrings(Map<String, String>... listOfMapOfEnumToString) {
listOfMapOfEnumToStringWithStrings(Arrays.asList(listOfMapOfEnumToString));
return this;
}
public final List<Map<String, SimpleStruct.Builder>> getListOfMapOfStringToStruct() {
List<Map<String, SimpleStruct.Builder>> result = ListOfMapOfStringToStructCopier
.copyToBuilder(this.listOfMapOfStringToStruct);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setListOfMapOfStringToStruct(
Collection<? extends Map<String, SimpleStruct.BuilderImpl>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copyFromBuilder(listOfMapOfStringToStruct);
}
@Override
public final Builder listOfMapOfStringToStruct(Collection<? extends Map<String, SimpleStruct>> listOfMapOfStringToStruct) {
this.listOfMapOfStringToStruct = ListOfMapOfStringToStructCopier.copy(listOfMapOfStringToStruct);
return this;
}
@Override
@SafeVarargs
public final Builder listOfMapOfStringToStruct(Map<String, SimpleStruct>... listOfMapOfStringToStruct) {
listOfMapOfStringToStruct(Arrays.asList(listOfMapOfStringToStruct));
return this;
}
public final Map<String, ? extends Collection<Integer>> getMapOfStringToIntegerList() {
if (mapOfStringToIntegerList instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToIntegerList;
}
public final void setMapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
}
@Override
public final Builder mapOfStringToIntegerList(Map<String, ? extends Collection<Integer>> mapOfStringToIntegerList) {
this.mapOfStringToIntegerList = MapOfStringToIntegerListCopier.copy(mapOfStringToIntegerList);
return this;
}
public final Map<String, String> getMapOfStringToString() {
if (mapOfStringToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToString;
}
public final void setMapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
}
@Override
public final Builder mapOfStringToString(Map<String, String> mapOfStringToString) {
this.mapOfStringToString = MapOfStringToStringCopier.copy(mapOfStringToString);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfStringToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfStringToSimpleStructCopier
.copyToBuilder(this.mapOfStringToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfStringToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copyFromBuilder(mapOfStringToSimpleStruct);
}
@Override
public final Builder mapOfStringToSimpleStruct(Map<String, SimpleStruct> mapOfStringToSimpleStruct) {
this.mapOfStringToSimpleStruct = MapOfStringToSimpleStructCopier.copy(mapOfStringToSimpleStruct);
return this;
}
public final Map<String, String> getMapOfEnumToEnum() {
if (mapOfEnumToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToEnum;
}
public final void setMapOfEnumToEnum(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
}
@Override
public final Builder mapOfEnumToEnumWithStrings(Map<String, String> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copy(mapOfEnumToEnum);
return this;
}
@Override
public final Builder mapOfEnumToEnum(Map<EnumType, EnumType> mapOfEnumToEnum) {
this.mapOfEnumToEnum = MapOfEnumToEnumCopier.copyEnumToString(mapOfEnumToEnum);
return this;
}
public final Map<String, String> getMapOfEnumToString() {
if (mapOfEnumToString instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToString;
}
public final void setMapOfEnumToString(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
}
@Override
public final Builder mapOfEnumToStringWithStrings(Map<String, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copy(mapOfEnumToString);
return this;
}
@Override
public final Builder mapOfEnumToString(Map<EnumType, String> mapOfEnumToString) {
this.mapOfEnumToString = MapOfEnumToStringCopier.copyEnumToString(mapOfEnumToString);
return this;
}
public final Map<String, String> getMapOfStringToEnum() {
if (mapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfStringToEnum;
}
public final void setMapOfStringToEnum(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
}
@Override
public final Builder mapOfStringToEnumWithStrings(Map<String, String> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copy(mapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfStringToEnum(Map<String, EnumType> mapOfStringToEnum) {
this.mapOfStringToEnum = MapOfStringToEnumCopier.copyEnumToString(mapOfStringToEnum);
return this;
}
public final Map<String, SimpleStruct.Builder> getMapOfEnumToSimpleStruct() {
Map<String, SimpleStruct.Builder> result = MapOfEnumToSimpleStructCopier.copyToBuilder(this.mapOfEnumToSimpleStruct);
if (result instanceof SdkAutoConstructMap) {
return null;
}
return result;
}
public final void setMapOfEnumToSimpleStruct(Map<String, SimpleStruct.BuilderImpl> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyFromBuilder(mapOfEnumToSimpleStruct);
}
@Override
public final Builder mapOfEnumToSimpleStructWithStrings(Map<String, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copy(mapOfEnumToSimpleStruct);
return this;
}
@Override
public final Builder mapOfEnumToSimpleStruct(Map<EnumType, SimpleStruct> mapOfEnumToSimpleStruct) {
this.mapOfEnumToSimpleStruct = MapOfEnumToSimpleStructCopier.copyEnumToString(mapOfEnumToSimpleStruct);
return this;
}
public final Map<String, ? extends Collection<String>> getMapOfEnumToListOfEnums() {
if (mapOfEnumToListOfEnums instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToListOfEnums;
}
public final void setMapOfEnumToListOfEnums(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
}
@Override
public final Builder mapOfEnumToListOfEnumsWithStrings(Map<String, ? extends Collection<String>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copy(mapOfEnumToListOfEnums);
return this;
}
@Override
public final Builder mapOfEnumToListOfEnums(Map<EnumType, ? extends Collection<EnumType>> mapOfEnumToListOfEnums) {
this.mapOfEnumToListOfEnums = MapOfEnumToListOfEnumsCopier.copyEnumToString(mapOfEnumToListOfEnums);
return this;
}
public final Map<String, ? extends Map<String, String>> getMapOfEnumToMapOfStringToEnum() {
if (mapOfEnumToMapOfStringToEnum instanceof SdkAutoConstructMap) {
return null;
}
return mapOfEnumToMapOfStringToEnum;
}
public final void setMapOfEnumToMapOfStringToEnum(Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
}
@Override
public final Builder mapOfEnumToMapOfStringToEnumWithStrings(
Map<String, ? extends Map<String, String>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copy(mapOfEnumToMapOfStringToEnum);
return this;
}
@Override
public final Builder mapOfEnumToMapOfStringToEnum(
Map<EnumType, ? extends Map<String, EnumType>> mapOfEnumToMapOfStringToEnum) {
this.mapOfEnumToMapOfStringToEnum = MapOfEnumToMapOfStringToEnumCopier.copyEnumToString(mapOfEnumToMapOfStringToEnum);
return this;
}
public final Instant getTimestampMember() {
return timestampMember;
}
public final void setTimestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
}
@Override
public final Builder timestampMember(Instant timestampMember) {
this.timestampMember = timestampMember;
return this;
}
public final StructWithTimestamp.Builder getStructWithNestedTimestampMember() {
return structWithNestedTimestampMember != null ? structWithNestedTimestampMember.toBuilder() : null;
}
public final void setStructWithNestedTimestampMember(StructWithTimestamp.BuilderImpl structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember != null ? structWithNestedTimestampMember
.build() : null;
}
@Override
public final Builder structWithNestedTimestampMember(StructWithTimestamp structWithNestedTimestampMember) {
this.structWithNestedTimestampMember = structWithNestedTimestampMember;
return this;
}
public final ByteBuffer getBlobArg() {
return blobArg == null ? null : blobArg.asByteBuffer();
}
public final void setBlobArg(ByteBuffer blobArg) {
blobArg(blobArg == null ? null : SdkBytes.fromByteBuffer(blobArg));
}
@Override
public final Builder blobArg(SdkBytes blobArg) {
this.blobArg = blobArg;
return this;
}
public final StructWithNestedBlobType.Builder getStructWithNestedBlob() {
return structWithNestedBlob != null ? structWithNestedBlob.toBuilder() : null;
}
public final void setStructWithNestedBlob(StructWithNestedBlobType.BuilderImpl structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob != null ? structWithNestedBlob.build() : null;
}
@Override
public final Builder structWithNestedBlob(StructWithNestedBlobType structWithNestedBlob) {
this.structWithNestedBlob = structWithNestedBlob;
return this;
}
public final Map<String, ByteBuffer> getBlobMap() {
if (blobMap instanceof SdkAutoConstructMap) {
return null;
}
return blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().asByteBuffer()));
}
public final void setBlobMap(Map<String, ByteBuffer> blobMap) {
blobMap(blobMap == null ? null : blobMap.entrySet().stream()
.collect(Collectors.toMap(e -> e.getKey(), e -> SdkBytes.fromByteBuffer(e.getValue()))));
}
@Override
public final Builder blobMap(Map<String, SdkBytes> blobMap) {
this.blobMap = BlobMapTypeCopier.copy(blobMap);
return this;
}
public final List<ByteBuffer> getListOfBlobs() {
if (listOfBlobs instanceof SdkAutoConstructList) {
return null;
}
return listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::asByteBuffer).collect(Collectors.toList());
}
public final void setListOfBlobs(Collection<ByteBuffer> listOfBlobs) {
listOfBlobs(listOfBlobs == null ? null : listOfBlobs.stream().map(SdkBytes::fromByteBuffer)
.collect(Collectors.toList()));
}
@Override
public final Builder listOfBlobs(Collection<SdkBytes> listOfBlobs) {
this.listOfBlobs = ListOfBlobsTypeCopier.copy(listOfBlobs);
return this;
}
@Override
@SafeVarargs
public final Builder listOfBlobs(SdkBytes... listOfBlobs) {
listOfBlobs(Arrays.asList(listOfBlobs));
return this;
}
public final RecursiveStructType.Builder getRecursiveStruct() {
return recursiveStruct != null ? recursiveStruct.toBuilder() : null;
}
public final void setRecursiveStruct(RecursiveStructType.BuilderImpl recursiveStruct) {
this.recursiveStruct = recursiveStruct != null ? recursiveStruct.build() : null;
}
@Override
public final Builder recursiveStruct(RecursiveStructType recursiveStruct) {
this.recursiveStruct = recursiveStruct;
return this;
}
public final BaseType.Builder getPolymorphicTypeWithSubTypes() {
return polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithSubTypes(BaseType.BuilderImpl polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes != null ? polymorphicTypeWithSubTypes.build() : null;
}
@Override
public final Builder polymorphicTypeWithSubTypes(BaseType polymorphicTypeWithSubTypes) {
this.polymorphicTypeWithSubTypes = polymorphicTypeWithSubTypes;
return this;
}
public final SubTypeOne.Builder getPolymorphicTypeWithoutSubTypes() {
return polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.toBuilder() : null;
}
public final void setPolymorphicTypeWithoutSubTypes(SubTypeOne.BuilderImpl polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes != null ? polymorphicTypeWithoutSubTypes.build()
: null;
}
@Override
public final Builder polymorphicTypeWithoutSubTypes(SubTypeOne polymorphicTypeWithoutSubTypes) {
this.polymorphicTypeWithoutSubTypes = polymorphicTypeWithoutSubTypes;
return this;
}
public final String getEnumType() {
return enumType;
}
public final void setEnumType(String enumType) {
this.enumType = enumType;
}
@Override
public final Builder enumType(String enumType) {
this.enumType = enumType;
return this;
}
@Override
public final Builder enumType(EnumType enumType) {
this.enumType(enumType == null ? null : enumType.toString());
return this;
}
public final Underscore_Name_Type.Builder getUnderscore_Name_Type() {
return underscore_Name_Type != null ? underscore_Name_Type.toBuilder() : null;
}
public final void setUnderscore_Name_Type(Underscore_Name_Type.BuilderImpl underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type != null ? underscore_Name_Type.build() : null;
}
@Override
public final Builder underscore_Name_Type(Underscore_Name_Type underscore_Name_Type) {
this.underscore_Name_Type = underscore_Name_Type;
return this;
}
public final Document getMyDocument() {
return myDocument;
}
public final void setMyDocument(Document myDocument) {
this.myDocument = myDocument;
}
@Override
public final Builder myDocument(Document myDocument) {
this.myDocument = myDocument;
return this;
}
public final AllTypesUnionStructure.Builder getAllTypesUnionStructure() {
return allTypesUnionStructure != null ? allTypesUnionStructure.toBuilder() : null;
}
public final void setAllTypesUnionStructure(AllTypesUnionStructure.BuilderImpl allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure != null ? allTypesUnionStructure.build() : null;
}
@Override
public final Builder allTypesUnionStructure(AllTypesUnionStructure allTypesUnionStructure) {
this.allTypesUnionStructure = allTypesUnionStructure;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public AllTypesRequest build() {
return new AllTypesRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,189 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/listofenumscopier.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
@Generated("software.amazon.awssdk:codegen")
final class ListOfEnumsCopier {
static List<String> copy(Collection<String> listOfEnumsParam) {
List<String> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
modifiableList.add(entry);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<String> copyEnumToString(Collection<EnumType> listOfEnumsParam) {
List<String> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<String> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
String result = entry.toString();
modifiableList.add(result);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
static List<EnumType> copyStringToEnum(Collection<String> listOfEnumsParam) {
List<EnumType> list;
if (listOfEnumsParam == null || listOfEnumsParam instanceof SdkAutoConstructList) {
list = DefaultSdkAutoConstructList.getInstance();
} else {
List<EnumType> modifiableList = new ArrayList<>();
listOfEnumsParam.forEach(entry -> {
EnumType result = EnumType.fromValue(entry);
modifiableList.add(result);
});
list = Collections.unmodifiableList(modifiableList);
}
return list;
}
}
| 3,190 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/operationwithdeprecatedmemberresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class OperationWithDeprecatedMemberResponse extends JsonProtocolTestsResponse implements
ToCopyableBuilder<OperationWithDeprecatedMemberResponse.Builder, OperationWithDeprecatedMemberResponse> {
private static final SdkField<String> MEMBER_MODELED_AS_DEPRECATED_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("MemberModeledAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberResponse::memberModeledAsDeprecated))
.setter(setter(Builder::memberModeledAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModeledAsDeprecated").build())
.build();
private static final SdkField<String> MEMBER_MODIFIED_AS_DEPRECATED_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("MemberModifiedAsDeprecated")
.getter(getter(OperationWithDeprecatedMemberResponse::memberModifiedAsDeprecated))
.setter(setter(Builder::memberModifiedAsDeprecated))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MemberModifiedAsDeprecated").build())
.build();
private static final SdkField<String> UNDEPRECATED_MEMBER_FIELD = SdkField.<String> builder(MarshallingType.STRING)
.memberName("UndeprecatedMember").getter(getter(OperationWithDeprecatedMemberResponse::undeprecatedMember))
.setter(setter(Builder::undeprecatedMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UndeprecatedMember").build())
.build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
MEMBER_MODELED_AS_DEPRECATED_FIELD, MEMBER_MODIFIED_AS_DEPRECATED_FIELD, UNDEPRECATED_MEMBER_FIELD));
private final String memberModeledAsDeprecated;
private final String memberModifiedAsDeprecated;
private final String undeprecatedMember;
private OperationWithDeprecatedMemberResponse(BuilderImpl builder) {
super(builder);
this.memberModeledAsDeprecated = builder.memberModeledAsDeprecated;
this.memberModifiedAsDeprecated = builder.memberModifiedAsDeprecated;
this.undeprecatedMember = builder.undeprecatedMember;
}
/**
* Returns the value of the MemberModeledAsDeprecated property for this object.
*
* @return The value of the MemberModeledAsDeprecated property for this object.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
public final String memberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
/**
* Returns the value of the MemberModifiedAsDeprecated property for this object.
*
* @return The value of the MemberModifiedAsDeprecated property for this object.
*/
public final String memberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
/**
* Returns the value of the UndeprecatedMember property for this object.
*
* @return The value of the UndeprecatedMember property for this object.
*/
public final String undeprecatedMember() {
return undeprecatedMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(memberModeledAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(memberModifiedAsDeprecated());
hashCode = 31 * hashCode + Objects.hashCode(undeprecatedMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof OperationWithDeprecatedMemberResponse)) {
return false;
}
OperationWithDeprecatedMemberResponse other = (OperationWithDeprecatedMemberResponse) obj;
return Objects.equals(memberModeledAsDeprecated(), other.memberModeledAsDeprecated())
&& Objects.equals(memberModifiedAsDeprecated(), other.memberModifiedAsDeprecated())
&& Objects.equals(undeprecatedMember(), other.undeprecatedMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("OperationWithDeprecatedMemberResponse")
.add("MemberModeledAsDeprecated", memberModeledAsDeprecated())
.add("MemberModifiedAsDeprecated", memberModifiedAsDeprecated()).add("UndeprecatedMember", undeprecatedMember())
.build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "MemberModeledAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModeledAsDeprecated()));
case "MemberModifiedAsDeprecated":
return Optional.ofNullable(clazz.cast(memberModifiedAsDeprecated()));
case "UndeprecatedMember":
return Optional.ofNullable(clazz.cast(undeprecatedMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<OperationWithDeprecatedMemberResponse, T> g) {
return obj -> g.apply((OperationWithDeprecatedMemberResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends JsonProtocolTestsResponse.Builder, SdkPojo,
CopyableBuilder<Builder, OperationWithDeprecatedMemberResponse> {
/**
* Sets the value of the MemberModeledAsDeprecated property for this object.
*
* @param memberModeledAsDeprecated
* The new value for the MemberModeledAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
* @deprecated This field is modeled as deprecated.
*/
@Deprecated
Builder memberModeledAsDeprecated(String memberModeledAsDeprecated);
/**
* Sets the value of the MemberModifiedAsDeprecated property for this object.
*
* @param memberModifiedAsDeprecated
* The new value for the MemberModifiedAsDeprecated property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated);
/**
* Sets the value of the UndeprecatedMember property for this object.
*
* @param undeprecatedMember
* The new value for the UndeprecatedMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder undeprecatedMember(String undeprecatedMember);
}
static final class BuilderImpl extends JsonProtocolTestsResponse.BuilderImpl implements Builder {
private String memberModeledAsDeprecated;
private String memberModifiedAsDeprecated;
private String undeprecatedMember;
private BuilderImpl() {
}
private BuilderImpl(OperationWithDeprecatedMemberResponse model) {
super(model);
memberModeledAsDeprecated(model.memberModeledAsDeprecated);
memberModifiedAsDeprecated(model.memberModifiedAsDeprecated);
undeprecatedMember(model.undeprecatedMember);
}
@Deprecated
public final String getMemberModeledAsDeprecated() {
return memberModeledAsDeprecated;
}
@Deprecated
public final void setMemberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
}
@Override
@Deprecated
public final Builder memberModeledAsDeprecated(String memberModeledAsDeprecated) {
this.memberModeledAsDeprecated = memberModeledAsDeprecated;
return this;
}
public final String getMemberModifiedAsDeprecated() {
return memberModifiedAsDeprecated;
}
public final void setMemberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
}
@Override
public final Builder memberModifiedAsDeprecated(String memberModifiedAsDeprecated) {
this.memberModifiedAsDeprecated = memberModifiedAsDeprecated;
return this;
}
public final String getUndeprecatedMember() {
return undeprecatedMember;
}
public final void setUndeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
}
@Override
public final Builder undeprecatedMember(String undeprecatedMember) {
this.undeprecatedMember = undeprecatedMember;
return this;
}
@Override
public OperationWithDeprecatedMemberResponse build() {
return new OperationWithDeprecatedMemberResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,191 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/serviceclientconfiguration-builder.java | package software.amazon.awssdk.services.jsonprotocoltests.internal;
import java.net.URI;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.config.AwsClientOption;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.http.auth.spi.scheme.AuthSchemeProvider;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.jsonprotocoltests.JsonProtocolTestsServiceClientConfiguration;
import software.amazon.awssdk.services.jsonprotocoltests.auth.scheme.JsonProtocolTestsAuthSchemeProvider;
import software.amazon.awssdk.utils.Validate;
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
public class JsonProtocolTestsServiceClientConfigurationBuilder implements JsonProtocolTestsServiceClientConfiguration.Builder {
private final SdkClientConfiguration.Builder config;
public JsonProtocolTestsServiceClientConfigurationBuilder() {
this(SdkClientConfiguration.builder());
}
public JsonProtocolTestsServiceClientConfigurationBuilder(SdkClientConfiguration.Builder config) {
this.config = config;
}
/**
* Sets the value for client override configuration
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder overrideConfiguration(
ClientOverrideConfiguration overrideConfiguration) {
config.putAll(overrideConfiguration);
return this;
}
/**
* Gets the value for client override configuration
*/
@Override
public ClientOverrideConfiguration overrideConfiguration() {
return config.asOverrideConfigurationBuilder().build();
}
/**
* Sets the value for endpoint override
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder endpointOverride(URI endpointOverride) {
if (endpointOverride != null) {
config.option(SdkClientOption.ENDPOINT, endpointOverride);
config.option(SdkClientOption.ENDPOINT_OVERRIDDEN, true);
} else {
config.option(SdkClientOption.ENDPOINT, null);
config.option(SdkClientOption.ENDPOINT_OVERRIDDEN, false);
}
return this;
}
/**
* Gets the value for endpoint override
*/
@Override
public URI endpointOverride() {
if (Boolean.TRUE.equals(config.option(SdkClientOption.ENDPOINT_OVERRIDDEN))) {
return config.option(SdkClientOption.ENDPOINT);
}
return null;
}
/**
* Sets the value for endpoint provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder endpointProvider(EndpointProvider endpointProvider) {
config.option(SdkClientOption.ENDPOINT_PROVIDER, endpointProvider);
return this;
}
/**
* Gets the value for endpoint provider
*/
@Override
public EndpointProvider endpointProvider() {
return config.option(SdkClientOption.ENDPOINT_PROVIDER);
}
/**
* Sets the value for AWS region
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder region(Region region) {
config.option(AwsClientOption.AWS_REGION, region);
return this;
}
/**
* Gets the value for AWS region
*/
@Override
public Region region() {
return config.option(AwsClientOption.AWS_REGION);
}
/**
* Sets the value for credentials provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder credentialsProvider(
IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider) {
config.option(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER, credentialsProvider);
return this;
}
/**
* Gets the value for credentials provider
*/
@Override
public IdentityProvider<? extends AwsCredentialsIdentity> credentialsProvider() {
return config.option(AwsClientOption.CREDENTIALS_IDENTITY_PROVIDER);
}
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder putAuthScheme(AuthScheme<?> authScheme) {
config.computeOptionIfAbsent(SdkClientOption.AUTH_SCHEMES, HashMap::new).put(authScheme.schemeId(), authScheme);
return this;
}
/**
* Gets the value for auth schemes
*/
@Override
public Map<String, AuthScheme<?>> authSchemes() {
Map<String, AuthScheme<?>> authSchemes = config.option(SdkClientOption.AUTH_SCHEMES);
return Collections.unmodifiableMap(authSchemes == null ? Collections.emptyMap() : authSchemes);
}
/**
* Sets the value for auth scheme provider
*/
@Override
public JsonProtocolTestsServiceClientConfiguration.Builder authSchemeProvider(
JsonProtocolTestsAuthSchemeProvider authSchemeProvider) {
config.option(SdkClientOption.AUTH_SCHEME_PROVIDER, authSchemeProvider);
return this;
}
/**
* Gets the value for auth scheme provider
*/
@Override
public JsonProtocolTestsAuthSchemeProvider authSchemeProvider() {
AuthSchemeProvider result = config.option(SdkClientOption.AUTH_SCHEME_PROVIDER);
if (result == null) {
return null;
}
return Validate.isInstanceOf(JsonProtocolTestsAuthSchemeProvider.class, result, "Expected an instance of "
+ JsonProtocolTestsAuthSchemeProvider.class.getSimpleName());
}
@Override
public JsonProtocolTestsServiceClientConfiguration build() {
return new JsonProtocolTestsServiceClientConfiguration(this);
}
}
| 3,192 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/baseserviceexception.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.exception.AwsErrorDetails;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
@Generated("software.amazon.awssdk:codegen")
public class JsonProtocolTestsException extends AwsServiceException {
protected JsonProtocolTestsException(Builder builder) {
super(builder);
}
public static Builder builder() {
return new BuilderImpl();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
public interface Builder extends AwsServiceException.Builder {
@Override
Builder awsErrorDetails(AwsErrorDetails awsErrorDetails);
@Override
Builder message(String message);
@Override
Builder requestId(String requestId);
@Override
Builder statusCode(int statusCode);
@Override
Builder cause(Throwable cause);
@Override
Builder writableStackTrace(Boolean writableStackTrace);
}
protected static class BuilderImpl extends AwsServiceException.BuilderImpl implements Builder {
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsException ex) {
super(ex);
}
@Override
public BuilderImpl awsErrorDetails(AwsErrorDetails awsErrorDetails) {
this.awsErrorDetails = awsErrorDetails;
return this;
}
@Override
public BuilderImpl message(String message) {
this.message = message;
return this;
}
@Override
public BuilderImpl requestId(String requestId) {
this.requestId = requestId;
return this;
}
@Override
public BuilderImpl statusCode(int statusCode) {
this.statusCode = statusCode;
return this;
}
@Override
public BuilderImpl cause(Throwable cause) {
this.cause = cause;
return this;
}
@Override
public BuilderImpl writableStackTrace(Boolean writableStackTrace) {
this.writableStackTrace = writableStackTrace;
return this;
}
@Override
public JsonProtocolTestsException build() {
return new JsonProtocolTestsException(this);
}
}
}
| 3,193 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/testxmlnamespaceresponse.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.XmlAttributesTrait;
import software.amazon.awssdk.utils.Pair;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class TestXmlNamespaceResponse extends ProtocolRestXmlResponse implements
ToCopyableBuilder<TestXmlNamespaceResponse.Builder, TestXmlNamespaceResponse> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(TestXmlNamespaceResponse::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField
.<Integer> builder(MarshallingType.INTEGER)
.memberName("integerMember")
.getter(getter(TestXmlNamespaceResponse::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("integerMember")
.unmarshallLocationName("integerMember").build()).build();
private static final SdkField<XmlNamespaceMember> XML_NAMESPACE_MEMBER_FIELD = SdkField
.<XmlNamespaceMember> builder(MarshallingType.SDK_POJO)
.memberName("xmlNamespaceMember")
.getter(getter(TestXmlNamespaceResponse::xmlNamespaceMember))
.setter(setter(Builder::xmlNamespaceMember))
.constructor(XmlNamespaceMember::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("xmlNamespaceMember")
.unmarshallLocationName("xmlNamespaceMember").build(),
XmlAttributesTrait.create(
Pair.of("xmlns:foo",
XmlAttributesTrait.AttributeAccessors.builder().attributeGetter((ignore) -> "http://bar")
.build()),
Pair.of("foo:type",
XmlAttributesTrait.AttributeAccessors.builder()
.attributeGetter(t -> ((XmlNamespaceMember) t).type()).build()))).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, XML_NAMESPACE_MEMBER_FIELD));
private final String stringMember;
private final Integer integerMember;
private final XmlNamespaceMember xmlNamespaceMember;
private TestXmlNamespaceResponse(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.xmlNamespaceMember = builder.xmlNamespaceMember;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the XmlNamespaceMember property for this object.
*
* @return The value of the XmlNamespaceMember property for this object.
*/
public final XmlNamespaceMember xmlNamespaceMember() {
return xmlNamespaceMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(xmlNamespaceMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TestXmlNamespaceResponse)) {
return false;
}
TestXmlNamespaceResponse other = (TestXmlNamespaceResponse) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(xmlNamespaceMember(), other.xmlNamespaceMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("TestXmlNamespaceResponse").add("StringMember", stringMember())
.add("IntegerMember", integerMember()).add("XmlNamespaceMember", xmlNamespaceMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "integerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "xmlNamespaceMember":
return Optional.ofNullable(clazz.cast(xmlNamespaceMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<TestXmlNamespaceResponse, T> g) {
return obj -> g.apply((TestXmlNamespaceResponse) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ProtocolRestXmlResponse.Builder, SdkPojo, CopyableBuilder<Builder, TestXmlNamespaceResponse> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* @param xmlNamespaceMember
* The new value for the XmlNamespaceMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* This is a convenience method that creates an instance of the {@link XmlNamespaceMember.Builder} avoiding the
* need to create one manually via {@link XmlNamespaceMember#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link XmlNamespaceMember.Builder#build()} is called immediately and its
* result is passed to {@link #xmlNamespaceMember(XmlNamespaceMember)}.
*
* @param xmlNamespaceMember
* a consumer that will call methods on {@link XmlNamespaceMember.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #xmlNamespaceMember(XmlNamespaceMember)
*/
default Builder xmlNamespaceMember(Consumer<XmlNamespaceMember.Builder> xmlNamespaceMember) {
return xmlNamespaceMember(XmlNamespaceMember.builder().applyMutation(xmlNamespaceMember).build());
}
}
static final class BuilderImpl extends ProtocolRestXmlResponse.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private XmlNamespaceMember xmlNamespaceMember;
private BuilderImpl() {
}
private BuilderImpl(TestXmlNamespaceResponse model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
xmlNamespaceMember(model.xmlNamespaceMember);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final XmlNamespaceMember.Builder getXmlNamespaceMember() {
return xmlNamespaceMember != null ? xmlNamespaceMember.toBuilder() : null;
}
public final void setXmlNamespaceMember(XmlNamespaceMember.BuilderImpl xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember != null ? xmlNamespaceMember.build() : null;
}
@Override
public final Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember;
return this;
}
@Override
public TestXmlNamespaceResponse build() {
return new TestXmlNamespaceResponse(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,194 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/testxmlnamespacerequest.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.XmlAttributesTrait;
import software.amazon.awssdk.utils.Pair;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class TestXmlNamespaceRequest extends ProtocolRestXmlRequest implements
ToCopyableBuilder<TestXmlNamespaceRequest.Builder, TestXmlNamespaceRequest> {
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(TestXmlNamespaceRequest::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final SdkField<Integer> INTEGER_MEMBER_FIELD = SdkField
.<Integer> builder(MarshallingType.INTEGER)
.memberName("integerMember")
.getter(getter(TestXmlNamespaceRequest::integerMember))
.setter(setter(Builder::integerMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("integerMember")
.unmarshallLocationName("integerMember").build()).build();
private static final SdkField<XmlNamespaceMember> XML_NAMESPACE_MEMBER_FIELD = SdkField
.<XmlNamespaceMember> builder(MarshallingType.SDK_POJO)
.memberName("xmlNamespaceMember")
.getter(getter(TestXmlNamespaceRequest::xmlNamespaceMember))
.setter(setter(Builder::xmlNamespaceMember))
.constructor(XmlNamespaceMember::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("xmlNamespaceMember")
.unmarshallLocationName("xmlNamespaceMember").build(),
XmlAttributesTrait.create(
Pair.of("xmlns:foo",
XmlAttributesTrait.AttributeAccessors.builder().attributeGetter((ignore) -> "http://bar")
.build()),
Pair.of("foo:type",
XmlAttributesTrait.AttributeAccessors.builder()
.attributeGetter(t -> ((XmlNamespaceMember) t).type()).build()))).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(STRING_MEMBER_FIELD,
INTEGER_MEMBER_FIELD, XML_NAMESPACE_MEMBER_FIELD));
private final String stringMember;
private final Integer integerMember;
private final XmlNamespaceMember xmlNamespaceMember;
private TestXmlNamespaceRequest(BuilderImpl builder) {
super(builder);
this.stringMember = builder.stringMember;
this.integerMember = builder.integerMember;
this.xmlNamespaceMember = builder.xmlNamespaceMember;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
/**
* Returns the value of the IntegerMember property for this object.
*
* @return The value of the IntegerMember property for this object.
*/
public final Integer integerMember() {
return integerMember;
}
/**
* Returns the value of the XmlNamespaceMember property for this object.
*
* @return The value of the XmlNamespaceMember property for this object.
*/
public final XmlNamespaceMember xmlNamespaceMember() {
return xmlNamespaceMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
hashCode = 31 * hashCode + Objects.hashCode(integerMember());
hashCode = 31 * hashCode + Objects.hashCode(xmlNamespaceMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof TestXmlNamespaceRequest)) {
return false;
}
TestXmlNamespaceRequest other = (TestXmlNamespaceRequest) obj;
return Objects.equals(stringMember(), other.stringMember()) && Objects.equals(integerMember(), other.integerMember())
&& Objects.equals(xmlNamespaceMember(), other.xmlNamespaceMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("TestXmlNamespaceRequest").add("StringMember", stringMember())
.add("IntegerMember", integerMember()).add("XmlNamespaceMember", xmlNamespaceMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
case "integerMember":
return Optional.ofNullable(clazz.cast(integerMember()));
case "xmlNamespaceMember":
return Optional.ofNullable(clazz.cast(xmlNamespaceMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<TestXmlNamespaceRequest, T> g) {
return obj -> g.apply((TestXmlNamespaceRequest) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends ProtocolRestXmlRequest.Builder, SdkPojo, CopyableBuilder<Builder, TestXmlNamespaceRequest> {
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
/**
* Sets the value of the IntegerMember property for this object.
*
* @param integerMember
* The new value for the IntegerMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder integerMember(Integer integerMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* @param xmlNamespaceMember
* The new value for the XmlNamespaceMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember);
/**
* Sets the value of the XmlNamespaceMember property for this object.
*
* This is a convenience method that creates an instance of the {@link XmlNamespaceMember.Builder} avoiding the
* need to create one manually via {@link XmlNamespaceMember#builder()}.
*
* <p>
* When the {@link Consumer} completes, {@link XmlNamespaceMember.Builder#build()} is called immediately and its
* result is passed to {@link #xmlNamespaceMember(XmlNamespaceMember)}.
*
* @param xmlNamespaceMember
* a consumer that will call methods on {@link XmlNamespaceMember.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #xmlNamespaceMember(XmlNamespaceMember)
*/
default Builder xmlNamespaceMember(Consumer<XmlNamespaceMember.Builder> xmlNamespaceMember) {
return xmlNamespaceMember(XmlNamespaceMember.builder().applyMutation(xmlNamespaceMember).build());
}
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends ProtocolRestXmlRequest.BuilderImpl implements Builder {
private String stringMember;
private Integer integerMember;
private XmlNamespaceMember xmlNamespaceMember;
private BuilderImpl() {
}
private BuilderImpl(TestXmlNamespaceRequest model) {
super(model);
stringMember(model.stringMember);
integerMember(model.integerMember);
xmlNamespaceMember(model.xmlNamespaceMember);
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
public final Integer getIntegerMember() {
return integerMember;
}
public final void setIntegerMember(Integer integerMember) {
this.integerMember = integerMember;
}
@Override
public final Builder integerMember(Integer integerMember) {
this.integerMember = integerMember;
return this;
}
public final XmlNamespaceMember.Builder getXmlNamespaceMember() {
return xmlNamespaceMember != null ? xmlNamespaceMember.toBuilder() : null;
}
public final void setXmlNamespaceMember(XmlNamespaceMember.BuilderImpl xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember != null ? xmlNamespaceMember.build() : null;
}
@Override
public final Builder xmlNamespaceMember(XmlNamespaceMember xmlNamespaceMember) {
this.xmlNamespaceMember = xmlNamespaceMember;
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public TestXmlNamespaceRequest build() {
return new TestXmlNamespaceRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,195 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/xmlnamespace/xmlnamespacemember.java | package software.amazon.awssdk.services.protocolrestxml.model;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.traits.XmlAttributeTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class XmlNamespaceMember implements SdkPojo, Serializable,
ToCopyableBuilder<XmlNamespaceMember.Builder, XmlNamespaceMember> {
private static final SdkField<String> TYPE_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("Type")
.getter(getter(XmlNamespaceMember::type))
.setter(setter(Builder::type))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("foo:type")
.unmarshallLocationName("foo:type").build(), XmlAttributeTrait.create()).build();
private static final SdkField<String> STRING_MEMBER_FIELD = SdkField
.<String> builder(MarshallingType.STRING)
.memberName("stringMember")
.getter(getter(XmlNamespaceMember::stringMember))
.setter(setter(Builder::stringMember))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("stringMember")
.unmarshallLocationName("stringMember").build()).build();
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TYPE_FIELD,
STRING_MEMBER_FIELD));
private static final long serialVersionUID = 1L;
private final String type;
private final String stringMember;
private XmlNamespaceMember(BuilderImpl builder) {
this.type = builder.type;
this.stringMember = builder.stringMember;
}
/**
* Returns the value of the Type property for this object.
*
* @return The value of the Type property for this object.
*/
public final String type() {
return type;
}
/**
* Returns the value of the StringMember property for this object.
*
* @return The value of the StringMember property for this object.
*/
public final String stringMember() {
return stringMember;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(type());
hashCode = 31 * hashCode + Objects.hashCode(stringMember());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof XmlNamespaceMember)) {
return false;
}
XmlNamespaceMember other = (XmlNamespaceMember) obj;
return Objects.equals(type(), other.type()) && Objects.equals(stringMember(), other.stringMember());
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("XmlNamespaceMember").add("Type", type()).add("StringMember", stringMember()).build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
switch (fieldName) {
case "Type":
return Optional.ofNullable(clazz.cast(type()));
case "stringMember":
return Optional.ofNullable(clazz.cast(stringMember()));
default:
return Optional.empty();
}
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
private static <T> Function<Object, T> getter(Function<XmlNamespaceMember, T> g) {
return obj -> g.apply((XmlNamespaceMember) obj);
}
private static <T> BiConsumer<Object, T> setter(BiConsumer<Builder, T> s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder<Builder, XmlNamespaceMember> {
/**
* Sets the value of the Type property for this object.
*
* @param type
* The new value for the Type property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder type(String type);
/**
* Sets the value of the StringMember property for this object.
*
* @param stringMember
* The new value for the StringMember property for this object.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stringMember(String stringMember);
}
static final class BuilderImpl implements Builder {
private String type;
private String stringMember;
private BuilderImpl() {
}
private BuilderImpl(XmlNamespaceMember model) {
type(model.type);
stringMember(model.stringMember);
}
public final String getType() {
return type;
}
public final void setType(String type) {
this.type = type;
}
@Override
public final Builder type(String type) {
this.type = type;
return this;
}
public final String getStringMember() {
return stringMember;
}
public final void setStringMember(String stringMember) {
this.stringMember = stringMember;
}
@Override
public final Builder stringMember(String stringMember) {
this.stringMember = stringMember;
return this;
}
@Override
public XmlNamespaceMember build() {
return new XmlNamespaceMember(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,196 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customresponsemetadata/jsonprotocoltestsresponse.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsResponse;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
public abstract class JsonProtocolTestsResponse extends AwsResponse {
private final JsonProtocolTestsResponseMetadata responseMetadata;
protected JsonProtocolTestsResponse(Builder builder) {
super(builder);
this.responseMetadata = builder.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
public interface Builder extends AwsResponse.Builder {
@Override
JsonProtocolTestsResponse build();
@Override
JsonProtocolTestsResponseMetadata responseMetadata();
@Override
Builder responseMetadata(AwsResponseMetadata metadata);
}
protected abstract static class BuilderImpl extends AwsResponse.BuilderImpl implements Builder {
private JsonProtocolTestsResponseMetadata responseMetadata;
protected BuilderImpl() {
}
protected BuilderImpl(JsonProtocolTestsResponse response) {
super(response);
this.responseMetadata = response.responseMetadata();
}
@Override
public JsonProtocolTestsResponseMetadata responseMetadata() {
return responseMetadata;
}
@Override
public Builder responseMetadata(AwsResponseMetadata responseMetadata) {
this.responseMetadata = JsonProtocolTestsResponseMetadata.create(responseMetadata);
return this;
}
}
}
| 3,197 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/customresponsemetadata/jsonprotocoltestsresponsemetadata.java | package software.amazon.awssdk.services.jsonprotocoltests.model;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.awscore.AwsResponseMetadata;
@Generated("software.amazon.awssdk:codegen")
@SdkPublicApi
public final class JsonProtocolTestsResponseMetadata extends AwsResponseMetadata {
private static final String BAR_ID = "x-bar-id";
private static final String FOO_ID = "x-foo-id";
private static final String REQUEST_ID = "x-foobar-id";
private JsonProtocolTestsResponseMetadata(AwsResponseMetadata responseMetadata) {
super(responseMetadata);
}
public static JsonProtocolTestsResponseMetadata create(AwsResponseMetadata responseMetadata) {
return new JsonProtocolTestsResponseMetadata(responseMetadata);
}
public String barId() {
return getValue(BAR_ID);
}
public String fooId() {
return getValue(FOO_ID);
}
@Override
public String requestId() {
return getValue(REQUEST_ID);
}
}
| 3,198 |
0 | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model | Create_ds/aws-sdk-java-v2/codegen/src/test/resources/software/amazon/awssdk/codegen/poet/model/sharedstream/getrandompersonrequest.java | package software.amazon.awssdk.services.sharedeventstream.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
@Generated("software.amazon.awssdk:codegen")
public final class GetRandomPersonRequest extends SharedEventStreamRequest implements
ToCopyableBuilder<GetRandomPersonRequest.Builder, GetRandomPersonRequest> {
private static final List<SdkField<?>> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList());
private GetRandomPersonRequest(BuilderImpl builder) {
super(builder);
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class<? extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return super.equals(obj) && equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof GetRandomPersonRequest)) {
return false;
}
return true;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*/
@Override
public final String toString() {
return ToString.builder("GetRandomPersonRequest").build();
}
public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz) {
return Optional.empty();
}
@Override
public final List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
public interface Builder extends SharedEventStreamRequest.Builder, SdkPojo, CopyableBuilder<Builder, GetRandomPersonRequest> {
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer);
}
static final class BuilderImpl extends SharedEventStreamRequest.BuilderImpl implements Builder {
private BuilderImpl() {
}
private BuilderImpl(GetRandomPersonRequest model) {
super(model);
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public GetRandomPersonRequest build() {
return new GetRandomPersonRequest(this);
}
@Override
public List<SdkField<?>> sdkFields() {
return SDK_FIELDS;
}
}
}
| 3,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.