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-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/GetBranchKeyIdInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Map;
import java.util.Objects;
/**
* Inputs for determining the Branch Key which should be used to wrap or unwrap the data key for this encryption or decryption
*/
public class GetBranchKeyIdInput {
/**
* The Encryption Context used with this encryption or decryption.
*/
private final Map<String, String> encryptionContext;
protected GetBranchKeyIdInput(BuilderImpl builder) {
this.encryptionContext = builder.encryptionContext();
}
/**
* @return The Encryption Context used with this encryption or decryption.
*/
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param encryptionContext The Encryption Context used with this encryption or decryption.
*/
Builder encryptionContext(Map<String, String> encryptionContext);
/**
* @return The Encryption Context used with this encryption or decryption.
*/
Map<String, String> encryptionContext();
GetBranchKeyIdInput build();
}
static class BuilderImpl implements Builder {
protected Map<String, String> encryptionContext;
protected BuilderImpl() {
}
protected BuilderImpl(GetBranchKeyIdInput model) {
this.encryptionContext = model.encryptionContext();
}
public Builder encryptionContext(Map<String, String> encryptionContext) {
this.encryptionContext = encryptionContext;
return this;
}
public Map<String, String> encryptionContext() {
return this.encryptionContext;
}
public GetBranchKeyIdInput build() {
if (Objects.isNull(this.encryptionContext())) {
throw new IllegalArgumentException("Missing value for required field `encryptionContext`");
}
return new GetBranchKeyIdInput(this);
}
}
}
| 400 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/SingleThreadedCache.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
/**
* A cache that is NOT safe for use in a multi threaded environment.
*/
public class SingleThreadedCache {
/**
* Maximum number of entries cached.
*/
private final int entryCapacity;
/**
* Number of entries to prune at a time.
*/
private final int entryPruningTailSize;
protected SingleThreadedCache(BuilderImpl builder) {
this.entryCapacity = builder.entryCapacity();
this.entryPruningTailSize = builder.entryPruningTailSize();
}
/**
* @return Maximum number of entries cached.
*/
public int entryCapacity() {
return this.entryCapacity;
}
/**
* @return Number of entries to prune at a time.
*/
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param entryCapacity Maximum number of entries cached.
*/
Builder entryCapacity(int entryCapacity);
/**
* @return Maximum number of entries cached.
*/
int entryCapacity();
/**
* @param entryPruningTailSize Number of entries to prune at a time.
*/
Builder entryPruningTailSize(int entryPruningTailSize);
/**
* @return Number of entries to prune at a time.
*/
int entryPruningTailSize();
SingleThreadedCache build();
}
static class BuilderImpl implements Builder {
protected int entryCapacity;
private boolean _entryCapacitySet = false;
protected int entryPruningTailSize;
private boolean _entryPruningTailSizeSet = false;
protected BuilderImpl() {
}
protected BuilderImpl(SingleThreadedCache model) {
this.entryCapacity = model.entryCapacity();
this._entryCapacitySet = true;
this.entryPruningTailSize = model.entryPruningTailSize();
this._entryPruningTailSizeSet = true;
}
public Builder entryCapacity(int entryCapacity) {
this.entryCapacity = entryCapacity;
this._entryCapacitySet = true;
return this;
}
public int entryCapacity() {
return this.entryCapacity;
}
public Builder entryPruningTailSize(int entryPruningTailSize) {
this.entryPruningTailSize = entryPruningTailSize;
this._entryPruningTailSizeSet = true;
return this;
}
public int entryPruningTailSize() {
return this.entryPruningTailSize;
}
public SingleThreadedCache build() {
if (!this._entryCapacitySet) {
throw new IllegalArgumentException("Missing value for required field `entryCapacity`");
}
if (this._entryCapacitySet && this.entryCapacity() < 1) {
throw new IllegalArgumentException("`entryCapacity` must be greater than or equal to 1");
}
if (this._entryPruningTailSizeSet && this.entryPruningTailSize() < 1) {
throw new IllegalArgumentException("`entryPruningTailSize` must be greater than or equal to 1");
}
return new SingleThreadedCache(this);
}
}
}
| 401 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CollectionOfErrors.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
public class CollectionOfErrors extends RuntimeException {
/**
* The list of Exceptions encountered.
*/
private final List<RuntimeException> list;
protected CollectionOfErrors(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
this.list = builder.list();
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
/**
* @return The list of Exceptions encountered.
*/
public List<RuntimeException> list() {
return this.list;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
/**
* @param list The list of Exceptions encountered.
*/
Builder list(List<RuntimeException> list);
/**
* @return The list of Exceptions encountered.
*/
List<RuntimeException> list();
CollectionOfErrors build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected List<RuntimeException> list;
protected BuilderImpl() {
}
protected BuilderImpl(CollectionOfErrors model) {
this.cause = model.getCause();
this.message = model.getMessage();
this.list = model.list();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public Builder list(List<RuntimeException> list) {
this.list = list;
return this;
}
public List<RuntimeException> list() {
return this.list;
}
public CollectionOfErrors build() {
return new CollectionOfErrors(this);
}
}
}
| 402 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/InvalidAlgorithmSuiteInfo.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.Objects;
public class InvalidAlgorithmSuiteInfo extends RuntimeException {
protected InvalidAlgorithmSuiteInfo(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
InvalidAlgorithmSuiteInfo build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(InvalidAlgorithmSuiteInfo model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public InvalidAlgorithmSuiteInfo build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new InvalidAlgorithmSuiteInfo(this);
}
}
}
| 403 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/AwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/model/CreateAwsKmsMrkDiscoveryKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.model;
import java.util.List;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
/**
* Inputs for for creating a AWS KMS MRK Discovery Keyring.
*/
public class CreateAwsKmsMrkDiscoveryKeyringInput {
/**
* The KMS Client this Keyring will use to call KMS.
*/
private final KmsClient kmsClient;
/**
* A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
private final DiscoveryFilter discoveryFilter;
/**
* A list of grant tokens to be used when calling KMS.
*/
private final List<String> grantTokens;
/**
* The region the input 'kmsClient' is in.
*/
private final String region;
protected CreateAwsKmsMrkDiscoveryKeyringInput(BuilderImpl builder) {
this.kmsClient = builder.kmsClient();
this.discoveryFilter = builder.discoveryFilter();
this.grantTokens = builder.grantTokens();
this.region = builder.region();
}
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
public KmsClient kmsClient() {
return this.kmsClient;
}
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
/**
* @return A list of grant tokens to be used when calling KMS.
*/
public List<String> grantTokens() {
return this.grantTokens;
}
/**
* @return The region the input 'kmsClient' is in.
*/
public String region() {
return this.region;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param kmsClient The KMS Client this Keyring will use to call KMS.
*/
Builder kmsClient(KmsClient kmsClient);
/**
* @return The KMS Client this Keyring will use to call KMS.
*/
KmsClient kmsClient();
/**
* @param discoveryFilter A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
Builder discoveryFilter(DiscoveryFilter discoveryFilter);
/**
* @return A filter which restricts which KMS Keys this Keyring may attempt to decrypt with by AWS partition and account.
*/
DiscoveryFilter discoveryFilter();
/**
* @param grantTokens A list of grant tokens to be used when calling KMS.
*/
Builder grantTokens(List<String> grantTokens);
/**
* @return A list of grant tokens to be used when calling KMS.
*/
List<String> grantTokens();
/**
* @param region The region the input 'kmsClient' is in.
*/
Builder region(String region);
/**
* @return The region the input 'kmsClient' is in.
*/
String region();
CreateAwsKmsMrkDiscoveryKeyringInput build();
}
static class BuilderImpl implements Builder {
protected KmsClient kmsClient;
protected DiscoveryFilter discoveryFilter;
protected List<String> grantTokens;
protected String region;
protected BuilderImpl() {
}
protected BuilderImpl(CreateAwsKmsMrkDiscoveryKeyringInput model) {
this.kmsClient = model.kmsClient();
this.discoveryFilter = model.discoveryFilter();
this.grantTokens = model.grantTokens();
this.region = model.region();
}
public Builder kmsClient(KmsClient kmsClient) {
this.kmsClient = kmsClient;
return this;
}
public KmsClient kmsClient() {
return this.kmsClient;
}
public Builder discoveryFilter(DiscoveryFilter discoveryFilter) {
this.discoveryFilter = discoveryFilter;
return this;
}
public DiscoveryFilter discoveryFilter() {
return this.discoveryFilter;
}
public Builder grantTokens(List<String> grantTokens) {
this.grantTokens = grantTokens;
return this;
}
public List<String> grantTokens() {
return this.grantTokens;
}
public Builder region(String region) {
this.region = region;
return this;
}
public String region() {
return this.region;
}
public CreateAwsKmsMrkDiscoveryKeyringInput build() {
if (Objects.isNull(this.kmsClient())) {
throw new IllegalArgumentException("Missing value for required field `kmsClient`");
}
if (Objects.isNull(this.region())) {
throw new IllegalArgumentException("Missing value for required field `region`");
}
return new CreateAwsKmsMrkDiscoveryKeyringInput(this);
}
}
}
| 404 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/java/software/amazon/cryptography/services/kms
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/java/software/amazon/cryptography/services/kms/internaldafny/__default.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Extern code for AWS SDK for Java V2
package software.amazon.cryptography.services.kms.internaldafny;
import dafny.DafnySequence;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkAdvancedClientOption;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.regions.providers.AwsRegionProviderChain;
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.awssdk.services.kms.KmsClientBuilder;
import software.amazon.cryptography.services.kms.internaldafny.types.Error;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
import Wrappers_Compile.Option;
import Wrappers_Compile.Result;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence;
import static software.amazon.smithy.dafny.conversion.ToNative.Simple.String;
public class __default extends software.amazon.cryptography.services.kms.internaldafny._ExternBase___default{
public static Result<IKMSClient, Error> KMSClient() {
try {
final KmsClientBuilder builder = KmsClient.builder();
final AwsRegionProviderChain regionProvider = DefaultAwsRegionProviderChain.builder().build();
final String region = regionProvider.getRegion().toString();
final KmsClient client = builder
.overrideConfiguration(
ClientOverrideConfiguration
.builder()
.putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_SUFFIX, UserAgentSuffix())
.build()
)
.build();
final IKMSClient shim = new Shim(client, region);
return Result.create_Success(shim);
} catch (Exception e) {
Error dafny_error = Error.create_KMSInternalException(
Option.create_Some(CharacterSequence(e.getMessage())));
return Result.create_Failure(dafny_error);
}
}
public static Result<IKMSClient, Error> KMSClientForRegion(
final DafnySequence<? extends Character> region
) {
try {
final String regionString = new String((char[]) region.toArray().unwrap());
final KmsClientBuilder builder = KmsClient.builder();
final KmsClient client = builder
.region(Region.of(regionString))
.overrideConfiguration(
ClientOverrideConfiguration
.builder()
.putAdvancedOption(SdkAdvancedClientOption.USER_AGENT_SUFFIX, UserAgentSuffix())
.build()
)
.build();
final IKMSClient shim = new Shim(client, regionString);
return Result.create_Success(shim);
} catch (Exception e) {
Error dafny_error = Error.create_KMSInternalException(
Option.create_Some(CharacterSequence(e.getMessage())));
return Result.create_Failure(dafny_error);
}
}
public static Wrappers_Compile.Option<Boolean> RegionMatch(
final IKMSClient client,
final DafnySequence<? extends Character> region
) {
// We should never be passing anything other than Shim as the 'client'.
// If this cast fails, that indicates that there is something wrong with
// our code generation.
Shim shim = (Shim) client;
// If the client was created externally we
// have no way to determine what region it is
// configured with.
if (shim.region() == null) {
return Option.create_None();
}
// Otherwise we kept record of the region
// when we created the client.
String shimRegion = shim.region();
String regionStr = String(region);
return Option.create_Some(regionStr.equals(shimRegion));
}
private static String UserAgentSuffix()
{
final DafnySequence<? extends Character> runtime = software.amazon.smithy.dafny.conversion.ToDafny.Simple
.CharacterSequence("Java");
return new String(
(char[]) DafnyUserAgentSuffix(runtime).toArray().unwrap()
);
}
}
| 405 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/java/software/amazon/cryptography/services/kms/internaldafny
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/java/software/amazon/cryptography/services/kms/internaldafny/types/__default.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package software.amazon.cryptography.services.kms.internaldafny.types;
public class __default extends software.amazon.cryptography.services.kms.internaldafny.types._ExternBase___default {}
| 406 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms/internaldafny/ToNative.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.kms.internaldafny;
import dafny.DafnyMap;
import dafny.DafnySequence;
import java.lang.Character;
import java.lang.String;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.awssdk.services.kms.model.AlgorithmSpec;
import software.amazon.awssdk.services.kms.model.AliasListEntry;
import software.amazon.awssdk.services.kms.model.AlreadyExistsException;
import software.amazon.awssdk.services.kms.model.CancelKeyDeletionRequest;
import software.amazon.awssdk.services.kms.model.CancelKeyDeletionResponse;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInUseException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInvalidConfigurationException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotActiveException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotFoundException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotRelatedException;
import software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreRequest;
import software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreResponse;
import software.amazon.awssdk.services.kms.model.ConnectionErrorCodeType;
import software.amazon.awssdk.services.kms.model.ConnectionStateType;
import software.amazon.awssdk.services.kms.model.CreateAliasRequest;
import software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreRequest;
import software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreResponse;
import software.amazon.awssdk.services.kms.model.CreateGrantRequest;
import software.amazon.awssdk.services.kms.model.CreateGrantResponse;
import software.amazon.awssdk.services.kms.model.CreateKeyRequest;
import software.amazon.awssdk.services.kms.model.CreateKeyResponse;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreHasCmKsException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreInvalidStateException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNameInUseException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNotFoundException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoresListEntry;
import software.amazon.awssdk.services.kms.model.CustomerMasterKeySpec;
import software.amazon.awssdk.services.kms.model.DataKeyPairSpec;
import software.amazon.awssdk.services.kms.model.DataKeySpec;
import software.amazon.awssdk.services.kms.model.DecryptRequest;
import software.amazon.awssdk.services.kms.model.DecryptResponse;
import software.amazon.awssdk.services.kms.model.DeleteAliasRequest;
import software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreRequest;
import software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreResponse;
import software.amazon.awssdk.services.kms.model.DeleteImportedKeyMaterialRequest;
import software.amazon.awssdk.services.kms.model.DependencyTimeoutException;
import software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresRequest;
import software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresResponse;
import software.amazon.awssdk.services.kms.model.DescribeKeyRequest;
import software.amazon.awssdk.services.kms.model.DescribeKeyResponse;
import software.amazon.awssdk.services.kms.model.DisableKeyRequest;
import software.amazon.awssdk.services.kms.model.DisableKeyRotationRequest;
import software.amazon.awssdk.services.kms.model.DisabledException;
import software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreRequest;
import software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreResponse;
import software.amazon.awssdk.services.kms.model.EnableKeyRequest;
import software.amazon.awssdk.services.kms.model.EnableKeyRotationRequest;
import software.amazon.awssdk.services.kms.model.EncryptRequest;
import software.amazon.awssdk.services.kms.model.EncryptResponse;
import software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec;
import software.amazon.awssdk.services.kms.model.ExpirationModelType;
import software.amazon.awssdk.services.kms.model.ExpiredImportTokenException;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyPairRequest;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyPairResponse;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextRequest;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextResponse;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyRequest;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyResponse;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextRequest;
import software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextResponse;
import software.amazon.awssdk.services.kms.model.GenerateRandomRequest;
import software.amazon.awssdk.services.kms.model.GenerateRandomResponse;
import software.amazon.awssdk.services.kms.model.GetKeyPolicyRequest;
import software.amazon.awssdk.services.kms.model.GetKeyPolicyResponse;
import software.amazon.awssdk.services.kms.model.GetKeyRotationStatusRequest;
import software.amazon.awssdk.services.kms.model.GetKeyRotationStatusResponse;
import software.amazon.awssdk.services.kms.model.GetParametersForImportRequest;
import software.amazon.awssdk.services.kms.model.GetParametersForImportResponse;
import software.amazon.awssdk.services.kms.model.GetPublicKeyRequest;
import software.amazon.awssdk.services.kms.model.GetPublicKeyResponse;
import software.amazon.awssdk.services.kms.model.GrantConstraints;
import software.amazon.awssdk.services.kms.model.GrantListEntry;
import software.amazon.awssdk.services.kms.model.GrantOperation;
import software.amazon.awssdk.services.kms.model.ImportKeyMaterialRequest;
import software.amazon.awssdk.services.kms.model.ImportKeyMaterialResponse;
import software.amazon.awssdk.services.kms.model.IncorrectKeyException;
import software.amazon.awssdk.services.kms.model.IncorrectKeyMaterialException;
import software.amazon.awssdk.services.kms.model.IncorrectTrustAnchorException;
import software.amazon.awssdk.services.kms.model.InvalidAliasNameException;
import software.amazon.awssdk.services.kms.model.InvalidArnException;
import software.amazon.awssdk.services.kms.model.InvalidCiphertextException;
import software.amazon.awssdk.services.kms.model.InvalidGrantIdException;
import software.amazon.awssdk.services.kms.model.InvalidGrantTokenException;
import software.amazon.awssdk.services.kms.model.InvalidImportTokenException;
import software.amazon.awssdk.services.kms.model.InvalidKeyUsageException;
import software.amazon.awssdk.services.kms.model.InvalidMarkerException;
import software.amazon.awssdk.services.kms.model.KeyManagerType;
import software.amazon.awssdk.services.kms.model.KeyMetadata;
import software.amazon.awssdk.services.kms.model.KeySpec;
import software.amazon.awssdk.services.kms.model.KeyState;
import software.amazon.awssdk.services.kms.model.KeyUnavailableException;
import software.amazon.awssdk.services.kms.model.KeyUsageType;
// BEGIN MANUAL EDIT
import software.amazon.awssdk.services.kms.model.KmsException;
// END MANUAL EDIT
import software.amazon.awssdk.services.kms.model.KmsInternalException;
import software.amazon.awssdk.services.kms.model.KmsInvalidSignatureException;
import software.amazon.awssdk.services.kms.model.KmsInvalidStateException;
import software.amazon.awssdk.services.kms.model.LimitExceededException;
import software.amazon.awssdk.services.kms.model.ListAliasesRequest;
import software.amazon.awssdk.services.kms.model.ListAliasesResponse;
import software.amazon.awssdk.services.kms.model.ListGrantsRequest;
import software.amazon.awssdk.services.kms.model.ListGrantsResponse;
import software.amazon.awssdk.services.kms.model.ListKeyPoliciesRequest;
import software.amazon.awssdk.services.kms.model.ListKeyPoliciesResponse;
import software.amazon.awssdk.services.kms.model.ListResourceTagsRequest;
import software.amazon.awssdk.services.kms.model.ListResourceTagsResponse;
import software.amazon.awssdk.services.kms.model.MalformedPolicyDocumentException;
import software.amazon.awssdk.services.kms.model.MessageType;
import software.amazon.awssdk.services.kms.model.MultiRegionConfiguration;
import software.amazon.awssdk.services.kms.model.MultiRegionKey;
import software.amazon.awssdk.services.kms.model.MultiRegionKeyType;
import software.amazon.awssdk.services.kms.model.NotFoundException;
import software.amazon.awssdk.services.kms.model.OriginType;
import software.amazon.awssdk.services.kms.model.PutKeyPolicyRequest;
import software.amazon.awssdk.services.kms.model.ReEncryptRequest;
import software.amazon.awssdk.services.kms.model.ReEncryptResponse;
import software.amazon.awssdk.services.kms.model.ReplicateKeyRequest;
import software.amazon.awssdk.services.kms.model.ReplicateKeyResponse;
import software.amazon.awssdk.services.kms.model.RetireGrantRequest;
import software.amazon.awssdk.services.kms.model.RevokeGrantRequest;
import software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionRequest;
import software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionResponse;
import software.amazon.awssdk.services.kms.model.SignRequest;
import software.amazon.awssdk.services.kms.model.SignResponse;
import software.amazon.awssdk.services.kms.model.SigningAlgorithmSpec;
import software.amazon.awssdk.services.kms.model.Tag;
import software.amazon.awssdk.services.kms.model.TagException;
import software.amazon.awssdk.services.kms.model.TagResourceRequest;
import software.amazon.awssdk.services.kms.model.UnsupportedOperationException;
import software.amazon.awssdk.services.kms.model.UntagResourceRequest;
import software.amazon.awssdk.services.kms.model.UpdateAliasRequest;
import software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreRequest;
import software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreResponse;
import software.amazon.awssdk.services.kms.model.UpdateKeyDescriptionRequest;
import software.amazon.awssdk.services.kms.model.UpdatePrimaryRegionRequest;
import software.amazon.awssdk.services.kms.model.VerifyRequest;
import software.amazon.awssdk.services.kms.model.VerifyResponse;
import software.amazon.awssdk.services.kms.model.WrappingKeySpec;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_AlreadyExistsException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterInUseException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterInvalidConfigurationException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotActiveException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotRelatedException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreHasCMKsException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreInvalidStateException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreNameInUseException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreNotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_DependencyTimeoutException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_DisabledException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_ExpiredImportTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectKeyException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectKeyMaterialException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectTrustAnchorException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidAliasNameException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidArnException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidCiphertextException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidGrantIdException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidGrantTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidImportTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidKeyUsageException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidMarkerException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInternalException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInvalidSignatureException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInvalidStateException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KeyUnavailableException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_LimitExceededException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_MalformedPolicyDocumentException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_NotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_TagException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_UnsupportedOperationException;
// BEGIN MANUAL EDIT
import software.amazon.cryptography.services.kms.internaldafny.types.Error_Opaque;
// END MANUAL EDIT
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
public class ToNative {
// BEGIN MANUAL EDIT
public static RuntimeException Error(Error_Opaque dafnyValue) {
if (dafnyValue.dtor_obj() instanceof KmsException) {
return (KmsException) dafnyValue.dtor_obj();
}
// Because we only ever put `KmsException` into `Error_Opaque`,
// recieving any other type here indicates a bug with the codegen.
// Bubble up some error to indicate this failure state.
return new IllegalStateException("Unknown error recieved from KMS.");
}
// END MANUAL EDIT
public static AlgorithmSpec AlgorithmSpec(
software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec dafnyValue) {
if (dafnyValue.is_RSAES__PKCS1__V1__5()) {
return AlgorithmSpec.RSAES_PKCS1_V1_5;
}
if (dafnyValue.is_RSAES__OAEP__SHA__1()) {
return AlgorithmSpec.RSAES_OAEP_SHA_1;
}
if (dafnyValue.is_RSAES__OAEP__SHA__256()) {
return AlgorithmSpec.RSAES_OAEP_SHA_256;
}
return AlgorithmSpec.fromValue(dafnyValue.toString());
}
public static List<AliasListEntry> AliasList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.AliasListEntry> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::AliasListEntry);
}
public static AliasListEntry AliasListEntry(
software.amazon.cryptography.services.kms.internaldafny.types.AliasListEntry dafnyValue) {
AliasListEntry.Builder builder = AliasListEntry.builder();
if (dafnyValue.dtor_AliasArn().is_Some()) {
builder.aliasArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AliasArn().dtor_value()));
}
if (dafnyValue.dtor_AliasName().is_Some()) {
builder.aliasName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AliasName().dtor_value()));
}
if (dafnyValue.dtor_CreationDate().is_Some()) {
builder.creationDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDate().dtor_value()));
}
if (dafnyValue.dtor_LastUpdatedDate().is_Some()) {
builder.lastUpdatedDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastUpdatedDate().dtor_value()));
}
if (dafnyValue.dtor_TargetKeyId().is_Some()) {
builder.targetKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TargetKeyId().dtor_value()));
}
return builder.build();
}
public static CancelKeyDeletionRequest CancelKeyDeletionRequest(
software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionRequest dafnyValue) {
CancelKeyDeletionRequest.Builder builder = CancelKeyDeletionRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static CancelKeyDeletionResponse CancelKeyDeletionResponse(
software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionResponse dafnyValue) {
CancelKeyDeletionResponse.Builder builder = CancelKeyDeletionResponse.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
return builder.build();
}
public static ConnectCustomKeyStoreRequest ConnectCustomKeyStoreRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreRequest dafnyValue) {
ConnectCustomKeyStoreRequest.Builder builder = ConnectCustomKeyStoreRequest.builder();
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId()));
return builder.build();
}
public static ConnectCustomKeyStoreResponse ConnectCustomKeyStoreResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreResponse dafnyValue) {
return ConnectCustomKeyStoreResponse.builder().build();
}
public static ConnectionErrorCodeType ConnectionErrorCodeType(
software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType dafnyValue) {
if (dafnyValue.is_INVALID__CREDENTIALS()) {
return ConnectionErrorCodeType.INVALID_CREDENTIALS;
}
if (dafnyValue.is_CLUSTER__NOT__FOUND()) {
return ConnectionErrorCodeType.CLUSTER_NOT_FOUND;
}
if (dafnyValue.is_NETWORK__ERRORS()) {
return ConnectionErrorCodeType.NETWORK_ERRORS;
}
if (dafnyValue.is_INTERNAL__ERROR()) {
return ConnectionErrorCodeType.INTERNAL_ERROR;
}
if (dafnyValue.is_INSUFFICIENT__CLOUDHSM__HSMS()) {
return ConnectionErrorCodeType.INSUFFICIENT_CLOUDHSM_HSMS;
}
if (dafnyValue.is_USER__LOCKED__OUT()) {
return ConnectionErrorCodeType.USER_LOCKED_OUT;
}
if (dafnyValue.is_USER__NOT__FOUND()) {
return ConnectionErrorCodeType.USER_NOT_FOUND;
}
if (dafnyValue.is_USER__LOGGED__IN()) {
return ConnectionErrorCodeType.USER_LOGGED_IN;
}
if (dafnyValue.is_SUBNET__NOT__FOUND()) {
return ConnectionErrorCodeType.SUBNET_NOT_FOUND;
}
return ConnectionErrorCodeType.fromValue(dafnyValue.toString());
}
public static ConnectionStateType ConnectionStateType(
software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType dafnyValue) {
if (dafnyValue.is_CONNECTED()) {
return ConnectionStateType.CONNECTED;
}
if (dafnyValue.is_CONNECTING()) {
return ConnectionStateType.CONNECTING;
}
if (dafnyValue.is_FAILED()) {
return ConnectionStateType.FAILED;
}
if (dafnyValue.is_DISCONNECTED()) {
return ConnectionStateType.DISCONNECTED;
}
if (dafnyValue.is_DISCONNECTING()) {
return ConnectionStateType.DISCONNECTING;
}
return ConnectionStateType.fromValue(dafnyValue.toString());
}
public static CreateAliasRequest CreateAliasRequest(
software.amazon.cryptography.services.kms.internaldafny.types.CreateAliasRequest dafnyValue) {
CreateAliasRequest.Builder builder = CreateAliasRequest.builder();
builder.aliasName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AliasName()));
builder.targetKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TargetKeyId()));
return builder.build();
}
public static CreateCustomKeyStoreRequest CreateCustomKeyStoreRequest(
software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreRequest dafnyValue) {
CreateCustomKeyStoreRequest.Builder builder = CreateCustomKeyStoreRequest.builder();
builder.cloudHsmClusterId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudHsmClusterId()));
builder.customKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreName()));
builder.keyStorePassword(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyStorePassword()));
builder.trustAnchorCertificate(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TrustAnchorCertificate()));
return builder.build();
}
public static CreateCustomKeyStoreResponse CreateCustomKeyStoreResponse(
software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreResponse dafnyValue) {
CreateCustomKeyStoreResponse.Builder builder = CreateCustomKeyStoreResponse.builder();
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
return builder.build();
}
public static CreateGrantRequest CreateGrantRequest(
software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantRequest dafnyValue) {
CreateGrantRequest.Builder builder = CreateGrantRequest.builder();
if (dafnyValue.dtor_Constraints().is_Some()) {
builder.constraints(ToNative.GrantConstraints(dafnyValue.dtor_Constraints().dtor_value()));
}
builder.granteePrincipal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GranteePrincipal()));
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_Name().is_Some()) {
builder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Name().dtor_value()));
}
builder.operations(ToNative.GrantOperationList(dafnyValue.dtor_Operations()));
if (dafnyValue.dtor_RetiringPrincipal().is_Some()) {
builder.retiringPrincipal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RetiringPrincipal().dtor_value()));
}
return builder.build();
}
public static CreateGrantResponse CreateGrantResponse(
software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantResponse dafnyValue) {
CreateGrantResponse.Builder builder = CreateGrantResponse.builder();
if (dafnyValue.dtor_GrantId().is_Some()) {
builder.grantId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantId().dtor_value()));
}
if (dafnyValue.dtor_GrantToken().is_Some()) {
builder.grantToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantToken().dtor_value()));
}
return builder.build();
}
public static CreateKeyRequest CreateKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyRequest dafnyValue) {
CreateKeyRequest.Builder builder = CreateKeyRequest.builder();
if (dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().is_Some()) {
builder.bypassPolicyLockoutSafetyCheck((dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().dtor_value()));
}
if (dafnyValue.dtor_CustomerMasterKeySpec().is_Some()) {
builder.customerMasterKeySpec(ToNative.CustomerMasterKeySpec(dafnyValue.dtor_CustomerMasterKeySpec().dtor_value()));
}
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
if (dafnyValue.dtor_Description().is_Some()) {
builder.description(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Description().dtor_value()));
}
if (dafnyValue.dtor_KeySpec().is_Some()) {
builder.keySpec(ToNative.KeySpec(dafnyValue.dtor_KeySpec().dtor_value()));
}
if (dafnyValue.dtor_KeyUsage().is_Some()) {
builder.keyUsage(ToNative.KeyUsageType(dafnyValue.dtor_KeyUsage().dtor_value()));
}
if (dafnyValue.dtor_MultiRegion().is_Some()) {
builder.multiRegion((dafnyValue.dtor_MultiRegion().dtor_value()));
}
if (dafnyValue.dtor_Origin().is_Some()) {
builder.origin(ToNative.OriginType(dafnyValue.dtor_Origin().dtor_value()));
}
if (dafnyValue.dtor_Policy().is_Some()) {
builder.policy(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Policy().dtor_value()));
}
if (dafnyValue.dtor_Tags().is_Some()) {
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags().dtor_value()));
}
return builder.build();
}
public static CreateKeyResponse CreateKeyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyResponse dafnyValue) {
CreateKeyResponse.Builder builder = CreateKeyResponse.builder();
if (dafnyValue.dtor_KeyMetadata().is_Some()) {
builder.keyMetadata(ToNative.KeyMetadata(dafnyValue.dtor_KeyMetadata().dtor_value()));
}
return builder.build();
}
public static CustomerMasterKeySpec CustomerMasterKeySpec(
software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec dafnyValue) {
if (dafnyValue.is_RSA__2048()) {
return CustomerMasterKeySpec.RSA_2048;
}
if (dafnyValue.is_RSA__3072()) {
return CustomerMasterKeySpec.RSA_3072;
}
if (dafnyValue.is_RSA__4096()) {
return CustomerMasterKeySpec.RSA_4096;
}
if (dafnyValue.is_ECC__NIST__P256()) {
return CustomerMasterKeySpec.ECC_NIST_P256;
}
if (dafnyValue.is_ECC__NIST__P384()) {
return CustomerMasterKeySpec.ECC_NIST_P384;
}
if (dafnyValue.is_ECC__NIST__P521()) {
return CustomerMasterKeySpec.ECC_NIST_P521;
}
if (dafnyValue.is_ECC__SECG__P256K1()) {
return CustomerMasterKeySpec.ECC_SECG_P256_K1;
}
if (dafnyValue.is_SYMMETRIC__DEFAULT()) {
return CustomerMasterKeySpec.SYMMETRIC_DEFAULT;
}
return CustomerMasterKeySpec.fromValue(dafnyValue.toString());
}
public static List<CustomKeyStoresListEntry> CustomKeyStoresList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoresListEntry> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::CustomKeyStoresListEntry);
}
public static CustomKeyStoresListEntry CustomKeyStoresListEntry(
software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoresListEntry dafnyValue) {
CustomKeyStoresListEntry.Builder builder = CustomKeyStoresListEntry.builder();
if (dafnyValue.dtor_CloudHsmClusterId().is_Some()) {
builder.cloudHsmClusterId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudHsmClusterId().dtor_value()));
}
if (dafnyValue.dtor_ConnectionErrorCode().is_Some()) {
builder.connectionErrorCode(ToNative.ConnectionErrorCodeType(dafnyValue.dtor_ConnectionErrorCode().dtor_value()));
}
if (dafnyValue.dtor_ConnectionState().is_Some()) {
builder.connectionState(ToNative.ConnectionStateType(dafnyValue.dtor_ConnectionState().dtor_value()));
}
if (dafnyValue.dtor_CreationDate().is_Some()) {
builder.creationDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDate().dtor_value()));
}
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
if (dafnyValue.dtor_CustomKeyStoreName().is_Some()) {
builder.customKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreName().dtor_value()));
}
if (dafnyValue.dtor_TrustAnchorCertificate().is_Some()) {
builder.trustAnchorCertificate(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TrustAnchorCertificate().dtor_value()));
}
return builder.build();
}
public static DataKeyPairSpec DataKeyPairSpec(
software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec dafnyValue) {
if (dafnyValue.is_RSA__2048()) {
return DataKeyPairSpec.RSA_2048;
}
if (dafnyValue.is_RSA__3072()) {
return DataKeyPairSpec.RSA_3072;
}
if (dafnyValue.is_RSA__4096()) {
return DataKeyPairSpec.RSA_4096;
}
if (dafnyValue.is_ECC__NIST__P256()) {
return DataKeyPairSpec.ECC_NIST_P256;
}
if (dafnyValue.is_ECC__NIST__P384()) {
return DataKeyPairSpec.ECC_NIST_P384;
}
if (dafnyValue.is_ECC__NIST__P521()) {
return DataKeyPairSpec.ECC_NIST_P521;
}
if (dafnyValue.is_ECC__SECG__P256K1()) {
return DataKeyPairSpec.ECC_SECG_P256_K1;
}
return DataKeyPairSpec.fromValue(dafnyValue.toString());
}
public static DataKeySpec DataKeySpec(
software.amazon.cryptography.services.kms.internaldafny.types.DataKeySpec dafnyValue) {
if (dafnyValue.is_AES__256()) {
return DataKeySpec.AES_256;
}
if (dafnyValue.is_AES__128()) {
return DataKeySpec.AES_128;
}
return DataKeySpec.fromValue(dafnyValue.toString());
}
public static DecryptRequest DecryptRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DecryptRequest dafnyValue) {
DecryptRequest.Builder builder = DecryptRequest.builder();
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().toRawArray())));
if (dafnyValue.dtor_EncryptionAlgorithm().is_Some()) {
builder.encryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_EncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
return builder.build();
}
public static DecryptResponse DecryptResponse(
software.amazon.cryptography.services.kms.internaldafny.types.DecryptResponse dafnyValue) {
DecryptResponse.Builder builder = DecryptResponse.builder();
if (dafnyValue.dtor_EncryptionAlgorithm().is_Some()) {
builder.encryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_EncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_Plaintext().is_Some()) {
builder.plaintext(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Plaintext().dtor_value().toRawArray())));
}
return builder.build();
}
public static DeleteAliasRequest DeleteAliasRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DeleteAliasRequest dafnyValue) {
DeleteAliasRequest.Builder builder = DeleteAliasRequest.builder();
builder.aliasName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AliasName()));
return builder.build();
}
public static DeleteCustomKeyStoreRequest DeleteCustomKeyStoreRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreRequest dafnyValue) {
DeleteCustomKeyStoreRequest.Builder builder = DeleteCustomKeyStoreRequest.builder();
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId()));
return builder.build();
}
public static DeleteCustomKeyStoreResponse DeleteCustomKeyStoreResponse(
software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreResponse dafnyValue) {
return DeleteCustomKeyStoreResponse.builder().build();
}
public static DeleteImportedKeyMaterialRequest DeleteImportedKeyMaterialRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DeleteImportedKeyMaterialRequest dafnyValue) {
DeleteImportedKeyMaterialRequest.Builder builder = DeleteImportedKeyMaterialRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static DescribeCustomKeyStoresRequest DescribeCustomKeyStoresRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresRequest dafnyValue) {
DescribeCustomKeyStoresRequest.Builder builder = DescribeCustomKeyStoresRequest.builder();
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
if (dafnyValue.dtor_CustomKeyStoreName().is_Some()) {
builder.customKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreName().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_Marker().is_Some()) {
builder.marker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Marker().dtor_value()));
}
return builder.build();
}
public static DescribeCustomKeyStoresResponse DescribeCustomKeyStoresResponse(
software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresResponse dafnyValue) {
DescribeCustomKeyStoresResponse.Builder builder = DescribeCustomKeyStoresResponse.builder();
if (dafnyValue.dtor_CustomKeyStores().is_Some()) {
builder.customKeyStores(ToNative.CustomKeyStoresList(dafnyValue.dtor_CustomKeyStores().dtor_value()));
}
if (dafnyValue.dtor_NextMarker().is_Some()) {
builder.nextMarker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextMarker().dtor_value()));
}
if (dafnyValue.dtor_Truncated().is_Some()) {
builder.truncated((dafnyValue.dtor_Truncated().dtor_value()));
}
return builder.build();
}
public static DescribeKeyRequest DescribeKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyRequest dafnyValue) {
DescribeKeyRequest.Builder builder = DescribeKeyRequest.builder();
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static DescribeKeyResponse DescribeKeyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyResponse dafnyValue) {
DescribeKeyResponse.Builder builder = DescribeKeyResponse.builder();
if (dafnyValue.dtor_KeyMetadata().is_Some()) {
builder.keyMetadata(ToNative.KeyMetadata(dafnyValue.dtor_KeyMetadata().dtor_value()));
}
return builder.build();
}
public static DisableKeyRequest DisableKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRequest dafnyValue) {
DisableKeyRequest.Builder builder = DisableKeyRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static DisableKeyRotationRequest DisableKeyRotationRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRotationRequest dafnyValue) {
DisableKeyRotationRequest.Builder builder = DisableKeyRotationRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static DisconnectCustomKeyStoreRequest DisconnectCustomKeyStoreRequest(
software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreRequest dafnyValue) {
DisconnectCustomKeyStoreRequest.Builder builder = DisconnectCustomKeyStoreRequest.builder();
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId()));
return builder.build();
}
public static DisconnectCustomKeyStoreResponse DisconnectCustomKeyStoreResponse(
software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreResponse dafnyValue) {
return DisconnectCustomKeyStoreResponse.builder().build();
}
public static EnableKeyRequest EnableKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRequest dafnyValue) {
EnableKeyRequest.Builder builder = EnableKeyRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static EnableKeyRotationRequest EnableKeyRotationRequest(
software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRotationRequest dafnyValue) {
EnableKeyRotationRequest.Builder builder = EnableKeyRotationRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static EncryptionAlgorithmSpec EncryptionAlgorithmSpec(
software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec dafnyValue) {
if (dafnyValue.is_SYMMETRIC__DEFAULT()) {
return EncryptionAlgorithmSpec.SYMMETRIC_DEFAULT;
}
if (dafnyValue.is_RSAES__OAEP__SHA__1()) {
return EncryptionAlgorithmSpec.RSAES_OAEP_SHA_1;
}
if (dafnyValue.is_RSAES__OAEP__SHA__256()) {
return EncryptionAlgorithmSpec.RSAES_OAEP_SHA_256;
}
return EncryptionAlgorithmSpec.fromValue(dafnyValue.toString());
}
public static List<EncryptionAlgorithmSpec> EncryptionAlgorithmSpecList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::EncryptionAlgorithmSpec);
}
public static Map<String, String> EncryptionContextType(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static EncryptRequest EncryptRequest(
software.amazon.cryptography.services.kms.internaldafny.types.EncryptRequest dafnyValue) {
EncryptRequest.Builder builder = EncryptRequest.builder();
if (dafnyValue.dtor_EncryptionAlgorithm().is_Some()) {
builder.encryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_EncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.plaintext(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Plaintext().toRawArray())));
return builder.build();
}
public static EncryptResponse EncryptResponse(
software.amazon.cryptography.services.kms.internaldafny.types.EncryptResponse dafnyValue) {
EncryptResponse.Builder builder = EncryptResponse.builder();
if (dafnyValue.dtor_CiphertextBlob().is_Some()) {
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_EncryptionAlgorithm().is_Some()) {
builder.encryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_EncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
return builder.build();
}
public static ExpirationModelType ExpirationModelType(
software.amazon.cryptography.services.kms.internaldafny.types.ExpirationModelType dafnyValue) {
if (dafnyValue.is_KEY__MATERIAL__EXPIRES()) {
return ExpirationModelType.KEY_MATERIAL_EXPIRES;
}
if (dafnyValue.is_KEY__MATERIAL__DOES__NOT__EXPIRE()) {
return ExpirationModelType.KEY_MATERIAL_DOES_NOT_EXPIRE;
}
return ExpirationModelType.fromValue(dafnyValue.toString());
}
public static GenerateDataKeyPairRequest GenerateDataKeyPairRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairRequest dafnyValue) {
GenerateDataKeyPairRequest.Builder builder = GenerateDataKeyPairRequest.builder();
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.keyPairSpec(ToNative.DataKeyPairSpec(dafnyValue.dtor_KeyPairSpec()));
return builder.build();
}
public static GenerateDataKeyPairResponse GenerateDataKeyPairResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairResponse dafnyValue) {
GenerateDataKeyPairResponse.Builder builder = GenerateDataKeyPairResponse.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_KeyPairSpec().is_Some()) {
builder.keyPairSpec(ToNative.DataKeyPairSpec(dafnyValue.dtor_KeyPairSpec().dtor_value()));
}
if (dafnyValue.dtor_PrivateKeyCiphertextBlob().is_Some()) {
builder.privateKeyCiphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PrivateKeyCiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_PrivateKeyPlaintext().is_Some()) {
builder.privateKeyPlaintext(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PrivateKeyPlaintext().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_PublicKey().is_Some()) {
builder.publicKey(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PublicKey().dtor_value().toRawArray())));
}
return builder.build();
}
public static GenerateDataKeyPairWithoutPlaintextRequest GenerateDataKeyPairWithoutPlaintextRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextRequest dafnyValue) {
GenerateDataKeyPairWithoutPlaintextRequest.Builder builder = GenerateDataKeyPairWithoutPlaintextRequest.builder();
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.keyPairSpec(ToNative.DataKeyPairSpec(dafnyValue.dtor_KeyPairSpec()));
return builder.build();
}
public static GenerateDataKeyPairWithoutPlaintextResponse GenerateDataKeyPairWithoutPlaintextResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextResponse dafnyValue) {
GenerateDataKeyPairWithoutPlaintextResponse.Builder builder = GenerateDataKeyPairWithoutPlaintextResponse.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_KeyPairSpec().is_Some()) {
builder.keyPairSpec(ToNative.DataKeyPairSpec(dafnyValue.dtor_KeyPairSpec().dtor_value()));
}
if (dafnyValue.dtor_PrivateKeyCiphertextBlob().is_Some()) {
builder.privateKeyCiphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PrivateKeyCiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_PublicKey().is_Some()) {
builder.publicKey(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PublicKey().dtor_value().toRawArray())));
}
return builder.build();
}
public static GenerateDataKeyRequest GenerateDataKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyRequest dafnyValue) {
GenerateDataKeyRequest.Builder builder = GenerateDataKeyRequest.builder();
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_KeySpec().is_Some()) {
builder.keySpec(ToNative.DataKeySpec(dafnyValue.dtor_KeySpec().dtor_value()));
}
if (dafnyValue.dtor_NumberOfBytes().is_Some()) {
builder.numberOfBytes((dafnyValue.dtor_NumberOfBytes().dtor_value()));
}
return builder.build();
}
public static GenerateDataKeyResponse GenerateDataKeyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyResponse dafnyValue) {
GenerateDataKeyResponse.Builder builder = GenerateDataKeyResponse.builder();
if (dafnyValue.dtor_CiphertextBlob().is_Some()) {
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_Plaintext().is_Some()) {
builder.plaintext(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Plaintext().dtor_value().toRawArray())));
}
return builder.build();
}
public static GenerateDataKeyWithoutPlaintextRequest GenerateDataKeyWithoutPlaintextRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextRequest dafnyValue) {
GenerateDataKeyWithoutPlaintextRequest.Builder builder = GenerateDataKeyWithoutPlaintextRequest.builder();
if (dafnyValue.dtor_EncryptionContext().is_Some()) {
builder.encryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_KeySpec().is_Some()) {
builder.keySpec(ToNative.DataKeySpec(dafnyValue.dtor_KeySpec().dtor_value()));
}
if (dafnyValue.dtor_NumberOfBytes().is_Some()) {
builder.numberOfBytes((dafnyValue.dtor_NumberOfBytes().dtor_value()));
}
return builder.build();
}
public static GenerateDataKeyWithoutPlaintextResponse GenerateDataKeyWithoutPlaintextResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextResponse dafnyValue) {
GenerateDataKeyWithoutPlaintextResponse.Builder builder = GenerateDataKeyWithoutPlaintextResponse.builder();
if (dafnyValue.dtor_CiphertextBlob().is_Some()) {
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
return builder.build();
}
public static GenerateRandomRequest GenerateRandomRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomRequest dafnyValue) {
GenerateRandomRequest.Builder builder = GenerateRandomRequest.builder();
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
if (dafnyValue.dtor_NumberOfBytes().is_Some()) {
builder.numberOfBytes((dafnyValue.dtor_NumberOfBytes().dtor_value()));
}
return builder.build();
}
public static GenerateRandomResponse GenerateRandomResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomResponse dafnyValue) {
GenerateRandomResponse.Builder builder = GenerateRandomResponse.builder();
if (dafnyValue.dtor_Plaintext().is_Some()) {
builder.plaintext(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Plaintext().dtor_value().toRawArray())));
}
return builder.build();
}
public static GetKeyPolicyRequest GetKeyPolicyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyRequest dafnyValue) {
GetKeyPolicyRequest.Builder builder = GetKeyPolicyRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.policyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_PolicyName()));
return builder.build();
}
public static GetKeyPolicyResponse GetKeyPolicyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyResponse dafnyValue) {
GetKeyPolicyResponse.Builder builder = GetKeyPolicyResponse.builder();
if (dafnyValue.dtor_Policy().is_Some()) {
builder.policy(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Policy().dtor_value()));
}
return builder.build();
}
public static GetKeyRotationStatusRequest GetKeyRotationStatusRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusRequest dafnyValue) {
GetKeyRotationStatusRequest.Builder builder = GetKeyRotationStatusRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static GetKeyRotationStatusResponse GetKeyRotationStatusResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusResponse dafnyValue) {
GetKeyRotationStatusResponse.Builder builder = GetKeyRotationStatusResponse.builder();
if (dafnyValue.dtor_KeyRotationEnabled().is_Some()) {
builder.keyRotationEnabled((dafnyValue.dtor_KeyRotationEnabled().dtor_value()));
}
return builder.build();
}
public static GetParametersForImportRequest GetParametersForImportRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportRequest dafnyValue) {
GetParametersForImportRequest.Builder builder = GetParametersForImportRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.wrappingAlgorithm(ToNative.AlgorithmSpec(dafnyValue.dtor_WrappingAlgorithm()));
builder.wrappingKeySpec(ToNative.WrappingKeySpec(dafnyValue.dtor_WrappingKeySpec()));
return builder.build();
}
public static GetParametersForImportResponse GetParametersForImportResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportResponse dafnyValue) {
GetParametersForImportResponse.Builder builder = GetParametersForImportResponse.builder();
if (dafnyValue.dtor_ImportToken().is_Some()) {
builder.importToken(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_ImportToken().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_ParametersValidTo().is_Some()) {
builder.parametersValidTo(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ParametersValidTo().dtor_value()));
}
if (dafnyValue.dtor_PublicKey().is_Some()) {
builder.publicKey(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PublicKey().dtor_value().toRawArray())));
}
return builder.build();
}
public static GetPublicKeyRequest GetPublicKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyRequest dafnyValue) {
GetPublicKeyRequest.Builder builder = GetPublicKeyRequest.builder();
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static GetPublicKeyResponse GetPublicKeyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyResponse dafnyValue) {
GetPublicKeyResponse.Builder builder = GetPublicKeyResponse.builder();
if (dafnyValue.dtor_CustomerMasterKeySpec().is_Some()) {
builder.customerMasterKeySpec(ToNative.CustomerMasterKeySpec(dafnyValue.dtor_CustomerMasterKeySpec().dtor_value()));
}
if (dafnyValue.dtor_EncryptionAlgorithms().is_Some()) {
builder.encryptionAlgorithms(ToNative.EncryptionAlgorithmSpecList(dafnyValue.dtor_EncryptionAlgorithms().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_KeySpec().is_Some()) {
builder.keySpec(ToNative.KeySpec(dafnyValue.dtor_KeySpec().dtor_value()));
}
if (dafnyValue.dtor_KeyUsage().is_Some()) {
builder.keyUsage(ToNative.KeyUsageType(dafnyValue.dtor_KeyUsage().dtor_value()));
}
if (dafnyValue.dtor_PublicKey().is_Some()) {
builder.publicKey(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_PublicKey().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_SigningAlgorithms().is_Some()) {
builder.signingAlgorithms(ToNative.SigningAlgorithmSpecList(dafnyValue.dtor_SigningAlgorithms().dtor_value()));
}
return builder.build();
}
public static GrantConstraints GrantConstraints(
software.amazon.cryptography.services.kms.internaldafny.types.GrantConstraints dafnyValue) {
GrantConstraints.Builder builder = GrantConstraints.builder();
if (dafnyValue.dtor_EncryptionContextEquals().is_Some()) {
builder.encryptionContextEquals(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContextEquals().dtor_value()));
}
if (dafnyValue.dtor_EncryptionContextSubset().is_Some()) {
builder.encryptionContextSubset(ToNative.EncryptionContextType(dafnyValue.dtor_EncryptionContextSubset().dtor_value()));
}
return builder.build();
}
public static List<GrantListEntry> GrantList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.GrantListEntry> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::GrantListEntry);
}
public static GrantListEntry GrantListEntry(
software.amazon.cryptography.services.kms.internaldafny.types.GrantListEntry dafnyValue) {
GrantListEntry.Builder builder = GrantListEntry.builder();
if (dafnyValue.dtor_Constraints().is_Some()) {
builder.constraints(ToNative.GrantConstraints(dafnyValue.dtor_Constraints().dtor_value()));
}
if (dafnyValue.dtor_CreationDate().is_Some()) {
builder.creationDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDate().dtor_value()));
}
if (dafnyValue.dtor_GranteePrincipal().is_Some()) {
builder.granteePrincipal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GranteePrincipal().dtor_value()));
}
if (dafnyValue.dtor_GrantId().is_Some()) {
builder.grantId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantId().dtor_value()));
}
if (dafnyValue.dtor_IssuingAccount().is_Some()) {
builder.issuingAccount(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IssuingAccount().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_Name().is_Some()) {
builder.name(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Name().dtor_value()));
}
if (dafnyValue.dtor_Operations().is_Some()) {
builder.operations(ToNative.GrantOperationList(dafnyValue.dtor_Operations().dtor_value()));
}
if (dafnyValue.dtor_RetiringPrincipal().is_Some()) {
builder.retiringPrincipal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RetiringPrincipal().dtor_value()));
}
return builder.build();
}
public static GrantOperation GrantOperation(
software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation dafnyValue) {
if (dafnyValue.is_Decrypt()) {
return GrantOperation.DECRYPT;
}
if (dafnyValue.is_Encrypt()) {
return GrantOperation.ENCRYPT;
}
if (dafnyValue.is_GenerateDataKey()) {
return GrantOperation.GENERATE_DATA_KEY;
}
if (dafnyValue.is_GenerateDataKeyWithoutPlaintext()) {
return GrantOperation.GENERATE_DATA_KEY_WITHOUT_PLAINTEXT;
}
if (dafnyValue.is_ReEncryptFrom()) {
return GrantOperation.RE_ENCRYPT_FROM;
}
if (dafnyValue.is_ReEncryptTo()) {
return GrantOperation.RE_ENCRYPT_TO;
}
if (dafnyValue.is_Sign()) {
return GrantOperation.SIGN;
}
if (dafnyValue.is_Verify()) {
return GrantOperation.VERIFY;
}
if (dafnyValue.is_GetPublicKey()) {
return GrantOperation.GET_PUBLIC_KEY;
}
if (dafnyValue.is_CreateGrant()) {
return GrantOperation.CREATE_GRANT;
}
if (dafnyValue.is_RetireGrant()) {
return GrantOperation.RETIRE_GRANT;
}
if (dafnyValue.is_DescribeKey()) {
return GrantOperation.DESCRIBE_KEY;
}
if (dafnyValue.is_GenerateDataKeyPair()) {
return GrantOperation.GENERATE_DATA_KEY_PAIR;
}
if (dafnyValue.is_GenerateDataKeyPairWithoutPlaintext()) {
return GrantOperation.GENERATE_DATA_KEY_PAIR_WITHOUT_PLAINTEXT;
}
return GrantOperation.fromValue(dafnyValue.toString());
}
public static List<GrantOperation> GrantOperationList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::GrantOperation);
}
public static List<String> GrantTokenList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static ImportKeyMaterialRequest ImportKeyMaterialRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialRequest dafnyValue) {
ImportKeyMaterialRequest.Builder builder = ImportKeyMaterialRequest.builder();
builder.encryptedKeyMaterial(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_EncryptedKeyMaterial().toRawArray())));
if (dafnyValue.dtor_ExpirationModel().is_Some()) {
builder.expirationModel(ToNative.ExpirationModelType(dafnyValue.dtor_ExpirationModel().dtor_value()));
}
builder.importToken(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_ImportToken().toRawArray())));
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_ValidTo().is_Some()) {
builder.validTo(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ValidTo().dtor_value()));
}
return builder.build();
}
public static ImportKeyMaterialResponse ImportKeyMaterialResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialResponse dafnyValue) {
return ImportKeyMaterialResponse.builder().build();
}
public static KeyManagerType KeyManagerType(
software.amazon.cryptography.services.kms.internaldafny.types.KeyManagerType dafnyValue) {
if (dafnyValue.is_AWS()) {
return KeyManagerType.AWS;
}
if (dafnyValue.is_CUSTOMER()) {
return KeyManagerType.CUSTOMER;
}
return KeyManagerType.fromValue(dafnyValue.toString());
}
public static KeyMetadata KeyMetadata(
software.amazon.cryptography.services.kms.internaldafny.types.KeyMetadata dafnyValue) {
KeyMetadata.Builder builder = KeyMetadata.builder();
if (dafnyValue.dtor_Arn().is_Some()) {
builder.arn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Arn().dtor_value()));
}
if (dafnyValue.dtor_AWSAccountId().is_Some()) {
builder.awsAccountId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AWSAccountId().dtor_value()));
}
if (dafnyValue.dtor_CloudHsmClusterId().is_Some()) {
builder.cloudHsmClusterId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudHsmClusterId().dtor_value()));
}
if (dafnyValue.dtor_CreationDate().is_Some()) {
builder.creationDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDate().dtor_value()));
}
if (dafnyValue.dtor_CustomerMasterKeySpec().is_Some()) {
builder.customerMasterKeySpec(ToNative.CustomerMasterKeySpec(dafnyValue.dtor_CustomerMasterKeySpec().dtor_value()));
}
if (dafnyValue.dtor_CustomKeyStoreId().is_Some()) {
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId().dtor_value()));
}
if (dafnyValue.dtor_DeletionDate().is_Some()) {
builder.deletionDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_DeletionDate().dtor_value()));
}
if (dafnyValue.dtor_Description().is_Some()) {
builder.description(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Description().dtor_value()));
}
if (dafnyValue.dtor_Enabled().is_Some()) {
builder.enabled((dafnyValue.dtor_Enabled().dtor_value()));
}
if (dafnyValue.dtor_EncryptionAlgorithms().is_Some()) {
builder.encryptionAlgorithms(ToNative.EncryptionAlgorithmSpecList(dafnyValue.dtor_EncryptionAlgorithms().dtor_value()));
}
if (dafnyValue.dtor_ExpirationModel().is_Some()) {
builder.expirationModel(ToNative.ExpirationModelType(dafnyValue.dtor_ExpirationModel().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_KeyManager().is_Some()) {
builder.keyManager(ToNative.KeyManagerType(dafnyValue.dtor_KeyManager().dtor_value()));
}
if (dafnyValue.dtor_KeySpec().is_Some()) {
builder.keySpec(ToNative.KeySpec(dafnyValue.dtor_KeySpec().dtor_value()));
}
if (dafnyValue.dtor_KeyState().is_Some()) {
builder.keyState(ToNative.KeyState(dafnyValue.dtor_KeyState().dtor_value()));
}
if (dafnyValue.dtor_KeyUsage().is_Some()) {
builder.keyUsage(ToNative.KeyUsageType(dafnyValue.dtor_KeyUsage().dtor_value()));
}
if (dafnyValue.dtor_MultiRegion().is_Some()) {
builder.multiRegion((dafnyValue.dtor_MultiRegion().dtor_value()));
}
if (dafnyValue.dtor_MultiRegionConfiguration().is_Some()) {
builder.multiRegionConfiguration(ToNative.MultiRegionConfiguration(dafnyValue.dtor_MultiRegionConfiguration().dtor_value()));
}
if (dafnyValue.dtor_Origin().is_Some()) {
builder.origin(ToNative.OriginType(dafnyValue.dtor_Origin().dtor_value()));
}
if (dafnyValue.dtor_PendingDeletionWindowInDays().is_Some()) {
builder.pendingDeletionWindowInDays((dafnyValue.dtor_PendingDeletionWindowInDays().dtor_value()));
}
if (dafnyValue.dtor_SigningAlgorithms().is_Some()) {
builder.signingAlgorithms(ToNative.SigningAlgorithmSpecList(dafnyValue.dtor_SigningAlgorithms().dtor_value()));
}
if (dafnyValue.dtor_ValidTo().is_Some()) {
builder.validTo(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ValidTo().dtor_value()));
}
return builder.build();
}
public static KeySpec KeySpec(
software.amazon.cryptography.services.kms.internaldafny.types.KeySpec dafnyValue) {
if (dafnyValue.is_RSA__2048()) {
return KeySpec.RSA_2048;
}
if (dafnyValue.is_RSA__3072()) {
return KeySpec.RSA_3072;
}
if (dafnyValue.is_RSA__4096()) {
return KeySpec.RSA_4096;
}
if (dafnyValue.is_ECC__NIST__P256()) {
return KeySpec.ECC_NIST_P256;
}
if (dafnyValue.is_ECC__NIST__P384()) {
return KeySpec.ECC_NIST_P384;
}
if (dafnyValue.is_ECC__NIST__P521()) {
return KeySpec.ECC_NIST_P521;
}
if (dafnyValue.is_ECC__SECG__P256K1()) {
return KeySpec.ECC_SECG_P256_K1;
}
if (dafnyValue.is_SYMMETRIC__DEFAULT()) {
return KeySpec.SYMMETRIC_DEFAULT;
}
return KeySpec.fromValue(dafnyValue.toString());
}
public static KeyState KeyState(
software.amazon.cryptography.services.kms.internaldafny.types.KeyState dafnyValue) {
if (dafnyValue.is_Creating()) {
return KeyState.CREATING;
}
if (dafnyValue.is_Enabled()) {
return KeyState.ENABLED;
}
if (dafnyValue.is_Disabled()) {
return KeyState.DISABLED;
}
if (dafnyValue.is_PendingDeletion()) {
return KeyState.PENDING_DELETION;
}
if (dafnyValue.is_PendingImport()) {
return KeyState.PENDING_IMPORT;
}
if (dafnyValue.is_PendingReplicaDeletion()) {
return KeyState.PENDING_REPLICA_DELETION;
}
if (dafnyValue.is_Unavailable()) {
return KeyState.UNAVAILABLE;
}
if (dafnyValue.is_Updating()) {
return KeyState.UPDATING;
}
return KeyState.fromValue(dafnyValue.toString());
}
public static KeyUsageType KeyUsageType(
software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType dafnyValue) {
if (dafnyValue.is_SIGN__VERIFY()) {
return KeyUsageType.SIGN_VERIFY;
}
if (dafnyValue.is_ENCRYPT__DECRYPT()) {
return KeyUsageType.ENCRYPT_DECRYPT;
}
return KeyUsageType.fromValue(dafnyValue.toString());
}
public static ListAliasesRequest ListAliasesRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesRequest dafnyValue) {
ListAliasesRequest.Builder builder = ListAliasesRequest.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_Marker().is_Some()) {
builder.marker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Marker().dtor_value()));
}
return builder.build();
}
public static ListAliasesResponse ListAliasesResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesResponse dafnyValue) {
ListAliasesResponse.Builder builder = ListAliasesResponse.builder();
if (dafnyValue.dtor_Aliases().is_Some()) {
builder.aliases(ToNative.AliasList(dafnyValue.dtor_Aliases().dtor_value()));
}
if (dafnyValue.dtor_NextMarker().is_Some()) {
builder.nextMarker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextMarker().dtor_value()));
}
if (dafnyValue.dtor_Truncated().is_Some()) {
builder.truncated((dafnyValue.dtor_Truncated().dtor_value()));
}
return builder.build();
}
public static ListGrantsRequest ListGrantsRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsRequest dafnyValue) {
ListGrantsRequest.Builder builder = ListGrantsRequest.builder();
if (dafnyValue.dtor_GranteePrincipal().is_Some()) {
builder.granteePrincipal(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GranteePrincipal().dtor_value()));
}
if (dafnyValue.dtor_GrantId().is_Some()) {
builder.grantId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantId().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_Marker().is_Some()) {
builder.marker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Marker().dtor_value()));
}
return builder.build();
}
public static ListGrantsResponse ListGrantsResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsResponse dafnyValue) {
ListGrantsResponse.Builder builder = ListGrantsResponse.builder();
if (dafnyValue.dtor_Grants().is_Some()) {
builder.grants(ToNative.GrantList(dafnyValue.dtor_Grants().dtor_value()));
}
if (dafnyValue.dtor_NextMarker().is_Some()) {
builder.nextMarker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextMarker().dtor_value()));
}
if (dafnyValue.dtor_Truncated().is_Some()) {
builder.truncated((dafnyValue.dtor_Truncated().dtor_value()));
}
return builder.build();
}
public static ListKeyPoliciesRequest ListKeyPoliciesRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesRequest dafnyValue) {
ListKeyPoliciesRequest.Builder builder = ListKeyPoliciesRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_Marker().is_Some()) {
builder.marker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Marker().dtor_value()));
}
return builder.build();
}
public static ListKeyPoliciesResponse ListKeyPoliciesResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesResponse dafnyValue) {
ListKeyPoliciesResponse.Builder builder = ListKeyPoliciesResponse.builder();
if (dafnyValue.dtor_NextMarker().is_Some()) {
builder.nextMarker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextMarker().dtor_value()));
}
if (dafnyValue.dtor_PolicyNames().is_Some()) {
builder.policyNames(ToNative.PolicyNameList(dafnyValue.dtor_PolicyNames().dtor_value()));
}
if (dafnyValue.dtor_Truncated().is_Some()) {
builder.truncated((dafnyValue.dtor_Truncated().dtor_value()));
}
return builder.build();
}
public static ListResourceTagsRequest ListResourceTagsRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsRequest dafnyValue) {
ListResourceTagsRequest.Builder builder = ListResourceTagsRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_Marker().is_Some()) {
builder.marker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Marker().dtor_value()));
}
return builder.build();
}
public static ListResourceTagsResponse ListResourceTagsResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsResponse dafnyValue) {
ListResourceTagsResponse.Builder builder = ListResourceTagsResponse.builder();
if (dafnyValue.dtor_NextMarker().is_Some()) {
builder.nextMarker(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextMarker().dtor_value()));
}
if (dafnyValue.dtor_Tags().is_Some()) {
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags().dtor_value()));
}
if (dafnyValue.dtor_Truncated().is_Some()) {
builder.truncated((dafnyValue.dtor_Truncated().dtor_value()));
}
return builder.build();
}
public static MessageType MessageType(
software.amazon.cryptography.services.kms.internaldafny.types.MessageType dafnyValue) {
if (dafnyValue.is_RAW()) {
return MessageType.RAW;
}
if (dafnyValue.is_DIGEST()) {
return MessageType.DIGEST;
}
return MessageType.fromValue(dafnyValue.toString());
}
public static MultiRegionConfiguration MultiRegionConfiguration(
software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionConfiguration dafnyValue) {
MultiRegionConfiguration.Builder builder = MultiRegionConfiguration.builder();
if (dafnyValue.dtor_MultiRegionKeyType().is_Some()) {
builder.multiRegionKeyType(ToNative.MultiRegionKeyType(dafnyValue.dtor_MultiRegionKeyType().dtor_value()));
}
if (dafnyValue.dtor_PrimaryKey().is_Some()) {
builder.primaryKey(ToNative.MultiRegionKey(dafnyValue.dtor_PrimaryKey().dtor_value()));
}
if (dafnyValue.dtor_ReplicaKeys().is_Some()) {
builder.replicaKeys(ToNative.MultiRegionKeyList(dafnyValue.dtor_ReplicaKeys().dtor_value()));
}
return builder.build();
}
public static MultiRegionKey MultiRegionKey(
software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKey dafnyValue) {
MultiRegionKey.Builder builder = MultiRegionKey.builder();
if (dafnyValue.dtor_Arn().is_Some()) {
builder.arn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Arn().dtor_value()));
}
if (dafnyValue.dtor_Region().is_Some()) {
builder.region(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Region().dtor_value()));
}
return builder.build();
}
public static List<MultiRegionKey> MultiRegionKeyList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKey> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::MultiRegionKey);
}
public static MultiRegionKeyType MultiRegionKeyType(
software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKeyType dafnyValue) {
if (dafnyValue.is_PRIMARY()) {
return MultiRegionKeyType.PRIMARY;
}
if (dafnyValue.is_REPLICA()) {
return MultiRegionKeyType.REPLICA;
}
return MultiRegionKeyType.fromValue(dafnyValue.toString());
}
public static OriginType OriginType(
software.amazon.cryptography.services.kms.internaldafny.types.OriginType dafnyValue) {
if (dafnyValue.is_AWS__KMS()) {
return OriginType.AWS_KMS;
}
if (dafnyValue.is_EXTERNAL()) {
return OriginType.EXTERNAL;
}
if (dafnyValue.is_AWS__CLOUDHSM()) {
return OriginType.AWS_CLOUDHSM;
}
return OriginType.fromValue(dafnyValue.toString());
}
public static List<String> PolicyNameList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static PutKeyPolicyRequest PutKeyPolicyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.PutKeyPolicyRequest dafnyValue) {
PutKeyPolicyRequest.Builder builder = PutKeyPolicyRequest.builder();
if (dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().is_Some()) {
builder.bypassPolicyLockoutSafetyCheck((dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.policy(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Policy()));
builder.policyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_PolicyName()));
return builder.build();
}
public static ReEncryptRequest ReEncryptRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptRequest dafnyValue) {
ReEncryptRequest.Builder builder = ReEncryptRequest.builder();
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().toRawArray())));
if (dafnyValue.dtor_DestinationEncryptionAlgorithm().is_Some()) {
builder.destinationEncryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_DestinationEncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_DestinationEncryptionContext().is_Some()) {
builder.destinationEncryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_DestinationEncryptionContext().dtor_value()));
}
builder.destinationKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_DestinationKeyId()));
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
if (dafnyValue.dtor_SourceEncryptionAlgorithm().is_Some()) {
builder.sourceEncryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_SourceEncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_SourceEncryptionContext().is_Some()) {
builder.sourceEncryptionContext(ToNative.EncryptionContextType(dafnyValue.dtor_SourceEncryptionContext().dtor_value()));
}
if (dafnyValue.dtor_SourceKeyId().is_Some()) {
builder.sourceKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceKeyId().dtor_value()));
}
return builder.build();
}
public static ReEncryptResponse ReEncryptResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptResponse dafnyValue) {
ReEncryptResponse.Builder builder = ReEncryptResponse.builder();
if (dafnyValue.dtor_CiphertextBlob().is_Some()) {
builder.ciphertextBlob(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_CiphertextBlob().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_DestinationEncryptionAlgorithm().is_Some()) {
builder.destinationEncryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_DestinationEncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_SourceEncryptionAlgorithm().is_Some()) {
builder.sourceEncryptionAlgorithm(ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_SourceEncryptionAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_SourceKeyId().is_Some()) {
builder.sourceKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceKeyId().dtor_value()));
}
return builder.build();
}
public static ReplicateKeyRequest ReplicateKeyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyRequest dafnyValue) {
ReplicateKeyRequest.Builder builder = ReplicateKeyRequest.builder();
if (dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().is_Some()) {
builder.bypassPolicyLockoutSafetyCheck((dafnyValue.dtor_BypassPolicyLockoutSafetyCheck().dtor_value()));
}
if (dafnyValue.dtor_Description().is_Some()) {
builder.description(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Description().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_Policy().is_Some()) {
builder.policy(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Policy().dtor_value()));
}
builder.replicaRegion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ReplicaRegion()));
if (dafnyValue.dtor_Tags().is_Some()) {
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags().dtor_value()));
}
return builder.build();
}
public static ReplicateKeyResponse ReplicateKeyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyResponse dafnyValue) {
ReplicateKeyResponse.Builder builder = ReplicateKeyResponse.builder();
if (dafnyValue.dtor_ReplicaKeyMetadata().is_Some()) {
builder.replicaKeyMetadata(ToNative.KeyMetadata(dafnyValue.dtor_ReplicaKeyMetadata().dtor_value()));
}
if (dafnyValue.dtor_ReplicaPolicy().is_Some()) {
builder.replicaPolicy(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ReplicaPolicy().dtor_value()));
}
if (dafnyValue.dtor_ReplicaTags().is_Some()) {
builder.replicaTags(ToNative.TagList(dafnyValue.dtor_ReplicaTags().dtor_value()));
}
return builder.build();
}
public static RetireGrantRequest RetireGrantRequest(
software.amazon.cryptography.services.kms.internaldafny.types.RetireGrantRequest dafnyValue) {
RetireGrantRequest.Builder builder = RetireGrantRequest.builder();
if (dafnyValue.dtor_GrantId().is_Some()) {
builder.grantId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantId().dtor_value()));
}
if (dafnyValue.dtor_GrantToken().is_Some()) {
builder.grantToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantToken().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
return builder.build();
}
public static RevokeGrantRequest RevokeGrantRequest(
software.amazon.cryptography.services.kms.internaldafny.types.RevokeGrantRequest dafnyValue) {
RevokeGrantRequest.Builder builder = RevokeGrantRequest.builder();
builder.grantId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GrantId()));
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static ScheduleKeyDeletionRequest ScheduleKeyDeletionRequest(
software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionRequest dafnyValue) {
ScheduleKeyDeletionRequest.Builder builder = ScheduleKeyDeletionRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
if (dafnyValue.dtor_PendingWindowInDays().is_Some()) {
builder.pendingWindowInDays((dafnyValue.dtor_PendingWindowInDays().dtor_value()));
}
return builder.build();
}
public static ScheduleKeyDeletionResponse ScheduleKeyDeletionResponse(
software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionResponse dafnyValue) {
ScheduleKeyDeletionResponse.Builder builder = ScheduleKeyDeletionResponse.builder();
if (dafnyValue.dtor_DeletionDate().is_Some()) {
builder.deletionDate(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_DeletionDate().dtor_value()));
}
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_KeyState().is_Some()) {
builder.keyState(ToNative.KeyState(dafnyValue.dtor_KeyState().dtor_value()));
}
if (dafnyValue.dtor_PendingWindowInDays().is_Some()) {
builder.pendingWindowInDays((dafnyValue.dtor_PendingWindowInDays().dtor_value()));
}
return builder.build();
}
public static SigningAlgorithmSpec SigningAlgorithmSpec(
software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec dafnyValue) {
if (dafnyValue.is_RSASSA__PSS__SHA__256()) {
return SigningAlgorithmSpec.RSASSA_PSS_SHA_256;
}
if (dafnyValue.is_RSASSA__PSS__SHA__384()) {
return SigningAlgorithmSpec.RSASSA_PSS_SHA_384;
}
if (dafnyValue.is_RSASSA__PSS__SHA__512()) {
return SigningAlgorithmSpec.RSASSA_PSS_SHA_512;
}
if (dafnyValue.is_RSASSA__PKCS1__V1__5__SHA__256()) {
return SigningAlgorithmSpec.RSASSA_PKCS1_V1_5_SHA_256;
}
if (dafnyValue.is_RSASSA__PKCS1__V1__5__SHA__384()) {
return SigningAlgorithmSpec.RSASSA_PKCS1_V1_5_SHA_384;
}
if (dafnyValue.is_RSASSA__PKCS1__V1__5__SHA__512()) {
return SigningAlgorithmSpec.RSASSA_PKCS1_V1_5_SHA_512;
}
if (dafnyValue.is_ECDSA__SHA__256()) {
return SigningAlgorithmSpec.ECDSA_SHA_256;
}
if (dafnyValue.is_ECDSA__SHA__384()) {
return SigningAlgorithmSpec.ECDSA_SHA_384;
}
if (dafnyValue.is_ECDSA__SHA__512()) {
return SigningAlgorithmSpec.ECDSA_SHA_512;
}
return SigningAlgorithmSpec.fromValue(dafnyValue.toString());
}
public static List<SigningAlgorithmSpec> SigningAlgorithmSpecList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::SigningAlgorithmSpec);
}
public static SignRequest SignRequest(
software.amazon.cryptography.services.kms.internaldafny.types.SignRequest dafnyValue) {
SignRequest.Builder builder = SignRequest.builder();
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.message(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Message().toRawArray())));
if (dafnyValue.dtor_MessageType().is_Some()) {
builder.messageType(ToNative.MessageType(dafnyValue.dtor_MessageType().dtor_value()));
}
builder.signingAlgorithm(ToNative.SigningAlgorithmSpec(dafnyValue.dtor_SigningAlgorithm()));
return builder.build();
}
public static SignResponse SignResponse(
software.amazon.cryptography.services.kms.internaldafny.types.SignResponse dafnyValue) {
SignResponse.Builder builder = SignResponse.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_Signature().is_Some()) {
builder.signature(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Signature().dtor_value().toRawArray())));
}
if (dafnyValue.dtor_SigningAlgorithm().is_Some()) {
builder.signingAlgorithm(ToNative.SigningAlgorithmSpec(dafnyValue.dtor_SigningAlgorithm().dtor_value()));
}
return builder.build();
}
public static Tag Tag(
software.amazon.cryptography.services.kms.internaldafny.types.Tag dafnyValue) {
Tag.Builder builder = Tag.builder();
builder.tagKey(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TagKey()));
builder.tagValue(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TagValue()));
return builder.build();
}
public static List<String> TagKeyList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<Tag> TagList(
DafnySequence<? extends software.amazon.cryptography.services.kms.internaldafny.types.Tag> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.kms.internaldafny.ToNative::Tag);
}
public static TagResourceRequest TagResourceRequest(
software.amazon.cryptography.services.kms.internaldafny.types.TagResourceRequest dafnyValue) {
TagResourceRequest.Builder builder = TagResourceRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags()));
return builder.build();
}
public static UntagResourceRequest UntagResourceRequest(
software.amazon.cryptography.services.kms.internaldafny.types.UntagResourceRequest dafnyValue) {
UntagResourceRequest.Builder builder = UntagResourceRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.tagKeys(ToNative.TagKeyList(dafnyValue.dtor_TagKeys()));
return builder.build();
}
public static UpdateAliasRequest UpdateAliasRequest(
software.amazon.cryptography.services.kms.internaldafny.types.UpdateAliasRequest dafnyValue) {
UpdateAliasRequest.Builder builder = UpdateAliasRequest.builder();
builder.aliasName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AliasName()));
builder.targetKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TargetKeyId()));
return builder.build();
}
public static UpdateCustomKeyStoreRequest UpdateCustomKeyStoreRequest(
software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreRequest dafnyValue) {
UpdateCustomKeyStoreRequest.Builder builder = UpdateCustomKeyStoreRequest.builder();
if (dafnyValue.dtor_CloudHsmClusterId().is_Some()) {
builder.cloudHsmClusterId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudHsmClusterId().dtor_value()));
}
builder.customKeyStoreId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CustomKeyStoreId()));
if (dafnyValue.dtor_KeyStorePassword().is_Some()) {
builder.keyStorePassword(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyStorePassword().dtor_value()));
}
if (dafnyValue.dtor_NewCustomKeyStoreName().is_Some()) {
builder.newCustomKeyStoreName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NewCustomKeyStoreName().dtor_value()));
}
return builder.build();
}
public static UpdateCustomKeyStoreResponse UpdateCustomKeyStoreResponse(
software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreResponse dafnyValue) {
return UpdateCustomKeyStoreResponse.builder().build();
}
public static UpdateKeyDescriptionRequest UpdateKeyDescriptionRequest(
software.amazon.cryptography.services.kms.internaldafny.types.UpdateKeyDescriptionRequest dafnyValue) {
UpdateKeyDescriptionRequest.Builder builder = UpdateKeyDescriptionRequest.builder();
builder.description(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Description()));
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
return builder.build();
}
public static UpdatePrimaryRegionRequest UpdatePrimaryRegionRequest(
software.amazon.cryptography.services.kms.internaldafny.types.UpdatePrimaryRegionRequest dafnyValue) {
UpdatePrimaryRegionRequest.Builder builder = UpdatePrimaryRegionRequest.builder();
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.primaryRegion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_PrimaryRegion()));
return builder.build();
}
public static VerifyRequest VerifyRequest(
software.amazon.cryptography.services.kms.internaldafny.types.VerifyRequest dafnyValue) {
VerifyRequest.Builder builder = VerifyRequest.builder();
if (dafnyValue.dtor_GrantTokens().is_Some()) {
builder.grantTokens(ToNative.GrantTokenList(dafnyValue.dtor_GrantTokens().dtor_value()));
}
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId()));
builder.message(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Message().toRawArray())));
if (dafnyValue.dtor_MessageType().is_Some()) {
builder.messageType(ToNative.MessageType(dafnyValue.dtor_MessageType().dtor_value()));
}
builder.signature(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_Signature().toRawArray())));
builder.signingAlgorithm(ToNative.SigningAlgorithmSpec(dafnyValue.dtor_SigningAlgorithm()));
return builder.build();
}
public static VerifyResponse VerifyResponse(
software.amazon.cryptography.services.kms.internaldafny.types.VerifyResponse dafnyValue) {
VerifyResponse.Builder builder = VerifyResponse.builder();
if (dafnyValue.dtor_KeyId().is_Some()) {
builder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyId().dtor_value()));
}
if (dafnyValue.dtor_SignatureValid().is_Some()) {
builder.signatureValid((dafnyValue.dtor_SignatureValid().dtor_value()));
}
if (dafnyValue.dtor_SigningAlgorithm().is_Some()) {
builder.signingAlgorithm(ToNative.SigningAlgorithmSpec(dafnyValue.dtor_SigningAlgorithm().dtor_value()));
}
return builder.build();
}
public static WrappingKeySpec WrappingKeySpec(
software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec dafnyValue) {
if (dafnyValue.is_RSA__2048()) {
return WrappingKeySpec.RSA_2048;
}
return WrappingKeySpec.fromValue(dafnyValue.toString());
}
public static AlreadyExistsException Error(Error_AlreadyExistsException dafnyValue) {
AlreadyExistsException.Builder builder = AlreadyExistsException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CloudHsmClusterInUseException Error(
Error_CloudHsmClusterInUseException dafnyValue) {
CloudHsmClusterInUseException.Builder builder = CloudHsmClusterInUseException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CloudHsmClusterInvalidConfigurationException Error(
Error_CloudHsmClusterInvalidConfigurationException dafnyValue) {
CloudHsmClusterInvalidConfigurationException.Builder builder = CloudHsmClusterInvalidConfigurationException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CloudHsmClusterNotActiveException Error(
Error_CloudHsmClusterNotActiveException dafnyValue) {
CloudHsmClusterNotActiveException.Builder builder = CloudHsmClusterNotActiveException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CloudHsmClusterNotFoundException Error(
Error_CloudHsmClusterNotFoundException dafnyValue) {
CloudHsmClusterNotFoundException.Builder builder = CloudHsmClusterNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CloudHsmClusterNotRelatedException Error(
Error_CloudHsmClusterNotRelatedException dafnyValue) {
CloudHsmClusterNotRelatedException.Builder builder = CloudHsmClusterNotRelatedException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CustomKeyStoreHasCmKsException Error(
Error_CustomKeyStoreHasCMKsException dafnyValue) {
CustomKeyStoreHasCmKsException.Builder builder = CustomKeyStoreHasCmKsException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CustomKeyStoreInvalidStateException Error(
Error_CustomKeyStoreInvalidStateException dafnyValue) {
CustomKeyStoreInvalidStateException.Builder builder = CustomKeyStoreInvalidStateException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CustomKeyStoreNameInUseException Error(
Error_CustomKeyStoreNameInUseException dafnyValue) {
CustomKeyStoreNameInUseException.Builder builder = CustomKeyStoreNameInUseException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static CustomKeyStoreNotFoundException Error(
Error_CustomKeyStoreNotFoundException dafnyValue) {
CustomKeyStoreNotFoundException.Builder builder = CustomKeyStoreNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static DependencyTimeoutException Error(Error_DependencyTimeoutException dafnyValue) {
DependencyTimeoutException.Builder builder = DependencyTimeoutException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static DisabledException Error(Error_DisabledException dafnyValue) {
DisabledException.Builder builder = DisabledException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ExpiredImportTokenException Error(Error_ExpiredImportTokenException dafnyValue) {
ExpiredImportTokenException.Builder builder = ExpiredImportTokenException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static IncorrectKeyException Error(Error_IncorrectKeyException dafnyValue) {
IncorrectKeyException.Builder builder = IncorrectKeyException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static IncorrectKeyMaterialException Error(
Error_IncorrectKeyMaterialException dafnyValue) {
IncorrectKeyMaterialException.Builder builder = IncorrectKeyMaterialException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static IncorrectTrustAnchorException Error(
Error_IncorrectTrustAnchorException dafnyValue) {
IncorrectTrustAnchorException.Builder builder = IncorrectTrustAnchorException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidAliasNameException Error(Error_InvalidAliasNameException dafnyValue) {
InvalidAliasNameException.Builder builder = InvalidAliasNameException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidArnException Error(Error_InvalidArnException dafnyValue) {
InvalidArnException.Builder builder = InvalidArnException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidCiphertextException Error(Error_InvalidCiphertextException dafnyValue) {
InvalidCiphertextException.Builder builder = InvalidCiphertextException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidGrantIdException Error(Error_InvalidGrantIdException dafnyValue) {
InvalidGrantIdException.Builder builder = InvalidGrantIdException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidGrantTokenException Error(Error_InvalidGrantTokenException dafnyValue) {
InvalidGrantTokenException.Builder builder = InvalidGrantTokenException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidImportTokenException Error(Error_InvalidImportTokenException dafnyValue) {
InvalidImportTokenException.Builder builder = InvalidImportTokenException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidKeyUsageException Error(Error_InvalidKeyUsageException dafnyValue) {
InvalidKeyUsageException.Builder builder = InvalidKeyUsageException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidMarkerException Error(Error_InvalidMarkerException dafnyValue) {
InvalidMarkerException.Builder builder = InvalidMarkerException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static KeyUnavailableException Error(Error_KeyUnavailableException dafnyValue) {
KeyUnavailableException.Builder builder = KeyUnavailableException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static KmsInternalException Error(Error_KMSInternalException dafnyValue) {
KmsInternalException.Builder builder = KmsInternalException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static KmsInvalidSignatureException Error(Error_KMSInvalidSignatureException dafnyValue) {
KmsInvalidSignatureException.Builder builder = KmsInvalidSignatureException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static KmsInvalidStateException Error(Error_KMSInvalidStateException dafnyValue) {
KmsInvalidStateException.Builder builder = KmsInvalidStateException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static LimitExceededException Error(Error_LimitExceededException dafnyValue) {
LimitExceededException.Builder builder = LimitExceededException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static MalformedPolicyDocumentException Error(
Error_MalformedPolicyDocumentException dafnyValue) {
MalformedPolicyDocumentException.Builder builder = MalformedPolicyDocumentException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static NotFoundException Error(Error_NotFoundException dafnyValue) {
NotFoundException.Builder builder = NotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TagException Error(Error_TagException dafnyValue) {
TagException.Builder builder = TagException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static UnsupportedOperationException Error(
Error_UnsupportedOperationException dafnyValue) {
UnsupportedOperationException.Builder builder = UnsupportedOperationException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
// BEGIN MANUAL EDIT
public static RuntimeException Error(software.amazon.cryptography.services.kms.internaldafny.types.Error dafnyValue) {
if (dafnyValue.is_AlreadyExistsException()) {
return ToNative.Error((Error_AlreadyExistsException) dafnyValue);
}
if (dafnyValue.is_CloudHsmClusterInUseException()) {
return ToNative.Error((Error_CloudHsmClusterInUseException) dafnyValue);
}
if (dafnyValue.is_CloudHsmClusterInvalidConfigurationException()) {
return ToNative.Error((Error_CloudHsmClusterInvalidConfigurationException) dafnyValue);
}
if (dafnyValue.is_CloudHsmClusterNotActiveException()) {
return ToNative.Error((Error_CloudHsmClusterNotActiveException) dafnyValue);
}
if (dafnyValue.is_CloudHsmClusterNotFoundException()) {
return ToNative.Error((Error_CloudHsmClusterNotFoundException) dafnyValue);
}
if (dafnyValue.is_CloudHsmClusterNotRelatedException()) {
return ToNative.Error((Error_CloudHsmClusterNotRelatedException) dafnyValue);
}
if (dafnyValue.is_CustomKeyStoreHasCMKsException()) {
return ToNative.Error((Error_CustomKeyStoreHasCMKsException) dafnyValue);
}
if (dafnyValue.is_CustomKeyStoreInvalidStateException()) {
return ToNative.Error((Error_CustomKeyStoreInvalidStateException) dafnyValue);
}
if (dafnyValue.is_CustomKeyStoreNameInUseException()) {
return ToNative.Error((Error_CustomKeyStoreNameInUseException) dafnyValue);
}
if (dafnyValue.is_CustomKeyStoreNotFoundException()) {
return ToNative.Error((Error_CustomKeyStoreNotFoundException) dafnyValue);
}
if (dafnyValue.is_DependencyTimeoutException()) {
return ToNative.Error((Error_DependencyTimeoutException) dafnyValue);
}
if (dafnyValue.is_DisabledException()) {
return ToNative.Error((Error_DisabledException) dafnyValue);
}
if (dafnyValue.is_ExpiredImportTokenException()) {
return ToNative.Error((Error_ExpiredImportTokenException) dafnyValue);
}
if (dafnyValue.is_IncorrectKeyException()) {
return ToNative.Error((Error_IncorrectKeyException) dafnyValue);
}
if (dafnyValue.is_IncorrectKeyMaterialException()) {
return ToNative.Error((Error_IncorrectKeyMaterialException) dafnyValue);
}
if (dafnyValue.is_IncorrectTrustAnchorException()) {
return ToNative.Error((Error_IncorrectTrustAnchorException) dafnyValue);
}
if (dafnyValue.is_InvalidAliasNameException()) {
return ToNative.Error((Error_InvalidAliasNameException) dafnyValue);
}
if (dafnyValue.is_InvalidArnException()) {
return ToNative.Error((Error_InvalidArnException) dafnyValue);
}
if (dafnyValue.is_InvalidCiphertextException()) {
return ToNative.Error((Error_InvalidCiphertextException) dafnyValue);
}
if (dafnyValue.is_InvalidGrantIdException()) {
return ToNative.Error((Error_InvalidGrantIdException) dafnyValue);
}
if (dafnyValue.is_InvalidGrantTokenException()) {
return ToNative.Error((Error_InvalidGrantTokenException) dafnyValue);
}
if (dafnyValue.is_InvalidImportTokenException()) {
return ToNative.Error((Error_InvalidImportTokenException) dafnyValue);
}
if (dafnyValue.is_InvalidKeyUsageException()) {
return ToNative.Error((Error_InvalidKeyUsageException) dafnyValue);
}
if (dafnyValue.is_InvalidMarkerException()) {
return ToNative.Error((Error_InvalidMarkerException) dafnyValue);
}
if (dafnyValue.is_KeyUnavailableException()) {
return ToNative.Error((Error_KeyUnavailableException) dafnyValue);
}
if (dafnyValue.is_KMSInternalException()) {
return ToNative.Error((Error_KMSInternalException) dafnyValue);
}
if (dafnyValue.is_KMSInvalidSignatureException()) {
return ToNative.Error((Error_KMSInvalidSignatureException) dafnyValue);
}
if (dafnyValue.is_KMSInvalidStateException()) {
return ToNative.Error((Error_KMSInvalidStateException) dafnyValue);
}
if (dafnyValue.is_LimitExceededException()) {
return ToNative.Error((Error_LimitExceededException) dafnyValue);
}
if (dafnyValue.is_MalformedPolicyDocumentException()) {
return ToNative.Error((Error_MalformedPolicyDocumentException) dafnyValue);
}
if (dafnyValue.is_NotFoundException()) {
return ToNative.Error((Error_NotFoundException) dafnyValue);
}
if (dafnyValue.is_TagException()) {
return ToNative.Error((Error_TagException) dafnyValue);
}
if (dafnyValue.is_UnsupportedOperationException()) {
return ToNative.Error((Error_UnsupportedOperationException) dafnyValue);
}
if (dafnyValue.is_Opaque()) {
return ToNative.Error((Error_Opaque) dafnyValue);
}
// TODO This should indicate a codegen bug
return new IllegalStateException("Unknown error recieved from KMS.");
}
// END MANUAL EDIT
public static KmsClient TrentService(IKMSClient dafnyValue) {
return ((Shim) dafnyValue).impl();
}
}
| 407 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms/internaldafny/Shim.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.kms.internaldafny;
import Wrappers_Compile.Result;
import dafny.Tuple0;
import java.lang.Override;
import java.lang.String;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.awssdk.services.kms.model.AlreadyExistsException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInUseException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInvalidConfigurationException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotActiveException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotFoundException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotRelatedException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreHasCmKsException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreInvalidStateException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNameInUseException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNotFoundException;
import software.amazon.awssdk.services.kms.model.DependencyTimeoutException;
import software.amazon.awssdk.services.kms.model.DisabledException;
import software.amazon.awssdk.services.kms.model.ExpiredImportTokenException;
import software.amazon.awssdk.services.kms.model.IncorrectKeyException;
import software.amazon.awssdk.services.kms.model.IncorrectKeyMaterialException;
import software.amazon.awssdk.services.kms.model.IncorrectTrustAnchorException;
import software.amazon.awssdk.services.kms.model.InvalidAliasNameException;
import software.amazon.awssdk.services.kms.model.InvalidArnException;
import software.amazon.awssdk.services.kms.model.InvalidCiphertextException;
import software.amazon.awssdk.services.kms.model.InvalidGrantIdException;
import software.amazon.awssdk.services.kms.model.InvalidGrantTokenException;
import software.amazon.awssdk.services.kms.model.InvalidImportTokenException;
import software.amazon.awssdk.services.kms.model.InvalidKeyUsageException;
import software.amazon.awssdk.services.kms.model.InvalidMarkerException;
import software.amazon.awssdk.services.kms.model.KeyUnavailableException;
import software.amazon.awssdk.services.kms.model.KmsException;
import software.amazon.awssdk.services.kms.model.KmsInternalException;
import software.amazon.awssdk.services.kms.model.KmsInvalidSignatureException;
import software.amazon.awssdk.services.kms.model.KmsInvalidStateException;
import software.amazon.awssdk.services.kms.model.LimitExceededException;
import software.amazon.awssdk.services.kms.model.MalformedPolicyDocumentException;
import software.amazon.awssdk.services.kms.model.NotFoundException;
import software.amazon.awssdk.services.kms.model.TagException;
import software.amazon.awssdk.services.kms.model.UnsupportedOperationException;
import software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DecryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DecryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteImportedKeyMaterialRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRotationRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRotationRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.Error;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
import software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.PutKeyPolicyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.RetireGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.RevokeGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.SignRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.SignResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.TagResourceRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UntagResourceRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateKeyDescriptionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdatePrimaryRegionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.VerifyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.VerifyResponse;
public class Shim implements IKMSClient {
private final KmsClient _impl;
private final String region;
public Shim(final KmsClient impl, final String region) {
this._impl = impl;
this.region = region;
}
public KmsClient impl() {
return this._impl;
}
public String region() {
return this.region;
}
@Override
public Result<CancelKeyDeletionResponse, Error> CancelKeyDeletion(
CancelKeyDeletionRequest input) {
software.amazon.awssdk.services.kms.model.CancelKeyDeletionRequest converted = ToNative.CancelKeyDeletionRequest(input);
try {
software.amazon.awssdk.services.kms.model.CancelKeyDeletionResponse result = _impl.cancelKeyDeletion(converted);
CancelKeyDeletionResponse dafnyResponse = ToDafny.CancelKeyDeletionResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ConnectCustomKeyStoreResponse, Error> ConnectCustomKeyStore(
ConnectCustomKeyStoreRequest input) {
software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreRequest converted = ToNative.ConnectCustomKeyStoreRequest(input);
try {
software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreResponse result = _impl.connectCustomKeyStore(converted);
ConnectCustomKeyStoreResponse dafnyResponse = ToDafny.ConnectCustomKeyStoreResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CloudHsmClusterInvalidConfigurationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotActiveException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> CreateAlias(CreateAliasRequest input) {
software.amazon.awssdk.services.kms.model.CreateAliasRequest converted = ToNative.CreateAliasRequest(input);
try {
_impl.createAlias(converted);
return Result.create_Success(Tuple0.create());
} catch (AlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidAliasNameException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateCustomKeyStoreResponse, Error> CreateCustomKeyStore(
CreateCustomKeyStoreRequest input) {
software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreRequest converted = ToNative.CreateCustomKeyStoreRequest(input);
try {
software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreResponse result = _impl.createCustomKeyStore(converted);
CreateCustomKeyStoreResponse dafnyResponse = ToDafny.CreateCustomKeyStoreResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CloudHsmClusterInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterInvalidConfigurationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotActiveException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNameInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (IncorrectTrustAnchorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateGrantResponse, Error> CreateGrant(CreateGrantRequest input) {
software.amazon.awssdk.services.kms.model.CreateGrantRequest converted = ToNative.CreateGrantRequest(input);
try {
software.amazon.awssdk.services.kms.model.CreateGrantResponse result = _impl.createGrant(converted);
CreateGrantResponse dafnyResponse = ToDafny.CreateGrantResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateKeyResponse, Error> CreateKey(CreateKeyRequest input) {
software.amazon.awssdk.services.kms.model.CreateKeyRequest converted = ToNative.CreateKeyRequest(input);
try {
software.amazon.awssdk.services.kms.model.CreateKeyResponse result = _impl.createKey(converted);
CreateKeyResponse dafnyResponse = ToDafny.CreateKeyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CloudHsmClusterInvalidConfigurationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (MalformedPolicyDocumentException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TagException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DecryptResponse, Error> Decrypt(DecryptRequest input) {
software.amazon.awssdk.services.kms.model.DecryptRequest converted = ToNative.DecryptRequest(input);
try {
software.amazon.awssdk.services.kms.model.DecryptResponse result = _impl.decrypt(converted);
DecryptResponse dafnyResponse = ToDafny.DecryptResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (IncorrectKeyException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidCiphertextException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> DeleteAlias(DeleteAliasRequest input) {
software.amazon.awssdk.services.kms.model.DeleteAliasRequest converted = ToNative.DeleteAliasRequest(input);
try {
_impl.deleteAlias(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DeleteCustomKeyStoreResponse, Error> DeleteCustomKeyStore(
DeleteCustomKeyStoreRequest input) {
software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreRequest converted = ToNative.DeleteCustomKeyStoreRequest(input);
try {
software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreResponse result = _impl.deleteCustomKeyStore(converted);
DeleteCustomKeyStoreResponse dafnyResponse = ToDafny.DeleteCustomKeyStoreResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CustomKeyStoreHasCmKsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> DeleteImportedKeyMaterial(DeleteImportedKeyMaterialRequest input) {
software.amazon.awssdk.services.kms.model.DeleteImportedKeyMaterialRequest converted = ToNative.DeleteImportedKeyMaterialRequest(input);
try {
_impl.deleteImportedKeyMaterial(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeCustomKeyStoresResponse, Error> DescribeCustomKeyStores(
DescribeCustomKeyStoresRequest input) {
software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresRequest converted = ToNative.DescribeCustomKeyStoresRequest(input);
try {
software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresResponse result = _impl.describeCustomKeyStores(converted);
DescribeCustomKeyStoresResponse dafnyResponse = ToDafny.DescribeCustomKeyStoresResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidMarkerException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeKeyResponse, Error> DescribeKey(DescribeKeyRequest input) {
software.amazon.awssdk.services.kms.model.DescribeKeyRequest converted = ToNative.DescribeKeyRequest(input);
try {
software.amazon.awssdk.services.kms.model.DescribeKeyResponse result = _impl.describeKey(converted);
DescribeKeyResponse dafnyResponse = ToDafny.DescribeKeyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> DisableKey(DisableKeyRequest input) {
software.amazon.awssdk.services.kms.model.DisableKeyRequest converted = ToNative.DisableKeyRequest(input);
try {
_impl.disableKey(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> DisableKeyRotation(DisableKeyRotationRequest input) {
software.amazon.awssdk.services.kms.model.DisableKeyRotationRequest converted = ToNative.DisableKeyRotationRequest(input);
try {
_impl.disableKeyRotation(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DisconnectCustomKeyStoreResponse, Error> DisconnectCustomKeyStore(
DisconnectCustomKeyStoreRequest input) {
software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreRequest converted = ToNative.DisconnectCustomKeyStoreRequest(input);
try {
software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreResponse result = _impl.disconnectCustomKeyStore(converted);
DisconnectCustomKeyStoreResponse dafnyResponse = ToDafny.DisconnectCustomKeyStoreResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> EnableKey(EnableKeyRequest input) {
software.amazon.awssdk.services.kms.model.EnableKeyRequest converted = ToNative.EnableKeyRequest(input);
try {
_impl.enableKey(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> EnableKeyRotation(EnableKeyRotationRequest input) {
software.amazon.awssdk.services.kms.model.EnableKeyRotationRequest converted = ToNative.EnableKeyRotationRequest(input);
try {
_impl.enableKeyRotation(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<EncryptResponse, Error> Encrypt(EncryptRequest input) {
software.amazon.awssdk.services.kms.model.EncryptRequest converted = ToNative.EncryptRequest(input);
try {
software.amazon.awssdk.services.kms.model.EncryptResponse result = _impl.encrypt(converted);
EncryptResponse dafnyResponse = ToDafny.EncryptResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GenerateDataKeyResponse, Error> GenerateDataKey(GenerateDataKeyRequest input) {
software.amazon.awssdk.services.kms.model.GenerateDataKeyRequest converted = ToNative.GenerateDataKeyRequest(input);
try {
software.amazon.awssdk.services.kms.model.GenerateDataKeyResponse result = _impl.generateDataKey(converted);
GenerateDataKeyResponse dafnyResponse = ToDafny.GenerateDataKeyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GenerateDataKeyPairResponse, Error> GenerateDataKeyPair(
GenerateDataKeyPairRequest input) {
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairRequest converted = ToNative.GenerateDataKeyPairRequest(input);
try {
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairResponse result = _impl.generateDataKeyPair(converted);
GenerateDataKeyPairResponse dafnyResponse = ToDafny.GenerateDataKeyPairResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GenerateDataKeyPairWithoutPlaintextResponse, Error> GenerateDataKeyPairWithoutPlaintext(
GenerateDataKeyPairWithoutPlaintextRequest input) {
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextRequest converted = ToNative.GenerateDataKeyPairWithoutPlaintextRequest(input);
try {
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextResponse result = _impl.generateDataKeyPairWithoutPlaintext(converted);
GenerateDataKeyPairWithoutPlaintextResponse dafnyResponse = ToDafny.GenerateDataKeyPairWithoutPlaintextResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GenerateDataKeyWithoutPlaintextResponse, Error> GenerateDataKeyWithoutPlaintext(
GenerateDataKeyWithoutPlaintextRequest input) {
software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextRequest converted = ToNative.GenerateDataKeyWithoutPlaintextRequest(input);
try {
software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextResponse result = _impl.generateDataKeyWithoutPlaintext(converted);
GenerateDataKeyWithoutPlaintextResponse dafnyResponse = ToDafny.GenerateDataKeyWithoutPlaintextResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GenerateRandomResponse, Error> GenerateRandom(GenerateRandomRequest input) {
software.amazon.awssdk.services.kms.model.GenerateRandomRequest converted = ToNative.GenerateRandomRequest(input);
try {
software.amazon.awssdk.services.kms.model.GenerateRandomResponse result = _impl.generateRandom(converted);
GenerateRandomResponse dafnyResponse = ToDafny.GenerateRandomResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GetKeyPolicyResponse, Error> GetKeyPolicy(GetKeyPolicyRequest input) {
software.amazon.awssdk.services.kms.model.GetKeyPolicyRequest converted = ToNative.GetKeyPolicyRequest(input);
try {
software.amazon.awssdk.services.kms.model.GetKeyPolicyResponse result = _impl.getKeyPolicy(converted);
GetKeyPolicyResponse dafnyResponse = ToDafny.GetKeyPolicyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GetKeyRotationStatusResponse, Error> GetKeyRotationStatus(
GetKeyRotationStatusRequest input) {
software.amazon.awssdk.services.kms.model.GetKeyRotationStatusRequest converted = ToNative.GetKeyRotationStatusRequest(input);
try {
software.amazon.awssdk.services.kms.model.GetKeyRotationStatusResponse result = _impl.getKeyRotationStatus(converted);
GetKeyRotationStatusResponse dafnyResponse = ToDafny.GetKeyRotationStatusResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GetParametersForImportResponse, Error> GetParametersForImport(
GetParametersForImportRequest input) {
software.amazon.awssdk.services.kms.model.GetParametersForImportRequest converted = ToNative.GetParametersForImportRequest(input);
try {
software.amazon.awssdk.services.kms.model.GetParametersForImportResponse result = _impl.getParametersForImport(converted);
GetParametersForImportResponse dafnyResponse = ToDafny.GetParametersForImportResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GetPublicKeyResponse, Error> GetPublicKey(GetPublicKeyRequest input) {
software.amazon.awssdk.services.kms.model.GetPublicKeyRequest converted = ToNative.GetPublicKeyRequest(input);
try {
software.amazon.awssdk.services.kms.model.GetPublicKeyResponse result = _impl.getPublicKey(converted);
GetPublicKeyResponse dafnyResponse = ToDafny.GetPublicKeyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ImportKeyMaterialResponse, Error> ImportKeyMaterial(
ImportKeyMaterialRequest input) {
software.amazon.awssdk.services.kms.model.ImportKeyMaterialRequest converted = ToNative.ImportKeyMaterialRequest(input);
try {
software.amazon.awssdk.services.kms.model.ImportKeyMaterialResponse result = _impl.importKeyMaterial(converted);
ImportKeyMaterialResponse dafnyResponse = ToDafny.ImportKeyMaterialResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ExpiredImportTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (IncorrectKeyMaterialException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidCiphertextException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidImportTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListAliasesResponse, Error> ListAliases(ListAliasesRequest input) {
software.amazon.awssdk.services.kms.model.ListAliasesRequest converted = ToNative.ListAliasesRequest(input);
try {
software.amazon.awssdk.services.kms.model.ListAliasesResponse result = _impl.listAliases(converted);
ListAliasesResponse dafnyResponse = ToDafny.ListAliasesResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidMarkerException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListGrantsResponse, Error> ListGrants(ListGrantsRequest input) {
software.amazon.awssdk.services.kms.model.ListGrantsRequest converted = ToNative.ListGrantsRequest(input);
try {
software.amazon.awssdk.services.kms.model.ListGrantsResponse result = _impl.listGrants(converted);
ListGrantsResponse dafnyResponse = ToDafny.ListGrantsResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantIdException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidMarkerException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListKeyPoliciesResponse, Error> ListKeyPolicies(ListKeyPoliciesRequest input) {
software.amazon.awssdk.services.kms.model.ListKeyPoliciesRequest converted = ToNative.ListKeyPoliciesRequest(input);
try {
software.amazon.awssdk.services.kms.model.ListKeyPoliciesResponse result = _impl.listKeyPolicies(converted);
ListKeyPoliciesResponse dafnyResponse = ToDafny.ListKeyPoliciesResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListResourceTagsResponse, Error> ListResourceTags(ListResourceTagsRequest input) {
software.amazon.awssdk.services.kms.model.ListResourceTagsRequest converted = ToNative.ListResourceTagsRequest(input);
try {
software.amazon.awssdk.services.kms.model.ListResourceTagsResponse result = _impl.listResourceTags(converted);
ListResourceTagsResponse dafnyResponse = ToDafny.ListResourceTagsResponse(result);
return Result.create_Success(dafnyResponse);
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidMarkerException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> PutKeyPolicy(PutKeyPolicyRequest input) {
software.amazon.awssdk.services.kms.model.PutKeyPolicyRequest converted = ToNative.PutKeyPolicyRequest(input);
try {
_impl.putKeyPolicy(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (MalformedPolicyDocumentException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ReEncryptResponse, Error> ReEncrypt(ReEncryptRequest input) {
software.amazon.awssdk.services.kms.model.ReEncryptRequest converted = ToNative.ReEncryptRequest(input);
try {
software.amazon.awssdk.services.kms.model.ReEncryptResponse result = _impl.reEncrypt(converted);
ReEncryptResponse dafnyResponse = ToDafny.ReEncryptResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (IncorrectKeyException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidCiphertextException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ReplicateKeyResponse, Error> ReplicateKey(ReplicateKeyRequest input) {
software.amazon.awssdk.services.kms.model.ReplicateKeyRequest converted = ToNative.ReplicateKeyRequest(input);
try {
software.amazon.awssdk.services.kms.model.ReplicateKeyResponse result = _impl.replicateKey(converted);
ReplicateKeyResponse dafnyResponse = ToDafny.ReplicateKeyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (AlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (MalformedPolicyDocumentException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TagException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> RetireGrant(RetireGrantRequest input) {
software.amazon.awssdk.services.kms.model.RetireGrantRequest converted = ToNative.RetireGrantRequest(input);
try {
_impl.retireGrant(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantIdException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> RevokeGrant(RevokeGrantRequest input) {
software.amazon.awssdk.services.kms.model.RevokeGrantRequest converted = ToNative.RevokeGrantRequest(input);
try {
_impl.revokeGrant(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantIdException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ScheduleKeyDeletionResponse, Error> ScheduleKeyDeletion(
ScheduleKeyDeletionRequest input) {
software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionRequest converted = ToNative.ScheduleKeyDeletionRequest(input);
try {
software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionResponse result = _impl.scheduleKeyDeletion(converted);
ScheduleKeyDeletionResponse dafnyResponse = ToDafny.ScheduleKeyDeletionResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<SignResponse, Error> Sign(SignRequest input) {
software.amazon.awssdk.services.kms.model.SignRequest converted = ToNative.SignRequest(input);
try {
software.amazon.awssdk.services.kms.model.SignResponse result = _impl.sign(converted);
SignResponse dafnyResponse = ToDafny.SignResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> TagResource(TagResourceRequest input) {
software.amazon.awssdk.services.kms.model.TagResourceRequest converted = ToNative.TagResourceRequest(input);
try {
_impl.tagResource(converted);
return Result.create_Success(Tuple0.create());
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TagException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> UntagResource(UntagResourceRequest input) {
software.amazon.awssdk.services.kms.model.UntagResourceRequest converted = ToNative.UntagResourceRequest(input);
try {
_impl.untagResource(converted);
return Result.create_Success(Tuple0.create());
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TagException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> UpdateAlias(UpdateAliasRequest input) {
software.amazon.awssdk.services.kms.model.UpdateAliasRequest converted = ToNative.UpdateAliasRequest(input);
try {
_impl.updateAlias(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateCustomKeyStoreResponse, Error> UpdateCustomKeyStore(
UpdateCustomKeyStoreRequest input) {
software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreRequest converted = ToNative.UpdateCustomKeyStoreRequest(input);
try {
software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreResponse result = _impl.updateCustomKeyStore(converted);
UpdateCustomKeyStoreResponse dafnyResponse = ToDafny.UpdateCustomKeyStoreResponse(result);
return Result.create_Success(dafnyResponse);
} catch (CloudHsmClusterInvalidConfigurationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotActiveException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CloudHsmClusterNotRelatedException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNameInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (CustomKeyStoreNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> UpdateKeyDescription(UpdateKeyDescriptionRequest input) {
software.amazon.awssdk.services.kms.model.UpdateKeyDescriptionRequest converted = ToNative.UpdateKeyDescriptionRequest(input);
try {
_impl.updateKeyDescription(converted);
return Result.create_Success(Tuple0.create());
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> UpdatePrimaryRegion(UpdatePrimaryRegionRequest input) {
software.amazon.awssdk.services.kms.model.UpdatePrimaryRegionRequest converted = ToNative.UpdatePrimaryRegionRequest(input);
try {
_impl.updatePrimaryRegion(converted);
return Result.create_Success(Tuple0.create());
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidArnException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (UnsupportedOperationException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<VerifyResponse, Error> Verify(VerifyRequest input) {
software.amazon.awssdk.services.kms.model.VerifyRequest converted = ToNative.VerifyRequest(input);
try {
software.amazon.awssdk.services.kms.model.VerifyResponse result = _impl.verify(converted);
VerifyResponse dafnyResponse = ToDafny.VerifyResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DependencyTimeoutException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DisabledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidGrantTokenException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidKeyUsageException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KeyUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInternalException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidSignatureException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsInvalidStateException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (NotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (KmsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
}
| 408 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsKms/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/kms/internaldafny/ToDafny.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.kms.internaldafny;
import Wrappers_Compile.Option;
import dafny.DafnyMap;
import dafny.DafnySequence;
import dafny.TypeDescriptor;
import java.lang.Boolean;
import java.lang.Byte;
import java.lang.Character;
import java.lang.Integer;
import java.lang.RuntimeException;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import software.amazon.awssdk.services.kms.KmsClient;
import software.amazon.awssdk.services.kms.model.AlreadyExistsException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInUseException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterInvalidConfigurationException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotActiveException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotFoundException;
import software.amazon.awssdk.services.kms.model.CloudHsmClusterNotRelatedException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreHasCmKsException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreInvalidStateException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNameInUseException;
import software.amazon.awssdk.services.kms.model.CustomKeyStoreNotFoundException;
import software.amazon.awssdk.services.kms.model.DependencyTimeoutException;
import software.amazon.awssdk.services.kms.model.DisabledException;
import software.amazon.awssdk.services.kms.model.ExpiredImportTokenException;
import software.amazon.awssdk.services.kms.model.IncorrectKeyException;
import software.amazon.awssdk.services.kms.model.IncorrectKeyMaterialException;
import software.amazon.awssdk.services.kms.model.IncorrectTrustAnchorException;
import software.amazon.awssdk.services.kms.model.InvalidAliasNameException;
import software.amazon.awssdk.services.kms.model.InvalidArnException;
import software.amazon.awssdk.services.kms.model.InvalidCiphertextException;
import software.amazon.awssdk.services.kms.model.InvalidGrantIdException;
import software.amazon.awssdk.services.kms.model.InvalidGrantTokenException;
import software.amazon.awssdk.services.kms.model.InvalidImportTokenException;
import software.amazon.awssdk.services.kms.model.InvalidKeyUsageException;
import software.amazon.awssdk.services.kms.model.InvalidMarkerException;
import software.amazon.awssdk.services.kms.model.KeyUnavailableException;
import software.amazon.awssdk.services.kms.model.KmsException;
import software.amazon.awssdk.services.kms.model.KmsInternalException;
import software.amazon.awssdk.services.kms.model.KmsInvalidSignatureException;
import software.amazon.awssdk.services.kms.model.KmsInvalidStateException;
import software.amazon.awssdk.services.kms.model.LimitExceededException;
import software.amazon.awssdk.services.kms.model.MalformedPolicyDocumentException;
import software.amazon.awssdk.services.kms.model.NotFoundException;
import software.amazon.awssdk.services.kms.model.TagException;
import software.amazon.awssdk.services.kms.model.UnsupportedOperationException;
import software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec;
import software.amazon.cryptography.services.kms.internaldafny.types.AliasListEntry;
import software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CancelKeyDeletionResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType;
import software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateGrantResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.CreateKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.CustomKeyStoresListEntry;
import software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec;
import software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec;
import software.amazon.cryptography.services.kms.internaldafny.types.DataKeySpec;
import software.amazon.cryptography.services.kms.internaldafny.types.DecryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DecryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DeleteImportedKeyMaterialRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeCustomKeyStoresResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DescribeKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisableKeyRotationRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.DisconnectCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EnableKeyRotationRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec;
import software.amazon.cryptography.services.kms.internaldafny.types.Error;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_AlreadyExistsException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterInUseException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterInvalidConfigurationException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotActiveException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CloudHsmClusterNotRelatedException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreHasCMKsException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreInvalidStateException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreNameInUseException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_CustomKeyStoreNotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_DependencyTimeoutException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_DisabledException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_ExpiredImportTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectKeyException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectKeyMaterialException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_IncorrectTrustAnchorException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidAliasNameException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidArnException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidCiphertextException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidGrantIdException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidGrantTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidImportTokenException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidKeyUsageException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_InvalidMarkerException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInternalException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInvalidSignatureException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KMSInvalidStateException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_KeyUnavailableException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_LimitExceededException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_MalformedPolicyDocumentException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_NotFoundException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_Opaque;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_TagException;
import software.amazon.cryptography.services.kms.internaldafny.types.Error_UnsupportedOperationException;
import software.amazon.cryptography.services.kms.internaldafny.types.ExpirationModelType;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyPairWithoutPlaintextResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateDataKeyWithoutPlaintextResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GenerateRandomResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyPolicyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetKeyRotationStatusResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetParametersForImportResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.GetPublicKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.GrantConstraints;
import software.amazon.cryptography.services.kms.internaldafny.types.GrantListEntry;
import software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation;
import software.amazon.cryptography.services.kms.internaldafny.types.IKMSClient;
import software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ImportKeyMaterialResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.KeyManagerType;
import software.amazon.cryptography.services.kms.internaldafny.types.KeyMetadata;
import software.amazon.cryptography.services.kms.internaldafny.types.KeySpec;
import software.amazon.cryptography.services.kms.internaldafny.types.KeyState;
import software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType;
import software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListAliasesResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListGrantsResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListKeyPoliciesResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ListResourceTagsResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.MessageType;
import software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionConfiguration;
import software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKey;
import software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKeyType;
import software.amazon.cryptography.services.kms.internaldafny.types.OriginType;
import software.amazon.cryptography.services.kms.internaldafny.types.PutKeyPolicyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReEncryptResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ReplicateKeyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.RetireGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.RevokeGrantRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.ScheduleKeyDeletionResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.SignRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.SignResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec;
import software.amazon.cryptography.services.kms.internaldafny.types.Tag;
import software.amazon.cryptography.services.kms.internaldafny.types.TagResourceRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UntagResourceRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateAliasRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateCustomKeyStoreResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdateKeyDescriptionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.UpdatePrimaryRegionRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.VerifyRequest;
import software.amazon.cryptography.services.kms.internaldafny.types.VerifyResponse;
import software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec;
public class ToDafny {
public static DafnySequence<? extends AliasListEntry> AliasList(
List<software.amazon.awssdk.services.kms.model.AliasListEntry> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::AliasListEntry,
AliasListEntry._typeDescriptor());
}
public static AliasListEntry AliasListEntry(
software.amazon.awssdk.services.kms.model.AliasListEntry nativeValue) {
Option<DafnySequence<? extends Character>> aliasName;
aliasName = Objects.nonNull(nativeValue.aliasName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.aliasName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> aliasArn;
aliasArn = Objects.nonNull(nativeValue.aliasArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.aliasArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> targetKeyId;
targetKeyId = Objects.nonNull(nativeValue.targetKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.targetKeyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDate;
creationDate = Objects.nonNull(nativeValue.creationDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDate()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastUpdatedDate;
lastUpdatedDate = Objects.nonNull(nativeValue.lastUpdatedDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastUpdatedDate()))
: Option.create_None();
return new AliasListEntry(aliasName, aliasArn, targetKeyId, creationDate, lastUpdatedDate);
}
public static CancelKeyDeletionRequest CancelKeyDeletionRequest(
software.amazon.awssdk.services.kms.model.CancelKeyDeletionRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new CancelKeyDeletionRequest(keyId);
}
public static CancelKeyDeletionResponse CancelKeyDeletionResponse(
software.amazon.awssdk.services.kms.model.CancelKeyDeletionResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
return new CancelKeyDeletionResponse(keyId);
}
public static ConnectCustomKeyStoreRequest ConnectCustomKeyStoreRequest(
software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreRequest nativeValue) {
DafnySequence<? extends Character> customKeyStoreId;
customKeyStoreId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId());
return new ConnectCustomKeyStoreRequest(customKeyStoreId);
}
public static ConnectCustomKeyStoreResponse ConnectCustomKeyStoreResponse(
software.amazon.awssdk.services.kms.model.ConnectCustomKeyStoreResponse nativeValue) {
return new ConnectCustomKeyStoreResponse();
}
public static CreateAliasRequest CreateAliasRequest(
software.amazon.awssdk.services.kms.model.CreateAliasRequest nativeValue) {
DafnySequence<? extends Character> aliasName;
aliasName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.aliasName());
DafnySequence<? extends Character> targetKeyId;
targetKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.targetKeyId());
return new CreateAliasRequest(aliasName, targetKeyId);
}
public static CreateCustomKeyStoreRequest CreateCustomKeyStoreRequest(
software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreRequest nativeValue) {
DafnySequence<? extends Character> customKeyStoreName;
customKeyStoreName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreName());
DafnySequence<? extends Character> cloudHsmClusterId;
cloudHsmClusterId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudHsmClusterId());
DafnySequence<? extends Character> trustAnchorCertificate;
trustAnchorCertificate = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.trustAnchorCertificate());
DafnySequence<? extends Character> keyStorePassword;
keyStorePassword = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyStorePassword());
return new CreateCustomKeyStoreRequest(customKeyStoreName, cloudHsmClusterId, trustAnchorCertificate, keyStorePassword);
}
public static CreateCustomKeyStoreResponse CreateCustomKeyStoreResponse(
software.amazon.awssdk.services.kms.model.CreateCustomKeyStoreResponse nativeValue) {
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
return new CreateCustomKeyStoreResponse(customKeyStoreId);
}
public static CreateGrantRequest CreateGrantRequest(
software.amazon.awssdk.services.kms.model.CreateGrantRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> granteePrincipal;
granteePrincipal = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.granteePrincipal());
Option<DafnySequence<? extends Character>> retiringPrincipal;
retiringPrincipal = Objects.nonNull(nativeValue.retiringPrincipal()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.retiringPrincipal()))
: Option.create_None();
DafnySequence<? extends GrantOperation> operations;
operations = ToDafny.GrantOperationList(nativeValue.operations());
Option<GrantConstraints> constraints;
constraints = Objects.nonNull(nativeValue.constraints()) ?
Option.create_Some(ToDafny.GrantConstraints(nativeValue.constraints()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
Option<DafnySequence<? extends Character>> name;
name = Objects.nonNull(nativeValue.name()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()))
: Option.create_None();
return new CreateGrantRequest(keyId, granteePrincipal, retiringPrincipal, operations, constraints, grantTokens, name);
}
public static CreateGrantResponse CreateGrantResponse(
software.amazon.awssdk.services.kms.model.CreateGrantResponse nativeValue) {
Option<DafnySequence<? extends Character>> grantToken;
grantToken = Objects.nonNull(nativeValue.grantToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantToken()))
: Option.create_None();
Option<DafnySequence<? extends Character>> grantId;
grantId = Objects.nonNull(nativeValue.grantId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantId()))
: Option.create_None();
return new CreateGrantResponse(grantToken, grantId);
}
public static CreateKeyRequest CreateKeyRequest(
software.amazon.awssdk.services.kms.model.CreateKeyRequest nativeValue) {
Option<DafnySequence<? extends Character>> policy;
policy = Objects.nonNull(nativeValue.policy()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policy()))
: Option.create_None();
Option<DafnySequence<? extends Character>> description;
description = Objects.nonNull(nativeValue.description()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.description()))
: Option.create_None();
Option<KeyUsageType> keyUsage;
keyUsage = Objects.nonNull(nativeValue.keyUsage()) ?
Option.create_Some(ToDafny.KeyUsageType(nativeValue.keyUsage()))
: Option.create_None();
Option<CustomerMasterKeySpec> customerMasterKeySpec;
customerMasterKeySpec = Objects.nonNull(nativeValue.customerMasterKeySpec()) ?
Option.create_Some(ToDafny.CustomerMasterKeySpec(nativeValue.customerMasterKeySpec()))
: Option.create_None();
Option<KeySpec> keySpec;
keySpec = Objects.nonNull(nativeValue.keySpec()) ?
Option.create_Some(ToDafny.KeySpec(nativeValue.keySpec()))
: Option.create_None();
Option<OriginType> origin;
origin = Objects.nonNull(nativeValue.origin()) ?
Option.create_Some(ToDafny.OriginType(nativeValue.origin()))
: Option.create_None();
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
Option<Boolean> bypassPolicyLockoutSafetyCheck;
bypassPolicyLockoutSafetyCheck = Objects.nonNull(nativeValue.bypassPolicyLockoutSafetyCheck()) ?
Option.create_Some((nativeValue.bypassPolicyLockoutSafetyCheck()))
: Option.create_None();
Option<DafnySequence<? extends Tag>> tags;
tags = (Objects.nonNull(nativeValue.tags()) && nativeValue.tags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.tags()))
: Option.create_None();
Option<Boolean> multiRegion;
multiRegion = Objects.nonNull(nativeValue.multiRegion()) ?
Option.create_Some((nativeValue.multiRegion()))
: Option.create_None();
return new CreateKeyRequest(policy, description, keyUsage, customerMasterKeySpec, keySpec, origin, customKeyStoreId, bypassPolicyLockoutSafetyCheck, tags, multiRegion);
}
public static CreateKeyResponse CreateKeyResponse(
software.amazon.awssdk.services.kms.model.CreateKeyResponse nativeValue) {
Option<KeyMetadata> keyMetadata;
keyMetadata = Objects.nonNull(nativeValue.keyMetadata()) ?
Option.create_Some(ToDafny.KeyMetadata(nativeValue.keyMetadata()))
: Option.create_None();
return new CreateKeyResponse(keyMetadata);
}
public static DafnySequence<? extends CustomKeyStoresListEntry> CustomKeyStoresList(
List<software.amazon.awssdk.services.kms.model.CustomKeyStoresListEntry> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::CustomKeyStoresListEntry,
CustomKeyStoresListEntry._typeDescriptor());
}
public static CustomKeyStoresListEntry CustomKeyStoresListEntry(
software.amazon.awssdk.services.kms.model.CustomKeyStoresListEntry nativeValue) {
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> customKeyStoreName;
customKeyStoreName = Objects.nonNull(nativeValue.customKeyStoreName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> cloudHsmClusterId;
cloudHsmClusterId = Objects.nonNull(nativeValue.cloudHsmClusterId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudHsmClusterId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> trustAnchorCertificate;
trustAnchorCertificate = Objects.nonNull(nativeValue.trustAnchorCertificate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.trustAnchorCertificate()))
: Option.create_None();
Option<ConnectionStateType> connectionState;
connectionState = Objects.nonNull(nativeValue.connectionState()) ?
Option.create_Some(ToDafny.ConnectionStateType(nativeValue.connectionState()))
: Option.create_None();
Option<ConnectionErrorCodeType> connectionErrorCode;
connectionErrorCode = Objects.nonNull(nativeValue.connectionErrorCode()) ?
Option.create_Some(ToDafny.ConnectionErrorCodeType(nativeValue.connectionErrorCode()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDate;
creationDate = Objects.nonNull(nativeValue.creationDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDate()))
: Option.create_None();
return new CustomKeyStoresListEntry(customKeyStoreId, customKeyStoreName, cloudHsmClusterId, trustAnchorCertificate, connectionState, connectionErrorCode, creationDate);
}
public static DecryptRequest DecryptRequest(
software.amazon.awssdk.services.kms.model.DecryptRequest nativeValue) {
DafnySequence<? extends Byte> ciphertextBlob;
ciphertextBlob = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> encryptionAlgorithm;
encryptionAlgorithm = Objects.nonNull(nativeValue.encryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm()))
: Option.create_None();
return new DecryptRequest(ciphertextBlob, encryptionContext, grantTokens, keyId, encryptionAlgorithm);
}
public static DecryptResponse DecryptResponse(
software.amazon.awssdk.services.kms.model.DecryptResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> plaintext;
plaintext = Objects.nonNull(nativeValue.plaintext()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintext().asByteArray()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> encryptionAlgorithm;
encryptionAlgorithm = Objects.nonNull(nativeValue.encryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm()))
: Option.create_None();
return new DecryptResponse(keyId, plaintext, encryptionAlgorithm);
}
public static DeleteAliasRequest DeleteAliasRequest(
software.amazon.awssdk.services.kms.model.DeleteAliasRequest nativeValue) {
DafnySequence<? extends Character> aliasName;
aliasName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.aliasName());
return new DeleteAliasRequest(aliasName);
}
public static DeleteCustomKeyStoreRequest DeleteCustomKeyStoreRequest(
software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreRequest nativeValue) {
DafnySequence<? extends Character> customKeyStoreId;
customKeyStoreId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId());
return new DeleteCustomKeyStoreRequest(customKeyStoreId);
}
public static DeleteCustomKeyStoreResponse DeleteCustomKeyStoreResponse(
software.amazon.awssdk.services.kms.model.DeleteCustomKeyStoreResponse nativeValue) {
return new DeleteCustomKeyStoreResponse();
}
public static DeleteImportedKeyMaterialRequest DeleteImportedKeyMaterialRequest(
software.amazon.awssdk.services.kms.model.DeleteImportedKeyMaterialRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new DeleteImportedKeyMaterialRequest(keyId);
}
public static DescribeCustomKeyStoresRequest DescribeCustomKeyStoresRequest(
software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresRequest nativeValue) {
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> customKeyStoreName;
customKeyStoreName = Objects.nonNull(nativeValue.customKeyStoreName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreName()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> marker;
marker = Objects.nonNull(nativeValue.marker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.marker()))
: Option.create_None();
return new DescribeCustomKeyStoresRequest(customKeyStoreId, customKeyStoreName, limit, marker);
}
public static DescribeCustomKeyStoresResponse DescribeCustomKeyStoresResponse(
software.amazon.awssdk.services.kms.model.DescribeCustomKeyStoresResponse nativeValue) {
Option<DafnySequence<? extends CustomKeyStoresListEntry>> customKeyStores;
customKeyStores = (Objects.nonNull(nativeValue.customKeyStores()) && nativeValue.customKeyStores().size() > 0) ?
Option.create_Some(ToDafny.CustomKeyStoresList(nativeValue.customKeyStores()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextMarker;
nextMarker = Objects.nonNull(nativeValue.nextMarker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextMarker()))
: Option.create_None();
Option<Boolean> truncated;
truncated = Objects.nonNull(nativeValue.truncated()) ?
Option.create_Some((nativeValue.truncated()))
: Option.create_None();
return new DescribeCustomKeyStoresResponse(customKeyStores, nextMarker, truncated);
}
public static DescribeKeyRequest DescribeKeyRequest(
software.amazon.awssdk.services.kms.model.DescribeKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new DescribeKeyRequest(keyId, grantTokens);
}
public static DescribeKeyResponse DescribeKeyResponse(
software.amazon.awssdk.services.kms.model.DescribeKeyResponse nativeValue) {
Option<KeyMetadata> keyMetadata;
keyMetadata = Objects.nonNull(nativeValue.keyMetadata()) ?
Option.create_Some(ToDafny.KeyMetadata(nativeValue.keyMetadata()))
: Option.create_None();
return new DescribeKeyResponse(keyMetadata);
}
public static DisableKeyRequest DisableKeyRequest(
software.amazon.awssdk.services.kms.model.DisableKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new DisableKeyRequest(keyId);
}
public static DisableKeyRotationRequest DisableKeyRotationRequest(
software.amazon.awssdk.services.kms.model.DisableKeyRotationRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new DisableKeyRotationRequest(keyId);
}
public static DisconnectCustomKeyStoreRequest DisconnectCustomKeyStoreRequest(
software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreRequest nativeValue) {
DafnySequence<? extends Character> customKeyStoreId;
customKeyStoreId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId());
return new DisconnectCustomKeyStoreRequest(customKeyStoreId);
}
public static DisconnectCustomKeyStoreResponse DisconnectCustomKeyStoreResponse(
software.amazon.awssdk.services.kms.model.DisconnectCustomKeyStoreResponse nativeValue) {
return new DisconnectCustomKeyStoreResponse();
}
public static EnableKeyRequest EnableKeyRequest(
software.amazon.awssdk.services.kms.model.EnableKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new EnableKeyRequest(keyId);
}
public static EnableKeyRotationRequest EnableKeyRotationRequest(
software.amazon.awssdk.services.kms.model.EnableKeyRotationRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new EnableKeyRotationRequest(keyId);
}
public static DafnySequence<? extends EncryptionAlgorithmSpec> EncryptionAlgorithmSpecList(
List<software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::EncryptionAlgorithmSpec,
EncryptionAlgorithmSpec._typeDescriptor());
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>> EncryptionContextType(
Map<String, String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence);
}
public static EncryptRequest EncryptRequest(
software.amazon.awssdk.services.kms.model.EncryptRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Byte> plaintext;
plaintext = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintext().asByteArray());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> encryptionAlgorithm;
encryptionAlgorithm = Objects.nonNull(nativeValue.encryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm()))
: Option.create_None();
return new EncryptRequest(keyId, plaintext, encryptionContext, grantTokens, encryptionAlgorithm);
}
public static EncryptResponse EncryptResponse(
software.amazon.awssdk.services.kms.model.EncryptResponse nativeValue) {
Option<DafnySequence<? extends Byte>> ciphertextBlob;
ciphertextBlob = Objects.nonNull(nativeValue.ciphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> encryptionAlgorithm;
encryptionAlgorithm = Objects.nonNull(nativeValue.encryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm()))
: Option.create_None();
return new EncryptResponse(ciphertextBlob, keyId, encryptionAlgorithm);
}
public static GenerateDataKeyPairRequest GenerateDataKeyPairRequest(
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairRequest nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DataKeyPairSpec keyPairSpec;
keyPairSpec = ToDafny.DataKeyPairSpec(nativeValue.keyPairSpec());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new GenerateDataKeyPairRequest(encryptionContext, keyId, keyPairSpec, grantTokens);
}
public static GenerateDataKeyPairResponse GenerateDataKeyPairResponse(
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairResponse nativeValue) {
Option<DafnySequence<? extends Byte>> privateKeyCiphertextBlob;
privateKeyCiphertextBlob = Objects.nonNull(nativeValue.privateKeyCiphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.privateKeyCiphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> privateKeyPlaintext;
privateKeyPlaintext = Objects.nonNull(nativeValue.privateKeyPlaintext()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.privateKeyPlaintext().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DataKeyPairSpec> keyPairSpec;
keyPairSpec = Objects.nonNull(nativeValue.keyPairSpec()) ?
Option.create_Some(ToDafny.DataKeyPairSpec(nativeValue.keyPairSpec()))
: Option.create_None();
return new GenerateDataKeyPairResponse(privateKeyCiphertextBlob, privateKeyPlaintext, publicKey, keyId, keyPairSpec);
}
public static GenerateDataKeyPairWithoutPlaintextRequest GenerateDataKeyPairWithoutPlaintextRequest(
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextRequest nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DataKeyPairSpec keyPairSpec;
keyPairSpec = ToDafny.DataKeyPairSpec(nativeValue.keyPairSpec());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new GenerateDataKeyPairWithoutPlaintextRequest(encryptionContext, keyId, keyPairSpec, grantTokens);
}
public static GenerateDataKeyPairWithoutPlaintextResponse GenerateDataKeyPairWithoutPlaintextResponse(
software.amazon.awssdk.services.kms.model.GenerateDataKeyPairWithoutPlaintextResponse nativeValue) {
Option<DafnySequence<? extends Byte>> privateKeyCiphertextBlob;
privateKeyCiphertextBlob = Objects.nonNull(nativeValue.privateKeyCiphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.privateKeyCiphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DataKeyPairSpec> keyPairSpec;
keyPairSpec = Objects.nonNull(nativeValue.keyPairSpec()) ?
Option.create_Some(ToDafny.DataKeyPairSpec(nativeValue.keyPairSpec()))
: Option.create_None();
return new GenerateDataKeyPairWithoutPlaintextResponse(privateKeyCiphertextBlob, publicKey, keyId, keyPairSpec);
}
public static GenerateDataKeyRequest GenerateDataKeyRequest(
software.amazon.awssdk.services.kms.model.GenerateDataKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
Option<Integer> numberOfBytes;
numberOfBytes = Objects.nonNull(nativeValue.numberOfBytes()) ?
Option.create_Some((nativeValue.numberOfBytes()))
: Option.create_None();
Option<DataKeySpec> keySpec;
keySpec = Objects.nonNull(nativeValue.keySpec()) ?
Option.create_Some(ToDafny.DataKeySpec(nativeValue.keySpec()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new GenerateDataKeyRequest(keyId, encryptionContext, numberOfBytes, keySpec, grantTokens);
}
public static GenerateDataKeyResponse GenerateDataKeyResponse(
software.amazon.awssdk.services.kms.model.GenerateDataKeyResponse nativeValue) {
Option<DafnySequence<? extends Byte>> ciphertextBlob;
ciphertextBlob = Objects.nonNull(nativeValue.ciphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> plaintext;
plaintext = Objects.nonNull(nativeValue.plaintext()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintext().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
return new GenerateDataKeyResponse(ciphertextBlob, plaintext, keyId);
}
public static GenerateDataKeyWithoutPlaintextRequest GenerateDataKeyWithoutPlaintextRequest(
software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContext;
encryptionContext = (Objects.nonNull(nativeValue.encryptionContext()) && nativeValue.encryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContext()))
: Option.create_None();
Option<DataKeySpec> keySpec;
keySpec = Objects.nonNull(nativeValue.keySpec()) ?
Option.create_Some(ToDafny.DataKeySpec(nativeValue.keySpec()))
: Option.create_None();
Option<Integer> numberOfBytes;
numberOfBytes = Objects.nonNull(nativeValue.numberOfBytes()) ?
Option.create_Some((nativeValue.numberOfBytes()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new GenerateDataKeyWithoutPlaintextRequest(keyId, encryptionContext, keySpec, numberOfBytes, grantTokens);
}
public static GenerateDataKeyWithoutPlaintextResponse GenerateDataKeyWithoutPlaintextResponse(
software.amazon.awssdk.services.kms.model.GenerateDataKeyWithoutPlaintextResponse nativeValue) {
Option<DafnySequence<? extends Byte>> ciphertextBlob;
ciphertextBlob = Objects.nonNull(nativeValue.ciphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
return new GenerateDataKeyWithoutPlaintextResponse(ciphertextBlob, keyId);
}
public static GenerateRandomRequest GenerateRandomRequest(
software.amazon.awssdk.services.kms.model.GenerateRandomRequest nativeValue) {
Option<Integer> numberOfBytes;
numberOfBytes = Objects.nonNull(nativeValue.numberOfBytes()) ?
Option.create_Some((nativeValue.numberOfBytes()))
: Option.create_None();
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
return new GenerateRandomRequest(numberOfBytes, customKeyStoreId);
}
public static GenerateRandomResponse GenerateRandomResponse(
software.amazon.awssdk.services.kms.model.GenerateRandomResponse nativeValue) {
Option<DafnySequence<? extends Byte>> plaintext;
plaintext = Objects.nonNull(nativeValue.plaintext()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.plaintext().asByteArray()))
: Option.create_None();
return new GenerateRandomResponse(plaintext);
}
public static GetKeyPolicyRequest GetKeyPolicyRequest(
software.amazon.awssdk.services.kms.model.GetKeyPolicyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> policyName;
policyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policyName());
return new GetKeyPolicyRequest(keyId, policyName);
}
public static GetKeyPolicyResponse GetKeyPolicyResponse(
software.amazon.awssdk.services.kms.model.GetKeyPolicyResponse nativeValue) {
Option<DafnySequence<? extends Character>> policy;
policy = Objects.nonNull(nativeValue.policy()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policy()))
: Option.create_None();
return new GetKeyPolicyResponse(policy);
}
public static GetKeyRotationStatusRequest GetKeyRotationStatusRequest(
software.amazon.awssdk.services.kms.model.GetKeyRotationStatusRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new GetKeyRotationStatusRequest(keyId);
}
public static GetKeyRotationStatusResponse GetKeyRotationStatusResponse(
software.amazon.awssdk.services.kms.model.GetKeyRotationStatusResponse nativeValue) {
Option<Boolean> keyRotationEnabled;
keyRotationEnabled = Objects.nonNull(nativeValue.keyRotationEnabled()) ?
Option.create_Some((nativeValue.keyRotationEnabled()))
: Option.create_None();
return new GetKeyRotationStatusResponse(keyRotationEnabled);
}
public static GetParametersForImportRequest GetParametersForImportRequest(
software.amazon.awssdk.services.kms.model.GetParametersForImportRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
AlgorithmSpec wrappingAlgorithm;
wrappingAlgorithm = ToDafny.AlgorithmSpec(nativeValue.wrappingAlgorithm());
WrappingKeySpec wrappingKeySpec;
wrappingKeySpec = ToDafny.WrappingKeySpec(nativeValue.wrappingKeySpec());
return new GetParametersForImportRequest(keyId, wrappingAlgorithm, wrappingKeySpec);
}
public static GetParametersForImportResponse GetParametersForImportResponse(
software.amazon.awssdk.services.kms.model.GetParametersForImportResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> importToken;
importToken = Objects.nonNull(nativeValue.importToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.importToken().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> parametersValidTo;
parametersValidTo = Objects.nonNull(nativeValue.parametersValidTo()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.parametersValidTo()))
: Option.create_None();
return new GetParametersForImportResponse(keyId, importToken, publicKey, parametersValidTo);
}
public static GetPublicKeyRequest GetPublicKeyRequest(
software.amazon.awssdk.services.kms.model.GetPublicKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new GetPublicKeyRequest(keyId, grantTokens);
}
public static GetPublicKeyResponse GetPublicKeyResponse(
software.amazon.awssdk.services.kms.model.GetPublicKeyResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> publicKey;
publicKey = Objects.nonNull(nativeValue.publicKey()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.publicKey().asByteArray()))
: Option.create_None();
Option<CustomerMasterKeySpec> customerMasterKeySpec;
customerMasterKeySpec = Objects.nonNull(nativeValue.customerMasterKeySpec()) ?
Option.create_Some(ToDafny.CustomerMasterKeySpec(nativeValue.customerMasterKeySpec()))
: Option.create_None();
Option<KeySpec> keySpec;
keySpec = Objects.nonNull(nativeValue.keySpec()) ?
Option.create_Some(ToDafny.KeySpec(nativeValue.keySpec()))
: Option.create_None();
Option<KeyUsageType> keyUsage;
keyUsage = Objects.nonNull(nativeValue.keyUsage()) ?
Option.create_Some(ToDafny.KeyUsageType(nativeValue.keyUsage()))
: Option.create_None();
Option<DafnySequence<? extends EncryptionAlgorithmSpec>> encryptionAlgorithms;
encryptionAlgorithms = (Objects.nonNull(nativeValue.encryptionAlgorithms()) && nativeValue.encryptionAlgorithms().size() > 0) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpecList(nativeValue.encryptionAlgorithms()))
: Option.create_None();
Option<DafnySequence<? extends SigningAlgorithmSpec>> signingAlgorithms;
signingAlgorithms = (Objects.nonNull(nativeValue.signingAlgorithms()) && nativeValue.signingAlgorithms().size() > 0) ?
Option.create_Some(ToDafny.SigningAlgorithmSpecList(nativeValue.signingAlgorithms()))
: Option.create_None();
return new GetPublicKeyResponse(keyId, publicKey, customerMasterKeySpec, keySpec, keyUsage, encryptionAlgorithms, signingAlgorithms);
}
public static GrantConstraints GrantConstraints(
software.amazon.awssdk.services.kms.model.GrantConstraints nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContextSubset;
encryptionContextSubset = (Objects.nonNull(nativeValue.encryptionContextSubset()) && nativeValue.encryptionContextSubset().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContextSubset()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> encryptionContextEquals;
encryptionContextEquals = (Objects.nonNull(nativeValue.encryptionContextEquals()) && nativeValue.encryptionContextEquals().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.encryptionContextEquals()))
: Option.create_None();
return new GrantConstraints(encryptionContextSubset, encryptionContextEquals);
}
public static DafnySequence<? extends GrantListEntry> GrantList(
List<software.amazon.awssdk.services.kms.model.GrantListEntry> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::GrantListEntry,
GrantListEntry._typeDescriptor());
}
public static GrantListEntry GrantListEntry(
software.amazon.awssdk.services.kms.model.GrantListEntry nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> grantId;
grantId = Objects.nonNull(nativeValue.grantId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> name;
name = Objects.nonNull(nativeValue.name()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.name()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDate;
creationDate = Objects.nonNull(nativeValue.creationDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDate()))
: Option.create_None();
Option<DafnySequence<? extends Character>> granteePrincipal;
granteePrincipal = Objects.nonNull(nativeValue.granteePrincipal()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.granteePrincipal()))
: Option.create_None();
Option<DafnySequence<? extends Character>> retiringPrincipal;
retiringPrincipal = Objects.nonNull(nativeValue.retiringPrincipal()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.retiringPrincipal()))
: Option.create_None();
Option<DafnySequence<? extends Character>> issuingAccount;
issuingAccount = Objects.nonNull(nativeValue.issuingAccount()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.issuingAccount()))
: Option.create_None();
Option<DafnySequence<? extends GrantOperation>> operations;
operations = (Objects.nonNull(nativeValue.operations()) && nativeValue.operations().size() > 0) ?
Option.create_Some(ToDafny.GrantOperationList(nativeValue.operations()))
: Option.create_None();
Option<GrantConstraints> constraints;
constraints = Objects.nonNull(nativeValue.constraints()) ?
Option.create_Some(ToDafny.GrantConstraints(nativeValue.constraints()))
: Option.create_None();
return new GrantListEntry(keyId, grantId, name, creationDate, granteePrincipal, retiringPrincipal, issuingAccount, operations, constraints);
}
public static DafnySequence<? extends GrantOperation> GrantOperationList(
List<software.amazon.awssdk.services.kms.model.GrantOperation> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::GrantOperation,
GrantOperation._typeDescriptor());
}
public static DafnySequence<? extends DafnySequence<? extends Character>> GrantTokenList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static ImportKeyMaterialRequest ImportKeyMaterialRequest(
software.amazon.awssdk.services.kms.model.ImportKeyMaterialRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Byte> importToken;
importToken = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.importToken().asByteArray());
DafnySequence<? extends Byte> encryptedKeyMaterial;
encryptedKeyMaterial = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.encryptedKeyMaterial().asByteArray());
Option<DafnySequence<? extends Character>> validTo;
validTo = Objects.nonNull(nativeValue.validTo()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.validTo()))
: Option.create_None();
Option<ExpirationModelType> expirationModel;
expirationModel = Objects.nonNull(nativeValue.expirationModel()) ?
Option.create_Some(ToDafny.ExpirationModelType(nativeValue.expirationModel()))
: Option.create_None();
return new ImportKeyMaterialRequest(keyId, importToken, encryptedKeyMaterial, validTo, expirationModel);
}
public static ImportKeyMaterialResponse ImportKeyMaterialResponse(
software.amazon.awssdk.services.kms.model.ImportKeyMaterialResponse nativeValue) {
return new ImportKeyMaterialResponse();
}
public static KeyMetadata KeyMetadata(
software.amazon.awssdk.services.kms.model.KeyMetadata nativeValue) {
Option<DafnySequence<? extends Character>> aWSAccountId;
aWSAccountId = Objects.nonNull(nativeValue.awsAccountId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.awsAccountId()))
: Option.create_None();
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnySequence<? extends Character>> arn;
arn = Objects.nonNull(nativeValue.arn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.arn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDate;
creationDate = Objects.nonNull(nativeValue.creationDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDate()))
: Option.create_None();
Option<Boolean> enabled;
enabled = Objects.nonNull(nativeValue.enabled()) ?
Option.create_Some((nativeValue.enabled()))
: Option.create_None();
Option<DafnySequence<? extends Character>> description;
description = Objects.nonNull(nativeValue.description()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.description()))
: Option.create_None();
Option<KeyUsageType> keyUsage;
keyUsage = Objects.nonNull(nativeValue.keyUsage()) ?
Option.create_Some(ToDafny.KeyUsageType(nativeValue.keyUsage()))
: Option.create_None();
Option<KeyState> keyState;
keyState = Objects.nonNull(nativeValue.keyState()) ?
Option.create_Some(ToDafny.KeyState(nativeValue.keyState()))
: Option.create_None();
Option<DafnySequence<? extends Character>> deletionDate;
deletionDate = Objects.nonNull(nativeValue.deletionDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.deletionDate()))
: Option.create_None();
Option<DafnySequence<? extends Character>> validTo;
validTo = Objects.nonNull(nativeValue.validTo()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.validTo()))
: Option.create_None();
Option<OriginType> origin;
origin = Objects.nonNull(nativeValue.origin()) ?
Option.create_Some(ToDafny.OriginType(nativeValue.origin()))
: Option.create_None();
Option<DafnySequence<? extends Character>> customKeyStoreId;
customKeyStoreId = Objects.nonNull(nativeValue.customKeyStoreId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> cloudHsmClusterId;
cloudHsmClusterId = Objects.nonNull(nativeValue.cloudHsmClusterId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudHsmClusterId()))
: Option.create_None();
Option<ExpirationModelType> expirationModel;
expirationModel = Objects.nonNull(nativeValue.expirationModel()) ?
Option.create_Some(ToDafny.ExpirationModelType(nativeValue.expirationModel()))
: Option.create_None();
Option<KeyManagerType> keyManager;
keyManager = Objects.nonNull(nativeValue.keyManager()) ?
Option.create_Some(ToDafny.KeyManagerType(nativeValue.keyManager()))
: Option.create_None();
Option<CustomerMasterKeySpec> customerMasterKeySpec;
customerMasterKeySpec = Objects.nonNull(nativeValue.customerMasterKeySpec()) ?
Option.create_Some(ToDafny.CustomerMasterKeySpec(nativeValue.customerMasterKeySpec()))
: Option.create_None();
Option<KeySpec> keySpec;
keySpec = Objects.nonNull(nativeValue.keySpec()) ?
Option.create_Some(ToDafny.KeySpec(nativeValue.keySpec()))
: Option.create_None();
Option<DafnySequence<? extends EncryptionAlgorithmSpec>> encryptionAlgorithms;
encryptionAlgorithms = (Objects.nonNull(nativeValue.encryptionAlgorithms()) && nativeValue.encryptionAlgorithms().size() > 0) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpecList(nativeValue.encryptionAlgorithms()))
: Option.create_None();
Option<DafnySequence<? extends SigningAlgorithmSpec>> signingAlgorithms;
signingAlgorithms = (Objects.nonNull(nativeValue.signingAlgorithms()) && nativeValue.signingAlgorithms().size() > 0) ?
Option.create_Some(ToDafny.SigningAlgorithmSpecList(nativeValue.signingAlgorithms()))
: Option.create_None();
Option<Boolean> multiRegion;
multiRegion = Objects.nonNull(nativeValue.multiRegion()) ?
Option.create_Some((nativeValue.multiRegion()))
: Option.create_None();
Option<MultiRegionConfiguration> multiRegionConfiguration;
multiRegionConfiguration = Objects.nonNull(nativeValue.multiRegionConfiguration()) ?
Option.create_Some(ToDafny.MultiRegionConfiguration(nativeValue.multiRegionConfiguration()))
: Option.create_None();
Option<Integer> pendingDeletionWindowInDays;
pendingDeletionWindowInDays = Objects.nonNull(nativeValue.pendingDeletionWindowInDays()) ?
Option.create_Some((nativeValue.pendingDeletionWindowInDays()))
: Option.create_None();
return new KeyMetadata(aWSAccountId, keyId, arn, creationDate, enabled, description, keyUsage, keyState, deletionDate, validTo, origin, customKeyStoreId, cloudHsmClusterId, expirationModel, keyManager, customerMasterKeySpec, keySpec, encryptionAlgorithms, signingAlgorithms, multiRegion, multiRegionConfiguration, pendingDeletionWindowInDays);
}
public static ListAliasesRequest ListAliasesRequest(
software.amazon.awssdk.services.kms.model.ListAliasesRequest nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> marker;
marker = Objects.nonNull(nativeValue.marker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.marker()))
: Option.create_None();
return new ListAliasesRequest(keyId, limit, marker);
}
public static ListAliasesResponse ListAliasesResponse(
software.amazon.awssdk.services.kms.model.ListAliasesResponse nativeValue) {
Option<DafnySequence<? extends AliasListEntry>> aliases;
aliases = (Objects.nonNull(nativeValue.aliases()) && nativeValue.aliases().size() > 0) ?
Option.create_Some(ToDafny.AliasList(nativeValue.aliases()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextMarker;
nextMarker = Objects.nonNull(nativeValue.nextMarker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextMarker()))
: Option.create_None();
Option<Boolean> truncated;
truncated = Objects.nonNull(nativeValue.truncated()) ?
Option.create_Some((nativeValue.truncated()))
: Option.create_None();
return new ListAliasesResponse(aliases, nextMarker, truncated);
}
public static ListGrantsRequest ListGrantsRequest(
software.amazon.awssdk.services.kms.model.ListGrantsRequest nativeValue) {
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> marker;
marker = Objects.nonNull(nativeValue.marker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.marker()))
: Option.create_None();
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<DafnySequence<? extends Character>> grantId;
grantId = Objects.nonNull(nativeValue.grantId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> granteePrincipal;
granteePrincipal = Objects.nonNull(nativeValue.granteePrincipal()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.granteePrincipal()))
: Option.create_None();
return new ListGrantsRequest(limit, marker, keyId, grantId, granteePrincipal);
}
public static ListGrantsResponse ListGrantsResponse(
software.amazon.awssdk.services.kms.model.ListGrantsResponse nativeValue) {
Option<DafnySequence<? extends GrantListEntry>> grants;
grants = (Objects.nonNull(nativeValue.grants()) && nativeValue.grants().size() > 0) ?
Option.create_Some(ToDafny.GrantList(nativeValue.grants()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextMarker;
nextMarker = Objects.nonNull(nativeValue.nextMarker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextMarker()))
: Option.create_None();
Option<Boolean> truncated;
truncated = Objects.nonNull(nativeValue.truncated()) ?
Option.create_Some((nativeValue.truncated()))
: Option.create_None();
return new ListGrantsResponse(grants, nextMarker, truncated);
}
public static ListKeyPoliciesRequest ListKeyPoliciesRequest(
software.amazon.awssdk.services.kms.model.ListKeyPoliciesRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> marker;
marker = Objects.nonNull(nativeValue.marker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.marker()))
: Option.create_None();
return new ListKeyPoliciesRequest(keyId, limit, marker);
}
public static ListKeyPoliciesResponse ListKeyPoliciesResponse(
software.amazon.awssdk.services.kms.model.ListKeyPoliciesResponse nativeValue) {
Option<DafnySequence<? extends DafnySequence<? extends Character>>> policyNames;
policyNames = (Objects.nonNull(nativeValue.policyNames()) && nativeValue.policyNames().size() > 0) ?
Option.create_Some(ToDafny.PolicyNameList(nativeValue.policyNames()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextMarker;
nextMarker = Objects.nonNull(nativeValue.nextMarker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextMarker()))
: Option.create_None();
Option<Boolean> truncated;
truncated = Objects.nonNull(nativeValue.truncated()) ?
Option.create_Some((nativeValue.truncated()))
: Option.create_None();
return new ListKeyPoliciesResponse(policyNames, nextMarker, truncated);
}
public static ListResourceTagsRequest ListResourceTagsRequest(
software.amazon.awssdk.services.kms.model.ListResourceTagsRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> marker;
marker = Objects.nonNull(nativeValue.marker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.marker()))
: Option.create_None();
return new ListResourceTagsRequest(keyId, limit, marker);
}
public static ListResourceTagsResponse ListResourceTagsResponse(
software.amazon.awssdk.services.kms.model.ListResourceTagsResponse nativeValue) {
Option<DafnySequence<? extends Tag>> tags;
tags = (Objects.nonNull(nativeValue.tags()) && nativeValue.tags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.tags()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextMarker;
nextMarker = Objects.nonNull(nativeValue.nextMarker()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextMarker()))
: Option.create_None();
Option<Boolean> truncated;
truncated = Objects.nonNull(nativeValue.truncated()) ?
Option.create_Some((nativeValue.truncated()))
: Option.create_None();
return new ListResourceTagsResponse(tags, nextMarker, truncated);
}
public static MultiRegionConfiguration MultiRegionConfiguration(
software.amazon.awssdk.services.kms.model.MultiRegionConfiguration nativeValue) {
Option<MultiRegionKeyType> multiRegionKeyType;
multiRegionKeyType = Objects.nonNull(nativeValue.multiRegionKeyType()) ?
Option.create_Some(ToDafny.MultiRegionKeyType(nativeValue.multiRegionKeyType()))
: Option.create_None();
Option<MultiRegionKey> primaryKey;
primaryKey = Objects.nonNull(nativeValue.primaryKey()) ?
Option.create_Some(ToDafny.MultiRegionKey(nativeValue.primaryKey()))
: Option.create_None();
Option<DafnySequence<? extends MultiRegionKey>> replicaKeys;
replicaKeys = (Objects.nonNull(nativeValue.replicaKeys()) && nativeValue.replicaKeys().size() > 0) ?
Option.create_Some(ToDafny.MultiRegionKeyList(nativeValue.replicaKeys()))
: Option.create_None();
return new MultiRegionConfiguration(multiRegionKeyType, primaryKey, replicaKeys);
}
public static MultiRegionKey MultiRegionKey(
software.amazon.awssdk.services.kms.model.MultiRegionKey nativeValue) {
Option<DafnySequence<? extends Character>> arn;
arn = Objects.nonNull(nativeValue.arn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.arn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> region;
region = Objects.nonNull(nativeValue.region()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.region()))
: Option.create_None();
return new MultiRegionKey(arn, region);
}
public static DafnySequence<? extends MultiRegionKey> MultiRegionKeyList(
List<software.amazon.awssdk.services.kms.model.MultiRegionKey> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::MultiRegionKey,
MultiRegionKey._typeDescriptor());
}
public static DafnySequence<? extends DafnySequence<? extends Character>> PolicyNameList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static PutKeyPolicyRequest PutKeyPolicyRequest(
software.amazon.awssdk.services.kms.model.PutKeyPolicyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> policyName;
policyName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policyName());
DafnySequence<? extends Character> policy;
policy = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policy());
Option<Boolean> bypassPolicyLockoutSafetyCheck;
bypassPolicyLockoutSafetyCheck = Objects.nonNull(nativeValue.bypassPolicyLockoutSafetyCheck()) ?
Option.create_Some((nativeValue.bypassPolicyLockoutSafetyCheck()))
: Option.create_None();
return new PutKeyPolicyRequest(keyId, policyName, policy, bypassPolicyLockoutSafetyCheck);
}
public static ReEncryptRequest ReEncryptRequest(
software.amazon.awssdk.services.kms.model.ReEncryptRequest nativeValue) {
DafnySequence<? extends Byte> ciphertextBlob;
ciphertextBlob = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> sourceEncryptionContext;
sourceEncryptionContext = (Objects.nonNull(nativeValue.sourceEncryptionContext()) && nativeValue.sourceEncryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.sourceEncryptionContext()))
: Option.create_None();
Option<DafnySequence<? extends Character>> sourceKeyId;
sourceKeyId = Objects.nonNull(nativeValue.sourceKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceKeyId()))
: Option.create_None();
DafnySequence<? extends Character> destinationKeyId;
destinationKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.destinationKeyId());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> destinationEncryptionContext;
destinationEncryptionContext = (Objects.nonNull(nativeValue.destinationEncryptionContext()) && nativeValue.destinationEncryptionContext().size() > 0) ?
Option.create_Some(ToDafny.EncryptionContextType(nativeValue.destinationEncryptionContext()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> sourceEncryptionAlgorithm;
sourceEncryptionAlgorithm = Objects.nonNull(nativeValue.sourceEncryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.sourceEncryptionAlgorithm()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> destinationEncryptionAlgorithm;
destinationEncryptionAlgorithm = Objects.nonNull(nativeValue.destinationEncryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.destinationEncryptionAlgorithm()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new ReEncryptRequest(ciphertextBlob, sourceEncryptionContext, sourceKeyId, destinationKeyId, destinationEncryptionContext, sourceEncryptionAlgorithm, destinationEncryptionAlgorithm, grantTokens);
}
public static ReEncryptResponse ReEncryptResponse(
software.amazon.awssdk.services.kms.model.ReEncryptResponse nativeValue) {
Option<DafnySequence<? extends Byte>> ciphertextBlob;
ciphertextBlob = Objects.nonNull(nativeValue.ciphertextBlob()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.ciphertextBlob().asByteArray()))
: Option.create_None();
Option<DafnySequence<? extends Character>> sourceKeyId;
sourceKeyId = Objects.nonNull(nativeValue.sourceKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceKeyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> sourceEncryptionAlgorithm;
sourceEncryptionAlgorithm = Objects.nonNull(nativeValue.sourceEncryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.sourceEncryptionAlgorithm()))
: Option.create_None();
Option<EncryptionAlgorithmSpec> destinationEncryptionAlgorithm;
destinationEncryptionAlgorithm = Objects.nonNull(nativeValue.destinationEncryptionAlgorithm()) ?
Option.create_Some(ToDafny.EncryptionAlgorithmSpec(nativeValue.destinationEncryptionAlgorithm()))
: Option.create_None();
return new ReEncryptResponse(ciphertextBlob, sourceKeyId, keyId, sourceEncryptionAlgorithm, destinationEncryptionAlgorithm);
}
public static ReplicateKeyRequest ReplicateKeyRequest(
software.amazon.awssdk.services.kms.model.ReplicateKeyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> replicaRegion;
replicaRegion = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.replicaRegion());
Option<DafnySequence<? extends Character>> policy;
policy = Objects.nonNull(nativeValue.policy()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policy()))
: Option.create_None();
Option<Boolean> bypassPolicyLockoutSafetyCheck;
bypassPolicyLockoutSafetyCheck = Objects.nonNull(nativeValue.bypassPolicyLockoutSafetyCheck()) ?
Option.create_Some((nativeValue.bypassPolicyLockoutSafetyCheck()))
: Option.create_None();
Option<DafnySequence<? extends Character>> description;
description = Objects.nonNull(nativeValue.description()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.description()))
: Option.create_None();
Option<DafnySequence<? extends Tag>> tags;
tags = (Objects.nonNull(nativeValue.tags()) && nativeValue.tags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.tags()))
: Option.create_None();
return new ReplicateKeyRequest(keyId, replicaRegion, policy, bypassPolicyLockoutSafetyCheck, description, tags);
}
public static ReplicateKeyResponse ReplicateKeyResponse(
software.amazon.awssdk.services.kms.model.ReplicateKeyResponse nativeValue) {
Option<KeyMetadata> replicaKeyMetadata;
replicaKeyMetadata = Objects.nonNull(nativeValue.replicaKeyMetadata()) ?
Option.create_Some(ToDafny.KeyMetadata(nativeValue.replicaKeyMetadata()))
: Option.create_None();
Option<DafnySequence<? extends Character>> replicaPolicy;
replicaPolicy = Objects.nonNull(nativeValue.replicaPolicy()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.replicaPolicy()))
: Option.create_None();
Option<DafnySequence<? extends Tag>> replicaTags;
replicaTags = (Objects.nonNull(nativeValue.replicaTags()) && nativeValue.replicaTags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.replicaTags()))
: Option.create_None();
return new ReplicateKeyResponse(replicaKeyMetadata, replicaPolicy, replicaTags);
}
public static RetireGrantRequest RetireGrantRequest(
software.amazon.awssdk.services.kms.model.RetireGrantRequest nativeValue) {
Option<DafnySequence<? extends Character>> grantToken;
grantToken = Objects.nonNull(nativeValue.grantToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantToken()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> grantId;
grantId = Objects.nonNull(nativeValue.grantId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantId()))
: Option.create_None();
return new RetireGrantRequest(grantToken, keyId, grantId);
}
public static RevokeGrantRequest RevokeGrantRequest(
software.amazon.awssdk.services.kms.model.RevokeGrantRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> grantId;
grantId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.grantId());
return new RevokeGrantRequest(keyId, grantId);
}
public static ScheduleKeyDeletionRequest ScheduleKeyDeletionRequest(
software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
Option<Integer> pendingWindowInDays;
pendingWindowInDays = Objects.nonNull(nativeValue.pendingWindowInDays()) ?
Option.create_Some((nativeValue.pendingWindowInDays()))
: Option.create_None();
return new ScheduleKeyDeletionRequest(keyId, pendingWindowInDays);
}
public static ScheduleKeyDeletionResponse ScheduleKeyDeletionResponse(
software.amazon.awssdk.services.kms.model.ScheduleKeyDeletionResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> deletionDate;
deletionDate = Objects.nonNull(nativeValue.deletionDate()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.deletionDate()))
: Option.create_None();
Option<KeyState> keyState;
keyState = Objects.nonNull(nativeValue.keyState()) ?
Option.create_Some(ToDafny.KeyState(nativeValue.keyState()))
: Option.create_None();
Option<Integer> pendingWindowInDays;
pendingWindowInDays = Objects.nonNull(nativeValue.pendingWindowInDays()) ?
Option.create_Some((nativeValue.pendingWindowInDays()))
: Option.create_None();
return new ScheduleKeyDeletionResponse(keyId, deletionDate, keyState, pendingWindowInDays);
}
public static DafnySequence<? extends SigningAlgorithmSpec> SigningAlgorithmSpecList(
List<software.amazon.awssdk.services.kms.model.SigningAlgorithmSpec> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::SigningAlgorithmSpec,
SigningAlgorithmSpec._typeDescriptor());
}
public static SignRequest SignRequest(
software.amazon.awssdk.services.kms.model.SignRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Byte> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.message().asByteArray());
Option<MessageType> messageType;
messageType = Objects.nonNull(nativeValue.messageType()) ?
Option.create_Some(ToDafny.MessageType(nativeValue.messageType()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
SigningAlgorithmSpec signingAlgorithm;
signingAlgorithm = ToDafny.SigningAlgorithmSpec(nativeValue.signingAlgorithm());
return new SignRequest(keyId, message, messageType, grantTokens, signingAlgorithm);
}
public static SignResponse SignResponse(
software.amazon.awssdk.services.kms.model.SignResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> signature;
signature = Objects.nonNull(nativeValue.signature()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.signature().asByteArray()))
: Option.create_None();
Option<SigningAlgorithmSpec> signingAlgorithm;
signingAlgorithm = Objects.nonNull(nativeValue.signingAlgorithm()) ?
Option.create_Some(ToDafny.SigningAlgorithmSpec(nativeValue.signingAlgorithm()))
: Option.create_None();
return new SignResponse(keyId, signature, signingAlgorithm);
}
public static Tag Tag(software.amazon.awssdk.services.kms.model.Tag nativeValue) {
DafnySequence<? extends Character> tagKey;
tagKey = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tagKey());
DafnySequence<? extends Character> tagValue;
tagValue = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tagValue());
return new Tag(tagKey, tagValue);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> TagKeyList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends Tag> TagList(
List<software.amazon.awssdk.services.kms.model.Tag> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.kms.internaldafny.ToDafny::Tag,
Tag._typeDescriptor());
}
public static TagResourceRequest TagResourceRequest(
software.amazon.awssdk.services.kms.model.TagResourceRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Tag> tags;
tags = ToDafny.TagList(nativeValue.tags());
return new TagResourceRequest(keyId, tags);
}
public static UntagResourceRequest UntagResourceRequest(
software.amazon.awssdk.services.kms.model.UntagResourceRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends DafnySequence<? extends Character>> tagKeys;
tagKeys = ToDafny.TagKeyList(nativeValue.tagKeys());
return new UntagResourceRequest(keyId, tagKeys);
}
public static UpdateAliasRequest UpdateAliasRequest(
software.amazon.awssdk.services.kms.model.UpdateAliasRequest nativeValue) {
DafnySequence<? extends Character> aliasName;
aliasName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.aliasName());
DafnySequence<? extends Character> targetKeyId;
targetKeyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.targetKeyId());
return new UpdateAliasRequest(aliasName, targetKeyId);
}
public static UpdateCustomKeyStoreRequest UpdateCustomKeyStoreRequest(
software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreRequest nativeValue) {
DafnySequence<? extends Character> customKeyStoreId;
customKeyStoreId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.customKeyStoreId());
Option<DafnySequence<? extends Character>> newCustomKeyStoreName;
newCustomKeyStoreName = Objects.nonNull(nativeValue.newCustomKeyStoreName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.newCustomKeyStoreName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyStorePassword;
keyStorePassword = Objects.nonNull(nativeValue.keyStorePassword()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyStorePassword()))
: Option.create_None();
Option<DafnySequence<? extends Character>> cloudHsmClusterId;
cloudHsmClusterId = Objects.nonNull(nativeValue.cloudHsmClusterId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudHsmClusterId()))
: Option.create_None();
return new UpdateCustomKeyStoreRequest(customKeyStoreId, newCustomKeyStoreName, keyStorePassword, cloudHsmClusterId);
}
public static UpdateCustomKeyStoreResponse UpdateCustomKeyStoreResponse(
software.amazon.awssdk.services.kms.model.UpdateCustomKeyStoreResponse nativeValue) {
return new UpdateCustomKeyStoreResponse();
}
public static UpdateKeyDescriptionRequest UpdateKeyDescriptionRequest(
software.amazon.awssdk.services.kms.model.UpdateKeyDescriptionRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> description;
description = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.description());
return new UpdateKeyDescriptionRequest(keyId, description);
}
public static UpdatePrimaryRegionRequest UpdatePrimaryRegionRequest(
software.amazon.awssdk.services.kms.model.UpdatePrimaryRegionRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> primaryRegion;
primaryRegion = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.primaryRegion());
return new UpdatePrimaryRegionRequest(keyId, primaryRegion);
}
public static VerifyRequest VerifyRequest(
software.amazon.awssdk.services.kms.model.VerifyRequest nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Byte> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.message().asByteArray());
Option<MessageType> messageType;
messageType = Objects.nonNull(nativeValue.messageType()) ?
Option.create_Some(ToDafny.MessageType(nativeValue.messageType()))
: Option.create_None();
DafnySequence<? extends Byte> signature;
signature = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.signature().asByteArray());
SigningAlgorithmSpec signingAlgorithm;
signingAlgorithm = ToDafny.SigningAlgorithmSpec(nativeValue.signingAlgorithm());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> grantTokens;
grantTokens = (Objects.nonNull(nativeValue.grantTokens()) && nativeValue.grantTokens().size() > 0) ?
Option.create_Some(ToDafny.GrantTokenList(nativeValue.grantTokens()))
: Option.create_None();
return new VerifyRequest(keyId, message, messageType, signature, signingAlgorithm, grantTokens);
}
public static VerifyResponse VerifyResponse(
software.amazon.awssdk.services.kms.model.VerifyResponse nativeValue) {
Option<DafnySequence<? extends Character>> keyId;
keyId = Objects.nonNull(nativeValue.keyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId()))
: Option.create_None();
Option<Boolean> signatureValid;
signatureValid = Objects.nonNull(nativeValue.signatureValid()) ?
Option.create_Some((nativeValue.signatureValid()))
: Option.create_None();
Option<SigningAlgorithmSpec> signingAlgorithm;
signingAlgorithm = Objects.nonNull(nativeValue.signingAlgorithm()) ?
Option.create_Some(ToDafny.SigningAlgorithmSpec(nativeValue.signingAlgorithm()))
: Option.create_None();
return new VerifyResponse(keyId, signatureValid, signingAlgorithm);
}
public static Error Error(AlreadyExistsException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_AlreadyExistsException(message);
}
public static Error Error(CloudHsmClusterInUseException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CloudHsmClusterInUseException(message);
}
public static Error Error(CloudHsmClusterInvalidConfigurationException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CloudHsmClusterInvalidConfigurationException(message);
}
public static Error Error(CloudHsmClusterNotActiveException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CloudHsmClusterNotActiveException(message);
}
public static Error Error(CloudHsmClusterNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CloudHsmClusterNotFoundException(message);
}
public static Error Error(CloudHsmClusterNotRelatedException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CloudHsmClusterNotRelatedException(message);
}
public static Error Error(CustomKeyStoreHasCmKsException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CustomKeyStoreHasCMKsException(message);
}
public static Error Error(CustomKeyStoreInvalidStateException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CustomKeyStoreInvalidStateException(message);
}
public static Error Error(CustomKeyStoreNameInUseException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CustomKeyStoreNameInUseException(message);
}
public static Error Error(CustomKeyStoreNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_CustomKeyStoreNotFoundException(message);
}
public static Error Error(DependencyTimeoutException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_DependencyTimeoutException(message);
}
public static Error Error(DisabledException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_DisabledException(message);
}
public static Error Error(ExpiredImportTokenException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ExpiredImportTokenException(message);
}
public static Error Error(IncorrectKeyException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_IncorrectKeyException(message);
}
public static Error Error(IncorrectKeyMaterialException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_IncorrectKeyMaterialException(message);
}
public static Error Error(IncorrectTrustAnchorException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_IncorrectTrustAnchorException(message);
}
public static Error Error(InvalidAliasNameException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidAliasNameException(message);
}
public static Error Error(InvalidArnException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidArnException(message);
}
public static Error Error(InvalidCiphertextException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidCiphertextException(message);
}
public static Error Error(InvalidGrantIdException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidGrantIdException(message);
}
public static Error Error(InvalidGrantTokenException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidGrantTokenException(message);
}
public static Error Error(InvalidImportTokenException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidImportTokenException(message);
}
public static Error Error(InvalidKeyUsageException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidKeyUsageException(message);
}
public static Error Error(InvalidMarkerException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidMarkerException(message);
}
public static Error Error(KeyUnavailableException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_KeyUnavailableException(message);
}
public static Error Error(KmsInternalException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_KMSInternalException(message);
}
public static Error Error(KmsInvalidSignatureException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_KMSInvalidSignatureException(message);
}
public static Error Error(KmsInvalidStateException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_KMSInvalidStateException(message);
}
public static Error Error(LimitExceededException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_LimitExceededException(message);
}
public static Error Error(MalformedPolicyDocumentException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_MalformedPolicyDocumentException(message);
}
public static Error Error(NotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_NotFoundException(message);
}
public static Error Error(TagException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TagException(message);
}
public static Error Error(UnsupportedOperationException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_UnsupportedOperationException(message);
}
public static AlgorithmSpec AlgorithmSpec(
software.amazon.awssdk.services.kms.model.AlgorithmSpec nativeValue) {
switch (nativeValue) {
case RSAES_PKCS1_V1_5: {
return AlgorithmSpec.create_RSAES__PKCS1__V1__5();
}
case RSAES_OAEP_SHA_1: {
return AlgorithmSpec.create_RSAES__OAEP__SHA__1();
}
case RSAES_OAEP_SHA_256: {
return AlgorithmSpec.create_RSAES__OAEP__SHA__256();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.AlgorithmSpec.");
}
}
}
public static ConnectionErrorCodeType ConnectionErrorCodeType(
software.amazon.awssdk.services.kms.model.ConnectionErrorCodeType nativeValue) {
switch (nativeValue) {
case INVALID_CREDENTIALS: {
return ConnectionErrorCodeType.create_INVALID__CREDENTIALS();
}
case CLUSTER_NOT_FOUND: {
return ConnectionErrorCodeType.create_CLUSTER__NOT__FOUND();
}
case NETWORK_ERRORS: {
return ConnectionErrorCodeType.create_NETWORK__ERRORS();
}
case INTERNAL_ERROR: {
return ConnectionErrorCodeType.create_INTERNAL__ERROR();
}
case INSUFFICIENT_CLOUDHSM_HSMS: {
return ConnectionErrorCodeType.create_INSUFFICIENT__CLOUDHSM__HSMS();
}
case USER_LOCKED_OUT: {
return ConnectionErrorCodeType.create_USER__LOCKED__OUT();
}
case USER_NOT_FOUND: {
return ConnectionErrorCodeType.create_USER__NOT__FOUND();
}
case USER_LOGGED_IN: {
return ConnectionErrorCodeType.create_USER__LOGGED__IN();
}
case SUBNET_NOT_FOUND: {
return ConnectionErrorCodeType.create_SUBNET__NOT__FOUND();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.ConnectionErrorCodeType.");
}
}
}
public static ConnectionStateType ConnectionStateType(
software.amazon.awssdk.services.kms.model.ConnectionStateType nativeValue) {
switch (nativeValue) {
case CONNECTED: {
return ConnectionStateType.create_CONNECTED();
}
case CONNECTING: {
return ConnectionStateType.create_CONNECTING();
}
case FAILED: {
return ConnectionStateType.create_FAILED();
}
case DISCONNECTED: {
return ConnectionStateType.create_DISCONNECTED();
}
case DISCONNECTING: {
return ConnectionStateType.create_DISCONNECTING();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.ConnectionStateType.");
}
}
}
public static CustomerMasterKeySpec CustomerMasterKeySpec(
software.amazon.awssdk.services.kms.model.CustomerMasterKeySpec nativeValue) {
switch (nativeValue) {
case RSA_2048: {
return CustomerMasterKeySpec.create_RSA__2048();
}
case RSA_3072: {
return CustomerMasterKeySpec.create_RSA__3072();
}
case RSA_4096: {
return CustomerMasterKeySpec.create_RSA__4096();
}
case ECC_NIST_P256: {
return CustomerMasterKeySpec.create_ECC__NIST__P256();
}
case ECC_NIST_P384: {
return CustomerMasterKeySpec.create_ECC__NIST__P384();
}
case ECC_NIST_P521: {
return CustomerMasterKeySpec.create_ECC__NIST__P521();
}
case ECC_SECG_P256_K1: {
return CustomerMasterKeySpec.create_ECC__SECG__P256K1();
}
case SYMMETRIC_DEFAULT: {
return CustomerMasterKeySpec.create_SYMMETRIC__DEFAULT();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.CustomerMasterKeySpec.");
}
}
}
public static DataKeyPairSpec DataKeyPairSpec(
software.amazon.awssdk.services.kms.model.DataKeyPairSpec nativeValue) {
switch (nativeValue) {
case RSA_2048: {
return DataKeyPairSpec.create_RSA__2048();
}
case RSA_3072: {
return DataKeyPairSpec.create_RSA__3072();
}
case RSA_4096: {
return DataKeyPairSpec.create_RSA__4096();
}
case ECC_NIST_P256: {
return DataKeyPairSpec.create_ECC__NIST__P256();
}
case ECC_NIST_P384: {
return DataKeyPairSpec.create_ECC__NIST__P384();
}
case ECC_NIST_P521: {
return DataKeyPairSpec.create_ECC__NIST__P521();
}
case ECC_SECG_P256_K1: {
return DataKeyPairSpec.create_ECC__SECG__P256K1();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.DataKeyPairSpec.");
}
}
}
public static DataKeySpec DataKeySpec(
software.amazon.awssdk.services.kms.model.DataKeySpec nativeValue) {
switch (nativeValue) {
case AES_256: {
return DataKeySpec.create_AES__256();
}
case AES_128: {
return DataKeySpec.create_AES__128();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.DataKeySpec.");
}
}
}
public static EncryptionAlgorithmSpec EncryptionAlgorithmSpec(
software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec nativeValue) {
switch (nativeValue) {
case SYMMETRIC_DEFAULT: {
return EncryptionAlgorithmSpec.create_SYMMETRIC__DEFAULT();
}
case RSAES_OAEP_SHA_1: {
return EncryptionAlgorithmSpec.create_RSAES__OAEP__SHA__1();
}
case RSAES_OAEP_SHA_256: {
return EncryptionAlgorithmSpec.create_RSAES__OAEP__SHA__256();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec.");
}
}
}
public static ExpirationModelType ExpirationModelType(
software.amazon.awssdk.services.kms.model.ExpirationModelType nativeValue) {
switch (nativeValue) {
case KEY_MATERIAL_EXPIRES: {
return ExpirationModelType.create_KEY__MATERIAL__EXPIRES();
}
case KEY_MATERIAL_DOES_NOT_EXPIRE: {
return ExpirationModelType.create_KEY__MATERIAL__DOES__NOT__EXPIRE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.ExpirationModelType.");
}
}
}
public static GrantOperation GrantOperation(
software.amazon.awssdk.services.kms.model.GrantOperation nativeValue) {
switch (nativeValue) {
case DECRYPT: {
return GrantOperation.create_Decrypt();
}
case ENCRYPT: {
return GrantOperation.create_Encrypt();
}
case GENERATE_DATA_KEY: {
return GrantOperation.create_GenerateDataKey();
}
case GENERATE_DATA_KEY_WITHOUT_PLAINTEXT: {
return GrantOperation.create_GenerateDataKeyWithoutPlaintext();
}
case RE_ENCRYPT_FROM: {
return GrantOperation.create_ReEncryptFrom();
}
case RE_ENCRYPT_TO: {
return GrantOperation.create_ReEncryptTo();
}
case SIGN: {
return GrantOperation.create_Sign();
}
case VERIFY: {
return GrantOperation.create_Verify();
}
case GET_PUBLIC_KEY: {
return GrantOperation.create_GetPublicKey();
}
case CREATE_GRANT: {
return GrantOperation.create_CreateGrant();
}
case RETIRE_GRANT: {
return GrantOperation.create_RetireGrant();
}
case DESCRIBE_KEY: {
return GrantOperation.create_DescribeKey();
}
case GENERATE_DATA_KEY_PAIR: {
return GrantOperation.create_GenerateDataKeyPair();
}
case GENERATE_DATA_KEY_PAIR_WITHOUT_PLAINTEXT: {
return GrantOperation.create_GenerateDataKeyPairWithoutPlaintext();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.GrantOperation.");
}
}
}
public static KeyManagerType KeyManagerType(
software.amazon.awssdk.services.kms.model.KeyManagerType nativeValue) {
switch (nativeValue) {
case AWS: {
return KeyManagerType.create_AWS();
}
case CUSTOMER: {
return KeyManagerType.create_CUSTOMER();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.KeyManagerType.");
}
}
}
public static KeySpec KeySpec(software.amazon.awssdk.services.kms.model.KeySpec nativeValue) {
switch (nativeValue) {
case RSA_2048: {
return KeySpec.create_RSA__2048();
}
case RSA_3072: {
return KeySpec.create_RSA__3072();
}
case RSA_4096: {
return KeySpec.create_RSA__4096();
}
case ECC_NIST_P256: {
return KeySpec.create_ECC__NIST__P256();
}
case ECC_NIST_P384: {
return KeySpec.create_ECC__NIST__P384();
}
case ECC_NIST_P521: {
return KeySpec.create_ECC__NIST__P521();
}
case ECC_SECG_P256_K1: {
return KeySpec.create_ECC__SECG__P256K1();
}
case SYMMETRIC_DEFAULT: {
return KeySpec.create_SYMMETRIC__DEFAULT();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.KeySpec.");
}
}
}
public static KeyState KeyState(software.amazon.awssdk.services.kms.model.KeyState nativeValue) {
switch (nativeValue) {
case CREATING: {
return KeyState.create_Creating();
}
case ENABLED: {
return KeyState.create_Enabled();
}
case DISABLED: {
return KeyState.create_Disabled();
}
case PENDING_DELETION: {
return KeyState.create_PendingDeletion();
}
case PENDING_IMPORT: {
return KeyState.create_PendingImport();
}
case PENDING_REPLICA_DELETION: {
return KeyState.create_PendingReplicaDeletion();
}
case UNAVAILABLE: {
return KeyState.create_Unavailable();
}
case UPDATING: {
return KeyState.create_Updating();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.KeyState.");
}
}
}
public static KeyUsageType KeyUsageType(
software.amazon.awssdk.services.kms.model.KeyUsageType nativeValue) {
switch (nativeValue) {
case SIGN_VERIFY: {
return KeyUsageType.create_SIGN__VERIFY();
}
case ENCRYPT_DECRYPT: {
return KeyUsageType.create_ENCRYPT__DECRYPT();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.KeyUsageType.");
}
}
}
public static MessageType MessageType(
software.amazon.awssdk.services.kms.model.MessageType nativeValue) {
switch (nativeValue) {
case RAW: {
return MessageType.create_RAW();
}
case DIGEST: {
return MessageType.create_DIGEST();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.MessageType.");
}
}
}
public static MultiRegionKeyType MultiRegionKeyType(
software.amazon.awssdk.services.kms.model.MultiRegionKeyType nativeValue) {
switch (nativeValue) {
case PRIMARY: {
return MultiRegionKeyType.create_PRIMARY();
}
case REPLICA: {
return MultiRegionKeyType.create_REPLICA();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.MultiRegionKeyType.");
}
}
}
public static OriginType OriginType(
software.amazon.awssdk.services.kms.model.OriginType nativeValue) {
switch (nativeValue) {
case AWS_KMS: {
return OriginType.create_AWS__KMS();
}
case EXTERNAL: {
return OriginType.create_EXTERNAL();
}
case AWS_CLOUDHSM: {
return OriginType.create_AWS__CLOUDHSM();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.OriginType.");
}
}
}
public static SigningAlgorithmSpec SigningAlgorithmSpec(
software.amazon.awssdk.services.kms.model.SigningAlgorithmSpec nativeValue) {
switch (nativeValue) {
case RSASSA_PSS_SHA_256: {
return SigningAlgorithmSpec.create_RSASSA__PSS__SHA__256();
}
case RSASSA_PSS_SHA_384: {
return SigningAlgorithmSpec.create_RSASSA__PSS__SHA__384();
}
case RSASSA_PSS_SHA_512: {
return SigningAlgorithmSpec.create_RSASSA__PSS__SHA__512();
}
case RSASSA_PKCS1_V1_5_SHA_256: {
return SigningAlgorithmSpec.create_RSASSA__PKCS1__V1__5__SHA__256();
}
case RSASSA_PKCS1_V1_5_SHA_384: {
return SigningAlgorithmSpec.create_RSASSA__PKCS1__V1__5__SHA__384();
}
case RSASSA_PKCS1_V1_5_SHA_512: {
return SigningAlgorithmSpec.create_RSASSA__PKCS1__V1__5__SHA__512();
}
case ECDSA_SHA_256: {
return SigningAlgorithmSpec.create_ECDSA__SHA__256();
}
case ECDSA_SHA_384: {
return SigningAlgorithmSpec.create_ECDSA__SHA__384();
}
case ECDSA_SHA_512: {
return SigningAlgorithmSpec.create_ECDSA__SHA__512();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.SigningAlgorithmSpec.");
}
}
}
public static WrappingKeySpec WrappingKeySpec(
software.amazon.awssdk.services.kms.model.WrappingKeySpec nativeValue) {
switch (nativeValue) {
case RSA_2048: {
return WrappingKeySpec.create();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.kms.internaldafny.types.WrappingKeySpec.");
}
}
}
public static AlgorithmSpec AlgorithmSpec(String nativeValue) {
return AlgorithmSpec(software.amazon.awssdk.services.kms.model.AlgorithmSpec.fromValue(nativeValue));
}
public static ConnectionErrorCodeType ConnectionErrorCodeType(String nativeValue) {
return ConnectionErrorCodeType(software.amazon.awssdk.services.kms.model.ConnectionErrorCodeType.fromValue(nativeValue));
}
public static ConnectionStateType ConnectionStateType(String nativeValue) {
return ConnectionStateType(software.amazon.awssdk.services.kms.model.ConnectionStateType.fromValue(nativeValue));
}
public static CustomerMasterKeySpec CustomerMasterKeySpec(String nativeValue) {
return CustomerMasterKeySpec(software.amazon.awssdk.services.kms.model.CustomerMasterKeySpec.fromValue(nativeValue));
}
public static DataKeyPairSpec DataKeyPairSpec(String nativeValue) {
return DataKeyPairSpec(software.amazon.awssdk.services.kms.model.DataKeyPairSpec.fromValue(nativeValue));
}
public static DataKeySpec DataKeySpec(String nativeValue) {
return DataKeySpec(software.amazon.awssdk.services.kms.model.DataKeySpec.fromValue(nativeValue));
}
public static EncryptionAlgorithmSpec EncryptionAlgorithmSpec(String nativeValue) {
return EncryptionAlgorithmSpec(software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec.fromValue(nativeValue));
}
public static ExpirationModelType ExpirationModelType(String nativeValue) {
return ExpirationModelType(software.amazon.awssdk.services.kms.model.ExpirationModelType.fromValue(nativeValue));
}
public static GrantOperation GrantOperation(String nativeValue) {
return GrantOperation(software.amazon.awssdk.services.kms.model.GrantOperation.fromValue(nativeValue));
}
public static KeyManagerType KeyManagerType(String nativeValue) {
return KeyManagerType(software.amazon.awssdk.services.kms.model.KeyManagerType.fromValue(nativeValue));
}
public static KeySpec KeySpec(String nativeValue) {
return KeySpec(software.amazon.awssdk.services.kms.model.KeySpec.fromValue(nativeValue));
}
public static KeyState KeyState(String nativeValue) {
return KeyState(software.amazon.awssdk.services.kms.model.KeyState.fromValue(nativeValue));
}
public static KeyUsageType KeyUsageType(String nativeValue) {
return KeyUsageType(software.amazon.awssdk.services.kms.model.KeyUsageType.fromValue(nativeValue));
}
public static MessageType MessageType(String nativeValue) {
return MessageType(software.amazon.awssdk.services.kms.model.MessageType.fromValue(nativeValue));
}
public static MultiRegionKeyType MultiRegionKeyType(String nativeValue) {
return MultiRegionKeyType(software.amazon.awssdk.services.kms.model.MultiRegionKeyType.fromValue(nativeValue));
}
public static OriginType OriginType(String nativeValue) {
return OriginType(software.amazon.awssdk.services.kms.model.OriginType.fromValue(nativeValue));
}
public static SigningAlgorithmSpec SigningAlgorithmSpec(String nativeValue) {
return SigningAlgorithmSpec(software.amazon.awssdk.services.kms.model.SigningAlgorithmSpec.fromValue(nativeValue));
}
public static WrappingKeySpec WrappingKeySpec(String nativeValue) {
return WrappingKeySpec(software.amazon.awssdk.services.kms.model.WrappingKeySpec.fromValue(nativeValue));
}
public static Error Error(KmsException nativeValue) {
// BEGIN MANUAL EDIT
return new Error_Opaque(nativeValue);
// END MANUAL EDIT
}
public static IKMSClient TrentService(KmsClient nativeValue) {
return new Shim(nativeValue, null);
}
}
| 409 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/java/software/amazon/cryptography/services/dynamodb
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/java/software/amazon/cryptography/services/dynamodb/internaldafny/__default.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package software.amazon.cryptography.services.dynamodb.internaldafny;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error;
import Wrappers_Compile.Option;
import Wrappers_Compile.Result;
import software.amazon.awssdk.auth.credentials.ProfileCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import dafny.DafnySequence;
import static software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence;
import static software.amazon.smithy.dafny.conversion.ToNative.Simple.String;
public class __default extends software.amazon.cryptography.services.dynamodb.internaldafny._ExternBase___default{
public static Result<IDynamoDBClient, Error> DynamoDBClient() {
try {
Region region = new DefaultAwsRegionProviderChain().getRegion();
final DynamoDbClient ddbClient = DynamoDbClient.builder()
.region(region)
.build();
IDynamoDBClient shim = new Shim(ddbClient, region.toString());
return Result.create_Success(shim);
} catch (Exception e) {
Error dafny_error = Error.create_InternalServerError(
Option.create_Some(CharacterSequence(e.getMessage())));
return Result.create_Failure(dafny_error);
}
}
public static Result<IDynamoDBClient, Error> DDBClientForRegion(
final DafnySequence<? extends Character> region
) {
try {
final String regionString = new String((char[]) region.toArray().unwrap());
final DynamoDbClient ddbClient = DynamoDbClient.builder()
.region(Region.of(regionString))
.build();
IDynamoDBClient shim = new Shim(ddbClient, regionString);
return Result.create_Success(shim);
} catch (Exception e) {
Error dafny_error = Error.create_InternalServerError(
Option.create_Some(CharacterSequence(e.getMessage())));
return Result.create_Failure(dafny_error);
}
}
}
| 410 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/java/software/amazon/cryptography/services/dynamodb/internaldafny
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/java/software/amazon/cryptography/services/dynamodb/internaldafny/types/__default.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package software.amazon.cryptography.services.dynamodb.internaldafny.types;
public class __default extends software.amazon.cryptography.services.dynamodb.internaldafny.types._ExternBase___default {}
| 411 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb/internaldafny/ToNative.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.dynamodb.internaldafny;
import dafny.DafnyMap;
import dafny.DafnySequence;
import java.lang.Byte;
import java.lang.Character;
import java.lang.Double;
import java.lang.String;
import java.util.List;
import java.util.Map;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.ArchivalSummary;
import software.amazon.awssdk.services.dynamodb.model.AttributeAction;
import software.amazon.awssdk.services.dynamodb.model.AttributeDefinition;
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
import software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingPolicyDescription;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingPolicyUpdate;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingSettingsDescription;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingSettingsUpdate;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingTargetTrackingScalingPolicyConfigurationDescription;
import software.amazon.awssdk.services.dynamodb.model.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate;
import software.amazon.awssdk.services.dynamodb.model.BackupDescription;
import software.amazon.awssdk.services.dynamodb.model.BackupDetails;
import software.amazon.awssdk.services.dynamodb.model.BackupInUseException;
import software.amazon.awssdk.services.dynamodb.model.BackupNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.BackupStatus;
import software.amazon.awssdk.services.dynamodb.model.BackupSummary;
import software.amazon.awssdk.services.dynamodb.model.BackupType;
import software.amazon.awssdk.services.dynamodb.model.BackupTypeFilter;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchStatementError;
import software.amazon.awssdk.services.dynamodb.model.BatchStatementErrorCodeEnum;
import software.amazon.awssdk.services.dynamodb.model.BatchStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.BillingMode;
import software.amazon.awssdk.services.dynamodb.model.BillingModeSummary;
import software.amazon.awssdk.services.dynamodb.model.CancellationReason;
import software.amazon.awssdk.services.dynamodb.model.Capacity;
import software.amazon.awssdk.services.dynamodb.model.ComparisonOperator;
import software.amazon.awssdk.services.dynamodb.model.Condition;
import software.amazon.awssdk.services.dynamodb.model.ConditionCheck;
import software.amazon.awssdk.services.dynamodb.model.ConditionalCheckFailedException;
import software.amazon.awssdk.services.dynamodb.model.ConditionalOperator;
import software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity;
import software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsDescription;
import software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsStatus;
import software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.ContributorInsightsAction;
import software.amazon.awssdk.services.dynamodb.model.ContributorInsightsStatus;
import software.amazon.awssdk.services.dynamodb.model.ContributorInsightsSummary;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalSecondaryIndexAction;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateReplicaAction;
import software.amazon.awssdk.services.dynamodb.model.CreateReplicationGroupMemberAction;
import software.amazon.awssdk.services.dynamodb.model.CreateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.CsvOptions;
import software.amazon.awssdk.services.dynamodb.model.Delete;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteGlobalSecondaryIndexAction;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteReplicaAction;
import software.amazon.awssdk.services.dynamodb.model.DeleteReplicationGroupMemberAction;
import software.amazon.awssdk.services.dynamodb.model.DeleteRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveResponse;
import software.amazon.awssdk.services.dynamodb.model.DestinationStatus;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DuplicateItemException;
// BEGIN MANUAL EDIT
import software.amazon.awssdk.services.dynamodb.model.DynamoDbException;
// END MANUAL EDIT
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.Endpoint;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionResponse;
import software.amazon.awssdk.services.dynamodb.model.ExpectedAttributeValue;
import software.amazon.awssdk.services.dynamodb.model.ExportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ExportDescription;
import software.amazon.awssdk.services.dynamodb.model.ExportFormat;
import software.amazon.awssdk.services.dynamodb.model.ExportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ExportStatus;
import software.amazon.awssdk.services.dynamodb.model.ExportSummary;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.FailureException;
import software.amazon.awssdk.services.dynamodb.model.Get;
import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.GetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndex;
import software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexAutoScalingUpdate;
import software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexDescription;
import software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexInfo;
import software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexUpdate;
import software.amazon.awssdk.services.dynamodb.model.GlobalTable;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableDescription;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableGlobalSecondaryIndexSettingsUpdate;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableStatus;
import software.amazon.awssdk.services.dynamodb.model.IdempotentParameterMismatchException;
import software.amazon.awssdk.services.dynamodb.model.ImportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ImportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ImportStatus;
import software.amazon.awssdk.services.dynamodb.model.ImportSummary;
import software.amazon.awssdk.services.dynamodb.model.ImportTableDescription;
import software.amazon.awssdk.services.dynamodb.model.ImportTableRequest;
import software.amazon.awssdk.services.dynamodb.model.ImportTableResponse;
import software.amazon.awssdk.services.dynamodb.model.IndexNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.IndexStatus;
import software.amazon.awssdk.services.dynamodb.model.InputCompressionType;
import software.amazon.awssdk.services.dynamodb.model.InputFormat;
import software.amazon.awssdk.services.dynamodb.model.InputFormatOptions;
import software.amazon.awssdk.services.dynamodb.model.InternalServerErrorException;
import software.amazon.awssdk.services.dynamodb.model.InvalidExportTimeException;
import software.amazon.awssdk.services.dynamodb.model.InvalidRestoreTimeException;
import software.amazon.awssdk.services.dynamodb.model.ItemCollectionMetrics;
import software.amazon.awssdk.services.dynamodb.model.ItemCollectionSizeLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ItemResponse;
import software.amazon.awssdk.services.dynamodb.model.KeySchemaElement;
import software.amazon.awssdk.services.dynamodb.model.KeyType;
import software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes;
import software.amazon.awssdk.services.dynamodb.model.KinesisDataStreamDestination;
import software.amazon.awssdk.services.dynamodb.model.LimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListExportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListExportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListImportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListImportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceResponse;
import software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndex;
import software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexDescription;
import software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexInfo;
import software.amazon.awssdk.services.dynamodb.model.ParameterizedStatement;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryDescription;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoverySpecification;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryStatus;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.Projection;
import software.amazon.awssdk.services.dynamodb.model.ProjectionType;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughput;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputDescription;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputExceededException;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputOverride;
import software.amazon.awssdk.services.dynamodb.model.Put;
import software.amazon.awssdk.services.dynamodb.model.PutItemRequest;
import software.amazon.awssdk.services.dynamodb.model.PutItemResponse;
import software.amazon.awssdk.services.dynamodb.model.PutRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;
import software.amazon.awssdk.services.dynamodb.model.Replica;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingUpdate;
import software.amazon.awssdk.services.dynamodb.model.ReplicaDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndex;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingUpdate;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsUpdate;
import software.amazon.awssdk.services.dynamodb.model.ReplicaNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsDescription;
import software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsUpdate;
import software.amazon.awssdk.services.dynamodb.model.ReplicaStatus;
import software.amazon.awssdk.services.dynamodb.model.ReplicaUpdate;
import software.amazon.awssdk.services.dynamodb.model.ReplicationGroupUpdate;
import software.amazon.awssdk.services.dynamodb.model.RequestLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ResourceInUseException;
import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.RestoreSummary;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity;
import software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics;
import software.amazon.awssdk.services.dynamodb.model.ReturnValue;
import software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure;
import software.amazon.awssdk.services.dynamodb.model.S3BucketSource;
import software.amazon.awssdk.services.dynamodb.model.S3SseAlgorithm;
import software.amazon.awssdk.services.dynamodb.model.SSEDescription;
import software.amazon.awssdk.services.dynamodb.model.SSESpecification;
import software.amazon.awssdk.services.dynamodb.model.SSEStatus;
import software.amazon.awssdk.services.dynamodb.model.SSEType;
import software.amazon.awssdk.services.dynamodb.model.ScalarAttributeType;
import software.amazon.awssdk.services.dynamodb.model.ScanRequest;
import software.amazon.awssdk.services.dynamodb.model.ScanResponse;
import software.amazon.awssdk.services.dynamodb.model.Select;
import software.amazon.awssdk.services.dynamodb.model.SourceTableDetails;
import software.amazon.awssdk.services.dynamodb.model.SourceTableFeatureDetails;
import software.amazon.awssdk.services.dynamodb.model.StreamSpecification;
import software.amazon.awssdk.services.dynamodb.model.StreamViewType;
import software.amazon.awssdk.services.dynamodb.model.TableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.TableAutoScalingDescription;
import software.amazon.awssdk.services.dynamodb.model.TableClass;
import software.amazon.awssdk.services.dynamodb.model.TableClassSummary;
import software.amazon.awssdk.services.dynamodb.model.TableCreationParameters;
import software.amazon.awssdk.services.dynamodb.model.TableDescription;
import software.amazon.awssdk.services.dynamodb.model.TableInUseException;
import software.amazon.awssdk.services.dynamodb.model.TableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.TableStatus;
import software.amazon.awssdk.services.dynamodb.model.Tag;
import software.amazon.awssdk.services.dynamodb.model.TagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.TimeToLiveDescription;
import software.amazon.awssdk.services.dynamodb.model.TimeToLiveSpecification;
import software.amazon.awssdk.services.dynamodb.model.TimeToLiveStatus;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItem;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItem;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactionCanceledException;
import software.amazon.awssdk.services.dynamodb.model.TransactionConflictException;
import software.amazon.awssdk.services.dynamodb.model.TransactionInProgressException;
import software.amazon.awssdk.services.dynamodb.model.UntagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.Update;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalSecondaryIndexAction;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateReplicationGroupMemberAction;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveResponse;
import software.amazon.awssdk.services.dynamodb.model.WriteRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_BackupInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_BackupNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ConditionalCheckFailedException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ContinuousBackupsUnavailableException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_DuplicateItemException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ExportConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ExportNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_GlobalTableAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_GlobalTableNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_IdempotentParameterMismatchException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ImportConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ImportNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_IndexNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InternalServerError;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InvalidExportTimeException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InvalidRestoreTimeException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ItemCollectionSizeLimitExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_LimitExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_PointInTimeRecoveryUnavailableException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ProvisionedThroughputExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ReplicaAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ReplicaNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_RequestLimitExceeded;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ResourceInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ResourceNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionCanceledException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionInProgressException;
// BEGIN MANUAL EDIT
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_Opaque;
// END MANUAL EDIT
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UntagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveOutput;
public class ToNative {
// BEGIN MANUAL EDIT
public static RuntimeException Error(Error_Opaque dafnyValue) {
if (dafnyValue.dtor_obj() instanceof DynamoDbException) {
return (DynamoDbException) dafnyValue.dtor_obj();
}
// Because we only ever put `DynamoDbException` into `Error_Opaque`,
// recieving any other type here indicates a bug with the codegen.
// Bubble up some error to indicate this failure state.
return new IllegalStateException("Unknown error recieved from DynamoDb.");
}
// END MANUAL EDIT
public static ArchivalSummary ArchivalSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ArchivalSummary dafnyValue) {
ArchivalSummary.Builder builder = ArchivalSummary.builder();
if (dafnyValue.dtor_ArchivalBackupArn().is_Some()) {
builder.archivalBackupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ArchivalBackupArn().dtor_value()));
}
if (dafnyValue.dtor_ArchivalDateTime().is_Some()) {
builder.archivalDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ArchivalDateTime().dtor_value()));
}
if (dafnyValue.dtor_ArchivalReason().is_Some()) {
builder.archivalReason(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ArchivalReason().dtor_value()));
}
return builder.build();
}
public static AttributeAction AttributeAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction dafnyValue) {
if (dafnyValue.is_ADD()) {
return AttributeAction.ADD;
}
if (dafnyValue.is_PUT()) {
return AttributeAction.PUT;
}
if (dafnyValue.is_DELETE()) {
return AttributeAction.DELETE;
}
return AttributeAction.fromValue(dafnyValue.toString());
}
public static AttributeDefinition AttributeDefinition(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeDefinition dafnyValue) {
AttributeDefinition.Builder builder = AttributeDefinition.builder();
builder.attributeName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AttributeName()));
builder.attributeType(ToNative.ScalarAttributeType(dafnyValue.dtor_AttributeType()));
return builder.build();
}
public static List<AttributeDefinition> AttributeDefinitions(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeDefinition> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeDefinition);
}
public static Map<String, AttributeValue> AttributeMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static List<String> AttributeNameList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static Map<String, AttributeValueUpdate> AttributeUpdates(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValueUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValueUpdate);
}
public static AttributeValue AttributeValue(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue dafnyValue) {
AttributeValue.Builder builder = AttributeValue.builder();
if (dafnyValue.is_S()) {
builder.s(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S()));
}
if (dafnyValue.is_N()) {
builder.n(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_N()));
}
if (dafnyValue.is_B()) {
builder.b(SdkBytes.fromByteArray((byte[]) (dafnyValue.dtor_B().toRawArray())));
}
if (dafnyValue.is_SS()) {
builder.ss(ToNative.StringSetAttributeValue(dafnyValue.dtor_SS()));
}
if (dafnyValue.is_NS()) {
builder.ns(ToNative.NumberSetAttributeValue(dafnyValue.dtor_NS()));
}
if (dafnyValue.is_BS()) {
builder.bs(ToNative.BinarySetAttributeValue(dafnyValue.dtor_BS()));
}
if (dafnyValue.is_M()) {
builder.m(ToNative.MapAttributeValue(dafnyValue.dtor_M()));
}
if (dafnyValue.is_L()) {
builder.l(ToNative.ListAttributeValue(dafnyValue.dtor_L()));
}
if (dafnyValue.is_NULL()) {
builder.nul((dafnyValue.dtor_NULL()));
}
if (dafnyValue.is_BOOL()) {
builder.bool((dafnyValue.dtor_BOOL()));
}
return builder.build();
}
public static List<AttributeValue> AttributeValueList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static AttributeValueUpdate AttributeValueUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValueUpdate dafnyValue) {
AttributeValueUpdate.Builder builder = AttributeValueUpdate.builder();
if (dafnyValue.dtor_Action().is_Some()) {
builder.action(ToNative.AttributeAction(dafnyValue.dtor_Action().dtor_value()));
}
if (dafnyValue.dtor_Value().is_Some()) {
builder.value(ToNative.AttributeValue(dafnyValue.dtor_Value().dtor_value()));
}
return builder.build();
}
public static AutoScalingPolicyDescription AutoScalingPolicyDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyDescription dafnyValue) {
AutoScalingPolicyDescription.Builder builder = AutoScalingPolicyDescription.builder();
if (dafnyValue.dtor_PolicyName().is_Some()) {
builder.policyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_PolicyName().dtor_value()));
}
if (dafnyValue.dtor_TargetTrackingScalingPolicyConfiguration().is_Some()) {
builder.targetTrackingScalingPolicyConfiguration(ToNative.AutoScalingTargetTrackingScalingPolicyConfigurationDescription(dafnyValue.dtor_TargetTrackingScalingPolicyConfiguration().dtor_value()));
}
return builder.build();
}
public static List<AutoScalingPolicyDescription> AutoScalingPolicyDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AutoScalingPolicyDescription);
}
public static AutoScalingPolicyUpdate AutoScalingPolicyUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyUpdate dafnyValue) {
AutoScalingPolicyUpdate.Builder builder = AutoScalingPolicyUpdate.builder();
if (dafnyValue.dtor_PolicyName().is_Some()) {
builder.policyName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_PolicyName().dtor_value()));
}
builder.targetTrackingScalingPolicyConfiguration(ToNative.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(dafnyValue.dtor_TargetTrackingScalingPolicyConfiguration()));
return builder.build();
}
public static AutoScalingSettingsDescription AutoScalingSettingsDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsDescription dafnyValue) {
AutoScalingSettingsDescription.Builder builder = AutoScalingSettingsDescription.builder();
if (dafnyValue.dtor_AutoScalingDisabled().is_Some()) {
builder.autoScalingDisabled((dafnyValue.dtor_AutoScalingDisabled().dtor_value()));
}
if (dafnyValue.dtor_AutoScalingRoleArn().is_Some()) {
builder.autoScalingRoleArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AutoScalingRoleArn().dtor_value()));
}
if (dafnyValue.dtor_MaximumUnits().is_Some()) {
builder.maximumUnits((dafnyValue.dtor_MaximumUnits().dtor_value()));
}
if (dafnyValue.dtor_MinimumUnits().is_Some()) {
builder.minimumUnits((dafnyValue.dtor_MinimumUnits().dtor_value()));
}
if (dafnyValue.dtor_ScalingPolicies().is_Some()) {
builder.scalingPolicies(ToNative.AutoScalingPolicyDescriptionList(dafnyValue.dtor_ScalingPolicies().dtor_value()));
}
return builder.build();
}
public static AutoScalingSettingsUpdate AutoScalingSettingsUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsUpdate dafnyValue) {
AutoScalingSettingsUpdate.Builder builder = AutoScalingSettingsUpdate.builder();
if (dafnyValue.dtor_AutoScalingDisabled().is_Some()) {
builder.autoScalingDisabled((dafnyValue.dtor_AutoScalingDisabled().dtor_value()));
}
if (dafnyValue.dtor_AutoScalingRoleArn().is_Some()) {
builder.autoScalingRoleArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AutoScalingRoleArn().dtor_value()));
}
if (dafnyValue.dtor_MaximumUnits().is_Some()) {
builder.maximumUnits((dafnyValue.dtor_MaximumUnits().dtor_value()));
}
if (dafnyValue.dtor_MinimumUnits().is_Some()) {
builder.minimumUnits((dafnyValue.dtor_MinimumUnits().dtor_value()));
}
if (dafnyValue.dtor_ScalingPolicyUpdate().is_Some()) {
builder.scalingPolicyUpdate(ToNative.AutoScalingPolicyUpdate(dafnyValue.dtor_ScalingPolicyUpdate().dtor_value()));
}
return builder.build();
}
public static AutoScalingTargetTrackingScalingPolicyConfigurationDescription AutoScalingTargetTrackingScalingPolicyConfigurationDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription dafnyValue) {
AutoScalingTargetTrackingScalingPolicyConfigurationDescription.Builder builder = AutoScalingTargetTrackingScalingPolicyConfigurationDescription.builder();
if (dafnyValue.dtor_DisableScaleIn().is_Some()) {
builder.disableScaleIn((dafnyValue.dtor_DisableScaleIn().dtor_value()));
}
if (dafnyValue.dtor_ScaleInCooldown().is_Some()) {
builder.scaleInCooldown((dafnyValue.dtor_ScaleInCooldown().dtor_value()));
}
if (dafnyValue.dtor_ScaleOutCooldown().is_Some()) {
builder.scaleOutCooldown((dafnyValue.dtor_ScaleOutCooldown().dtor_value()));
}
builder.targetValue(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_TargetValue()));
return builder.build();
}
public static AutoScalingTargetTrackingScalingPolicyConfigurationUpdate AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate dafnyValue) {
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.Builder builder = AutoScalingTargetTrackingScalingPolicyConfigurationUpdate.builder();
if (dafnyValue.dtor_DisableScaleIn().is_Some()) {
builder.disableScaleIn((dafnyValue.dtor_DisableScaleIn().dtor_value()));
}
if (dafnyValue.dtor_ScaleInCooldown().is_Some()) {
builder.scaleInCooldown((dafnyValue.dtor_ScaleInCooldown().dtor_value()));
}
if (dafnyValue.dtor_ScaleOutCooldown().is_Some()) {
builder.scaleOutCooldown((dafnyValue.dtor_ScaleOutCooldown().dtor_value()));
}
builder.targetValue(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_TargetValue()));
return builder.build();
}
public static BackupDescription BackupDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDescription dafnyValue) {
BackupDescription.Builder builder = BackupDescription.builder();
if (dafnyValue.dtor_BackupDetails().is_Some()) {
builder.backupDetails(ToNative.BackupDetails(dafnyValue.dtor_BackupDetails().dtor_value()));
}
if (dafnyValue.dtor_SourceTableDetails().is_Some()) {
builder.sourceTableDetails(ToNative.SourceTableDetails(dafnyValue.dtor_SourceTableDetails().dtor_value()));
}
if (dafnyValue.dtor_SourceTableFeatureDetails().is_Some()) {
builder.sourceTableFeatureDetails(ToNative.SourceTableFeatureDetails(dafnyValue.dtor_SourceTableFeatureDetails().dtor_value()));
}
return builder.build();
}
public static BackupDetails BackupDetails(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDetails dafnyValue) {
BackupDetails.Builder builder = BackupDetails.builder();
builder.backupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupArn()));
builder.backupCreationDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_BackupCreationDateTime()));
if (dafnyValue.dtor_BackupExpiryDateTime().is_Some()) {
builder.backupExpiryDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_BackupExpiryDateTime().dtor_value()));
}
builder.backupName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupName()));
if (dafnyValue.dtor_BackupSizeBytes().is_Some()) {
builder.backupSizeBytes((dafnyValue.dtor_BackupSizeBytes().dtor_value()));
}
builder.backupStatus(ToNative.BackupStatus(dafnyValue.dtor_BackupStatus()));
builder.backupType(ToNative.BackupType(dafnyValue.dtor_BackupType()));
return builder.build();
}
public static BackupStatus BackupStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus dafnyValue) {
if (dafnyValue.is_CREATING()) {
return BackupStatus.CREATING;
}
if (dafnyValue.is_DELETED()) {
return BackupStatus.DELETED;
}
if (dafnyValue.is_AVAILABLE()) {
return BackupStatus.AVAILABLE;
}
return BackupStatus.fromValue(dafnyValue.toString());
}
public static List<BackupSummary> BackupSummaries(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupSummary> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::BackupSummary);
}
public static BackupSummary BackupSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupSummary dafnyValue) {
BackupSummary.Builder builder = BackupSummary.builder();
if (dafnyValue.dtor_BackupArn().is_Some()) {
builder.backupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupArn().dtor_value()));
}
if (dafnyValue.dtor_BackupCreationDateTime().is_Some()) {
builder.backupCreationDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_BackupCreationDateTime().dtor_value()));
}
if (dafnyValue.dtor_BackupExpiryDateTime().is_Some()) {
builder.backupExpiryDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_BackupExpiryDateTime().dtor_value()));
}
if (dafnyValue.dtor_BackupName().is_Some()) {
builder.backupName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupName().dtor_value()));
}
if (dafnyValue.dtor_BackupSizeBytes().is_Some()) {
builder.backupSizeBytes((dafnyValue.dtor_BackupSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_BackupStatus().is_Some()) {
builder.backupStatus(ToNative.BackupStatus(dafnyValue.dtor_BackupStatus().dtor_value()));
}
if (dafnyValue.dtor_BackupType().is_Some()) {
builder.backupType(ToNative.BackupType(dafnyValue.dtor_BackupType().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
if (dafnyValue.dtor_TableId().is_Some()) {
builder.tableId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableId().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static BackupType BackupType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType dafnyValue) {
if (dafnyValue.is_USER()) {
return BackupType.USER;
}
if (dafnyValue.is_SYSTEM()) {
return BackupType.SYSTEM;
}
if (dafnyValue.is_AWS__BACKUP()) {
return BackupType.AWS_BACKUP;
}
return BackupType.fromValue(dafnyValue.toString());
}
public static BackupTypeFilter BackupTypeFilter(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter dafnyValue) {
if (dafnyValue.is_USER()) {
return BackupTypeFilter.USER;
}
if (dafnyValue.is_SYSTEM()) {
return BackupTypeFilter.SYSTEM;
}
if (dafnyValue.is_AWS__BACKUP()) {
return BackupTypeFilter.AWS_BACKUP;
}
if (dafnyValue.is_ALL()) {
return BackupTypeFilter.ALL;
}
return BackupTypeFilter.fromValue(dafnyValue.toString());
}
public static BatchExecuteStatementRequest BatchExecuteStatementInput(
BatchExecuteStatementInput dafnyValue) {
BatchExecuteStatementRequest.Builder builder = BatchExecuteStatementRequest.builder();
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
builder.statements(ToNative.PartiQLBatchRequest(dafnyValue.dtor_Statements()));
return builder.build();
}
public static BatchExecuteStatementResponse BatchExecuteStatementOutput(
BatchExecuteStatementOutput dafnyValue) {
BatchExecuteStatementResponse.Builder builder = BatchExecuteStatementResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Responses().is_Some()) {
builder.responses(ToNative.PartiQLBatchResponse(dafnyValue.dtor_Responses().dtor_value()));
}
return builder.build();
}
public static BatchGetItemRequest BatchGetItemInput(BatchGetItemInput dafnyValue) {
BatchGetItemRequest.Builder builder = BatchGetItemRequest.builder();
builder.requestItems(ToNative.BatchGetRequestMap(dafnyValue.dtor_RequestItems()));
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
return builder.build();
}
public static BatchGetItemResponse BatchGetItemOutput(BatchGetItemOutput dafnyValue) {
BatchGetItemResponse.Builder builder = BatchGetItemResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Responses().is_Some()) {
builder.responses(ToNative.BatchGetResponseMap(dafnyValue.dtor_Responses().dtor_value()));
}
if (dafnyValue.dtor_UnprocessedKeys().is_Some()) {
builder.unprocessedKeys(ToNative.BatchGetRequestMap(dafnyValue.dtor_UnprocessedKeys().dtor_value()));
}
return builder.build();
}
public static Map<String, KeysAndAttributes> BatchGetRequestMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.KeysAndAttributes> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::KeysAndAttributes);
}
public static Map<String, List<Map<String, AttributeValue>>> BatchGetResponseMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ItemList);
}
public static BatchStatementError BatchStatementError(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementError dafnyValue) {
BatchStatementError.Builder builder = BatchStatementError.builder();
if (dafnyValue.dtor_Code().is_Some()) {
builder.code(ToNative.BatchStatementErrorCodeEnum(dafnyValue.dtor_Code().dtor_value()));
}
if (dafnyValue.dtor_Message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Message().dtor_value()));
}
return builder.build();
}
public static BatchStatementErrorCodeEnum BatchStatementErrorCodeEnum(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum dafnyValue) {
if (dafnyValue.is_ConditionalCheckFailed()) {
return BatchStatementErrorCodeEnum.CONDITIONAL_CHECK_FAILED;
}
if (dafnyValue.is_ItemCollectionSizeLimitExceeded()) {
return BatchStatementErrorCodeEnum.ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED;
}
if (dafnyValue.is_RequestLimitExceeded()) {
return BatchStatementErrorCodeEnum.REQUEST_LIMIT_EXCEEDED;
}
if (dafnyValue.is_ValidationError()) {
return BatchStatementErrorCodeEnum.VALIDATION_ERROR;
}
if (dafnyValue.is_ProvisionedThroughputExceeded()) {
return BatchStatementErrorCodeEnum.PROVISIONED_THROUGHPUT_EXCEEDED;
}
if (dafnyValue.is_TransactionConflict()) {
return BatchStatementErrorCodeEnum.TRANSACTION_CONFLICT;
}
if (dafnyValue.is_ThrottlingError()) {
return BatchStatementErrorCodeEnum.THROTTLING_ERROR;
}
if (dafnyValue.is_InternalServerError()) {
return BatchStatementErrorCodeEnum.INTERNAL_SERVER_ERROR;
}
if (dafnyValue.is_ResourceNotFound()) {
return BatchStatementErrorCodeEnum.RESOURCE_NOT_FOUND;
}
if (dafnyValue.is_AccessDenied()) {
return BatchStatementErrorCodeEnum.ACCESS_DENIED;
}
if (dafnyValue.is_DuplicateItem()) {
return BatchStatementErrorCodeEnum.DUPLICATE_ITEM;
}
return BatchStatementErrorCodeEnum.fromValue(dafnyValue.toString());
}
public static BatchStatementRequest BatchStatementRequest(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementRequest dafnyValue) {
BatchStatementRequest.Builder builder = BatchStatementRequest.builder();
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_Parameters().is_Some()) {
builder.parameters(ToNative.PreparedStatementParameters(dafnyValue.dtor_Parameters().dtor_value()));
}
builder.statement(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Statement()));
return builder.build();
}
public static BatchStatementResponse BatchStatementResponse(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementResponse dafnyValue) {
BatchStatementResponse.Builder builder = BatchStatementResponse.builder();
if (dafnyValue.dtor_Error().is_Some()) {
builder.error(ToNative.BatchStatementError(dafnyValue.dtor_Error().dtor_value()));
}
if (dafnyValue.dtor_Item().is_Some()) {
builder.item(ToNative.AttributeMap(dafnyValue.dtor_Item().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static BatchWriteItemRequest BatchWriteItemInput(BatchWriteItemInput dafnyValue) {
BatchWriteItemRequest.Builder builder = BatchWriteItemRequest.builder();
builder.requestItems(ToNative.BatchWriteItemRequestMap(dafnyValue.dtor_RequestItems()));
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ReturnItemCollectionMetrics().is_Some()) {
builder.returnItemCollectionMetrics(ToNative.ReturnItemCollectionMetrics(dafnyValue.dtor_ReturnItemCollectionMetrics().dtor_value()));
}
return builder.build();
}
public static BatchWriteItemResponse BatchWriteItemOutput(BatchWriteItemOutput dafnyValue) {
BatchWriteItemResponse.Builder builder = BatchWriteItemResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ItemCollectionMetrics().is_Some()) {
builder.itemCollectionMetrics(ToNative.ItemCollectionMetricsPerTable(dafnyValue.dtor_ItemCollectionMetrics().dtor_value()));
}
if (dafnyValue.dtor_UnprocessedItems().is_Some()) {
builder.unprocessedItems(ToNative.BatchWriteItemRequestMap(dafnyValue.dtor_UnprocessedItems().dtor_value()));
}
return builder.build();
}
public static Map<String, List<WriteRequest>> BatchWriteItemRequestMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.WriteRequest>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::WriteRequests);
}
public static BillingMode BillingMode(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode dafnyValue) {
if (dafnyValue.is_PROVISIONED()) {
return BillingMode.PROVISIONED;
}
if (dafnyValue.is_PAY__PER__REQUEST()) {
return BillingMode.PAY_PER_REQUEST;
}
return BillingMode.fromValue(dafnyValue.toString());
}
public static BillingModeSummary BillingModeSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingModeSummary dafnyValue) {
BillingModeSummary.Builder builder = BillingModeSummary.builder();
if (dafnyValue.dtor_BillingMode().is_Some()) {
builder.billingMode(ToNative.BillingMode(dafnyValue.dtor_BillingMode().dtor_value()));
}
if (dafnyValue.dtor_LastUpdateToPayPerRequestDateTime().is_Some()) {
builder.lastUpdateToPayPerRequestDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastUpdateToPayPerRequestDateTime().dtor_value()));
}
return builder.build();
}
public static List<SdkBytes> BinarySetAttributeValue(
DafnySequence<? extends DafnySequence<? extends Byte>> dafnyValue) {
List<SdkBytes> returnList = new java.util.ArrayList<SdkBytes>();
dafnyValue.forEach((value) -> {
returnList.add(software.amazon.awssdk.core.SdkBytes.fromByteArray((byte[]) value.toRawArray()));
});
return returnList;
}
public static CancellationReason CancellationReason(
software.amazon.cryptography.services.dynamodb.internaldafny.types.CancellationReason dafnyValue) {
CancellationReason.Builder builder = CancellationReason.builder();
if (dafnyValue.dtor_Code().is_Some()) {
builder.code(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Code().dtor_value()));
}
if (dafnyValue.dtor_Item().is_Some()) {
builder.item(ToNative.AttributeMap(dafnyValue.dtor_Item().dtor_value()));
}
if (dafnyValue.dtor_Message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Message().dtor_value()));
}
return builder.build();
}
public static List<CancellationReason> CancellationReasonList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.CancellationReason> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::CancellationReason);
}
public static Capacity Capacity(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Capacity dafnyValue) {
Capacity.Builder builder = Capacity.builder();
if (dafnyValue.dtor_CapacityUnits().is_Some()) {
builder.capacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_CapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ReadCapacityUnits().is_Some()) {
builder.readCapacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_ReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_WriteCapacityUnits().is_Some()) {
builder.writeCapacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_WriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static ComparisonOperator ComparisonOperator(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator dafnyValue) {
if (dafnyValue.is_EQ()) {
return ComparisonOperator.EQ;
}
if (dafnyValue.is_NE()) {
return ComparisonOperator.NE;
}
if (dafnyValue.is_IN()) {
return ComparisonOperator.IN;
}
if (dafnyValue.is_LE()) {
return ComparisonOperator.LE;
}
if (dafnyValue.is_LT()) {
return ComparisonOperator.LT;
}
if (dafnyValue.is_GE()) {
return ComparisonOperator.GE;
}
if (dafnyValue.is_GT()) {
return ComparisonOperator.GT;
}
if (dafnyValue.is_BETWEEN()) {
return ComparisonOperator.BETWEEN;
}
if (dafnyValue.is_NOT__NULL()) {
return ComparisonOperator.NOT_NULL;
}
if (dafnyValue.is_NULL()) {
return ComparisonOperator.NULL;
}
if (dafnyValue.is_CONTAINS()) {
return ComparisonOperator.CONTAINS;
}
if (dafnyValue.is_NOT__CONTAINS()) {
return ComparisonOperator.NOT_CONTAINS;
}
if (dafnyValue.is_BEGINS__WITH()) {
return ComparisonOperator.BEGINS_WITH;
}
return ComparisonOperator.fromValue(dafnyValue.toString());
}
public static Condition Condition(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition dafnyValue) {
Condition.Builder builder = Condition.builder();
if (dafnyValue.dtor_AttributeValueList().is_Some()) {
builder.attributeValueList(ToNative.AttributeValueList(dafnyValue.dtor_AttributeValueList().dtor_value()));
}
builder.comparisonOperator(ToNative.ComparisonOperator(dafnyValue.dtor_ComparisonOperator()));
return builder.build();
}
public static ConditionalOperator ConditionalOperator(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator dafnyValue) {
if (dafnyValue.is_AND()) {
return ConditionalOperator.AND;
}
if (dafnyValue.is_OR()) {
return ConditionalOperator.OR;
}
return ConditionalOperator.fromValue(dafnyValue.toString());
}
public static ConditionCheck ConditionCheck(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionCheck dafnyValue) {
ConditionCheck.Builder builder = ConditionCheck.builder();
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression()));
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().is_Some()) {
builder.returnValuesOnConditionCheckFailure(ToNative.ReturnValuesOnConditionCheckFailure(dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static ConsumedCapacity ConsumedCapacity(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ConsumedCapacity dafnyValue) {
ConsumedCapacity.Builder builder = ConsumedCapacity.builder();
if (dafnyValue.dtor_CapacityUnits().is_Some()) {
builder.capacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_CapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.SecondaryIndexesCapacityMap(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_LocalSecondaryIndexes().is_Some()) {
builder.localSecondaryIndexes(ToNative.SecondaryIndexesCapacityMap(dafnyValue.dtor_LocalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_ReadCapacityUnits().is_Some()) {
builder.readCapacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_ReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_Table().is_Some()) {
builder.table(ToNative.Capacity(dafnyValue.dtor_Table().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
if (dafnyValue.dtor_WriteCapacityUnits().is_Some()) {
builder.writeCapacityUnits(software.amazon.smithy.dafny.conversion.ToNative.Simple.Double(dafnyValue.dtor_WriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static List<ConsumedCapacity> ConsumedCapacityMultiple(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ConsumedCapacity> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ConsumedCapacity);
}
public static ContinuousBackupsDescription ContinuousBackupsDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsDescription dafnyValue) {
ContinuousBackupsDescription.Builder builder = ContinuousBackupsDescription.builder();
builder.continuousBackupsStatus(ToNative.ContinuousBackupsStatus(dafnyValue.dtor_ContinuousBackupsStatus()));
if (dafnyValue.dtor_PointInTimeRecoveryDescription().is_Some()) {
builder.pointInTimeRecoveryDescription(ToNative.PointInTimeRecoveryDescription(dafnyValue.dtor_PointInTimeRecoveryDescription().dtor_value()));
}
return builder.build();
}
public static ContinuousBackupsStatus ContinuousBackupsStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsStatus dafnyValue) {
if (dafnyValue.is_ENABLED()) {
return ContinuousBackupsStatus.ENABLED;
}
if (dafnyValue.is_DISABLED()) {
return ContinuousBackupsStatus.DISABLED;
}
return ContinuousBackupsStatus.fromValue(dafnyValue.toString());
}
public static ContributorInsightsAction ContributorInsightsAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsAction dafnyValue) {
if (dafnyValue.is_ENABLE()) {
return ContributorInsightsAction.ENABLE;
}
if (dafnyValue.is_DISABLE()) {
return ContributorInsightsAction.DISABLE;
}
return ContributorInsightsAction.fromValue(dafnyValue.toString());
}
public static List<String> ContributorInsightsRuleList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static ContributorInsightsStatus ContributorInsightsStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus dafnyValue) {
if (dafnyValue.is_ENABLING()) {
return ContributorInsightsStatus.ENABLING;
}
if (dafnyValue.is_ENABLED()) {
return ContributorInsightsStatus.ENABLED;
}
if (dafnyValue.is_DISABLING()) {
return ContributorInsightsStatus.DISABLING;
}
if (dafnyValue.is_DISABLED()) {
return ContributorInsightsStatus.DISABLED;
}
if (dafnyValue.is_FAILED()) {
return ContributorInsightsStatus.FAILED;
}
return ContributorInsightsStatus.fromValue(dafnyValue.toString());
}
public static List<ContributorInsightsSummary> ContributorInsightsSummaries(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsSummary> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ContributorInsightsSummary);
}
public static ContributorInsightsSummary ContributorInsightsSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsSummary dafnyValue) {
ContributorInsightsSummary.Builder builder = ContributorInsightsSummary.builder();
if (dafnyValue.dtor_ContributorInsightsStatus().is_Some()) {
builder.contributorInsightsStatus(ToNative.ContributorInsightsStatus(dafnyValue.dtor_ContributorInsightsStatus().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static CreateBackupRequest CreateBackupInput(CreateBackupInput dafnyValue) {
CreateBackupRequest.Builder builder = CreateBackupRequest.builder();
builder.backupName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupName()));
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static CreateBackupResponse CreateBackupOutput(CreateBackupOutput dafnyValue) {
CreateBackupResponse.Builder builder = CreateBackupResponse.builder();
if (dafnyValue.dtor_BackupDetails().is_Some()) {
builder.backupDetails(ToNative.BackupDetails(dafnyValue.dtor_BackupDetails().dtor_value()));
}
return builder.build();
}
public static CreateGlobalSecondaryIndexAction CreateGlobalSecondaryIndexAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalSecondaryIndexAction dafnyValue) {
CreateGlobalSecondaryIndexAction.Builder builder = CreateGlobalSecondaryIndexAction.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection()));
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
return builder.build();
}
public static CreateGlobalTableRequest CreateGlobalTableInput(CreateGlobalTableInput dafnyValue) {
CreateGlobalTableRequest.Builder builder = CreateGlobalTableRequest.builder();
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName()));
builder.replicationGroup(ToNative.ReplicaList(dafnyValue.dtor_ReplicationGroup()));
return builder.build();
}
public static CreateGlobalTableResponse CreateGlobalTableOutput(
CreateGlobalTableOutput dafnyValue) {
CreateGlobalTableResponse.Builder builder = CreateGlobalTableResponse.builder();
if (dafnyValue.dtor_GlobalTableDescription().is_Some()) {
builder.globalTableDescription(ToNative.GlobalTableDescription(dafnyValue.dtor_GlobalTableDescription().dtor_value()));
}
return builder.build();
}
public static CreateReplicaAction CreateReplicaAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicaAction dafnyValue) {
CreateReplicaAction.Builder builder = CreateReplicaAction.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
return builder.build();
}
public static CreateReplicationGroupMemberAction CreateReplicationGroupMemberAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicationGroupMemberAction dafnyValue) {
CreateReplicationGroupMemberAction.Builder builder = CreateReplicationGroupMemberAction.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.ReplicaGlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_KMSMasterKeyId().is_Some()) {
builder.kmsMasterKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KMSMasterKeyId().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughputOverride(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
if (dafnyValue.dtor_TableClassOverride().is_Some()) {
builder.tableClassOverride(ToNative.TableClass(dafnyValue.dtor_TableClassOverride().dtor_value()));
}
return builder.build();
}
public static CreateTableRequest CreateTableInput(CreateTableInput dafnyValue) {
CreateTableRequest.Builder builder = CreateTableRequest.builder();
builder.attributeDefinitions(ToNative.AttributeDefinitions(dafnyValue.dtor_AttributeDefinitions()));
if (dafnyValue.dtor_BillingMode().is_Some()) {
builder.billingMode(ToNative.BillingMode(dafnyValue.dtor_BillingMode().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.GlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
if (dafnyValue.dtor_LocalSecondaryIndexes().is_Some()) {
builder.localSecondaryIndexes(ToNative.LocalSecondaryIndexList(dafnyValue.dtor_LocalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
if (dafnyValue.dtor_SSESpecification().is_Some()) {
builder.sseSpecification(ToNative.SSESpecification(dafnyValue.dtor_SSESpecification().dtor_value()));
}
if (dafnyValue.dtor_StreamSpecification().is_Some()) {
builder.streamSpecification(ToNative.StreamSpecification(dafnyValue.dtor_StreamSpecification().dtor_value()));
}
if (dafnyValue.dtor_TableClass().is_Some()) {
builder.tableClass(ToNative.TableClass(dafnyValue.dtor_TableClass().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
if (dafnyValue.dtor_Tags().is_Some()) {
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags().dtor_value()));
}
return builder.build();
}
public static CreateTableResponse CreateTableOutput(CreateTableOutput dafnyValue) {
CreateTableResponse.Builder builder = CreateTableResponse.builder();
if (dafnyValue.dtor_TableDescription().is_Some()) {
builder.tableDescription(ToNative.TableDescription(dafnyValue.dtor_TableDescription().dtor_value()));
}
return builder.build();
}
public static List<String> CsvHeaderList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static CsvOptions CsvOptions(
software.amazon.cryptography.services.dynamodb.internaldafny.types.CsvOptions dafnyValue) {
CsvOptions.Builder builder = CsvOptions.builder();
if (dafnyValue.dtor_Delimiter().is_Some()) {
builder.delimiter(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Delimiter().dtor_value()));
}
if (dafnyValue.dtor_HeaderList().is_Some()) {
builder.headerList(ToNative.CsvHeaderList(dafnyValue.dtor_HeaderList().dtor_value()));
}
return builder.build();
}
public static Delete Delete(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Delete dafnyValue) {
Delete.Builder builder = Delete.builder();
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().is_Some()) {
builder.returnValuesOnConditionCheckFailure(ToNative.ReturnValuesOnConditionCheckFailure(dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DeleteBackupRequest DeleteBackupInput(DeleteBackupInput dafnyValue) {
DeleteBackupRequest.Builder builder = DeleteBackupRequest.builder();
builder.backupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupArn()));
return builder.build();
}
public static DeleteBackupResponse DeleteBackupOutput(DeleteBackupOutput dafnyValue) {
DeleteBackupResponse.Builder builder = DeleteBackupResponse.builder();
if (dafnyValue.dtor_BackupDescription().is_Some()) {
builder.backupDescription(ToNative.BackupDescription(dafnyValue.dtor_BackupDescription().dtor_value()));
}
return builder.build();
}
public static DeleteGlobalSecondaryIndexAction DeleteGlobalSecondaryIndexAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteGlobalSecondaryIndexAction dafnyValue) {
DeleteGlobalSecondaryIndexAction.Builder builder = DeleteGlobalSecondaryIndexAction.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
return builder.build();
}
public static DeleteItemRequest DeleteItemInput(DeleteItemInput dafnyValue) {
DeleteItemRequest.Builder builder = DeleteItemRequest.builder();
if (dafnyValue.dtor_ConditionalOperator().is_Some()) {
builder.conditionalOperator(ToNative.ConditionalOperator(dafnyValue.dtor_ConditionalOperator().dtor_value()));
}
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_Expected().is_Some()) {
builder.expected(ToNative.ExpectedAttributeMap(dafnyValue.dtor_Expected().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ReturnItemCollectionMetrics().is_Some()) {
builder.returnItemCollectionMetrics(ToNative.ReturnItemCollectionMetrics(dafnyValue.dtor_ReturnItemCollectionMetrics().dtor_value()));
}
if (dafnyValue.dtor_ReturnValues().is_Some()) {
builder.returnValues(ToNative.ReturnValue(dafnyValue.dtor_ReturnValues().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DeleteItemResponse DeleteItemOutput(DeleteItemOutput dafnyValue) {
DeleteItemResponse.Builder builder = DeleteItemResponse.builder();
if (dafnyValue.dtor_Attributes().is_Some()) {
builder.attributes(ToNative.AttributeMap(dafnyValue.dtor_Attributes().dtor_value()));
}
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ItemCollectionMetrics().is_Some()) {
builder.itemCollectionMetrics(ToNative.ItemCollectionMetrics(dafnyValue.dtor_ItemCollectionMetrics().dtor_value()));
}
return builder.build();
}
public static DeleteReplicaAction DeleteReplicaAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicaAction dafnyValue) {
DeleteReplicaAction.Builder builder = DeleteReplicaAction.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
return builder.build();
}
public static DeleteReplicationGroupMemberAction DeleteReplicationGroupMemberAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicationGroupMemberAction dafnyValue) {
DeleteReplicationGroupMemberAction.Builder builder = DeleteReplicationGroupMemberAction.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
return builder.build();
}
public static DeleteRequest DeleteRequest(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteRequest dafnyValue) {
DeleteRequest.Builder builder = DeleteRequest.builder();
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
return builder.build();
}
public static DeleteTableRequest DeleteTableInput(DeleteTableInput dafnyValue) {
DeleteTableRequest.Builder builder = DeleteTableRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DeleteTableResponse DeleteTableOutput(DeleteTableOutput dafnyValue) {
DeleteTableResponse.Builder builder = DeleteTableResponse.builder();
if (dafnyValue.dtor_TableDescription().is_Some()) {
builder.tableDescription(ToNative.TableDescription(dafnyValue.dtor_TableDescription().dtor_value()));
}
return builder.build();
}
public static DescribeBackupRequest DescribeBackupInput(DescribeBackupInput dafnyValue) {
DescribeBackupRequest.Builder builder = DescribeBackupRequest.builder();
builder.backupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupArn()));
return builder.build();
}
public static DescribeBackupResponse DescribeBackupOutput(DescribeBackupOutput dafnyValue) {
DescribeBackupResponse.Builder builder = DescribeBackupResponse.builder();
if (dafnyValue.dtor_BackupDescription().is_Some()) {
builder.backupDescription(ToNative.BackupDescription(dafnyValue.dtor_BackupDescription().dtor_value()));
}
return builder.build();
}
public static DescribeContinuousBackupsRequest DescribeContinuousBackupsInput(
DescribeContinuousBackupsInput dafnyValue) {
DescribeContinuousBackupsRequest.Builder builder = DescribeContinuousBackupsRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeContinuousBackupsResponse DescribeContinuousBackupsOutput(
DescribeContinuousBackupsOutput dafnyValue) {
DescribeContinuousBackupsResponse.Builder builder = DescribeContinuousBackupsResponse.builder();
if (dafnyValue.dtor_ContinuousBackupsDescription().is_Some()) {
builder.continuousBackupsDescription(ToNative.ContinuousBackupsDescription(dafnyValue.dtor_ContinuousBackupsDescription().dtor_value()));
}
return builder.build();
}
public static DescribeContributorInsightsRequest DescribeContributorInsightsInput(
DescribeContributorInsightsInput dafnyValue) {
DescribeContributorInsightsRequest.Builder builder = DescribeContributorInsightsRequest.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeContributorInsightsResponse DescribeContributorInsightsOutput(
DescribeContributorInsightsOutput dafnyValue) {
DescribeContributorInsightsResponse.Builder builder = DescribeContributorInsightsResponse.builder();
if (dafnyValue.dtor_ContributorInsightsRuleList().is_Some()) {
builder.contributorInsightsRuleList(ToNative.ContributorInsightsRuleList(dafnyValue.dtor_ContributorInsightsRuleList().dtor_value()));
}
if (dafnyValue.dtor_ContributorInsightsStatus().is_Some()) {
builder.contributorInsightsStatus(ToNative.ContributorInsightsStatus(dafnyValue.dtor_ContributorInsightsStatus().dtor_value()));
}
if (dafnyValue.dtor_FailureException().is_Some()) {
builder.failureException(ToNative.FailureException(dafnyValue.dtor_FailureException().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_LastUpdateDateTime().is_Some()) {
builder.lastUpdateDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastUpdateDateTime().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static DescribeEndpointsRequest DescribeEndpointsRequest(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsRequest dafnyValue) {
return DescribeEndpointsRequest.builder().build();
}
public static DescribeEndpointsResponse DescribeEndpointsResponse(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsResponse dafnyValue) {
DescribeEndpointsResponse.Builder builder = DescribeEndpointsResponse.builder();
builder.endpoints(ToNative.Endpoints(dafnyValue.dtor_Endpoints()));
return builder.build();
}
public static DescribeExportRequest DescribeExportInput(DescribeExportInput dafnyValue) {
DescribeExportRequest.Builder builder = DescribeExportRequest.builder();
builder.exportArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExportArn()));
return builder.build();
}
public static DescribeExportResponse DescribeExportOutput(DescribeExportOutput dafnyValue) {
DescribeExportResponse.Builder builder = DescribeExportResponse.builder();
if (dafnyValue.dtor_ExportDescription().is_Some()) {
builder.exportDescription(ToNative.ExportDescription(dafnyValue.dtor_ExportDescription().dtor_value()));
}
return builder.build();
}
public static DescribeGlobalTableRequest DescribeGlobalTableInput(
DescribeGlobalTableInput dafnyValue) {
DescribeGlobalTableRequest.Builder builder = DescribeGlobalTableRequest.builder();
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName()));
return builder.build();
}
public static DescribeGlobalTableResponse DescribeGlobalTableOutput(
DescribeGlobalTableOutput dafnyValue) {
DescribeGlobalTableResponse.Builder builder = DescribeGlobalTableResponse.builder();
if (dafnyValue.dtor_GlobalTableDescription().is_Some()) {
builder.globalTableDescription(ToNative.GlobalTableDescription(dafnyValue.dtor_GlobalTableDescription().dtor_value()));
}
return builder.build();
}
public static DescribeGlobalTableSettingsRequest DescribeGlobalTableSettingsInput(
DescribeGlobalTableSettingsInput dafnyValue) {
DescribeGlobalTableSettingsRequest.Builder builder = DescribeGlobalTableSettingsRequest.builder();
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName()));
return builder.build();
}
public static DescribeGlobalTableSettingsResponse DescribeGlobalTableSettingsOutput(
DescribeGlobalTableSettingsOutput dafnyValue) {
DescribeGlobalTableSettingsResponse.Builder builder = DescribeGlobalTableSettingsResponse.builder();
if (dafnyValue.dtor_GlobalTableName().is_Some()) {
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName().dtor_value()));
}
if (dafnyValue.dtor_ReplicaSettings().is_Some()) {
builder.replicaSettings(ToNative.ReplicaSettingsDescriptionList(dafnyValue.dtor_ReplicaSettings().dtor_value()));
}
return builder.build();
}
public static DescribeImportRequest DescribeImportInput(DescribeImportInput dafnyValue) {
DescribeImportRequest.Builder builder = DescribeImportRequest.builder();
builder.importArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ImportArn()));
return builder.build();
}
public static DescribeImportResponse DescribeImportOutput(DescribeImportOutput dafnyValue) {
DescribeImportResponse.Builder builder = DescribeImportResponse.builder();
builder.importTableDescription(ToNative.ImportTableDescription(dafnyValue.dtor_ImportTableDescription()));
return builder.build();
}
public static DescribeKinesisStreamingDestinationRequest DescribeKinesisStreamingDestinationInput(
DescribeKinesisStreamingDestinationInput dafnyValue) {
DescribeKinesisStreamingDestinationRequest.Builder builder = DescribeKinesisStreamingDestinationRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeKinesisStreamingDestinationResponse DescribeKinesisStreamingDestinationOutput(
DescribeKinesisStreamingDestinationOutput dafnyValue) {
DescribeKinesisStreamingDestinationResponse.Builder builder = DescribeKinesisStreamingDestinationResponse.builder();
if (dafnyValue.dtor_KinesisDataStreamDestinations().is_Some()) {
builder.kinesisDataStreamDestinations(ToNative.KinesisDataStreamDestinations(dafnyValue.dtor_KinesisDataStreamDestinations().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static DescribeLimitsRequest DescribeLimitsInput(DescribeLimitsInput dafnyValue) {
return DescribeLimitsRequest.builder().build();
}
public static DescribeLimitsResponse DescribeLimitsOutput(DescribeLimitsOutput dafnyValue) {
DescribeLimitsResponse.Builder builder = DescribeLimitsResponse.builder();
if (dafnyValue.dtor_AccountMaxReadCapacityUnits().is_Some()) {
builder.accountMaxReadCapacityUnits((dafnyValue.dtor_AccountMaxReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_AccountMaxWriteCapacityUnits().is_Some()) {
builder.accountMaxWriteCapacityUnits((dafnyValue.dtor_AccountMaxWriteCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_TableMaxReadCapacityUnits().is_Some()) {
builder.tableMaxReadCapacityUnits((dafnyValue.dtor_TableMaxReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_TableMaxWriteCapacityUnits().is_Some()) {
builder.tableMaxWriteCapacityUnits((dafnyValue.dtor_TableMaxWriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static DescribeTableRequest DescribeTableInput(DescribeTableInput dafnyValue) {
DescribeTableRequest.Builder builder = DescribeTableRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeTableResponse DescribeTableOutput(DescribeTableOutput dafnyValue) {
DescribeTableResponse.Builder builder = DescribeTableResponse.builder();
if (dafnyValue.dtor_Table().is_Some()) {
builder.table(ToNative.TableDescription(dafnyValue.dtor_Table().dtor_value()));
}
return builder.build();
}
public static DescribeTableReplicaAutoScalingRequest DescribeTableReplicaAutoScalingInput(
DescribeTableReplicaAutoScalingInput dafnyValue) {
DescribeTableReplicaAutoScalingRequest.Builder builder = DescribeTableReplicaAutoScalingRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeTableReplicaAutoScalingResponse DescribeTableReplicaAutoScalingOutput(
DescribeTableReplicaAutoScalingOutput dafnyValue) {
DescribeTableReplicaAutoScalingResponse.Builder builder = DescribeTableReplicaAutoScalingResponse.builder();
if (dafnyValue.dtor_TableAutoScalingDescription().is_Some()) {
builder.tableAutoScalingDescription(ToNative.TableAutoScalingDescription(dafnyValue.dtor_TableAutoScalingDescription().dtor_value()));
}
return builder.build();
}
public static DescribeTimeToLiveRequest DescribeTimeToLiveInput(
DescribeTimeToLiveInput dafnyValue) {
DescribeTimeToLiveRequest.Builder builder = DescribeTimeToLiveRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DescribeTimeToLiveResponse DescribeTimeToLiveOutput(
DescribeTimeToLiveOutput dafnyValue) {
DescribeTimeToLiveResponse.Builder builder = DescribeTimeToLiveResponse.builder();
if (dafnyValue.dtor_TimeToLiveDescription().is_Some()) {
builder.timeToLiveDescription(ToNative.TimeToLiveDescription(dafnyValue.dtor_TimeToLiveDescription().dtor_value()));
}
return builder.build();
}
public static DestinationStatus DestinationStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus dafnyValue) {
if (dafnyValue.is_ENABLING()) {
return DestinationStatus.ENABLING;
}
if (dafnyValue.is_ACTIVE()) {
return DestinationStatus.ACTIVE;
}
if (dafnyValue.is_DISABLING()) {
return DestinationStatus.DISABLING;
}
if (dafnyValue.is_DISABLED()) {
return DestinationStatus.DISABLED;
}
if (dafnyValue.is_ENABLE__FAILED()) {
return DestinationStatus.ENABLE_FAILED;
}
return DestinationStatus.fromValue(dafnyValue.toString());
}
public static DisableKinesisStreamingDestinationRequest DisableKinesisStreamingDestinationInput(
DisableKinesisStreamingDestinationInput dafnyValue) {
DisableKinesisStreamingDestinationRequest.Builder builder = DisableKinesisStreamingDestinationRequest.builder();
builder.streamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_StreamArn()));
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static DisableKinesisStreamingDestinationResponse DisableKinesisStreamingDestinationOutput(
DisableKinesisStreamingDestinationOutput dafnyValue) {
DisableKinesisStreamingDestinationResponse.Builder builder = DisableKinesisStreamingDestinationResponse.builder();
if (dafnyValue.dtor_DestinationStatus().is_Some()) {
builder.destinationStatus(ToNative.DestinationStatus(dafnyValue.dtor_DestinationStatus().dtor_value()));
}
if (dafnyValue.dtor_StreamArn().is_Some()) {
builder.streamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_StreamArn().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static EnableKinesisStreamingDestinationRequest EnableKinesisStreamingDestinationInput(
EnableKinesisStreamingDestinationInput dafnyValue) {
EnableKinesisStreamingDestinationRequest.Builder builder = EnableKinesisStreamingDestinationRequest.builder();
builder.streamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_StreamArn()));
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static EnableKinesisStreamingDestinationResponse EnableKinesisStreamingDestinationOutput(
EnableKinesisStreamingDestinationOutput dafnyValue) {
EnableKinesisStreamingDestinationResponse.Builder builder = EnableKinesisStreamingDestinationResponse.builder();
if (dafnyValue.dtor_DestinationStatus().is_Some()) {
builder.destinationStatus(ToNative.DestinationStatus(dafnyValue.dtor_DestinationStatus().dtor_value()));
}
if (dafnyValue.dtor_StreamArn().is_Some()) {
builder.streamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_StreamArn().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static Endpoint Endpoint(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Endpoint dafnyValue) {
Endpoint.Builder builder = Endpoint.builder();
builder.address(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Address()));
builder.cachePeriodInMinutes((dafnyValue.dtor_CachePeriodInMinutes()));
return builder.build();
}
public static List<Endpoint> Endpoints(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Endpoint> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Endpoint);
}
public static ExecuteStatementRequest ExecuteStatementInput(ExecuteStatementInput dafnyValue) {
ExecuteStatementRequest.Builder builder = ExecuteStatementRequest.builder();
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
if (dafnyValue.dtor_Parameters().is_Some()) {
builder.parameters(ToNative.PreparedStatementParameters(dafnyValue.dtor_Parameters().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
builder.statement(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Statement()));
return builder.build();
}
public static ExecuteStatementResponse ExecuteStatementOutput(ExecuteStatementOutput dafnyValue) {
ExecuteStatementResponse.Builder builder = ExecuteStatementResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Items().is_Some()) {
builder.items(ToNative.ItemList(dafnyValue.dtor_Items().dtor_value()));
}
if (dafnyValue.dtor_LastEvaluatedKey().is_Some()) {
builder.lastEvaluatedKey(ToNative.Key(dafnyValue.dtor_LastEvaluatedKey().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
return builder.build();
}
public static ExecuteTransactionRequest ExecuteTransactionInput(
ExecuteTransactionInput dafnyValue) {
ExecuteTransactionRequest.Builder builder = ExecuteTransactionRequest.builder();
if (dafnyValue.dtor_ClientRequestToken().is_Some()) {
builder.clientRequestToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientRequestToken().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
builder.transactStatements(ToNative.ParameterizedStatements(dafnyValue.dtor_TransactStatements()));
return builder.build();
}
public static ExecuteTransactionResponse ExecuteTransactionOutput(
ExecuteTransactionOutput dafnyValue) {
ExecuteTransactionResponse.Builder builder = ExecuteTransactionResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Responses().is_Some()) {
builder.responses(ToNative.ItemResponseList(dafnyValue.dtor_Responses().dtor_value()));
}
return builder.build();
}
public static Map<String, ExpectedAttributeValue> ExpectedAttributeMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ExpectedAttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ExpectedAttributeValue);
}
public static ExpectedAttributeValue ExpectedAttributeValue(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ExpectedAttributeValue dafnyValue) {
ExpectedAttributeValue.Builder builder = ExpectedAttributeValue.builder();
if (dafnyValue.dtor_AttributeValueList().is_Some()) {
builder.attributeValueList(ToNative.AttributeValueList(dafnyValue.dtor_AttributeValueList().dtor_value()));
}
if (dafnyValue.dtor_ComparisonOperator().is_Some()) {
builder.comparisonOperator(ToNative.ComparisonOperator(dafnyValue.dtor_ComparisonOperator().dtor_value()));
}
if (dafnyValue.dtor_Exists().is_Some()) {
builder.exists((dafnyValue.dtor_Exists().dtor_value()));
}
if (dafnyValue.dtor_Value().is_Some()) {
builder.value(ToNative.AttributeValue(dafnyValue.dtor_Value().dtor_value()));
}
return builder.build();
}
public static ExportDescription ExportDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportDescription dafnyValue) {
ExportDescription.Builder builder = ExportDescription.builder();
if (dafnyValue.dtor_BilledSizeBytes().is_Some()) {
builder.billedSizeBytes((dafnyValue.dtor_BilledSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_ClientToken().is_Some()) {
builder.clientToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientToken().dtor_value()));
}
if (dafnyValue.dtor_EndTime().is_Some()) {
builder.endTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_EndTime().dtor_value()));
}
if (dafnyValue.dtor_ExportArn().is_Some()) {
builder.exportArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExportArn().dtor_value()));
}
if (dafnyValue.dtor_ExportFormat().is_Some()) {
builder.exportFormat(ToNative.ExportFormat(dafnyValue.dtor_ExportFormat().dtor_value()));
}
if (dafnyValue.dtor_ExportManifest().is_Some()) {
builder.exportManifest(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExportManifest().dtor_value()));
}
if (dafnyValue.dtor_ExportStatus().is_Some()) {
builder.exportStatus(ToNative.ExportStatus(dafnyValue.dtor_ExportStatus().dtor_value()));
}
if (dafnyValue.dtor_ExportTime().is_Some()) {
builder.exportTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ExportTime().dtor_value()));
}
if (dafnyValue.dtor_FailureCode().is_Some()) {
builder.failureCode(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FailureCode().dtor_value()));
}
if (dafnyValue.dtor_FailureMessage().is_Some()) {
builder.failureMessage(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FailureMessage().dtor_value()));
}
if (dafnyValue.dtor_ItemCount().is_Some()) {
builder.itemCount((dafnyValue.dtor_ItemCount().dtor_value()));
}
if (dafnyValue.dtor_S3Bucket().is_Some()) {
builder.s3Bucket(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3Bucket().dtor_value()));
}
if (dafnyValue.dtor_S3BucketOwner().is_Some()) {
builder.s3BucketOwner(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3BucketOwner().dtor_value()));
}
if (dafnyValue.dtor_S3Prefix().is_Some()) {
builder.s3Prefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3Prefix().dtor_value()));
}
if (dafnyValue.dtor_S3SseAlgorithm().is_Some()) {
builder.s3SseAlgorithm(ToNative.S3SseAlgorithm(dafnyValue.dtor_S3SseAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_S3SseKmsKeyId().is_Some()) {
builder.s3SseKmsKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3SseKmsKeyId().dtor_value()));
}
if (dafnyValue.dtor_StartTime().is_Some()) {
builder.startTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_StartTime().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
if (dafnyValue.dtor_TableId().is_Some()) {
builder.tableId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableId().dtor_value()));
}
return builder.build();
}
public static ExportFormat ExportFormat(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportFormat dafnyValue) {
if (dafnyValue.is_DYNAMODB__JSON()) {
return ExportFormat.DYNAMODB_JSON;
}
if (dafnyValue.is_ION()) {
return ExportFormat.ION;
}
return ExportFormat.fromValue(dafnyValue.toString());
}
public static ExportStatus ExportStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus dafnyValue) {
if (dafnyValue.is_IN__PROGRESS()) {
return ExportStatus.IN_PROGRESS;
}
if (dafnyValue.is_COMPLETED()) {
return ExportStatus.COMPLETED;
}
if (dafnyValue.is_FAILED()) {
return ExportStatus.FAILED;
}
return ExportStatus.fromValue(dafnyValue.toString());
}
public static List<ExportSummary> ExportSummaries(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportSummary> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ExportSummary);
}
public static ExportSummary ExportSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportSummary dafnyValue) {
ExportSummary.Builder builder = ExportSummary.builder();
if (dafnyValue.dtor_ExportArn().is_Some()) {
builder.exportArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExportArn().dtor_value()));
}
if (dafnyValue.dtor_ExportStatus().is_Some()) {
builder.exportStatus(ToNative.ExportStatus(dafnyValue.dtor_ExportStatus().dtor_value()));
}
return builder.build();
}
public static ExportTableToPointInTimeRequest ExportTableToPointInTimeInput(
ExportTableToPointInTimeInput dafnyValue) {
ExportTableToPointInTimeRequest.Builder builder = ExportTableToPointInTimeRequest.builder();
if (dafnyValue.dtor_ClientToken().is_Some()) {
builder.clientToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientToken().dtor_value()));
}
if (dafnyValue.dtor_ExportFormat().is_Some()) {
builder.exportFormat(ToNative.ExportFormat(dafnyValue.dtor_ExportFormat().dtor_value()));
}
if (dafnyValue.dtor_ExportTime().is_Some()) {
builder.exportTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ExportTime().dtor_value()));
}
builder.s3Bucket(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3Bucket()));
if (dafnyValue.dtor_S3BucketOwner().is_Some()) {
builder.s3BucketOwner(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3BucketOwner().dtor_value()));
}
if (dafnyValue.dtor_S3Prefix().is_Some()) {
builder.s3Prefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3Prefix().dtor_value()));
}
if (dafnyValue.dtor_S3SseAlgorithm().is_Some()) {
builder.s3SseAlgorithm(ToNative.S3SseAlgorithm(dafnyValue.dtor_S3SseAlgorithm().dtor_value()));
}
if (dafnyValue.dtor_S3SseKmsKeyId().is_Some()) {
builder.s3SseKmsKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3SseKmsKeyId().dtor_value()));
}
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn()));
return builder.build();
}
public static ExportTableToPointInTimeResponse ExportTableToPointInTimeOutput(
ExportTableToPointInTimeOutput dafnyValue) {
ExportTableToPointInTimeResponse.Builder builder = ExportTableToPointInTimeResponse.builder();
if (dafnyValue.dtor_ExportDescription().is_Some()) {
builder.exportDescription(ToNative.ExportDescription(dafnyValue.dtor_ExportDescription().dtor_value()));
}
return builder.build();
}
public static Map<String, String> ExpressionAttributeNameMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static Map<String, AttributeValue> ExpressionAttributeValueMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static FailureException FailureException(
software.amazon.cryptography.services.dynamodb.internaldafny.types.FailureException dafnyValue) {
FailureException.Builder builder = FailureException.builder();
if (dafnyValue.dtor_ExceptionDescription().is_Some()) {
builder.exceptionDescription(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExceptionDescription().dtor_value()));
}
if (dafnyValue.dtor_ExceptionName().is_Some()) {
builder.exceptionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExceptionName().dtor_value()));
}
return builder.build();
}
public static Map<String, Condition> FilterConditionMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Condition);
}
public static Get Get(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Get dafnyValue) {
Get.Builder builder = Get.builder();
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ProjectionExpression().is_Some()) {
builder.projectionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ProjectionExpression().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static GetItemRequest GetItemInput(GetItemInput dafnyValue) {
GetItemRequest.Builder builder = GetItemRequest.builder();
if (dafnyValue.dtor_AttributesToGet().is_Some()) {
builder.attributesToGet(ToNative.AttributeNameList(dafnyValue.dtor_AttributesToGet().dtor_value()));
}
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ProjectionExpression().is_Some()) {
builder.projectionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ProjectionExpression().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static GetItemResponse GetItemOutput(GetItemOutput dafnyValue) {
GetItemResponse.Builder builder = GetItemResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Item().is_Some()) {
builder.item(ToNative.AttributeMap(dafnyValue.dtor_Item().dtor_value()));
}
return builder.build();
}
public static GlobalSecondaryIndex GlobalSecondaryIndex(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndex dafnyValue) {
GlobalSecondaryIndex.Builder builder = GlobalSecondaryIndex.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection()));
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
return builder.build();
}
public static GlobalSecondaryIndexAutoScalingUpdate GlobalSecondaryIndexAutoScalingUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexAutoScalingUpdate dafnyValue) {
GlobalSecondaryIndexAutoScalingUpdate.Builder builder = GlobalSecondaryIndexAutoScalingUpdate.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingUpdate().is_Some()) {
builder.provisionedWriteCapacityAutoScalingUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingUpdate().dtor_value()));
}
return builder.build();
}
public static List<GlobalSecondaryIndexAutoScalingUpdate> GlobalSecondaryIndexAutoScalingUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexAutoScalingUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalSecondaryIndexAutoScalingUpdate);
}
public static GlobalSecondaryIndexDescription GlobalSecondaryIndexDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexDescription dafnyValue) {
GlobalSecondaryIndexDescription.Builder builder = GlobalSecondaryIndexDescription.builder();
if (dafnyValue.dtor_Backfilling().is_Some()) {
builder.backfilling((dafnyValue.dtor_Backfilling().dtor_value()));
}
if (dafnyValue.dtor_IndexArn().is_Some()) {
builder.indexArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexArn().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_IndexSizeBytes().is_Some()) {
builder.indexSizeBytes((dafnyValue.dtor_IndexSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_IndexStatus().is_Some()) {
builder.indexStatus(ToNative.IndexStatus(dafnyValue.dtor_IndexStatus().dtor_value()));
}
if (dafnyValue.dtor_ItemCount().is_Some()) {
builder.itemCount((dafnyValue.dtor_ItemCount().dtor_value()));
}
if (dafnyValue.dtor_KeySchema().is_Some()) {
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema().dtor_value()));
}
if (dafnyValue.dtor_Projection().is_Some()) {
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughputDescription(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
return builder.build();
}
public static List<GlobalSecondaryIndexDescription> GlobalSecondaryIndexDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalSecondaryIndexDescription);
}
public static List<GlobalSecondaryIndexInfo> GlobalSecondaryIndexes(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexInfo> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalSecondaryIndexInfo);
}
public static GlobalSecondaryIndexInfo GlobalSecondaryIndexInfo(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexInfo dafnyValue) {
GlobalSecondaryIndexInfo.Builder builder = GlobalSecondaryIndexInfo.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_KeySchema().is_Some()) {
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema().dtor_value()));
}
if (dafnyValue.dtor_Projection().is_Some()) {
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
return builder.build();
}
public static List<GlobalSecondaryIndex> GlobalSecondaryIndexList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndex> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalSecondaryIndex);
}
public static GlobalSecondaryIndexUpdate GlobalSecondaryIndexUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexUpdate dafnyValue) {
GlobalSecondaryIndexUpdate.Builder builder = GlobalSecondaryIndexUpdate.builder();
if (dafnyValue.dtor_Create().is_Some()) {
builder.create(ToNative.CreateGlobalSecondaryIndexAction(dafnyValue.dtor_Create().dtor_value()));
}
if (dafnyValue.dtor_Delete().is_Some()) {
builder.delete(ToNative.DeleteGlobalSecondaryIndexAction(dafnyValue.dtor_Delete().dtor_value()));
}
if (dafnyValue.dtor_Update().is_Some()) {
builder.update(ToNative.UpdateGlobalSecondaryIndexAction(dafnyValue.dtor_Update().dtor_value()));
}
return builder.build();
}
public static List<GlobalSecondaryIndexUpdate> GlobalSecondaryIndexUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalSecondaryIndexUpdate);
}
public static GlobalTable GlobalTable(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTable dafnyValue) {
GlobalTable.Builder builder = GlobalTable.builder();
if (dafnyValue.dtor_GlobalTableName().is_Some()) {
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName().dtor_value()));
}
if (dafnyValue.dtor_ReplicationGroup().is_Some()) {
builder.replicationGroup(ToNative.ReplicaList(dafnyValue.dtor_ReplicationGroup().dtor_value()));
}
return builder.build();
}
public static GlobalTableDescription GlobalTableDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableDescription dafnyValue) {
GlobalTableDescription.Builder builder = GlobalTableDescription.builder();
if (dafnyValue.dtor_CreationDateTime().is_Some()) {
builder.creationDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDateTime().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableArn().is_Some()) {
builder.globalTableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableArn().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableName().is_Some()) {
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableStatus().is_Some()) {
builder.globalTableStatus(ToNative.GlobalTableStatus(dafnyValue.dtor_GlobalTableStatus().dtor_value()));
}
if (dafnyValue.dtor_ReplicationGroup().is_Some()) {
builder.replicationGroup(ToNative.ReplicaDescriptionList(dafnyValue.dtor_ReplicationGroup().dtor_value()));
}
return builder.build();
}
public static GlobalTableGlobalSecondaryIndexSettingsUpdate GlobalTableGlobalSecondaryIndexSettingsUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableGlobalSecondaryIndexSettingsUpdate dafnyValue) {
GlobalTableGlobalSecondaryIndexSettingsUpdate.Builder builder = GlobalTableGlobalSecondaryIndexSettingsUpdate.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
if (dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettingsUpdate().is_Some()) {
builder.provisionedWriteCapacityAutoScalingSettingsUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettingsUpdate().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityUnits().is_Some()) {
builder.provisionedWriteCapacityUnits((dafnyValue.dtor_ProvisionedWriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static List<GlobalTableGlobalSecondaryIndexSettingsUpdate> GlobalTableGlobalSecondaryIndexSettingsUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableGlobalSecondaryIndexSettingsUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalTableGlobalSecondaryIndexSettingsUpdate);
}
public static List<GlobalTable> GlobalTableList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTable> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::GlobalTable);
}
public static GlobalTableStatus GlobalTableStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus dafnyValue) {
if (dafnyValue.is_CREATING()) {
return GlobalTableStatus.CREATING;
}
if (dafnyValue.is_ACTIVE()) {
return GlobalTableStatus.ACTIVE;
}
if (dafnyValue.is_DELETING()) {
return GlobalTableStatus.DELETING;
}
if (dafnyValue.is_UPDATING()) {
return GlobalTableStatus.UPDATING;
}
return GlobalTableStatus.fromValue(dafnyValue.toString());
}
public static ImportStatus ImportStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus dafnyValue) {
if (dafnyValue.is_IN__PROGRESS()) {
return ImportStatus.IN_PROGRESS;
}
if (dafnyValue.is_COMPLETED()) {
return ImportStatus.COMPLETED;
}
if (dafnyValue.is_CANCELLING()) {
return ImportStatus.CANCELLING;
}
if (dafnyValue.is_CANCELLED()) {
return ImportStatus.CANCELLED;
}
if (dafnyValue.is_FAILED()) {
return ImportStatus.FAILED;
}
return ImportStatus.fromValue(dafnyValue.toString());
}
public static ImportSummary ImportSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportSummary dafnyValue) {
ImportSummary.Builder builder = ImportSummary.builder();
if (dafnyValue.dtor_CloudWatchLogGroupArn().is_Some()) {
builder.cloudWatchLogGroupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudWatchLogGroupArn().dtor_value()));
}
if (dafnyValue.dtor_EndTime().is_Some()) {
builder.endTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_EndTime().dtor_value()));
}
if (dafnyValue.dtor_ImportArn().is_Some()) {
builder.importArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ImportArn().dtor_value()));
}
if (dafnyValue.dtor_ImportStatus().is_Some()) {
builder.importStatus(ToNative.ImportStatus(dafnyValue.dtor_ImportStatus().dtor_value()));
}
if (dafnyValue.dtor_InputFormat().is_Some()) {
builder.inputFormat(ToNative.InputFormat(dafnyValue.dtor_InputFormat().dtor_value()));
}
if (dafnyValue.dtor_S3BucketSource().is_Some()) {
builder.s3BucketSource(ToNative.S3BucketSource(dafnyValue.dtor_S3BucketSource().dtor_value()));
}
if (dafnyValue.dtor_StartTime().is_Some()) {
builder.startTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_StartTime().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
return builder.build();
}
public static List<ImportSummary> ImportSummaryList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportSummary> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ImportSummary);
}
public static ImportTableDescription ImportTableDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableDescription dafnyValue) {
ImportTableDescription.Builder builder = ImportTableDescription.builder();
if (dafnyValue.dtor_ClientToken().is_Some()) {
builder.clientToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientToken().dtor_value()));
}
if (dafnyValue.dtor_CloudWatchLogGroupArn().is_Some()) {
builder.cloudWatchLogGroupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_CloudWatchLogGroupArn().dtor_value()));
}
if (dafnyValue.dtor_EndTime().is_Some()) {
builder.endTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_EndTime().dtor_value()));
}
if (dafnyValue.dtor_ErrorCount().is_Some()) {
builder.errorCount((dafnyValue.dtor_ErrorCount().dtor_value()));
}
if (dafnyValue.dtor_FailureCode().is_Some()) {
builder.failureCode(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FailureCode().dtor_value()));
}
if (dafnyValue.dtor_FailureMessage().is_Some()) {
builder.failureMessage(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FailureMessage().dtor_value()));
}
if (dafnyValue.dtor_ImportArn().is_Some()) {
builder.importArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ImportArn().dtor_value()));
}
if (dafnyValue.dtor_ImportedItemCount().is_Some()) {
builder.importedItemCount((dafnyValue.dtor_ImportedItemCount().dtor_value()));
}
if (dafnyValue.dtor_ImportStatus().is_Some()) {
builder.importStatus(ToNative.ImportStatus(dafnyValue.dtor_ImportStatus().dtor_value()));
}
if (dafnyValue.dtor_InputCompressionType().is_Some()) {
builder.inputCompressionType(ToNative.InputCompressionType(dafnyValue.dtor_InputCompressionType().dtor_value()));
}
if (dafnyValue.dtor_InputFormat().is_Some()) {
builder.inputFormat(ToNative.InputFormat(dafnyValue.dtor_InputFormat().dtor_value()));
}
if (dafnyValue.dtor_InputFormatOptions().is_Some()) {
builder.inputFormatOptions(ToNative.InputFormatOptions(dafnyValue.dtor_InputFormatOptions().dtor_value()));
}
if (dafnyValue.dtor_ProcessedItemCount().is_Some()) {
builder.processedItemCount((dafnyValue.dtor_ProcessedItemCount().dtor_value()));
}
if (dafnyValue.dtor_ProcessedSizeBytes().is_Some()) {
builder.processedSizeBytes((dafnyValue.dtor_ProcessedSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_S3BucketSource().is_Some()) {
builder.s3BucketSource(ToNative.S3BucketSource(dafnyValue.dtor_S3BucketSource().dtor_value()));
}
if (dafnyValue.dtor_StartTime().is_Some()) {
builder.startTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_StartTime().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
if (dafnyValue.dtor_TableCreationParameters().is_Some()) {
builder.tableCreationParameters(ToNative.TableCreationParameters(dafnyValue.dtor_TableCreationParameters().dtor_value()));
}
if (dafnyValue.dtor_TableId().is_Some()) {
builder.tableId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableId().dtor_value()));
}
return builder.build();
}
public static ImportTableRequest ImportTableInput(ImportTableInput dafnyValue) {
ImportTableRequest.Builder builder = ImportTableRequest.builder();
if (dafnyValue.dtor_ClientToken().is_Some()) {
builder.clientToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientToken().dtor_value()));
}
if (dafnyValue.dtor_InputCompressionType().is_Some()) {
builder.inputCompressionType(ToNative.InputCompressionType(dafnyValue.dtor_InputCompressionType().dtor_value()));
}
builder.inputFormat(ToNative.InputFormat(dafnyValue.dtor_InputFormat()));
if (dafnyValue.dtor_InputFormatOptions().is_Some()) {
builder.inputFormatOptions(ToNative.InputFormatOptions(dafnyValue.dtor_InputFormatOptions().dtor_value()));
}
builder.s3BucketSource(ToNative.S3BucketSource(dafnyValue.dtor_S3BucketSource()));
builder.tableCreationParameters(ToNative.TableCreationParameters(dafnyValue.dtor_TableCreationParameters()));
return builder.build();
}
public static ImportTableResponse ImportTableOutput(ImportTableOutput dafnyValue) {
ImportTableResponse.Builder builder = ImportTableResponse.builder();
builder.importTableDescription(ToNative.ImportTableDescription(dafnyValue.dtor_ImportTableDescription()));
return builder.build();
}
public static IndexStatus IndexStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus dafnyValue) {
if (dafnyValue.is_CREATING()) {
return IndexStatus.CREATING;
}
if (dafnyValue.is_UPDATING()) {
return IndexStatus.UPDATING;
}
if (dafnyValue.is_DELETING()) {
return IndexStatus.DELETING;
}
if (dafnyValue.is_ACTIVE()) {
return IndexStatus.ACTIVE;
}
return IndexStatus.fromValue(dafnyValue.toString());
}
public static InputCompressionType InputCompressionType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType dafnyValue) {
if (dafnyValue.is_GZIP()) {
return InputCompressionType.GZIP;
}
if (dafnyValue.is_ZSTD()) {
return InputCompressionType.ZSTD;
}
if (dafnyValue.is_NONE()) {
return InputCompressionType.NONE;
}
return InputCompressionType.fromValue(dafnyValue.toString());
}
public static InputFormat InputFormat(
software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat dafnyValue) {
if (dafnyValue.is_DYNAMODB__JSON()) {
return InputFormat.DYNAMODB_JSON;
}
if (dafnyValue.is_ION()) {
return InputFormat.ION;
}
if (dafnyValue.is_CSV()) {
return InputFormat.CSV;
}
return InputFormat.fromValue(dafnyValue.toString());
}
public static InputFormatOptions InputFormatOptions(
software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormatOptions dafnyValue) {
InputFormatOptions.Builder builder = InputFormatOptions.builder();
if (dafnyValue.dtor_Csv().is_Some()) {
builder.csv(ToNative.CsvOptions(dafnyValue.dtor_Csv().dtor_value()));
}
return builder.build();
}
public static Map<String, AttributeValue> ItemCollectionKeyAttributeMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static ItemCollectionMetrics ItemCollectionMetrics(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics dafnyValue) {
ItemCollectionMetrics.Builder builder = ItemCollectionMetrics.builder();
if (dafnyValue.dtor_ItemCollectionKey().is_Some()) {
builder.itemCollectionKey(ToNative.ItemCollectionKeyAttributeMap(dafnyValue.dtor_ItemCollectionKey().dtor_value()));
}
if (dafnyValue.dtor_SizeEstimateRangeGB().is_Some()) {
builder.sizeEstimateRangeGB(ToNative.ItemCollectionSizeEstimateRange(dafnyValue.dtor_SizeEstimateRangeGB().dtor_value()));
}
return builder.build();
}
public static List<ItemCollectionMetrics> ItemCollectionMetricsMultiple(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ItemCollectionMetrics);
}
public static Map<String, List<ItemCollectionMetrics>> ItemCollectionMetricsPerTable(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ItemCollectionMetricsMultiple);
}
public static List<Double> ItemCollectionSizeEstimateRange(
DafnySequence<? extends DafnySequence<? extends Byte>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::Double);
}
public static List<Map<String, AttributeValue>> ItemList(
DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeMap);
}
public static ItemResponse ItemResponse(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemResponse dafnyValue) {
ItemResponse.Builder builder = ItemResponse.builder();
if (dafnyValue.dtor_Item().is_Some()) {
builder.item(ToNative.AttributeMap(dafnyValue.dtor_Item().dtor_value()));
}
return builder.build();
}
public static List<ItemResponse> ItemResponseList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemResponse> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ItemResponse);
}
public static Map<String, AttributeValue> Key(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static Map<String, Condition> KeyConditions(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Condition);
}
public static List<Map<String, AttributeValue>> KeyList(
DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Key);
}
public static KeysAndAttributes KeysAndAttributes(
software.amazon.cryptography.services.dynamodb.internaldafny.types.KeysAndAttributes dafnyValue) {
KeysAndAttributes.Builder builder = KeysAndAttributes.builder();
if (dafnyValue.dtor_AttributesToGet().is_Some()) {
builder.attributesToGet(ToNative.AttributeNameList(dafnyValue.dtor_AttributesToGet().dtor_value()));
}
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
builder.keys(ToNative.KeyList(dafnyValue.dtor_Keys()));
if (dafnyValue.dtor_ProjectionExpression().is_Some()) {
builder.projectionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ProjectionExpression().dtor_value()));
}
return builder.build();
}
public static List<KeySchemaElement> KeySchema(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.KeySchemaElement> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::KeySchemaElement);
}
public static KeySchemaElement KeySchemaElement(
software.amazon.cryptography.services.dynamodb.internaldafny.types.KeySchemaElement dafnyValue) {
KeySchemaElement.Builder builder = KeySchemaElement.builder();
builder.attributeName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AttributeName()));
builder.keyType(ToNative.KeyType(dafnyValue.dtor_KeyType()));
return builder.build();
}
public static KeyType KeyType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType dafnyValue) {
if (dafnyValue.is_HASH()) {
return KeyType.HASH;
}
if (dafnyValue.is_RANGE()) {
return KeyType.RANGE;
}
return KeyType.fromValue(dafnyValue.toString());
}
public static KinesisDataStreamDestination KinesisDataStreamDestination(
software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisDataStreamDestination dafnyValue) {
KinesisDataStreamDestination.Builder builder = KinesisDataStreamDestination.builder();
if (dafnyValue.dtor_DestinationStatus().is_Some()) {
builder.destinationStatus(ToNative.DestinationStatus(dafnyValue.dtor_DestinationStatus().dtor_value()));
}
if (dafnyValue.dtor_DestinationStatusDescription().is_Some()) {
builder.destinationStatusDescription(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_DestinationStatusDescription().dtor_value()));
}
if (dafnyValue.dtor_StreamArn().is_Some()) {
builder.streamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_StreamArn().dtor_value()));
}
return builder.build();
}
public static List<KinesisDataStreamDestination> KinesisDataStreamDestinations(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisDataStreamDestination> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::KinesisDataStreamDestination);
}
public static List<AttributeValue> ListAttributeValue(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static ListBackupsRequest ListBackupsInput(ListBackupsInput dafnyValue) {
ListBackupsRequest.Builder builder = ListBackupsRequest.builder();
if (dafnyValue.dtor_BackupType().is_Some()) {
builder.backupType(ToNative.BackupTypeFilter(dafnyValue.dtor_BackupType().dtor_value()));
}
if (dafnyValue.dtor_ExclusiveStartBackupArn().is_Some()) {
builder.exclusiveStartBackupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExclusiveStartBackupArn().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
if (dafnyValue.dtor_TimeRangeLowerBound().is_Some()) {
builder.timeRangeLowerBound(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_TimeRangeLowerBound().dtor_value()));
}
if (dafnyValue.dtor_TimeRangeUpperBound().is_Some()) {
builder.timeRangeUpperBound(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_TimeRangeUpperBound().dtor_value()));
}
return builder.build();
}
public static ListBackupsResponse ListBackupsOutput(ListBackupsOutput dafnyValue) {
ListBackupsResponse.Builder builder = ListBackupsResponse.builder();
if (dafnyValue.dtor_BackupSummaries().is_Some()) {
builder.backupSummaries(ToNative.BackupSummaries(dafnyValue.dtor_BackupSummaries().dtor_value()));
}
if (dafnyValue.dtor_LastEvaluatedBackupArn().is_Some()) {
builder.lastEvaluatedBackupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_LastEvaluatedBackupArn().dtor_value()));
}
return builder.build();
}
public static ListContributorInsightsRequest ListContributorInsightsInput(
ListContributorInsightsInput dafnyValue) {
ListContributorInsightsRequest.Builder builder = ListContributorInsightsRequest.builder();
if (dafnyValue.dtor_MaxResults().is_Some()) {
builder.maxResults((dafnyValue.dtor_MaxResults().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static ListContributorInsightsResponse ListContributorInsightsOutput(
ListContributorInsightsOutput dafnyValue) {
ListContributorInsightsResponse.Builder builder = ListContributorInsightsResponse.builder();
if (dafnyValue.dtor_ContributorInsightsSummaries().is_Some()) {
builder.contributorInsightsSummaries(ToNative.ContributorInsightsSummaries(dafnyValue.dtor_ContributorInsightsSummaries().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
return builder.build();
}
public static ListExportsRequest ListExportsInput(ListExportsInput dafnyValue) {
ListExportsRequest.Builder builder = ListExportsRequest.builder();
if (dafnyValue.dtor_MaxResults().is_Some()) {
builder.maxResults((dafnyValue.dtor_MaxResults().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
return builder.build();
}
public static ListExportsResponse ListExportsOutput(ListExportsOutput dafnyValue) {
ListExportsResponse.Builder builder = ListExportsResponse.builder();
if (dafnyValue.dtor_ExportSummaries().is_Some()) {
builder.exportSummaries(ToNative.ExportSummaries(dafnyValue.dtor_ExportSummaries().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
return builder.build();
}
public static ListGlobalTablesRequest ListGlobalTablesInput(ListGlobalTablesInput dafnyValue) {
ListGlobalTablesRequest.Builder builder = ListGlobalTablesRequest.builder();
if (dafnyValue.dtor_ExclusiveStartGlobalTableName().is_Some()) {
builder.exclusiveStartGlobalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExclusiveStartGlobalTableName().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_RegionName().is_Some()) {
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName().dtor_value()));
}
return builder.build();
}
public static ListGlobalTablesResponse ListGlobalTablesOutput(ListGlobalTablesOutput dafnyValue) {
ListGlobalTablesResponse.Builder builder = ListGlobalTablesResponse.builder();
if (dafnyValue.dtor_GlobalTables().is_Some()) {
builder.globalTables(ToNative.GlobalTableList(dafnyValue.dtor_GlobalTables().dtor_value()));
}
if (dafnyValue.dtor_LastEvaluatedGlobalTableName().is_Some()) {
builder.lastEvaluatedGlobalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_LastEvaluatedGlobalTableName().dtor_value()));
}
return builder.build();
}
public static ListImportsRequest ListImportsInput(ListImportsInput dafnyValue) {
ListImportsRequest.Builder builder = ListImportsRequest.builder();
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
if (dafnyValue.dtor_PageSize().is_Some()) {
builder.pageSize((dafnyValue.dtor_PageSize().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
return builder.build();
}
public static ListImportsResponse ListImportsOutput(ListImportsOutput dafnyValue) {
ListImportsResponse.Builder builder = ListImportsResponse.builder();
if (dafnyValue.dtor_ImportSummaryList().is_Some()) {
builder.importSummaryList(ToNative.ImportSummaryList(dafnyValue.dtor_ImportSummaryList().dtor_value()));
}
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
return builder.build();
}
public static ListTablesRequest ListTablesInput(ListTablesInput dafnyValue) {
ListTablesRequest.Builder builder = ListTablesRequest.builder();
if (dafnyValue.dtor_ExclusiveStartTableName().is_Some()) {
builder.exclusiveStartTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ExclusiveStartTableName().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
return builder.build();
}
public static ListTablesResponse ListTablesOutput(ListTablesOutput dafnyValue) {
ListTablesResponse.Builder builder = ListTablesResponse.builder();
if (dafnyValue.dtor_LastEvaluatedTableName().is_Some()) {
builder.lastEvaluatedTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_LastEvaluatedTableName().dtor_value()));
}
if (dafnyValue.dtor_TableNames().is_Some()) {
builder.tableNames(ToNative.TableNameList(dafnyValue.dtor_TableNames().dtor_value()));
}
return builder.build();
}
public static ListTagsOfResourceRequest ListTagsOfResourceInput(
ListTagsOfResourceInput dafnyValue) {
ListTagsOfResourceRequest.Builder builder = ListTagsOfResourceRequest.builder();
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
builder.resourceArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ResourceArn()));
return builder.build();
}
public static ListTagsOfResourceResponse ListTagsOfResourceOutput(
ListTagsOfResourceOutput dafnyValue) {
ListTagsOfResourceResponse.Builder builder = ListTagsOfResourceResponse.builder();
if (dafnyValue.dtor_NextToken().is_Some()) {
builder.nextToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_NextToken().dtor_value()));
}
if (dafnyValue.dtor_Tags().is_Some()) {
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags().dtor_value()));
}
return builder.build();
}
public static LocalSecondaryIndex LocalSecondaryIndex(
software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndex dafnyValue) {
LocalSecondaryIndex.Builder builder = LocalSecondaryIndex.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection()));
return builder.build();
}
public static LocalSecondaryIndexDescription LocalSecondaryIndexDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexDescription dafnyValue) {
LocalSecondaryIndexDescription.Builder builder = LocalSecondaryIndexDescription.builder();
if (dafnyValue.dtor_IndexArn().is_Some()) {
builder.indexArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexArn().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_IndexSizeBytes().is_Some()) {
builder.indexSizeBytes((dafnyValue.dtor_IndexSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_ItemCount().is_Some()) {
builder.itemCount((dafnyValue.dtor_ItemCount().dtor_value()));
}
if (dafnyValue.dtor_KeySchema().is_Some()) {
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema().dtor_value()));
}
if (dafnyValue.dtor_Projection().is_Some()) {
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection().dtor_value()));
}
return builder.build();
}
public static List<LocalSecondaryIndexDescription> LocalSecondaryIndexDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::LocalSecondaryIndexDescription);
}
public static List<LocalSecondaryIndexInfo> LocalSecondaryIndexes(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexInfo> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::LocalSecondaryIndexInfo);
}
public static LocalSecondaryIndexInfo LocalSecondaryIndexInfo(
software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexInfo dafnyValue) {
LocalSecondaryIndexInfo.Builder builder = LocalSecondaryIndexInfo.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_KeySchema().is_Some()) {
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema().dtor_value()));
}
if (dafnyValue.dtor_Projection().is_Some()) {
builder.projection(ToNative.Projection(dafnyValue.dtor_Projection().dtor_value()));
}
return builder.build();
}
public static List<LocalSecondaryIndex> LocalSecondaryIndexList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndex> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::LocalSecondaryIndex);
}
public static Map<String, AttributeValue> MapAttributeValue(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static List<String> NonKeyAttributeNameList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<String> NumberSetAttributeValue(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static ParameterizedStatement ParameterizedStatement(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ParameterizedStatement dafnyValue) {
ParameterizedStatement.Builder builder = ParameterizedStatement.builder();
if (dafnyValue.dtor_Parameters().is_Some()) {
builder.parameters(ToNative.PreparedStatementParameters(dafnyValue.dtor_Parameters().dtor_value()));
}
builder.statement(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Statement()));
return builder.build();
}
public static List<ParameterizedStatement> ParameterizedStatements(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ParameterizedStatement> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ParameterizedStatement);
}
public static List<BatchStatementRequest> PartiQLBatchRequest(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementRequest> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::BatchStatementRequest);
}
public static List<BatchStatementResponse> PartiQLBatchResponse(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementResponse> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::BatchStatementResponse);
}
public static PointInTimeRecoveryDescription PointInTimeRecoveryDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryDescription dafnyValue) {
PointInTimeRecoveryDescription.Builder builder = PointInTimeRecoveryDescription.builder();
if (dafnyValue.dtor_EarliestRestorableDateTime().is_Some()) {
builder.earliestRestorableDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_EarliestRestorableDateTime().dtor_value()));
}
if (dafnyValue.dtor_LatestRestorableDateTime().is_Some()) {
builder.latestRestorableDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LatestRestorableDateTime().dtor_value()));
}
if (dafnyValue.dtor_PointInTimeRecoveryStatus().is_Some()) {
builder.pointInTimeRecoveryStatus(ToNative.PointInTimeRecoveryStatus(dafnyValue.dtor_PointInTimeRecoveryStatus().dtor_value()));
}
return builder.build();
}
public static PointInTimeRecoverySpecification PointInTimeRecoverySpecification(
software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoverySpecification dafnyValue) {
PointInTimeRecoverySpecification.Builder builder = PointInTimeRecoverySpecification.builder();
builder.pointInTimeRecoveryEnabled((dafnyValue.dtor_PointInTimeRecoveryEnabled()));
return builder.build();
}
public static PointInTimeRecoveryStatus PointInTimeRecoveryStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryStatus dafnyValue) {
if (dafnyValue.is_ENABLED()) {
return PointInTimeRecoveryStatus.ENABLED;
}
if (dafnyValue.is_DISABLED()) {
return PointInTimeRecoveryStatus.DISABLED;
}
return PointInTimeRecoveryStatus.fromValue(dafnyValue.toString());
}
public static List<AttributeValue> PreparedStatementParameters(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static Projection Projection(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Projection dafnyValue) {
Projection.Builder builder = Projection.builder();
if (dafnyValue.dtor_NonKeyAttributes().is_Some()) {
builder.nonKeyAttributes(ToNative.NonKeyAttributeNameList(dafnyValue.dtor_NonKeyAttributes().dtor_value()));
}
if (dafnyValue.dtor_ProjectionType().is_Some()) {
builder.projectionType(ToNative.ProjectionType(dafnyValue.dtor_ProjectionType().dtor_value()));
}
return builder.build();
}
public static ProjectionType ProjectionType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType dafnyValue) {
if (dafnyValue.is_ALL()) {
return ProjectionType.ALL;
}
if (dafnyValue.is_KEYS__ONLY()) {
return ProjectionType.KEYS_ONLY;
}
if (dafnyValue.is_INCLUDE()) {
return ProjectionType.INCLUDE;
}
return ProjectionType.fromValue(dafnyValue.toString());
}
public static ProvisionedThroughput ProvisionedThroughput(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughput dafnyValue) {
ProvisionedThroughput.Builder builder = ProvisionedThroughput.builder();
builder.readCapacityUnits((dafnyValue.dtor_ReadCapacityUnits()));
builder.writeCapacityUnits((dafnyValue.dtor_WriteCapacityUnits()));
return builder.build();
}
public static ProvisionedThroughputDescription ProvisionedThroughputDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputDescription dafnyValue) {
ProvisionedThroughputDescription.Builder builder = ProvisionedThroughputDescription.builder();
if (dafnyValue.dtor_LastDecreaseDateTime().is_Some()) {
builder.lastDecreaseDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastDecreaseDateTime().dtor_value()));
}
if (dafnyValue.dtor_LastIncreaseDateTime().is_Some()) {
builder.lastIncreaseDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastIncreaseDateTime().dtor_value()));
}
if (dafnyValue.dtor_NumberOfDecreasesToday().is_Some()) {
builder.numberOfDecreasesToday((dafnyValue.dtor_NumberOfDecreasesToday().dtor_value()));
}
if (dafnyValue.dtor_ReadCapacityUnits().is_Some()) {
builder.readCapacityUnits((dafnyValue.dtor_ReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_WriteCapacityUnits().is_Some()) {
builder.writeCapacityUnits((dafnyValue.dtor_WriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static ProvisionedThroughputOverride ProvisionedThroughputOverride(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputOverride dafnyValue) {
ProvisionedThroughputOverride.Builder builder = ProvisionedThroughputOverride.builder();
if (dafnyValue.dtor_ReadCapacityUnits().is_Some()) {
builder.readCapacityUnits((dafnyValue.dtor_ReadCapacityUnits().dtor_value()));
}
return builder.build();
}
public static Put Put(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Put dafnyValue) {
Put.Builder builder = Put.builder();
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.item(ToNative.PutItemInputAttributeMap(dafnyValue.dtor_Item()));
if (dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().is_Some()) {
builder.returnValuesOnConditionCheckFailure(ToNative.ReturnValuesOnConditionCheckFailure(dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static PutItemRequest PutItemInput(PutItemInput dafnyValue) {
PutItemRequest.Builder builder = PutItemRequest.builder();
if (dafnyValue.dtor_ConditionalOperator().is_Some()) {
builder.conditionalOperator(ToNative.ConditionalOperator(dafnyValue.dtor_ConditionalOperator().dtor_value()));
}
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_Expected().is_Some()) {
builder.expected(ToNative.ExpectedAttributeMap(dafnyValue.dtor_Expected().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.item(ToNative.PutItemInputAttributeMap(dafnyValue.dtor_Item()));
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ReturnItemCollectionMetrics().is_Some()) {
builder.returnItemCollectionMetrics(ToNative.ReturnItemCollectionMetrics(dafnyValue.dtor_ReturnItemCollectionMetrics().dtor_value()));
}
if (dafnyValue.dtor_ReturnValues().is_Some()) {
builder.returnValues(ToNative.ReturnValue(dafnyValue.dtor_ReturnValues().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static Map<String, AttributeValue> PutItemInputAttributeMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::AttributeValue);
}
public static PutItemResponse PutItemOutput(PutItemOutput dafnyValue) {
PutItemResponse.Builder builder = PutItemResponse.builder();
if (dafnyValue.dtor_Attributes().is_Some()) {
builder.attributes(ToNative.AttributeMap(dafnyValue.dtor_Attributes().dtor_value()));
}
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ItemCollectionMetrics().is_Some()) {
builder.itemCollectionMetrics(ToNative.ItemCollectionMetrics(dafnyValue.dtor_ItemCollectionMetrics().dtor_value()));
}
return builder.build();
}
public static PutRequest PutRequest(
software.amazon.cryptography.services.dynamodb.internaldafny.types.PutRequest dafnyValue) {
PutRequest.Builder builder = PutRequest.builder();
builder.item(ToNative.PutItemInputAttributeMap(dafnyValue.dtor_Item()));
return builder.build();
}
public static QueryRequest QueryInput(QueryInput dafnyValue) {
QueryRequest.Builder builder = QueryRequest.builder();
if (dafnyValue.dtor_AttributesToGet().is_Some()) {
builder.attributesToGet(ToNative.AttributeNameList(dafnyValue.dtor_AttributesToGet().dtor_value()));
}
if (dafnyValue.dtor_ConditionalOperator().is_Some()) {
builder.conditionalOperator(ToNative.ConditionalOperator(dafnyValue.dtor_ConditionalOperator().dtor_value()));
}
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_ExclusiveStartKey().is_Some()) {
builder.exclusiveStartKey(ToNative.Key(dafnyValue.dtor_ExclusiveStartKey().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
if (dafnyValue.dtor_FilterExpression().is_Some()) {
builder.filterExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FilterExpression().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_KeyConditionExpression().is_Some()) {
builder.keyConditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KeyConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_KeyConditions().is_Some()) {
builder.keyConditions(ToNative.KeyConditions(dafnyValue.dtor_KeyConditions().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_ProjectionExpression().is_Some()) {
builder.projectionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ProjectionExpression().dtor_value()));
}
if (dafnyValue.dtor_QueryFilter().is_Some()) {
builder.queryFilter(ToNative.FilterConditionMap(dafnyValue.dtor_QueryFilter().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ScanIndexForward().is_Some()) {
builder.scanIndexForward((dafnyValue.dtor_ScanIndexForward().dtor_value()));
}
if (dafnyValue.dtor_Select().is_Some()) {
builder.select(ToNative.Select(dafnyValue.dtor_Select().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static QueryResponse QueryOutput(QueryOutput dafnyValue) {
QueryResponse.Builder builder = QueryResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Count().is_Some()) {
builder.count((dafnyValue.dtor_Count().dtor_value()));
}
if (dafnyValue.dtor_Items().is_Some()) {
builder.items(ToNative.ItemList(dafnyValue.dtor_Items().dtor_value()));
}
if (dafnyValue.dtor_LastEvaluatedKey().is_Some()) {
builder.lastEvaluatedKey(ToNative.Key(dafnyValue.dtor_LastEvaluatedKey().dtor_value()));
}
if (dafnyValue.dtor_ScannedCount().is_Some()) {
builder.scannedCount((dafnyValue.dtor_ScannedCount().dtor_value()));
}
return builder.build();
}
public static Replica Replica(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Replica dafnyValue) {
Replica.Builder builder = Replica.builder();
if (dafnyValue.dtor_RegionName().is_Some()) {
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName().dtor_value()));
}
return builder.build();
}
public static ReplicaAutoScalingDescription ReplicaAutoScalingDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingDescription dafnyValue) {
ReplicaAutoScalingDescription.Builder builder = ReplicaAutoScalingDescription.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.ReplicaGlobalSecondaryIndexAutoScalingDescriptionList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_RegionName().is_Some()) {
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().is_Some()) {
builder.replicaProvisionedReadCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().is_Some()) {
builder.replicaProvisionedWriteCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ReplicaStatus().is_Some()) {
builder.replicaStatus(ToNative.ReplicaStatus(dafnyValue.dtor_ReplicaStatus().dtor_value()));
}
return builder.build();
}
public static List<ReplicaAutoScalingDescription> ReplicaAutoScalingDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaAutoScalingDescription);
}
public static ReplicaAutoScalingUpdate ReplicaAutoScalingUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingUpdate dafnyValue) {
ReplicaAutoScalingUpdate.Builder builder = ReplicaAutoScalingUpdate.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
if (dafnyValue.dtor_ReplicaGlobalSecondaryIndexUpdates().is_Some()) {
builder.replicaGlobalSecondaryIndexUpdates(ToNative.ReplicaGlobalSecondaryIndexAutoScalingUpdateList(dafnyValue.dtor_ReplicaGlobalSecondaryIndexUpdates().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingUpdate().is_Some()) {
builder.replicaProvisionedReadCapacityAutoScalingUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingUpdate().dtor_value()));
}
return builder.build();
}
public static List<ReplicaAutoScalingUpdate> ReplicaAutoScalingUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaAutoScalingUpdate);
}
public static ReplicaDescription ReplicaDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaDescription dafnyValue) {
ReplicaDescription.Builder builder = ReplicaDescription.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.ReplicaGlobalSecondaryIndexDescriptionList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_KMSMasterKeyId().is_Some()) {
builder.kmsMasterKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KMSMasterKeyId().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughputOverride(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
if (dafnyValue.dtor_RegionName().is_Some()) {
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName().dtor_value()));
}
if (dafnyValue.dtor_ReplicaInaccessibleDateTime().is_Some()) {
builder.replicaInaccessibleDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_ReplicaInaccessibleDateTime().dtor_value()));
}
if (dafnyValue.dtor_ReplicaStatus().is_Some()) {
builder.replicaStatus(ToNative.ReplicaStatus(dafnyValue.dtor_ReplicaStatus().dtor_value()));
}
if (dafnyValue.dtor_ReplicaStatusDescription().is_Some()) {
builder.replicaStatusDescription(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ReplicaStatusDescription().dtor_value()));
}
if (dafnyValue.dtor_ReplicaStatusPercentProgress().is_Some()) {
builder.replicaStatusPercentProgress(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ReplicaStatusPercentProgress().dtor_value()));
}
if (dafnyValue.dtor_ReplicaTableClassSummary().is_Some()) {
builder.replicaTableClassSummary(ToNative.TableClassSummary(dafnyValue.dtor_ReplicaTableClassSummary().dtor_value()));
}
return builder.build();
}
public static List<ReplicaDescription> ReplicaDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaDescription);
}
public static ReplicaGlobalSecondaryIndex ReplicaGlobalSecondaryIndex(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndex dafnyValue) {
ReplicaGlobalSecondaryIndex.Builder builder = ReplicaGlobalSecondaryIndex.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughputOverride(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
return builder.build();
}
public static ReplicaGlobalSecondaryIndexAutoScalingDescription ReplicaGlobalSecondaryIndexAutoScalingDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingDescription dafnyValue) {
ReplicaGlobalSecondaryIndexAutoScalingDescription.Builder builder = ReplicaGlobalSecondaryIndexAutoScalingDescription.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_IndexStatus().is_Some()) {
builder.indexStatus(ToNative.IndexStatus(dafnyValue.dtor_IndexStatus().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettings().is_Some()) {
builder.provisionedReadCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettings().is_Some()) {
builder.provisionedWriteCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettings().dtor_value()));
}
return builder.build();
}
public static List<ReplicaGlobalSecondaryIndexAutoScalingDescription> ReplicaGlobalSecondaryIndexAutoScalingDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndexAutoScalingDescription);
}
public static ReplicaGlobalSecondaryIndexAutoScalingUpdate ReplicaGlobalSecondaryIndexAutoScalingUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingUpdate dafnyValue) {
ReplicaGlobalSecondaryIndexAutoScalingUpdate.Builder builder = ReplicaGlobalSecondaryIndexAutoScalingUpdate.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedReadCapacityAutoScalingUpdate().is_Some()) {
builder.provisionedReadCapacityAutoScalingUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ProvisionedReadCapacityAutoScalingUpdate().dtor_value()));
}
return builder.build();
}
public static List<ReplicaGlobalSecondaryIndexAutoScalingUpdate> ReplicaGlobalSecondaryIndexAutoScalingUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndexAutoScalingUpdate);
}
public static ReplicaGlobalSecondaryIndexDescription ReplicaGlobalSecondaryIndexDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexDescription dafnyValue) {
ReplicaGlobalSecondaryIndexDescription.Builder builder = ReplicaGlobalSecondaryIndexDescription.builder();
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughputOverride(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
return builder.build();
}
public static List<ReplicaGlobalSecondaryIndexDescription> ReplicaGlobalSecondaryIndexDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndexDescription);
}
public static List<ReplicaGlobalSecondaryIndex> ReplicaGlobalSecondaryIndexList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndex> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndex);
}
public static ReplicaGlobalSecondaryIndexSettingsDescription ReplicaGlobalSecondaryIndexSettingsDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsDescription dafnyValue) {
ReplicaGlobalSecondaryIndexSettingsDescription.Builder builder = ReplicaGlobalSecondaryIndexSettingsDescription.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
if (dafnyValue.dtor_IndexStatus().is_Some()) {
builder.indexStatus(ToNative.IndexStatus(dafnyValue.dtor_IndexStatus().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettings().is_Some()) {
builder.provisionedReadCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedReadCapacityUnits().is_Some()) {
builder.provisionedReadCapacityUnits((dafnyValue.dtor_ProvisionedReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettings().is_Some()) {
builder.provisionedWriteCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityUnits().is_Some()) {
builder.provisionedWriteCapacityUnits((dafnyValue.dtor_ProvisionedWriteCapacityUnits().dtor_value()));
}
return builder.build();
}
public static List<ReplicaGlobalSecondaryIndexSettingsDescription> ReplicaGlobalSecondaryIndexSettingsDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndexSettingsDescription);
}
public static ReplicaGlobalSecondaryIndexSettingsUpdate ReplicaGlobalSecondaryIndexSettingsUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsUpdate dafnyValue) {
ReplicaGlobalSecondaryIndexSettingsUpdate.Builder builder = ReplicaGlobalSecondaryIndexSettingsUpdate.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
if (dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettingsUpdate().is_Some()) {
builder.provisionedReadCapacityAutoScalingSettingsUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ProvisionedReadCapacityAutoScalingSettingsUpdate().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedReadCapacityUnits().is_Some()) {
builder.provisionedReadCapacityUnits((dafnyValue.dtor_ProvisionedReadCapacityUnits().dtor_value()));
}
return builder.build();
}
public static List<ReplicaGlobalSecondaryIndexSettingsUpdate> ReplicaGlobalSecondaryIndexSettingsUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaGlobalSecondaryIndexSettingsUpdate);
}
public static List<Replica> ReplicaList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Replica> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Replica);
}
public static ReplicaSettingsDescription ReplicaSettingsDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsDescription dafnyValue) {
ReplicaSettingsDescription.Builder builder = ReplicaSettingsDescription.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
if (dafnyValue.dtor_ReplicaBillingModeSummary().is_Some()) {
builder.replicaBillingModeSummary(ToNative.BillingModeSummary(dafnyValue.dtor_ReplicaBillingModeSummary().dtor_value()));
}
if (dafnyValue.dtor_ReplicaGlobalSecondaryIndexSettings().is_Some()) {
builder.replicaGlobalSecondaryIndexSettings(ToNative.ReplicaGlobalSecondaryIndexSettingsDescriptionList(dafnyValue.dtor_ReplicaGlobalSecondaryIndexSettings().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().is_Some()) {
builder.replicaProvisionedReadCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityUnits().is_Some()) {
builder.replicaProvisionedReadCapacityUnits((dafnyValue.dtor_ReplicaProvisionedReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().is_Some()) {
builder.replicaProvisionedWriteCapacityAutoScalingSettings(ToNative.AutoScalingSettingsDescription(dafnyValue.dtor_ReplicaProvisionedWriteCapacityAutoScalingSettings().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedWriteCapacityUnits().is_Some()) {
builder.replicaProvisionedWriteCapacityUnits((dafnyValue.dtor_ReplicaProvisionedWriteCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ReplicaStatus().is_Some()) {
builder.replicaStatus(ToNative.ReplicaStatus(dafnyValue.dtor_ReplicaStatus().dtor_value()));
}
if (dafnyValue.dtor_ReplicaTableClassSummary().is_Some()) {
builder.replicaTableClassSummary(ToNative.TableClassSummary(dafnyValue.dtor_ReplicaTableClassSummary().dtor_value()));
}
return builder.build();
}
public static List<ReplicaSettingsDescription> ReplicaSettingsDescriptionList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsDescription> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaSettingsDescription);
}
public static ReplicaSettingsUpdate ReplicaSettingsUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsUpdate dafnyValue) {
ReplicaSettingsUpdate.Builder builder = ReplicaSettingsUpdate.builder();
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
if (dafnyValue.dtor_ReplicaGlobalSecondaryIndexSettingsUpdate().is_Some()) {
builder.replicaGlobalSecondaryIndexSettingsUpdate(ToNative.ReplicaGlobalSecondaryIndexSettingsUpdateList(dafnyValue.dtor_ReplicaGlobalSecondaryIndexSettingsUpdate().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate().is_Some()) {
builder.replicaProvisionedReadCapacityAutoScalingSettingsUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate().dtor_value()));
}
if (dafnyValue.dtor_ReplicaProvisionedReadCapacityUnits().is_Some()) {
builder.replicaProvisionedReadCapacityUnits((dafnyValue.dtor_ReplicaProvisionedReadCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ReplicaTableClass().is_Some()) {
builder.replicaTableClass(ToNative.TableClass(dafnyValue.dtor_ReplicaTableClass().dtor_value()));
}
return builder.build();
}
public static List<ReplicaSettingsUpdate> ReplicaSettingsUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaSettingsUpdate);
}
public static ReplicaStatus ReplicaStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus dafnyValue) {
if (dafnyValue.is_CREATING()) {
return ReplicaStatus.CREATING;
}
if (dafnyValue.is_CREATION__FAILED()) {
return ReplicaStatus.CREATION_FAILED;
}
if (dafnyValue.is_UPDATING()) {
return ReplicaStatus.UPDATING;
}
if (dafnyValue.is_DELETING()) {
return ReplicaStatus.DELETING;
}
if (dafnyValue.is_ACTIVE()) {
return ReplicaStatus.ACTIVE;
}
if (dafnyValue.is_REGION__DISABLED()) {
return ReplicaStatus.REGION_DISABLED;
}
if (dafnyValue.is_INACCESSIBLE__ENCRYPTION__CREDENTIALS()) {
return ReplicaStatus.INACCESSIBLE_ENCRYPTION_CREDENTIALS;
}
return ReplicaStatus.fromValue(dafnyValue.toString());
}
public static ReplicationGroupUpdate ReplicationGroupUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicationGroupUpdate dafnyValue) {
ReplicationGroupUpdate.Builder builder = ReplicationGroupUpdate.builder();
if (dafnyValue.dtor_Create().is_Some()) {
builder.create(ToNative.CreateReplicationGroupMemberAction(dafnyValue.dtor_Create().dtor_value()));
}
if (dafnyValue.dtor_Delete().is_Some()) {
builder.delete(ToNative.DeleteReplicationGroupMemberAction(dafnyValue.dtor_Delete().dtor_value()));
}
if (dafnyValue.dtor_Update().is_Some()) {
builder.update(ToNative.UpdateReplicationGroupMemberAction(dafnyValue.dtor_Update().dtor_value()));
}
return builder.build();
}
public static List<ReplicationGroupUpdate> ReplicationGroupUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicationGroupUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicationGroupUpdate);
}
public static ReplicaUpdate ReplicaUpdate(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaUpdate dafnyValue) {
ReplicaUpdate.Builder builder = ReplicaUpdate.builder();
if (dafnyValue.dtor_Create().is_Some()) {
builder.create(ToNative.CreateReplicaAction(dafnyValue.dtor_Create().dtor_value()));
}
if (dafnyValue.dtor_Delete().is_Some()) {
builder.delete(ToNative.DeleteReplicaAction(dafnyValue.dtor_Delete().dtor_value()));
}
return builder.build();
}
public static List<ReplicaUpdate> ReplicaUpdateList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaUpdate> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::ReplicaUpdate);
}
public static RestoreSummary RestoreSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreSummary dafnyValue) {
RestoreSummary.Builder builder = RestoreSummary.builder();
builder.restoreDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_RestoreDateTime()));
builder.restoreInProgress((dafnyValue.dtor_RestoreInProgress()));
if (dafnyValue.dtor_SourceBackupArn().is_Some()) {
builder.sourceBackupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceBackupArn().dtor_value()));
}
if (dafnyValue.dtor_SourceTableArn().is_Some()) {
builder.sourceTableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceTableArn().dtor_value()));
}
return builder.build();
}
public static RestoreTableFromBackupRequest RestoreTableFromBackupInput(
RestoreTableFromBackupInput dafnyValue) {
RestoreTableFromBackupRequest.Builder builder = RestoreTableFromBackupRequest.builder();
builder.backupArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_BackupArn()));
if (dafnyValue.dtor_BillingModeOverride().is_Some()) {
builder.billingModeOverride(ToNative.BillingMode(dafnyValue.dtor_BillingModeOverride().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexOverride().is_Some()) {
builder.globalSecondaryIndexOverride(ToNative.GlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexOverride().dtor_value()));
}
if (dafnyValue.dtor_LocalSecondaryIndexOverride().is_Some()) {
builder.localSecondaryIndexOverride(ToNative.LocalSecondaryIndexList(dafnyValue.dtor_LocalSecondaryIndexOverride().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
if (dafnyValue.dtor_SSESpecificationOverride().is_Some()) {
builder.sseSpecificationOverride(ToNative.SSESpecification(dafnyValue.dtor_SSESpecificationOverride().dtor_value()));
}
builder.targetTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TargetTableName()));
return builder.build();
}
public static RestoreTableFromBackupResponse RestoreTableFromBackupOutput(
RestoreTableFromBackupOutput dafnyValue) {
RestoreTableFromBackupResponse.Builder builder = RestoreTableFromBackupResponse.builder();
if (dafnyValue.dtor_TableDescription().is_Some()) {
builder.tableDescription(ToNative.TableDescription(dafnyValue.dtor_TableDescription().dtor_value()));
}
return builder.build();
}
public static RestoreTableToPointInTimeRequest RestoreTableToPointInTimeInput(
RestoreTableToPointInTimeInput dafnyValue) {
RestoreTableToPointInTimeRequest.Builder builder = RestoreTableToPointInTimeRequest.builder();
if (dafnyValue.dtor_BillingModeOverride().is_Some()) {
builder.billingModeOverride(ToNative.BillingMode(dafnyValue.dtor_BillingModeOverride().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexOverride().is_Some()) {
builder.globalSecondaryIndexOverride(ToNative.GlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexOverride().dtor_value()));
}
if (dafnyValue.dtor_LocalSecondaryIndexOverride().is_Some()) {
builder.localSecondaryIndexOverride(ToNative.LocalSecondaryIndexList(dafnyValue.dtor_LocalSecondaryIndexOverride().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
if (dafnyValue.dtor_RestoreDateTime().is_Some()) {
builder.restoreDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_RestoreDateTime().dtor_value()));
}
if (dafnyValue.dtor_SourceTableArn().is_Some()) {
builder.sourceTableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceTableArn().dtor_value()));
}
if (dafnyValue.dtor_SourceTableName().is_Some()) {
builder.sourceTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_SourceTableName().dtor_value()));
}
if (dafnyValue.dtor_SSESpecificationOverride().is_Some()) {
builder.sseSpecificationOverride(ToNative.SSESpecification(dafnyValue.dtor_SSESpecificationOverride().dtor_value()));
}
builder.targetTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TargetTableName()));
if (dafnyValue.dtor_UseLatestRestorableTime().is_Some()) {
builder.useLatestRestorableTime((dafnyValue.dtor_UseLatestRestorableTime().dtor_value()));
}
return builder.build();
}
public static RestoreTableToPointInTimeResponse RestoreTableToPointInTimeOutput(
RestoreTableToPointInTimeOutput dafnyValue) {
RestoreTableToPointInTimeResponse.Builder builder = RestoreTableToPointInTimeResponse.builder();
if (dafnyValue.dtor_TableDescription().is_Some()) {
builder.tableDescription(ToNative.TableDescription(dafnyValue.dtor_TableDescription().dtor_value()));
}
return builder.build();
}
public static ReturnConsumedCapacity ReturnConsumedCapacity(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity dafnyValue) {
if (dafnyValue.is_INDEXES()) {
return ReturnConsumedCapacity.INDEXES;
}
if (dafnyValue.is_TOTAL()) {
return ReturnConsumedCapacity.TOTAL;
}
if (dafnyValue.is_NONE()) {
return ReturnConsumedCapacity.NONE;
}
return ReturnConsumedCapacity.fromValue(dafnyValue.toString());
}
public static ReturnItemCollectionMetrics ReturnItemCollectionMetrics(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics dafnyValue) {
if (dafnyValue.is_SIZE()) {
return ReturnItemCollectionMetrics.SIZE;
}
if (dafnyValue.is_NONE()) {
return ReturnItemCollectionMetrics.NONE;
}
return ReturnItemCollectionMetrics.fromValue(dafnyValue.toString());
}
public static ReturnValue ReturnValue(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue dafnyValue) {
if (dafnyValue.is_NONE()) {
return ReturnValue.NONE;
}
if (dafnyValue.is_ALL__OLD()) {
return ReturnValue.ALL_OLD;
}
if (dafnyValue.is_UPDATED__OLD()) {
return ReturnValue.UPDATED_OLD;
}
if (dafnyValue.is_ALL__NEW()) {
return ReturnValue.ALL_NEW;
}
if (dafnyValue.is_UPDATED__NEW()) {
return ReturnValue.UPDATED_NEW;
}
return ReturnValue.fromValue(dafnyValue.toString());
}
public static ReturnValuesOnConditionCheckFailure ReturnValuesOnConditionCheckFailure(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure dafnyValue) {
if (dafnyValue.is_ALL__OLD()) {
return ReturnValuesOnConditionCheckFailure.ALL_OLD;
}
if (dafnyValue.is_NONE()) {
return ReturnValuesOnConditionCheckFailure.NONE;
}
return ReturnValuesOnConditionCheckFailure.fromValue(dafnyValue.toString());
}
public static S3BucketSource S3BucketSource(
software.amazon.cryptography.services.dynamodb.internaldafny.types.S3BucketSource dafnyValue) {
S3BucketSource.Builder builder = S3BucketSource.builder();
builder.s3Bucket(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3Bucket()));
if (dafnyValue.dtor_S3BucketOwner().is_Some()) {
builder.s3BucketOwner(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3BucketOwner().dtor_value()));
}
if (dafnyValue.dtor_S3KeyPrefix().is_Some()) {
builder.s3KeyPrefix(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_S3KeyPrefix().dtor_value()));
}
return builder.build();
}
public static S3SseAlgorithm S3SseAlgorithm(
software.amazon.cryptography.services.dynamodb.internaldafny.types.S3SseAlgorithm dafnyValue) {
if (dafnyValue.is_AES256()) {
return S3SseAlgorithm.AES256;
}
if (dafnyValue.is_KMS()) {
return S3SseAlgorithm.KMS;
}
return S3SseAlgorithm.fromValue(dafnyValue.toString());
}
public static ScalarAttributeType ScalarAttributeType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType dafnyValue) {
if (dafnyValue.is_S()) {
return ScalarAttributeType.S;
}
if (dafnyValue.is_N()) {
return ScalarAttributeType.N;
}
if (dafnyValue.is_B()) {
return ScalarAttributeType.B;
}
return ScalarAttributeType.fromValue(dafnyValue.toString());
}
public static ScanRequest ScanInput(ScanInput dafnyValue) {
ScanRequest.Builder builder = ScanRequest.builder();
if (dafnyValue.dtor_AttributesToGet().is_Some()) {
builder.attributesToGet(ToNative.AttributeNameList(dafnyValue.dtor_AttributesToGet().dtor_value()));
}
if (dafnyValue.dtor_ConditionalOperator().is_Some()) {
builder.conditionalOperator(ToNative.ConditionalOperator(dafnyValue.dtor_ConditionalOperator().dtor_value()));
}
if (dafnyValue.dtor_ConsistentRead().is_Some()) {
builder.consistentRead((dafnyValue.dtor_ConsistentRead().dtor_value()));
}
if (dafnyValue.dtor_ExclusiveStartKey().is_Some()) {
builder.exclusiveStartKey(ToNative.Key(dafnyValue.dtor_ExclusiveStartKey().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
if (dafnyValue.dtor_FilterExpression().is_Some()) {
builder.filterExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_FilterExpression().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_Limit().is_Some()) {
builder.limit((dafnyValue.dtor_Limit().dtor_value()));
}
if (dafnyValue.dtor_ProjectionExpression().is_Some()) {
builder.projectionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ProjectionExpression().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ScanFilter().is_Some()) {
builder.scanFilter(ToNative.FilterConditionMap(dafnyValue.dtor_ScanFilter().dtor_value()));
}
if (dafnyValue.dtor_Segment().is_Some()) {
builder.segment((dafnyValue.dtor_Segment().dtor_value()));
}
if (dafnyValue.dtor_Select().is_Some()) {
builder.select(ToNative.Select(dafnyValue.dtor_Select().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
if (dafnyValue.dtor_TotalSegments().is_Some()) {
builder.totalSegments((dafnyValue.dtor_TotalSegments().dtor_value()));
}
return builder.build();
}
public static ScanResponse ScanOutput(ScanOutput dafnyValue) {
ScanResponse.Builder builder = ScanResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Count().is_Some()) {
builder.count((dafnyValue.dtor_Count().dtor_value()));
}
if (dafnyValue.dtor_Items().is_Some()) {
builder.items(ToNative.ItemList(dafnyValue.dtor_Items().dtor_value()));
}
if (dafnyValue.dtor_LastEvaluatedKey().is_Some()) {
builder.lastEvaluatedKey(ToNative.Key(dafnyValue.dtor_LastEvaluatedKey().dtor_value()));
}
if (dafnyValue.dtor_ScannedCount().is_Some()) {
builder.scannedCount((dafnyValue.dtor_ScannedCount().dtor_value()));
}
return builder.build();
}
public static Map<String, Capacity> SecondaryIndexesCapacityMap(
DafnyMap<? extends DafnySequence<? extends Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Capacity> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToMap(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Capacity);
}
public static Select Select(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Select dafnyValue) {
if (dafnyValue.is_ALL__ATTRIBUTES()) {
return Select.ALL_ATTRIBUTES;
}
if (dafnyValue.is_ALL__PROJECTED__ATTRIBUTES()) {
return Select.ALL_PROJECTED_ATTRIBUTES;
}
if (dafnyValue.is_SPECIFIC__ATTRIBUTES()) {
return Select.SPECIFIC_ATTRIBUTES;
}
if (dafnyValue.is_COUNT()) {
return Select.COUNT;
}
return Select.fromValue(dafnyValue.toString());
}
public static SourceTableDetails SourceTableDetails(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableDetails dafnyValue) {
SourceTableDetails.Builder builder = SourceTableDetails.builder();
if (dafnyValue.dtor_BillingMode().is_Some()) {
builder.billingMode(ToNative.BillingMode(dafnyValue.dtor_BillingMode().dtor_value()));
}
if (dafnyValue.dtor_ItemCount().is_Some()) {
builder.itemCount((dafnyValue.dtor_ItemCount().dtor_value()));
}
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput()));
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
builder.tableCreationDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_TableCreationDateTime()));
builder.tableId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableId()));
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
if (dafnyValue.dtor_TableSizeBytes().is_Some()) {
builder.tableSizeBytes((dafnyValue.dtor_TableSizeBytes().dtor_value()));
}
return builder.build();
}
public static SourceTableFeatureDetails SourceTableFeatureDetails(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableFeatureDetails dafnyValue) {
SourceTableFeatureDetails.Builder builder = SourceTableFeatureDetails.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.GlobalSecondaryIndexes(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_LocalSecondaryIndexes().is_Some()) {
builder.localSecondaryIndexes(ToNative.LocalSecondaryIndexes(dafnyValue.dtor_LocalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_SSEDescription().is_Some()) {
builder.sseDescription(ToNative.SSEDescription(dafnyValue.dtor_SSEDescription().dtor_value()));
}
if (dafnyValue.dtor_StreamDescription().is_Some()) {
builder.streamDescription(ToNative.StreamSpecification(dafnyValue.dtor_StreamDescription().dtor_value()));
}
if (dafnyValue.dtor_TimeToLiveDescription().is_Some()) {
builder.timeToLiveDescription(ToNative.TimeToLiveDescription(dafnyValue.dtor_TimeToLiveDescription().dtor_value()));
}
return builder.build();
}
public static SSEDescription SSEDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEDescription dafnyValue) {
SSEDescription.Builder builder = SSEDescription.builder();
if (dafnyValue.dtor_InaccessibleEncryptionDateTime().is_Some()) {
builder.inaccessibleEncryptionDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_InaccessibleEncryptionDateTime().dtor_value()));
}
if (dafnyValue.dtor_KMSMasterKeyArn().is_Some()) {
builder.kmsMasterKeyArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KMSMasterKeyArn().dtor_value()));
}
if (dafnyValue.dtor_SSEType().is_Some()) {
builder.sseType(ToNative.SSEType(dafnyValue.dtor_SSEType().dtor_value()));
}
if (dafnyValue.dtor_Status().is_Some()) {
builder.status(ToNative.SSEStatus(dafnyValue.dtor_Status().dtor_value()));
}
return builder.build();
}
public static SSESpecification SSESpecification(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SSESpecification dafnyValue) {
SSESpecification.Builder builder = SSESpecification.builder();
if (dafnyValue.dtor_Enabled().is_Some()) {
builder.enabled((dafnyValue.dtor_Enabled().dtor_value()));
}
if (dafnyValue.dtor_KMSMasterKeyId().is_Some()) {
builder.kmsMasterKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KMSMasterKeyId().dtor_value()));
}
if (dafnyValue.dtor_SSEType().is_Some()) {
builder.sseType(ToNative.SSEType(dafnyValue.dtor_SSEType().dtor_value()));
}
return builder.build();
}
public static SSEStatus SSEStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus dafnyValue) {
if (dafnyValue.is_ENABLING()) {
return SSEStatus.ENABLING;
}
if (dafnyValue.is_ENABLED()) {
return SSEStatus.ENABLED;
}
if (dafnyValue.is_DISABLING()) {
return SSEStatus.DISABLING;
}
if (dafnyValue.is_DISABLED()) {
return SSEStatus.DISABLED;
}
if (dafnyValue.is_UPDATING()) {
return SSEStatus.UPDATING;
}
return SSEStatus.fromValue(dafnyValue.toString());
}
public static SSEType SSEType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEType dafnyValue) {
if (dafnyValue.is_AES256()) {
return SSEType.AES256;
}
if (dafnyValue.is_KMS()) {
return SSEType.KMS;
}
return SSEType.fromValue(dafnyValue.toString());
}
public static StreamSpecification StreamSpecification(
software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamSpecification dafnyValue) {
StreamSpecification.Builder builder = StreamSpecification.builder();
builder.streamEnabled((dafnyValue.dtor_StreamEnabled()));
if (dafnyValue.dtor_StreamViewType().is_Some()) {
builder.streamViewType(ToNative.StreamViewType(dafnyValue.dtor_StreamViewType().dtor_value()));
}
return builder.build();
}
public static StreamViewType StreamViewType(
software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType dafnyValue) {
if (dafnyValue.is_NEW__IMAGE()) {
return StreamViewType.NEW_IMAGE;
}
if (dafnyValue.is_OLD__IMAGE()) {
return StreamViewType.OLD_IMAGE;
}
if (dafnyValue.is_NEW__AND__OLD__IMAGES()) {
return StreamViewType.NEW_AND_OLD_IMAGES;
}
if (dafnyValue.is_KEYS__ONLY()) {
return StreamViewType.KEYS_ONLY;
}
return StreamViewType.fromValue(dafnyValue.toString());
}
public static List<String> StringSetAttributeValue(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static TableAutoScalingDescription TableAutoScalingDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableAutoScalingDescription dafnyValue) {
TableAutoScalingDescription.Builder builder = TableAutoScalingDescription.builder();
if (dafnyValue.dtor_Replicas().is_Some()) {
builder.replicas(ToNative.ReplicaAutoScalingDescriptionList(dafnyValue.dtor_Replicas().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
if (dafnyValue.dtor_TableStatus().is_Some()) {
builder.tableStatus(ToNative.TableStatus(dafnyValue.dtor_TableStatus().dtor_value()));
}
return builder.build();
}
public static TableClass TableClass(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClass dafnyValue) {
if (dafnyValue.is_STANDARD()) {
return TableClass.STANDARD;
}
if (dafnyValue.is_STANDARD__INFREQUENT__ACCESS()) {
return TableClass.STANDARD_INFREQUENT_ACCESS;
}
return TableClass.fromValue(dafnyValue.toString());
}
public static TableClassSummary TableClassSummary(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClassSummary dafnyValue) {
TableClassSummary.Builder builder = TableClassSummary.builder();
if (dafnyValue.dtor_LastUpdateDateTime().is_Some()) {
builder.lastUpdateDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_LastUpdateDateTime().dtor_value()));
}
if (dafnyValue.dtor_TableClass().is_Some()) {
builder.tableClass(ToNative.TableClass(dafnyValue.dtor_TableClass().dtor_value()));
}
return builder.build();
}
public static TableCreationParameters TableCreationParameters(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableCreationParameters dafnyValue) {
TableCreationParameters.Builder builder = TableCreationParameters.builder();
builder.attributeDefinitions(ToNative.AttributeDefinitions(dafnyValue.dtor_AttributeDefinitions()));
if (dafnyValue.dtor_BillingMode().is_Some()) {
builder.billingMode(ToNative.BillingMode(dafnyValue.dtor_BillingMode().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.GlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema()));
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
if (dafnyValue.dtor_SSESpecification().is_Some()) {
builder.sseSpecification(ToNative.SSESpecification(dafnyValue.dtor_SSESpecification().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static TableDescription TableDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableDescription dafnyValue) {
TableDescription.Builder builder = TableDescription.builder();
if (dafnyValue.dtor_ArchivalSummary().is_Some()) {
builder.archivalSummary(ToNative.ArchivalSummary(dafnyValue.dtor_ArchivalSummary().dtor_value()));
}
if (dafnyValue.dtor_AttributeDefinitions().is_Some()) {
builder.attributeDefinitions(ToNative.AttributeDefinitions(dafnyValue.dtor_AttributeDefinitions().dtor_value()));
}
if (dafnyValue.dtor_BillingModeSummary().is_Some()) {
builder.billingModeSummary(ToNative.BillingModeSummary(dafnyValue.dtor_BillingModeSummary().dtor_value()));
}
if (dafnyValue.dtor_CreationDateTime().is_Some()) {
builder.creationDateTime(software.amazon.smithy.dafny.conversion.ToNative.Simple.Instant(dafnyValue.dtor_CreationDateTime().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.GlobalSecondaryIndexDescriptionList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableVersion().is_Some()) {
builder.globalTableVersion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableVersion().dtor_value()));
}
if (dafnyValue.dtor_ItemCount().is_Some()) {
builder.itemCount((dafnyValue.dtor_ItemCount().dtor_value()));
}
if (dafnyValue.dtor_KeySchema().is_Some()) {
builder.keySchema(ToNative.KeySchema(dafnyValue.dtor_KeySchema().dtor_value()));
}
if (dafnyValue.dtor_LatestStreamArn().is_Some()) {
builder.latestStreamArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_LatestStreamArn().dtor_value()));
}
if (dafnyValue.dtor_LatestStreamLabel().is_Some()) {
builder.latestStreamLabel(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_LatestStreamLabel().dtor_value()));
}
if (dafnyValue.dtor_LocalSecondaryIndexes().is_Some()) {
builder.localSecondaryIndexes(ToNative.LocalSecondaryIndexDescriptionList(dafnyValue.dtor_LocalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughputDescription(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
if (dafnyValue.dtor_Replicas().is_Some()) {
builder.replicas(ToNative.ReplicaDescriptionList(dafnyValue.dtor_Replicas().dtor_value()));
}
if (dafnyValue.dtor_RestoreSummary().is_Some()) {
builder.restoreSummary(ToNative.RestoreSummary(dafnyValue.dtor_RestoreSummary().dtor_value()));
}
if (dafnyValue.dtor_SSEDescription().is_Some()) {
builder.sseDescription(ToNative.SSEDescription(dafnyValue.dtor_SSEDescription().dtor_value()));
}
if (dafnyValue.dtor_StreamSpecification().is_Some()) {
builder.streamSpecification(ToNative.StreamSpecification(dafnyValue.dtor_StreamSpecification().dtor_value()));
}
if (dafnyValue.dtor_TableArn().is_Some()) {
builder.tableArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableArn().dtor_value()));
}
if (dafnyValue.dtor_TableClassSummary().is_Some()) {
builder.tableClassSummary(ToNative.TableClassSummary(dafnyValue.dtor_TableClassSummary().dtor_value()));
}
if (dafnyValue.dtor_TableId().is_Some()) {
builder.tableId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableId().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
if (dafnyValue.dtor_TableSizeBytes().is_Some()) {
builder.tableSizeBytes((dafnyValue.dtor_TableSizeBytes().dtor_value()));
}
if (dafnyValue.dtor_TableStatus().is_Some()) {
builder.tableStatus(ToNative.TableStatus(dafnyValue.dtor_TableStatus().dtor_value()));
}
return builder.build();
}
public static List<String> TableNameList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static TableStatus TableStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus dafnyValue) {
if (dafnyValue.is_CREATING()) {
return TableStatus.CREATING;
}
if (dafnyValue.is_UPDATING()) {
return TableStatus.UPDATING;
}
if (dafnyValue.is_DELETING()) {
return TableStatus.DELETING;
}
if (dafnyValue.is_ACTIVE()) {
return TableStatus.ACTIVE;
}
if (dafnyValue.is_INACCESSIBLE__ENCRYPTION__CREDENTIALS()) {
return TableStatus.INACCESSIBLE_ENCRYPTION_CREDENTIALS;
}
if (dafnyValue.is_ARCHIVING()) {
return TableStatus.ARCHIVING;
}
if (dafnyValue.is_ARCHIVED()) {
return TableStatus.ARCHIVED;
}
return TableStatus.fromValue(dafnyValue.toString());
}
public static Tag Tag(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Tag dafnyValue) {
Tag.Builder builder = Tag.builder();
builder.key(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Key()));
builder.value(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Value()));
return builder.build();
}
public static List<String> TagKeyList(
DafnySequence<? extends DafnySequence<? extends Character>> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.smithy.dafny.conversion.ToNative.Simple::String);
}
public static List<Tag> TagList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.Tag> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::Tag);
}
public static TagResourceRequest TagResourceInput(TagResourceInput dafnyValue) {
TagResourceRequest.Builder builder = TagResourceRequest.builder();
builder.resourceArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ResourceArn()));
builder.tags(ToNative.TagList(dafnyValue.dtor_Tags()));
return builder.build();
}
public static TimeToLiveDescription TimeToLiveDescription(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveDescription dafnyValue) {
TimeToLiveDescription.Builder builder = TimeToLiveDescription.builder();
if (dafnyValue.dtor_AttributeName().is_Some()) {
builder.attributeName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AttributeName().dtor_value()));
}
if (dafnyValue.dtor_TimeToLiveStatus().is_Some()) {
builder.timeToLiveStatus(ToNative.TimeToLiveStatus(dafnyValue.dtor_TimeToLiveStatus().dtor_value()));
}
return builder.build();
}
public static TimeToLiveSpecification TimeToLiveSpecification(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveSpecification dafnyValue) {
TimeToLiveSpecification.Builder builder = TimeToLiveSpecification.builder();
builder.attributeName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_AttributeName()));
builder.enabled((dafnyValue.dtor_Enabled()));
return builder.build();
}
public static TimeToLiveStatus TimeToLiveStatus(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus dafnyValue) {
if (dafnyValue.is_ENABLING()) {
return TimeToLiveStatus.ENABLING;
}
if (dafnyValue.is_DISABLING()) {
return TimeToLiveStatus.DISABLING;
}
if (dafnyValue.is_ENABLED()) {
return TimeToLiveStatus.ENABLED;
}
if (dafnyValue.is_DISABLED()) {
return TimeToLiveStatus.DISABLED;
}
return TimeToLiveStatus.fromValue(dafnyValue.toString());
}
public static TransactGetItem TransactGetItem(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItem dafnyValue) {
TransactGetItem.Builder builder = TransactGetItem.builder();
builder.get(ToNative.Get(dafnyValue.dtor_Get()));
return builder.build();
}
public static List<TransactGetItem> TransactGetItemList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItem> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::TransactGetItem);
}
public static TransactGetItemsRequest TransactGetItemsInput(TransactGetItemsInput dafnyValue) {
TransactGetItemsRequest.Builder builder = TransactGetItemsRequest.builder();
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
builder.transactItems(ToNative.TransactGetItemList(dafnyValue.dtor_TransactItems()));
return builder.build();
}
public static TransactGetItemsResponse TransactGetItemsOutput(TransactGetItemsOutput dafnyValue) {
TransactGetItemsResponse.Builder builder = TransactGetItemsResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_Responses().is_Some()) {
builder.responses(ToNative.ItemResponseList(dafnyValue.dtor_Responses().dtor_value()));
}
return builder.build();
}
public static TransactWriteItem TransactWriteItem(
software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItem dafnyValue) {
TransactWriteItem.Builder builder = TransactWriteItem.builder();
if (dafnyValue.dtor_ConditionCheck().is_Some()) {
builder.conditionCheck(ToNative.ConditionCheck(dafnyValue.dtor_ConditionCheck().dtor_value()));
}
if (dafnyValue.dtor_Delete().is_Some()) {
builder.delete(ToNative.Delete(dafnyValue.dtor_Delete().dtor_value()));
}
if (dafnyValue.dtor_Put().is_Some()) {
builder.put(ToNative.Put(dafnyValue.dtor_Put().dtor_value()));
}
if (dafnyValue.dtor_Update().is_Some()) {
builder.update(ToNative.Update(dafnyValue.dtor_Update().dtor_value()));
}
return builder.build();
}
public static List<TransactWriteItem> TransactWriteItemList(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItem> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::TransactWriteItem);
}
public static TransactWriteItemsRequest TransactWriteItemsInput(
TransactWriteItemsInput dafnyValue) {
TransactWriteItemsRequest.Builder builder = TransactWriteItemsRequest.builder();
if (dafnyValue.dtor_ClientRequestToken().is_Some()) {
builder.clientRequestToken(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ClientRequestToken().dtor_value()));
}
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ReturnItemCollectionMetrics().is_Some()) {
builder.returnItemCollectionMetrics(ToNative.ReturnItemCollectionMetrics(dafnyValue.dtor_ReturnItemCollectionMetrics().dtor_value()));
}
builder.transactItems(ToNative.TransactWriteItemList(dafnyValue.dtor_TransactItems()));
return builder.build();
}
public static TransactWriteItemsResponse TransactWriteItemsOutput(
TransactWriteItemsOutput dafnyValue) {
TransactWriteItemsResponse.Builder builder = TransactWriteItemsResponse.builder();
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacityMultiple(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ItemCollectionMetrics().is_Some()) {
builder.itemCollectionMetrics(ToNative.ItemCollectionMetricsPerTable(dafnyValue.dtor_ItemCollectionMetrics().dtor_value()));
}
return builder.build();
}
public static UntagResourceRequest UntagResourceInput(UntagResourceInput dafnyValue) {
UntagResourceRequest.Builder builder = UntagResourceRequest.builder();
builder.resourceArn(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ResourceArn()));
builder.tagKeys(ToNative.TagKeyList(dafnyValue.dtor_TagKeys()));
return builder.build();
}
public static Update Update(
software.amazon.cryptography.services.dynamodb.internaldafny.types.Update dafnyValue) {
Update.Builder builder = Update.builder();
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().is_Some()) {
builder.returnValuesOnConditionCheckFailure(ToNative.ReturnValuesOnConditionCheckFailure(dafnyValue.dtor_ReturnValuesOnConditionCheckFailure().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
builder.updateExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_UpdateExpression()));
return builder.build();
}
public static UpdateContinuousBackupsRequest UpdateContinuousBackupsInput(
UpdateContinuousBackupsInput dafnyValue) {
UpdateContinuousBackupsRequest.Builder builder = UpdateContinuousBackupsRequest.builder();
builder.pointInTimeRecoverySpecification(ToNative.PointInTimeRecoverySpecification(dafnyValue.dtor_PointInTimeRecoverySpecification()));
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static UpdateContinuousBackupsResponse UpdateContinuousBackupsOutput(
UpdateContinuousBackupsOutput dafnyValue) {
UpdateContinuousBackupsResponse.Builder builder = UpdateContinuousBackupsResponse.builder();
if (dafnyValue.dtor_ContinuousBackupsDescription().is_Some()) {
builder.continuousBackupsDescription(ToNative.ContinuousBackupsDescription(dafnyValue.dtor_ContinuousBackupsDescription().dtor_value()));
}
return builder.build();
}
public static UpdateContributorInsightsRequest UpdateContributorInsightsInput(
UpdateContributorInsightsInput dafnyValue) {
UpdateContributorInsightsRequest.Builder builder = UpdateContributorInsightsRequest.builder();
builder.contributorInsightsAction(ToNative.ContributorInsightsAction(dafnyValue.dtor_ContributorInsightsAction()));
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static UpdateContributorInsightsResponse UpdateContributorInsightsOutput(
UpdateContributorInsightsOutput dafnyValue) {
UpdateContributorInsightsResponse.Builder builder = UpdateContributorInsightsResponse.builder();
if (dafnyValue.dtor_ContributorInsightsStatus().is_Some()) {
builder.contributorInsightsStatus(ToNative.ContributorInsightsStatus(dafnyValue.dtor_ContributorInsightsStatus().dtor_value()));
}
if (dafnyValue.dtor_IndexName().is_Some()) {
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName().dtor_value()));
}
if (dafnyValue.dtor_TableName().is_Some()) {
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName().dtor_value()));
}
return builder.build();
}
public static UpdateGlobalSecondaryIndexAction UpdateGlobalSecondaryIndexAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalSecondaryIndexAction dafnyValue) {
UpdateGlobalSecondaryIndexAction.Builder builder = UpdateGlobalSecondaryIndexAction.builder();
builder.indexName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_IndexName()));
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput()));
return builder.build();
}
public static UpdateGlobalTableRequest UpdateGlobalTableInput(UpdateGlobalTableInput dafnyValue) {
UpdateGlobalTableRequest.Builder builder = UpdateGlobalTableRequest.builder();
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName()));
builder.replicaUpdates(ToNative.ReplicaUpdateList(dafnyValue.dtor_ReplicaUpdates()));
return builder.build();
}
public static UpdateGlobalTableResponse UpdateGlobalTableOutput(
UpdateGlobalTableOutput dafnyValue) {
UpdateGlobalTableResponse.Builder builder = UpdateGlobalTableResponse.builder();
if (dafnyValue.dtor_GlobalTableDescription().is_Some()) {
builder.globalTableDescription(ToNative.GlobalTableDescription(dafnyValue.dtor_GlobalTableDescription().dtor_value()));
}
return builder.build();
}
public static UpdateGlobalTableSettingsRequest UpdateGlobalTableSettingsInput(
UpdateGlobalTableSettingsInput dafnyValue) {
UpdateGlobalTableSettingsRequest.Builder builder = UpdateGlobalTableSettingsRequest.builder();
if (dafnyValue.dtor_GlobalTableBillingMode().is_Some()) {
builder.globalTableBillingMode(ToNative.BillingMode(dafnyValue.dtor_GlobalTableBillingMode().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableGlobalSecondaryIndexSettingsUpdate().is_Some()) {
builder.globalTableGlobalSecondaryIndexSettingsUpdate(ToNative.GlobalTableGlobalSecondaryIndexSettingsUpdateList(dafnyValue.dtor_GlobalTableGlobalSecondaryIndexSettingsUpdate().dtor_value()));
}
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName()));
if (dafnyValue.dtor_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate().is_Some()) {
builder.globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate().dtor_value()));
}
if (dafnyValue.dtor_GlobalTableProvisionedWriteCapacityUnits().is_Some()) {
builder.globalTableProvisionedWriteCapacityUnits((dafnyValue.dtor_GlobalTableProvisionedWriteCapacityUnits().dtor_value()));
}
if (dafnyValue.dtor_ReplicaSettingsUpdate().is_Some()) {
builder.replicaSettingsUpdate(ToNative.ReplicaSettingsUpdateList(dafnyValue.dtor_ReplicaSettingsUpdate().dtor_value()));
}
return builder.build();
}
public static UpdateGlobalTableSettingsResponse UpdateGlobalTableSettingsOutput(
UpdateGlobalTableSettingsOutput dafnyValue) {
UpdateGlobalTableSettingsResponse.Builder builder = UpdateGlobalTableSettingsResponse.builder();
if (dafnyValue.dtor_GlobalTableName().is_Some()) {
builder.globalTableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_GlobalTableName().dtor_value()));
}
if (dafnyValue.dtor_ReplicaSettings().is_Some()) {
builder.replicaSettings(ToNative.ReplicaSettingsDescriptionList(dafnyValue.dtor_ReplicaSettings().dtor_value()));
}
return builder.build();
}
public static UpdateItemRequest UpdateItemInput(UpdateItemInput dafnyValue) {
UpdateItemRequest.Builder builder = UpdateItemRequest.builder();
if (dafnyValue.dtor_AttributeUpdates().is_Some()) {
builder.attributeUpdates(ToNative.AttributeUpdates(dafnyValue.dtor_AttributeUpdates().dtor_value()));
}
if (dafnyValue.dtor_ConditionalOperator().is_Some()) {
builder.conditionalOperator(ToNative.ConditionalOperator(dafnyValue.dtor_ConditionalOperator().dtor_value()));
}
if (dafnyValue.dtor_ConditionExpression().is_Some()) {
builder.conditionExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_ConditionExpression().dtor_value()));
}
if (dafnyValue.dtor_Expected().is_Some()) {
builder.expected(ToNative.ExpectedAttributeMap(dafnyValue.dtor_Expected().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeNames().is_Some()) {
builder.expressionAttributeNames(ToNative.ExpressionAttributeNameMap(dafnyValue.dtor_ExpressionAttributeNames().dtor_value()));
}
if (dafnyValue.dtor_ExpressionAttributeValues().is_Some()) {
builder.expressionAttributeValues(ToNative.ExpressionAttributeValueMap(dafnyValue.dtor_ExpressionAttributeValues().dtor_value()));
}
builder.key(ToNative.Key(dafnyValue.dtor_Key()));
if (dafnyValue.dtor_ReturnConsumedCapacity().is_Some()) {
builder.returnConsumedCapacity(ToNative.ReturnConsumedCapacity(dafnyValue.dtor_ReturnConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ReturnItemCollectionMetrics().is_Some()) {
builder.returnItemCollectionMetrics(ToNative.ReturnItemCollectionMetrics(dafnyValue.dtor_ReturnItemCollectionMetrics().dtor_value()));
}
if (dafnyValue.dtor_ReturnValues().is_Some()) {
builder.returnValues(ToNative.ReturnValue(dafnyValue.dtor_ReturnValues().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
if (dafnyValue.dtor_UpdateExpression().is_Some()) {
builder.updateExpression(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_UpdateExpression().dtor_value()));
}
return builder.build();
}
public static UpdateItemResponse UpdateItemOutput(UpdateItemOutput dafnyValue) {
UpdateItemResponse.Builder builder = UpdateItemResponse.builder();
if (dafnyValue.dtor_Attributes().is_Some()) {
builder.attributes(ToNative.AttributeMap(dafnyValue.dtor_Attributes().dtor_value()));
}
if (dafnyValue.dtor_ConsumedCapacity().is_Some()) {
builder.consumedCapacity(ToNative.ConsumedCapacity(dafnyValue.dtor_ConsumedCapacity().dtor_value()));
}
if (dafnyValue.dtor_ItemCollectionMetrics().is_Some()) {
builder.itemCollectionMetrics(ToNative.ItemCollectionMetrics(dafnyValue.dtor_ItemCollectionMetrics().dtor_value()));
}
return builder.build();
}
public static UpdateReplicationGroupMemberAction UpdateReplicationGroupMemberAction(
software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateReplicationGroupMemberAction dafnyValue) {
UpdateReplicationGroupMemberAction.Builder builder = UpdateReplicationGroupMemberAction.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexes().is_Some()) {
builder.globalSecondaryIndexes(ToNative.ReplicaGlobalSecondaryIndexList(dafnyValue.dtor_GlobalSecondaryIndexes().dtor_value()));
}
if (dafnyValue.dtor_KMSMasterKeyId().is_Some()) {
builder.kmsMasterKeyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_KMSMasterKeyId().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughputOverride().is_Some()) {
builder.provisionedThroughputOverride(ToNative.ProvisionedThroughputOverride(dafnyValue.dtor_ProvisionedThroughputOverride().dtor_value()));
}
builder.regionName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_RegionName()));
if (dafnyValue.dtor_TableClassOverride().is_Some()) {
builder.tableClassOverride(ToNative.TableClass(dafnyValue.dtor_TableClassOverride().dtor_value()));
}
return builder.build();
}
public static UpdateTableRequest UpdateTableInput(UpdateTableInput dafnyValue) {
UpdateTableRequest.Builder builder = UpdateTableRequest.builder();
if (dafnyValue.dtor_AttributeDefinitions().is_Some()) {
builder.attributeDefinitions(ToNative.AttributeDefinitions(dafnyValue.dtor_AttributeDefinitions().dtor_value()));
}
if (dafnyValue.dtor_BillingMode().is_Some()) {
builder.billingMode(ToNative.BillingMode(dafnyValue.dtor_BillingMode().dtor_value()));
}
if (dafnyValue.dtor_GlobalSecondaryIndexUpdates().is_Some()) {
builder.globalSecondaryIndexUpdates(ToNative.GlobalSecondaryIndexUpdateList(dafnyValue.dtor_GlobalSecondaryIndexUpdates().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedThroughput().is_Some()) {
builder.provisionedThroughput(ToNative.ProvisionedThroughput(dafnyValue.dtor_ProvisionedThroughput().dtor_value()));
}
if (dafnyValue.dtor_ReplicaUpdates().is_Some()) {
builder.replicaUpdates(ToNative.ReplicationGroupUpdateList(dafnyValue.dtor_ReplicaUpdates().dtor_value()));
}
if (dafnyValue.dtor_SSESpecification().is_Some()) {
builder.sseSpecification(ToNative.SSESpecification(dafnyValue.dtor_SSESpecification().dtor_value()));
}
if (dafnyValue.dtor_StreamSpecification().is_Some()) {
builder.streamSpecification(ToNative.StreamSpecification(dafnyValue.dtor_StreamSpecification().dtor_value()));
}
if (dafnyValue.dtor_TableClass().is_Some()) {
builder.tableClass(ToNative.TableClass(dafnyValue.dtor_TableClass().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static UpdateTableResponse UpdateTableOutput(UpdateTableOutput dafnyValue) {
UpdateTableResponse.Builder builder = UpdateTableResponse.builder();
if (dafnyValue.dtor_TableDescription().is_Some()) {
builder.tableDescription(ToNative.TableDescription(dafnyValue.dtor_TableDescription().dtor_value()));
}
return builder.build();
}
public static UpdateTableReplicaAutoScalingRequest UpdateTableReplicaAutoScalingInput(
UpdateTableReplicaAutoScalingInput dafnyValue) {
UpdateTableReplicaAutoScalingRequest.Builder builder = UpdateTableReplicaAutoScalingRequest.builder();
if (dafnyValue.dtor_GlobalSecondaryIndexUpdates().is_Some()) {
builder.globalSecondaryIndexUpdates(ToNative.GlobalSecondaryIndexAutoScalingUpdateList(dafnyValue.dtor_GlobalSecondaryIndexUpdates().dtor_value()));
}
if (dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingUpdate().is_Some()) {
builder.provisionedWriteCapacityAutoScalingUpdate(ToNative.AutoScalingSettingsUpdate(dafnyValue.dtor_ProvisionedWriteCapacityAutoScalingUpdate().dtor_value()));
}
if (dafnyValue.dtor_ReplicaUpdates().is_Some()) {
builder.replicaUpdates(ToNative.ReplicaAutoScalingUpdateList(dafnyValue.dtor_ReplicaUpdates().dtor_value()));
}
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
return builder.build();
}
public static UpdateTableReplicaAutoScalingResponse UpdateTableReplicaAutoScalingOutput(
UpdateTableReplicaAutoScalingOutput dafnyValue) {
UpdateTableReplicaAutoScalingResponse.Builder builder = UpdateTableReplicaAutoScalingResponse.builder();
if (dafnyValue.dtor_TableAutoScalingDescription().is_Some()) {
builder.tableAutoScalingDescription(ToNative.TableAutoScalingDescription(dafnyValue.dtor_TableAutoScalingDescription().dtor_value()));
}
return builder.build();
}
public static UpdateTimeToLiveRequest UpdateTimeToLiveInput(UpdateTimeToLiveInput dafnyValue) {
UpdateTimeToLiveRequest.Builder builder = UpdateTimeToLiveRequest.builder();
builder.tableName(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_TableName()));
builder.timeToLiveSpecification(ToNative.TimeToLiveSpecification(dafnyValue.dtor_TimeToLiveSpecification()));
return builder.build();
}
public static UpdateTimeToLiveResponse UpdateTimeToLiveOutput(UpdateTimeToLiveOutput dafnyValue) {
UpdateTimeToLiveResponse.Builder builder = UpdateTimeToLiveResponse.builder();
if (dafnyValue.dtor_TimeToLiveSpecification().is_Some()) {
builder.timeToLiveSpecification(ToNative.TimeToLiveSpecification(dafnyValue.dtor_TimeToLiveSpecification().dtor_value()));
}
return builder.build();
}
public static WriteRequest WriteRequest(
software.amazon.cryptography.services.dynamodb.internaldafny.types.WriteRequest dafnyValue) {
WriteRequest.Builder builder = WriteRequest.builder();
if (dafnyValue.dtor_DeleteRequest().is_Some()) {
builder.deleteRequest(ToNative.DeleteRequest(dafnyValue.dtor_DeleteRequest().dtor_value()));
}
if (dafnyValue.dtor_PutRequest().is_Some()) {
builder.putRequest(ToNative.PutRequest(dafnyValue.dtor_PutRequest().dtor_value()));
}
return builder.build();
}
public static List<WriteRequest> WriteRequests(
DafnySequence<? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.WriteRequest> dafnyValue) {
return software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToNative::WriteRequest);
}
public static BackupInUseException Error(Error_BackupInUseException dafnyValue) {
BackupInUseException.Builder builder = BackupInUseException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static BackupNotFoundException Error(Error_BackupNotFoundException dafnyValue) {
BackupNotFoundException.Builder builder = BackupNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ConditionalCheckFailedException Error(
Error_ConditionalCheckFailedException dafnyValue) {
ConditionalCheckFailedException.Builder builder = ConditionalCheckFailedException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ContinuousBackupsUnavailableException Error(
Error_ContinuousBackupsUnavailableException dafnyValue) {
ContinuousBackupsUnavailableException.Builder builder = ContinuousBackupsUnavailableException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static DuplicateItemException Error(Error_DuplicateItemException dafnyValue) {
DuplicateItemException.Builder builder = DuplicateItemException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ExportConflictException Error(Error_ExportConflictException dafnyValue) {
ExportConflictException.Builder builder = ExportConflictException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ExportNotFoundException Error(Error_ExportNotFoundException dafnyValue) {
ExportNotFoundException.Builder builder = ExportNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static GlobalTableAlreadyExistsException Error(
Error_GlobalTableAlreadyExistsException dafnyValue) {
GlobalTableAlreadyExistsException.Builder builder = GlobalTableAlreadyExistsException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static GlobalTableNotFoundException Error(Error_GlobalTableNotFoundException dafnyValue) {
GlobalTableNotFoundException.Builder builder = GlobalTableNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static IdempotentParameterMismatchException Error(
Error_IdempotentParameterMismatchException dafnyValue) {
IdempotentParameterMismatchException.Builder builder = IdempotentParameterMismatchException.builder();
if (dafnyValue.dtor_Message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Message().dtor_value()));
}
return builder.build();
}
public static ImportConflictException Error(Error_ImportConflictException dafnyValue) {
ImportConflictException.Builder builder = ImportConflictException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ImportNotFoundException Error(Error_ImportNotFoundException dafnyValue) {
ImportNotFoundException.Builder builder = ImportNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static IndexNotFoundException Error(Error_IndexNotFoundException dafnyValue) {
IndexNotFoundException.Builder builder = IndexNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InternalServerErrorException Error(Error_InternalServerError dafnyValue) {
InternalServerErrorException.Builder builder = InternalServerErrorException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidExportTimeException Error(Error_InvalidExportTimeException dafnyValue) {
InvalidExportTimeException.Builder builder = InvalidExportTimeException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static InvalidRestoreTimeException Error(Error_InvalidRestoreTimeException dafnyValue) {
InvalidRestoreTimeException.Builder builder = InvalidRestoreTimeException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ItemCollectionSizeLimitExceededException Error(
Error_ItemCollectionSizeLimitExceededException dafnyValue) {
ItemCollectionSizeLimitExceededException.Builder builder = ItemCollectionSizeLimitExceededException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static LimitExceededException Error(Error_LimitExceededException dafnyValue) {
LimitExceededException.Builder builder = LimitExceededException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static PointInTimeRecoveryUnavailableException Error(
Error_PointInTimeRecoveryUnavailableException dafnyValue) {
PointInTimeRecoveryUnavailableException.Builder builder = PointInTimeRecoveryUnavailableException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ProvisionedThroughputExceededException Error(
Error_ProvisionedThroughputExceededException dafnyValue) {
ProvisionedThroughputExceededException.Builder builder = ProvisionedThroughputExceededException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ReplicaAlreadyExistsException Error(
Error_ReplicaAlreadyExistsException dafnyValue) {
ReplicaAlreadyExistsException.Builder builder = ReplicaAlreadyExistsException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ReplicaNotFoundException Error(Error_ReplicaNotFoundException dafnyValue) {
ReplicaNotFoundException.Builder builder = ReplicaNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static RequestLimitExceededException Error(Error_RequestLimitExceeded dafnyValue) {
RequestLimitExceededException.Builder builder = RequestLimitExceededException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ResourceInUseException Error(Error_ResourceInUseException dafnyValue) {
ResourceInUseException.Builder builder = ResourceInUseException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static ResourceNotFoundException Error(Error_ResourceNotFoundException dafnyValue) {
ResourceNotFoundException.Builder builder = ResourceNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TableAlreadyExistsException Error(Error_TableAlreadyExistsException dafnyValue) {
TableAlreadyExistsException.Builder builder = TableAlreadyExistsException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TableInUseException Error(Error_TableInUseException dafnyValue) {
TableInUseException.Builder builder = TableInUseException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TableNotFoundException Error(Error_TableNotFoundException dafnyValue) {
TableNotFoundException.Builder builder = TableNotFoundException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TransactionCanceledException Error(Error_TransactionCanceledException dafnyValue) {
TransactionCanceledException.Builder builder = TransactionCanceledException.builder();
if (dafnyValue.dtor_CancellationReasons().is_Some()) {
builder.cancellationReasons(ToNative.CancellationReasonList(dafnyValue.dtor_CancellationReasons().dtor_value()));
}
if (dafnyValue.dtor_Message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Message().dtor_value()));
}
return builder.build();
}
public static TransactionConflictException Error(Error_TransactionConflictException dafnyValue) {
TransactionConflictException.Builder builder = TransactionConflictException.builder();
if (dafnyValue.dtor_message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message().dtor_value()));
}
return builder.build();
}
public static TransactionInProgressException Error(
Error_TransactionInProgressException dafnyValue) {
TransactionInProgressException.Builder builder = TransactionInProgressException.builder();
if (dafnyValue.dtor_Message().is_Some()) {
builder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_Message().dtor_value()));
}
return builder.build();
}
// BEGIN MANUAL EDIT
public static RuntimeException Error(software.amazon.cryptography.services.dynamodb.internaldafny.types.Error dafnyValue) {
if (dafnyValue.is_BackupInUseException()) {
return ToNative.Error((Error_BackupInUseException) dafnyValue);
}
if (dafnyValue.is_BackupNotFoundException()) {
return ToNative.Error((Error_BackupNotFoundException) dafnyValue);
}
if (dafnyValue.is_ConditionalCheckFailedException()) {
return ToNative.Error((Error_ConditionalCheckFailedException) dafnyValue);
}
if (dafnyValue.is_ContinuousBackupsUnavailableException()) {
return ToNative.Error((Error_ContinuousBackupsUnavailableException) dafnyValue);
}
if (dafnyValue.is_DuplicateItemException()) {
return ToNative.Error((Error_DuplicateItemException) dafnyValue);
}
if (dafnyValue.is_ExportConflictException()) {
return ToNative.Error((Error_ExportConflictException) dafnyValue);
}
if (dafnyValue.is_ExportNotFoundException()) {
return ToNative.Error((Error_ExportNotFoundException) dafnyValue);
}
if (dafnyValue.is_GlobalTableAlreadyExistsException()) {
return ToNative.Error((Error_GlobalTableAlreadyExistsException) dafnyValue);
}
if (dafnyValue.is_GlobalTableNotFoundException()) {
return ToNative.Error((Error_GlobalTableNotFoundException) dafnyValue);
}
if (dafnyValue.is_IdempotentParameterMismatchException()) {
return ToNative.Error((Error_IdempotentParameterMismatchException) dafnyValue);
}
if (dafnyValue.is_ImportConflictException()) {
return ToNative.Error((Error_ImportConflictException) dafnyValue);
}
if (dafnyValue.is_ImportNotFoundException()) {
return ToNative.Error((Error_ImportNotFoundException) dafnyValue);
}
if (dafnyValue.is_IndexNotFoundException()) {
return ToNative.Error((Error_IndexNotFoundException) dafnyValue);
}
if (dafnyValue.is_InternalServerError()) {
return ToNative.Error((Error_InternalServerError) dafnyValue);
}
if (dafnyValue.is_InvalidExportTimeException()) {
return ToNative.Error((Error_InvalidExportTimeException) dafnyValue);
}
if (dafnyValue.is_InvalidRestoreTimeException()) {
return ToNative.Error((Error_InvalidRestoreTimeException) dafnyValue);
}
if (dafnyValue.is_ItemCollectionSizeLimitExceededException()) {
return ToNative.Error((Error_ItemCollectionSizeLimitExceededException) dafnyValue);
}
if (dafnyValue.is_LimitExceededException()) {
return ToNative.Error((Error_LimitExceededException) dafnyValue);
}
if (dafnyValue.is_PointInTimeRecoveryUnavailableException()) {
return ToNative.Error((Error_PointInTimeRecoveryUnavailableException) dafnyValue);
}
if (dafnyValue.is_ProvisionedThroughputExceededException()) {
return ToNative.Error((Error_ProvisionedThroughputExceededException) dafnyValue);
}
if (dafnyValue.is_ReplicaAlreadyExistsException()) {
return ToNative.Error((Error_ReplicaAlreadyExistsException) dafnyValue);
}
if (dafnyValue.is_ReplicaNotFoundException()) {
return ToNative.Error((Error_ReplicaNotFoundException) dafnyValue);
}
if (dafnyValue.is_RequestLimitExceeded()) {
return ToNative.Error((Error_RequestLimitExceeded) dafnyValue);
}
if (dafnyValue.is_ResourceInUseException()) {
return ToNative.Error((Error_ResourceInUseException) dafnyValue);
}
if (dafnyValue.is_ResourceNotFoundException()) {
return ToNative.Error((Error_ResourceNotFoundException) dafnyValue);
}
if (dafnyValue.is_TableAlreadyExistsException()) {
return ToNative.Error((Error_TableAlreadyExistsException) dafnyValue);
}
if (dafnyValue.is_TableInUseException()) {
return ToNative.Error((Error_TableInUseException) dafnyValue);
}
if (dafnyValue.is_TableNotFoundException()) {
return ToNative.Error((Error_TableNotFoundException) dafnyValue);
}
if (dafnyValue.is_TransactionCanceledException()) {
return ToNative.Error((Error_TransactionCanceledException) dafnyValue);
}
if (dafnyValue.is_TransactionConflictException()) {
return ToNative.Error((Error_TransactionConflictException) dafnyValue);
}
if (dafnyValue.is_TransactionInProgressException()) {
return ToNative.Error((Error_TransactionInProgressException) dafnyValue);
}
if (dafnyValue.is_Opaque()) {
return ToNative.Error((Error_Opaque) dafnyValue);
}
// TODO This should indicate a codegen bug
return new IllegalStateException("Unknown error recieved from DynamoDb.");
}
// END MANUAL EDIT
public static DynamoDbClient DynamoDB_20120810(IDynamoDBClient dafnyValue) {
return ((Shim) dafnyValue).impl();
}
}
| 412 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb/internaldafny/Shim.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.dynamodb.internaldafny;
import Wrappers_Compile.Result;
import dafny.Tuple0;
import java.lang.Override;
import java.lang.String;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.BackupInUseException;
import software.amazon.awssdk.services.dynamodb.model.BackupNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.ConditionalCheckFailedException;
import software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveResponse;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DuplicateItemException;
import software.amazon.awssdk.services.dynamodb.model.DynamoDbException;
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionResponse;
import software.amazon.awssdk.services.dynamodb.model.ExportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ExportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.GetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.IdempotentParameterMismatchException;
import software.amazon.awssdk.services.dynamodb.model.ImportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ImportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ImportTableRequest;
import software.amazon.awssdk.services.dynamodb.model.ImportTableResponse;
import software.amazon.awssdk.services.dynamodb.model.IndexNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.InternalServerErrorException;
import software.amazon.awssdk.services.dynamodb.model.InvalidExportTimeException;
import software.amazon.awssdk.services.dynamodb.model.InvalidRestoreTimeException;
import software.amazon.awssdk.services.dynamodb.model.ItemCollectionSizeLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.LimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListExportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListExportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListImportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListImportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceResponse;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputExceededException;
import software.amazon.awssdk.services.dynamodb.model.PutItemRequest;
import software.amazon.awssdk.services.dynamodb.model.PutItemResponse;
import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.ReplicaNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.RequestLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ResourceInUseException;
import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.ScanRequest;
import software.amazon.awssdk.services.dynamodb.model.ScanResponse;
import software.amazon.awssdk.services.dynamodb.model.TableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.TableInUseException;
import software.amazon.awssdk.services.dynamodb.model.TableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.TagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactionCanceledException;
import software.amazon.awssdk.services.dynamodb.model.TransactionConflictException;
import software.amazon.awssdk.services.dynamodb.model.TransactionInProgressException;
import software.amazon.awssdk.services.dynamodb.model.UntagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UntagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveOutput;
public class Shim implements IDynamoDBClient {
private final DynamoDbClient _impl;
private final String region;
public Shim(final DynamoDbClient impl, final String region) {
this._impl = impl;
this.region = region;
}
public DynamoDbClient impl() {
return this._impl;
}
public String region() {
return this.region;
}
@Override
public Result<BatchExecuteStatementOutput, Error> BatchExecuteStatement(
BatchExecuteStatementInput input) {
BatchExecuteStatementRequest converted = ToNative.BatchExecuteStatementInput(input);
try {
BatchExecuteStatementResponse result = _impl.batchExecuteStatement(converted);
BatchExecuteStatementOutput dafnyResponse = ToDafny.BatchExecuteStatementOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<BatchGetItemOutput, Error> BatchGetItem(BatchGetItemInput input) {
BatchGetItemRequest converted = ToNative.BatchGetItemInput(input);
try {
BatchGetItemResponse result = _impl.batchGetItem(converted);
BatchGetItemOutput dafnyResponse = ToDafny.BatchGetItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<BatchWriteItemOutput, Error> BatchWriteItem(BatchWriteItemInput input) {
BatchWriteItemRequest converted = ToNative.BatchWriteItemInput(input);
try {
BatchWriteItemResponse result = _impl.batchWriteItem(converted);
BatchWriteItemOutput dafnyResponse = ToDafny.BatchWriteItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ItemCollectionSizeLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateBackupOutput, Error> CreateBackup(CreateBackupInput input) {
CreateBackupRequest converted = ToNative.CreateBackupInput(input);
try {
CreateBackupResponse result = _impl.createBackup(converted);
CreateBackupOutput dafnyResponse = ToDafny.CreateBackupOutput(result);
return Result.create_Success(dafnyResponse);
} catch (BackupInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ContinuousBackupsUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateGlobalTableOutput, Error> CreateGlobalTable(CreateGlobalTableInput input) {
CreateGlobalTableRequest converted = ToNative.CreateGlobalTableInput(input);
try {
CreateGlobalTableResponse result = _impl.createGlobalTable(converted);
CreateGlobalTableOutput dafnyResponse = ToDafny.CreateGlobalTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (GlobalTableAlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<CreateTableOutput, Error> CreateTable(CreateTableInput input) {
CreateTableRequest converted = ToNative.CreateTableInput(input);
try {
CreateTableResponse result = _impl.createTable(converted);
CreateTableOutput dafnyResponse = ToDafny.CreateTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DeleteBackupOutput, Error> DeleteBackup(DeleteBackupInput input) {
DeleteBackupRequest converted = ToNative.DeleteBackupInput(input);
try {
DeleteBackupResponse result = _impl.deleteBackup(converted);
DeleteBackupOutput dafnyResponse = ToDafny.DeleteBackupOutput(result);
return Result.create_Success(dafnyResponse);
} catch (BackupInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (BackupNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DeleteItemOutput, Error> DeleteItem(DeleteItemInput input) {
DeleteItemRequest converted = ToNative.DeleteItemInput(input);
try {
DeleteItemResponse result = _impl.deleteItem(converted);
DeleteItemOutput dafnyResponse = ToDafny.DeleteItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ConditionalCheckFailedException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ItemCollectionSizeLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DeleteTableOutput, Error> DeleteTable(DeleteTableInput input) {
DeleteTableRequest converted = ToNative.DeleteTableInput(input);
try {
DeleteTableResponse result = _impl.deleteTable(converted);
DeleteTableOutput dafnyResponse = ToDafny.DeleteTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeBackupOutput, Error> DescribeBackup(DescribeBackupInput input) {
DescribeBackupRequest converted = ToNative.DescribeBackupInput(input);
try {
DescribeBackupResponse result = _impl.describeBackup(converted);
DescribeBackupOutput dafnyResponse = ToDafny.DescribeBackupOutput(result);
return Result.create_Success(dafnyResponse);
} catch (BackupNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeContinuousBackupsOutput, Error> DescribeContinuousBackups(
DescribeContinuousBackupsInput input) {
DescribeContinuousBackupsRequest converted = ToNative.DescribeContinuousBackupsInput(input);
try {
DescribeContinuousBackupsResponse result = _impl.describeContinuousBackups(converted);
DescribeContinuousBackupsOutput dafnyResponse = ToDafny.DescribeContinuousBackupsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeContributorInsightsOutput, Error> DescribeContributorInsights(
DescribeContributorInsightsInput input) {
DescribeContributorInsightsRequest converted = ToNative.DescribeContributorInsightsInput(input);
try {
DescribeContributorInsightsResponse result = _impl.describeContributorInsights(converted);
DescribeContributorInsightsOutput dafnyResponse = ToDafny.DescribeContributorInsightsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeEndpointsResponse, Error> DescribeEndpoints(
DescribeEndpointsRequest input) {
software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsRequest converted = ToNative.DescribeEndpointsRequest(input);
try {
software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsResponse result = _impl.describeEndpoints(converted);
DescribeEndpointsResponse dafnyResponse = ToDafny.DescribeEndpointsResponse(result);
return Result.create_Success(dafnyResponse);
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeExportOutput, Error> DescribeExport(DescribeExportInput input) {
DescribeExportRequest converted = ToNative.DescribeExportInput(input);
try {
DescribeExportResponse result = _impl.describeExport(converted);
DescribeExportOutput dafnyResponse = ToDafny.DescribeExportOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ExportNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeGlobalTableOutput, Error> DescribeGlobalTable(
DescribeGlobalTableInput input) {
DescribeGlobalTableRequest converted = ToNative.DescribeGlobalTableInput(input);
try {
DescribeGlobalTableResponse result = _impl.describeGlobalTable(converted);
DescribeGlobalTableOutput dafnyResponse = ToDafny.DescribeGlobalTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (GlobalTableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeGlobalTableSettingsOutput, Error> DescribeGlobalTableSettings(
DescribeGlobalTableSettingsInput input) {
DescribeGlobalTableSettingsRequest converted = ToNative.DescribeGlobalTableSettingsInput(input);
try {
DescribeGlobalTableSettingsResponse result = _impl.describeGlobalTableSettings(converted);
DescribeGlobalTableSettingsOutput dafnyResponse = ToDafny.DescribeGlobalTableSettingsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (GlobalTableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeImportOutput, Error> DescribeImport(DescribeImportInput input) {
DescribeImportRequest converted = ToNative.DescribeImportInput(input);
try {
DescribeImportResponse result = _impl.describeImport(converted);
DescribeImportOutput dafnyResponse = ToDafny.DescribeImportOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ImportNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeKinesisStreamingDestinationOutput, Error> DescribeKinesisStreamingDestination(
DescribeKinesisStreamingDestinationInput input) {
DescribeKinesisStreamingDestinationRequest converted = ToNative.DescribeKinesisStreamingDestinationInput(input);
try {
DescribeKinesisStreamingDestinationResponse result = _impl.describeKinesisStreamingDestination(converted);
DescribeKinesisStreamingDestinationOutput dafnyResponse = ToDafny.DescribeKinesisStreamingDestinationOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeLimitsOutput, Error> DescribeLimits(DescribeLimitsInput input) {
DescribeLimitsRequest converted = ToNative.DescribeLimitsInput(input);
try {
DescribeLimitsResponse result = _impl.describeLimits(converted);
DescribeLimitsOutput dafnyResponse = ToDafny.DescribeLimitsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeTableOutput, Error> DescribeTable(DescribeTableInput input) {
DescribeTableRequest converted = ToNative.DescribeTableInput(input);
try {
DescribeTableResponse result = _impl.describeTable(converted);
DescribeTableOutput dafnyResponse = ToDafny.DescribeTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeTableReplicaAutoScalingOutput, Error> DescribeTableReplicaAutoScaling(
DescribeTableReplicaAutoScalingInput input) {
DescribeTableReplicaAutoScalingRequest converted = ToNative.DescribeTableReplicaAutoScalingInput(input);
try {
DescribeTableReplicaAutoScalingResponse result = _impl.describeTableReplicaAutoScaling(converted);
DescribeTableReplicaAutoScalingOutput dafnyResponse = ToDafny.DescribeTableReplicaAutoScalingOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DescribeTimeToLiveOutput, Error> DescribeTimeToLive(DescribeTimeToLiveInput input) {
DescribeTimeToLiveRequest converted = ToNative.DescribeTimeToLiveInput(input);
try {
DescribeTimeToLiveResponse result = _impl.describeTimeToLive(converted);
DescribeTimeToLiveOutput dafnyResponse = ToDafny.DescribeTimeToLiveOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<DisableKinesisStreamingDestinationOutput, Error> DisableKinesisStreamingDestination(
DisableKinesisStreamingDestinationInput input) {
DisableKinesisStreamingDestinationRequest converted = ToNative.DisableKinesisStreamingDestinationInput(input);
try {
DisableKinesisStreamingDestinationResponse result = _impl.disableKinesisStreamingDestination(converted);
DisableKinesisStreamingDestinationOutput dafnyResponse = ToDafny.DisableKinesisStreamingDestinationOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<EnableKinesisStreamingDestinationOutput, Error> EnableKinesisStreamingDestination(
EnableKinesisStreamingDestinationInput input) {
EnableKinesisStreamingDestinationRequest converted = ToNative.EnableKinesisStreamingDestinationInput(input);
try {
EnableKinesisStreamingDestinationResponse result = _impl.enableKinesisStreamingDestination(converted);
EnableKinesisStreamingDestinationOutput dafnyResponse = ToDafny.EnableKinesisStreamingDestinationOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ExecuteStatementOutput, Error> ExecuteStatement(ExecuteStatementInput input) {
ExecuteStatementRequest converted = ToNative.ExecuteStatementInput(input);
try {
ExecuteStatementResponse result = _impl.executeStatement(converted);
ExecuteStatementOutput dafnyResponse = ToDafny.ExecuteStatementOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ConditionalCheckFailedException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DuplicateItemException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ItemCollectionSizeLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ExecuteTransactionOutput, Error> ExecuteTransaction(ExecuteTransactionInput input) {
ExecuteTransactionRequest converted = ToNative.ExecuteTransactionInput(input);
try {
ExecuteTransactionResponse result = _impl.executeTransaction(converted);
ExecuteTransactionOutput dafnyResponse = ToDafny.ExecuteTransactionOutput(result);
return Result.create_Success(dafnyResponse);
} catch (IdempotentParameterMismatchException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionCanceledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionInProgressException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ExportTableToPointInTimeOutput, Error> ExportTableToPointInTime(
ExportTableToPointInTimeInput input) {
ExportTableToPointInTimeRequest converted = ToNative.ExportTableToPointInTimeInput(input);
try {
ExportTableToPointInTimeResponse result = _impl.exportTableToPointInTime(converted);
ExportTableToPointInTimeOutput dafnyResponse = ToDafny.ExportTableToPointInTimeOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ExportConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidExportTimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (PointInTimeRecoveryUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<GetItemOutput, Error> GetItem(GetItemInput input) {
GetItemRequest converted = ToNative.GetItemInput(input);
try {
GetItemResponse result = _impl.getItem(converted);
GetItemOutput dafnyResponse = ToDafny.GetItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ImportTableOutput, Error> ImportTable(ImportTableInput input) {
ImportTableRequest converted = ToNative.ImportTableInput(input);
try {
ImportTableResponse result = _impl.importTable(converted);
ImportTableOutput dafnyResponse = ToDafny.ImportTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ImportConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListBackupsOutput, Error> ListBackups(ListBackupsInput input) {
ListBackupsRequest converted = ToNative.ListBackupsInput(input);
try {
ListBackupsResponse result = _impl.listBackups(converted);
ListBackupsOutput dafnyResponse = ToDafny.ListBackupsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListContributorInsightsOutput, Error> ListContributorInsights(
ListContributorInsightsInput input) {
ListContributorInsightsRequest converted = ToNative.ListContributorInsightsInput(input);
try {
ListContributorInsightsResponse result = _impl.listContributorInsights(converted);
ListContributorInsightsOutput dafnyResponse = ToDafny.ListContributorInsightsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListExportsOutput, Error> ListExports(ListExportsInput input) {
ListExportsRequest converted = ToNative.ListExportsInput(input);
try {
ListExportsResponse result = _impl.listExports(converted);
ListExportsOutput dafnyResponse = ToDafny.ListExportsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListGlobalTablesOutput, Error> ListGlobalTables(ListGlobalTablesInput input) {
ListGlobalTablesRequest converted = ToNative.ListGlobalTablesInput(input);
try {
ListGlobalTablesResponse result = _impl.listGlobalTables(converted);
ListGlobalTablesOutput dafnyResponse = ToDafny.ListGlobalTablesOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListImportsOutput, Error> ListImports(ListImportsInput input) {
ListImportsRequest converted = ToNative.ListImportsInput(input);
try {
ListImportsResponse result = _impl.listImports(converted);
ListImportsOutput dafnyResponse = ToDafny.ListImportsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListTablesOutput, Error> ListTables(ListTablesInput input) {
ListTablesRequest converted = ToNative.ListTablesInput(input);
try {
ListTablesResponse result = _impl.listTables(converted);
ListTablesOutput dafnyResponse = ToDafny.ListTablesOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ListTagsOfResourceOutput, Error> ListTagsOfResource(ListTagsOfResourceInput input) {
ListTagsOfResourceRequest converted = ToNative.ListTagsOfResourceInput(input);
try {
ListTagsOfResourceResponse result = _impl.listTagsOfResource(converted);
ListTagsOfResourceOutput dafnyResponse = ToDafny.ListTagsOfResourceOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<PutItemOutput, Error> PutItem(PutItemInput input) {
PutItemRequest converted = ToNative.PutItemInput(input);
try {
PutItemResponse result = _impl.putItem(converted);
PutItemOutput dafnyResponse = ToDafny.PutItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ConditionalCheckFailedException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ItemCollectionSizeLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<QueryOutput, Error> Query(QueryInput input) {
QueryRequest converted = ToNative.QueryInput(input);
try {
QueryResponse result = _impl.query(converted);
QueryOutput dafnyResponse = ToDafny.QueryOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<RestoreTableFromBackupOutput, Error> RestoreTableFromBackup(
RestoreTableFromBackupInput input) {
RestoreTableFromBackupRequest converted = ToNative.RestoreTableFromBackupInput(input);
try {
RestoreTableFromBackupResponse result = _impl.restoreTableFromBackup(converted);
RestoreTableFromBackupOutput dafnyResponse = ToDafny.RestoreTableFromBackupOutput(result);
return Result.create_Success(dafnyResponse);
} catch (BackupInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (BackupNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableAlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<RestoreTableToPointInTimeOutput, Error> RestoreTableToPointInTime(
RestoreTableToPointInTimeInput input) {
RestoreTableToPointInTimeRequest converted = ToNative.RestoreTableToPointInTimeInput(input);
try {
RestoreTableToPointInTimeResponse result = _impl.restoreTableToPointInTime(converted);
RestoreTableToPointInTimeOutput dafnyResponse = ToDafny.RestoreTableToPointInTimeOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InvalidRestoreTimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (PointInTimeRecoveryUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableAlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<ScanOutput, Error> Scan(ScanInput input) {
ScanRequest converted = ToNative.ScanInput(input);
try {
ScanResponse result = _impl.scan(converted);
ScanOutput dafnyResponse = ToDafny.ScanOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> TagResource(TagResourceInput input) {
TagResourceRequest converted = ToNative.TagResourceInput(input);
try {
_impl.tagResource(converted);
return Result.create_Success(Tuple0.create());
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<TransactGetItemsOutput, Error> TransactGetItems(TransactGetItemsInput input) {
TransactGetItemsRequest converted = ToNative.TransactGetItemsInput(input);
try {
TransactGetItemsResponse result = _impl.transactGetItems(converted);
TransactGetItemsOutput dafnyResponse = ToDafny.TransactGetItemsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionCanceledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<TransactWriteItemsOutput, Error> TransactWriteItems(TransactWriteItemsInput input) {
TransactWriteItemsRequest converted = ToNative.TransactWriteItemsInput(input);
try {
TransactWriteItemsResponse result = _impl.transactWriteItems(converted);
TransactWriteItemsOutput dafnyResponse = ToDafny.TransactWriteItemsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (IdempotentParameterMismatchException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionCanceledException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionInProgressException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<Tuple0, Error> UntagResource(UntagResourceInput input) {
UntagResourceRequest converted = ToNative.UntagResourceInput(input);
try {
_impl.untagResource(converted);
return Result.create_Success(Tuple0.create());
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateContinuousBackupsOutput, Error> UpdateContinuousBackups(
UpdateContinuousBackupsInput input) {
UpdateContinuousBackupsRequest converted = ToNative.UpdateContinuousBackupsInput(input);
try {
UpdateContinuousBackupsResponse result = _impl.updateContinuousBackups(converted);
UpdateContinuousBackupsOutput dafnyResponse = ToDafny.UpdateContinuousBackupsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ContinuousBackupsUnavailableException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateContributorInsightsOutput, Error> UpdateContributorInsights(
UpdateContributorInsightsInput input) {
UpdateContributorInsightsRequest converted = ToNative.UpdateContributorInsightsInput(input);
try {
UpdateContributorInsightsResponse result = _impl.updateContributorInsights(converted);
UpdateContributorInsightsOutput dafnyResponse = ToDafny.UpdateContributorInsightsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateGlobalTableOutput, Error> UpdateGlobalTable(UpdateGlobalTableInput input) {
UpdateGlobalTableRequest converted = ToNative.UpdateGlobalTableInput(input);
try {
UpdateGlobalTableResponse result = _impl.updateGlobalTable(converted);
UpdateGlobalTableOutput dafnyResponse = ToDafny.UpdateGlobalTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (GlobalTableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ReplicaAlreadyExistsException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ReplicaNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateGlobalTableSettingsOutput, Error> UpdateGlobalTableSettings(
UpdateGlobalTableSettingsInput input) {
UpdateGlobalTableSettingsRequest converted = ToNative.UpdateGlobalTableSettingsInput(input);
try {
UpdateGlobalTableSettingsResponse result = _impl.updateGlobalTableSettings(converted);
UpdateGlobalTableSettingsOutput dafnyResponse = ToDafny.UpdateGlobalTableSettingsOutput(result);
return Result.create_Success(dafnyResponse);
} catch (GlobalTableNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (IndexNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ReplicaNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateItemOutput, Error> UpdateItem(UpdateItemInput input) {
UpdateItemRequest converted = ToNative.UpdateItemInput(input);
try {
UpdateItemResponse result = _impl.updateItem(converted);
UpdateItemOutput dafnyResponse = ToDafny.UpdateItemOutput(result);
return Result.create_Success(dafnyResponse);
} catch (ConditionalCheckFailedException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ItemCollectionSizeLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ProvisionedThroughputExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (RequestLimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (TransactionConflictException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateTableOutput, Error> UpdateTable(UpdateTableInput input) {
UpdateTableRequest converted = ToNative.UpdateTableInput(input);
try {
UpdateTableResponse result = _impl.updateTable(converted);
UpdateTableOutput dafnyResponse = ToDafny.UpdateTableOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateTableReplicaAutoScalingOutput, Error> UpdateTableReplicaAutoScaling(
UpdateTableReplicaAutoScalingInput input) {
UpdateTableReplicaAutoScalingRequest converted = ToNative.UpdateTableReplicaAutoScalingInput(input);
try {
UpdateTableReplicaAutoScalingResponse result = _impl.updateTableReplicaAutoScaling(converted);
UpdateTableReplicaAutoScalingOutput dafnyResponse = ToDafny.UpdateTableReplicaAutoScalingOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
@Override
public Result<UpdateTimeToLiveOutput, Error> UpdateTimeToLive(UpdateTimeToLiveInput input) {
UpdateTimeToLiveRequest converted = ToNative.UpdateTimeToLiveInput(input);
try {
UpdateTimeToLiveResponse result = _impl.updateTimeToLive(converted);
UpdateTimeToLiveOutput dafnyResponse = ToDafny.UpdateTimeToLiveOutput(result);
return Result.create_Success(dafnyResponse);
} catch (InternalServerErrorException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (LimitExceededException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceInUseException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (ResourceNotFoundException ex) {
return Result.create_Failure(ToDafny.Error(ex));
} catch (DynamoDbException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
}
| 413 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb
|
Create_ds/aws-cryptographic-material-providers-library-java/ComAmazonawsDynamodb/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/services/dynamodb/internaldafny/ToDafny.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.services.dynamodb.internaldafny;
import Wrappers_Compile.Option;
import dafny.DafnyMap;
import dafny.DafnySequence;
import dafny.TypeDescriptor;
import java.lang.Boolean;
import java.lang.Byte;
import java.lang.Character;
import java.lang.Double;
import java.lang.IllegalArgumentException;
import java.lang.Integer;
import java.lang.Long;
import java.lang.RuntimeException;
import java.lang.String;
import java.lang.SuppressWarnings;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
import software.amazon.awssdk.services.dynamodb.model.BackupInUseException;
import software.amazon.awssdk.services.dynamodb.model.BackupNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchGetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.BatchWriteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.ConditionalCheckFailedException;
import software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.CreateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.CreateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteItemResponse;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DeleteTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeExportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeImportResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeLimitsResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTableResponse;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.DescribeTimeToLiveResponse;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.DisableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.DuplicateItemException;
import software.amazon.awssdk.services.dynamodb.model.DynamoDbException;
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationRequest;
import software.amazon.awssdk.services.dynamodb.model.EnableKinesisStreamingDestinationResponse;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteStatementResponse;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionRequest;
import software.amazon.awssdk.services.dynamodb.model.ExecuteTransactionResponse;
import software.amazon.awssdk.services.dynamodb.model.ExportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ExportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.ExportTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.GetItemRequest;
import software.amazon.awssdk.services.dynamodb.model.GetItemResponse;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.GlobalTableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.IdempotentParameterMismatchException;
import software.amazon.awssdk.services.dynamodb.model.ImportConflictException;
import software.amazon.awssdk.services.dynamodb.model.ImportNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.ImportTableRequest;
import software.amazon.awssdk.services.dynamodb.model.ImportTableResponse;
import software.amazon.awssdk.services.dynamodb.model.IndexNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.InternalServerErrorException;
import software.amazon.awssdk.services.dynamodb.model.InvalidExportTimeException;
import software.amazon.awssdk.services.dynamodb.model.InvalidRestoreTimeException;
import software.amazon.awssdk.services.dynamodb.model.ItemCollectionSizeLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.LimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListExportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListExportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListGlobalTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListImportsRequest;
import software.amazon.awssdk.services.dynamodb.model.ListImportsResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTablesRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTablesResponse;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.ListTagsOfResourceResponse;
import software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryUnavailableException;
import software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputExceededException;
import software.amazon.awssdk.services.dynamodb.model.PutItemRequest;
import software.amazon.awssdk.services.dynamodb.model.PutItemResponse;
import software.amazon.awssdk.services.dynamodb.model.QueryRequest;
import software.amazon.awssdk.services.dynamodb.model.QueryResponse;
import software.amazon.awssdk.services.dynamodb.model.ReplicaAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.ReplicaNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.RequestLimitExceededException;
import software.amazon.awssdk.services.dynamodb.model.ResourceInUseException;
import software.amazon.awssdk.services.dynamodb.model.ResourceNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableFromBackupResponse;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeRequest;
import software.amazon.awssdk.services.dynamodb.model.RestoreTableToPointInTimeResponse;
import software.amazon.awssdk.services.dynamodb.model.ScanRequest;
import software.amazon.awssdk.services.dynamodb.model.ScanResponse;
import software.amazon.awssdk.services.dynamodb.model.TableAlreadyExistsException;
import software.amazon.awssdk.services.dynamodb.model.TableInUseException;
import software.amazon.awssdk.services.dynamodb.model.TableNotFoundException;
import software.amazon.awssdk.services.dynamodb.model.TagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactGetItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsRequest;
import software.amazon.awssdk.services.dynamodb.model.TransactWriteItemsResponse;
import software.amazon.awssdk.services.dynamodb.model.TransactionCanceledException;
import software.amazon.awssdk.services.dynamodb.model.TransactionConflictException;
import software.amazon.awssdk.services.dynamodb.model.TransactionInProgressException;
import software.amazon.awssdk.services.dynamodb.model.UntagResourceRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContinuousBackupsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateContributorInsightsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateGlobalTableSettingsResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateItemResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableReplicaAutoScalingResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTableResponse;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveRequest;
import software.amazon.awssdk.services.dynamodb.model.UpdateTimeToLiveResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ArchivalSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeDefinition;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValueUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingPolicyUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingSettingsUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupDetails;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchGetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementError;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchWriteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingModeSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CancellationReason;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Capacity;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Condition;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionCheck;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ConsumedCapacity;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalSecondaryIndexAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicaAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateReplicationGroupMemberAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CreateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.CsvOptions;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Delete;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteGlobalSecondaryIndexAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicaAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteReplicationGroupMemberAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DeleteTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeEndpointsResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeExportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeImportOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeLimitsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DescribeTimeToLiveOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.DisableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.EnableKinesisStreamingDestinationOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Endpoint;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_BackupInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_BackupNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ConditionalCheckFailedException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ContinuousBackupsUnavailableException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_DuplicateItemException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ExportConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ExportNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_GlobalTableAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_GlobalTableNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_IdempotentParameterMismatchException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ImportConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ImportNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_IndexNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InternalServerError;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InvalidExportTimeException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_InvalidRestoreTimeException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ItemCollectionSizeLimitExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_LimitExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_Opaque;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_PointInTimeRecoveryUnavailableException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ProvisionedThroughputExceededException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ReplicaAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ReplicaNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_RequestLimitExceeded;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ResourceInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_ResourceNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableAlreadyExistsException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableInUseException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TableNotFoundException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionCanceledException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionConflictException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Error_TransactionInProgressException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteStatementOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExecuteTransactionOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExpectedAttributeValue;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportFormat;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.FailureException;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Get;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GetItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndex;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexAutoScalingUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexInfo;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalSecondaryIndexUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTable;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableGlobalSecondaryIndexSettingsUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IDynamoDBClient;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormatOptions;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionMetrics;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemCollectionSizeEstimateBound;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ItemResponse;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.KeySchemaElement;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.KeysAndAttributes;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.KinesisDataStreamDestination;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListExportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListGlobalTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListImportsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTablesOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ListTagsOfResourceOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndex;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.LocalSecondaryIndexInfo;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ParameterizedStatement;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoverySpecification;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Projection;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ProvisionedThroughputOverride;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Put;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.PutRequest;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.QueryOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Replica;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaAutoScalingUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndex;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexAutoScalingUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaGlobalSecondaryIndexSettingsUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaSettingsUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicationGroupUpdate;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableFromBackupOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.RestoreTableToPointInTimeOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.S3BucketSource;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.S3SseAlgorithm;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SSESpecification;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.ScanOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Select;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableDetails;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.SourceTableFeatureDetails;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamSpecification;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableAutoScalingDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClass;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClassSummary;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableCreationParameters;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Tag;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveDescription;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveSpecification;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItem;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactGetItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItem;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.TransactWriteItemsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UntagResourceInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.Update;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContinuousBackupsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateContributorInsightsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalSecondaryIndexAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateGlobalTableSettingsOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateItemOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateReplicationGroupMemberAction;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTableReplicaAutoScalingOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveInput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.UpdateTimeToLiveOutput;
import software.amazon.cryptography.services.dynamodb.internaldafny.types.WriteRequest;
public class ToDafny {
public static ArchivalSummary ArchivalSummary(
software.amazon.awssdk.services.dynamodb.model.ArchivalSummary nativeValue) {
Option<DafnySequence<? extends Character>> archivalDateTime;
archivalDateTime = Objects.nonNull(nativeValue.archivalDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.archivalDateTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> archivalReason;
archivalReason = Objects.nonNull(nativeValue.archivalReason()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.archivalReason()))
: Option.create_None();
Option<DafnySequence<? extends Character>> archivalBackupArn;
archivalBackupArn = Objects.nonNull(nativeValue.archivalBackupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.archivalBackupArn()))
: Option.create_None();
return new ArchivalSummary(archivalDateTime, archivalReason, archivalBackupArn);
}
public static AttributeDefinition AttributeDefinition(
software.amazon.awssdk.services.dynamodb.model.AttributeDefinition nativeValue) {
DafnySequence<? extends Character> attributeName;
attributeName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.attributeName());
ScalarAttributeType attributeType;
attributeType = ToDafny.ScalarAttributeType(nativeValue.attributeType());
return new AttributeDefinition(attributeName, attributeType);
}
public static DafnySequence<? extends AttributeDefinition> AttributeDefinitions(
List<software.amazon.awssdk.services.dynamodb.model.AttributeDefinition> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeDefinition,
AttributeDefinition._typeDescriptor());
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> AttributeMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> AttributeNameList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValueUpdate> AttributeUpdates(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValueUpdate);
}
public static AttributeValue AttributeValue(
software.amazon.awssdk.services.dynamodb.model.AttributeValue nativeValue) {
switch (nativeValue.type()) {
case S: {
return AttributeValue.create_S(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s()));
}
case N: {
return AttributeValue.create_N(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.n()));
}
case B: {
return AttributeValue.create_B(software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.b().asByteArray()));
}
case SS: {
return AttributeValue.create_SS(ToDafny.StringSetAttributeValue(nativeValue.ss()));
}
case NS: {
return AttributeValue.create_NS(ToDafny.NumberSetAttributeValue(nativeValue.ns()));
}
case BS: {
return AttributeValue.create_BS(ToDafny.BinarySetAttributeValue(nativeValue.bs().stream()
.map(software.amazon.awssdk.core.BytesWrapper::asByteBuffer)
.collect(java.util.stream.Collectors.toList())));
}
case M: {
return AttributeValue.create_M(ToDafny.MapAttributeValue(nativeValue.m()));
}
case L: {
return AttributeValue.create_L(ToDafny.ListAttributeValue(nativeValue.l()));
}
case NUL: {
return AttributeValue.create_NULL((nativeValue.nul()));
}
case BOOL: {
return AttributeValue.create_BOOL((nativeValue.bool()));
}
default: {
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue.");
}
}
}
public static DafnySequence<? extends AttributeValue> AttributeValueList(
List<software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue,
AttributeValue._typeDescriptor());
}
public static AttributeValueUpdate AttributeValueUpdate(
software.amazon.awssdk.services.dynamodb.model.AttributeValueUpdate nativeValue) {
Option<AttributeValue> value;
value = Objects.nonNull(nativeValue.value()) ?
Option.create_Some(ToDafny.AttributeValue(nativeValue.value()))
: Option.create_None();
Option<AttributeAction> action;
action = Objects.nonNull(nativeValue.action()) ?
Option.create_Some(ToDafny.AttributeAction(nativeValue.action()))
: Option.create_None();
return new AttributeValueUpdate(value, action);
}
public static AutoScalingPolicyDescription AutoScalingPolicyDescription(
software.amazon.awssdk.services.dynamodb.model.AutoScalingPolicyDescription nativeValue) {
Option<DafnySequence<? extends Character>> policyName;
policyName = Objects.nonNull(nativeValue.policyName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policyName()))
: Option.create_None();
Option<AutoScalingTargetTrackingScalingPolicyConfigurationDescription> targetTrackingScalingPolicyConfiguration;
targetTrackingScalingPolicyConfiguration = Objects.nonNull(nativeValue.targetTrackingScalingPolicyConfiguration()) ?
Option.create_Some(ToDafny.AutoScalingTargetTrackingScalingPolicyConfigurationDescription(nativeValue.targetTrackingScalingPolicyConfiguration()))
: Option.create_None();
return new AutoScalingPolicyDescription(policyName, targetTrackingScalingPolicyConfiguration);
}
public static DafnySequence<? extends AutoScalingPolicyDescription> AutoScalingPolicyDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.AutoScalingPolicyDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AutoScalingPolicyDescription,
AutoScalingPolicyDescription._typeDescriptor());
}
public static AutoScalingPolicyUpdate AutoScalingPolicyUpdate(
software.amazon.awssdk.services.dynamodb.model.AutoScalingPolicyUpdate nativeValue) {
Option<DafnySequence<? extends Character>> policyName;
policyName = Objects.nonNull(nativeValue.policyName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.policyName()))
: Option.create_None();
AutoScalingTargetTrackingScalingPolicyConfigurationUpdate targetTrackingScalingPolicyConfiguration;
targetTrackingScalingPolicyConfiguration = ToDafny.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(nativeValue.targetTrackingScalingPolicyConfiguration());
return new AutoScalingPolicyUpdate(policyName, targetTrackingScalingPolicyConfiguration);
}
public static AutoScalingSettingsDescription AutoScalingSettingsDescription(
software.amazon.awssdk.services.dynamodb.model.AutoScalingSettingsDescription nativeValue) {
Option<Long> minimumUnits;
minimumUnits = Objects.nonNull(nativeValue.minimumUnits()) ?
Option.create_Some((nativeValue.minimumUnits()))
: Option.create_None();
Option<Long> maximumUnits;
maximumUnits = Objects.nonNull(nativeValue.maximumUnits()) ?
Option.create_Some((nativeValue.maximumUnits()))
: Option.create_None();
Option<Boolean> autoScalingDisabled;
autoScalingDisabled = Objects.nonNull(nativeValue.autoScalingDisabled()) ?
Option.create_Some((nativeValue.autoScalingDisabled()))
: Option.create_None();
Option<DafnySequence<? extends Character>> autoScalingRoleArn;
autoScalingRoleArn = Objects.nonNull(nativeValue.autoScalingRoleArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.autoScalingRoleArn()))
: Option.create_None();
Option<DafnySequence<? extends AutoScalingPolicyDescription>> scalingPolicies;
scalingPolicies = (Objects.nonNull(nativeValue.scalingPolicies()) && nativeValue.scalingPolicies().size() > 0) ?
Option.create_Some(ToDafny.AutoScalingPolicyDescriptionList(nativeValue.scalingPolicies()))
: Option.create_None();
return new AutoScalingSettingsDescription(minimumUnits, maximumUnits, autoScalingDisabled, autoScalingRoleArn, scalingPolicies);
}
public static AutoScalingSettingsUpdate AutoScalingSettingsUpdate(
software.amazon.awssdk.services.dynamodb.model.AutoScalingSettingsUpdate nativeValue) {
Option<Long> minimumUnits;
minimumUnits = Objects.nonNull(nativeValue.minimumUnits()) ?
Option.create_Some((nativeValue.minimumUnits()))
: Option.create_None();
Option<Long> maximumUnits;
maximumUnits = Objects.nonNull(nativeValue.maximumUnits()) ?
Option.create_Some((nativeValue.maximumUnits()))
: Option.create_None();
Option<Boolean> autoScalingDisabled;
autoScalingDisabled = Objects.nonNull(nativeValue.autoScalingDisabled()) ?
Option.create_Some((nativeValue.autoScalingDisabled()))
: Option.create_None();
Option<DafnySequence<? extends Character>> autoScalingRoleArn;
autoScalingRoleArn = Objects.nonNull(nativeValue.autoScalingRoleArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.autoScalingRoleArn()))
: Option.create_None();
Option<AutoScalingPolicyUpdate> scalingPolicyUpdate;
scalingPolicyUpdate = Objects.nonNull(nativeValue.scalingPolicyUpdate()) ?
Option.create_Some(ToDafny.AutoScalingPolicyUpdate(nativeValue.scalingPolicyUpdate()))
: Option.create_None();
return new AutoScalingSettingsUpdate(minimumUnits, maximumUnits, autoScalingDisabled, autoScalingRoleArn, scalingPolicyUpdate);
}
public static AutoScalingTargetTrackingScalingPolicyConfigurationDescription AutoScalingTargetTrackingScalingPolicyConfigurationDescription(
software.amazon.awssdk.services.dynamodb.model.AutoScalingTargetTrackingScalingPolicyConfigurationDescription nativeValue) {
Option<Boolean> disableScaleIn;
disableScaleIn = Objects.nonNull(nativeValue.disableScaleIn()) ?
Option.create_Some((nativeValue.disableScaleIn()))
: Option.create_None();
Option<Integer> scaleInCooldown;
scaleInCooldown = Objects.nonNull(nativeValue.scaleInCooldown()) ?
Option.create_Some((nativeValue.scaleInCooldown()))
: Option.create_None();
Option<Integer> scaleOutCooldown;
scaleOutCooldown = Objects.nonNull(nativeValue.scaleOutCooldown()) ?
Option.create_Some((nativeValue.scaleOutCooldown()))
: Option.create_None();
DafnySequence<? extends Byte> targetValue;
targetValue = software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.targetValue());
return new AutoScalingTargetTrackingScalingPolicyConfigurationDescription(disableScaleIn, scaleInCooldown, scaleOutCooldown, targetValue);
}
public static AutoScalingTargetTrackingScalingPolicyConfigurationUpdate AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(
software.amazon.awssdk.services.dynamodb.model.AutoScalingTargetTrackingScalingPolicyConfigurationUpdate nativeValue) {
Option<Boolean> disableScaleIn;
disableScaleIn = Objects.nonNull(nativeValue.disableScaleIn()) ?
Option.create_Some((nativeValue.disableScaleIn()))
: Option.create_None();
Option<Integer> scaleInCooldown;
scaleInCooldown = Objects.nonNull(nativeValue.scaleInCooldown()) ?
Option.create_Some((nativeValue.scaleInCooldown()))
: Option.create_None();
Option<Integer> scaleOutCooldown;
scaleOutCooldown = Objects.nonNull(nativeValue.scaleOutCooldown()) ?
Option.create_Some((nativeValue.scaleOutCooldown()))
: Option.create_None();
DafnySequence<? extends Byte> targetValue;
targetValue = software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.targetValue());
return new AutoScalingTargetTrackingScalingPolicyConfigurationUpdate(disableScaleIn, scaleInCooldown, scaleOutCooldown, targetValue);
}
public static BackupDescription BackupDescription(
software.amazon.awssdk.services.dynamodb.model.BackupDescription nativeValue) {
Option<BackupDetails> backupDetails;
backupDetails = Objects.nonNull(nativeValue.backupDetails()) ?
Option.create_Some(ToDafny.BackupDetails(nativeValue.backupDetails()))
: Option.create_None();
Option<SourceTableDetails> sourceTableDetails;
sourceTableDetails = Objects.nonNull(nativeValue.sourceTableDetails()) ?
Option.create_Some(ToDafny.SourceTableDetails(nativeValue.sourceTableDetails()))
: Option.create_None();
Option<SourceTableFeatureDetails> sourceTableFeatureDetails;
sourceTableFeatureDetails = Objects.nonNull(nativeValue.sourceTableFeatureDetails()) ?
Option.create_Some(ToDafny.SourceTableFeatureDetails(nativeValue.sourceTableFeatureDetails()))
: Option.create_None();
return new BackupDescription(backupDetails, sourceTableDetails, sourceTableFeatureDetails);
}
public static BackupDetails BackupDetails(
software.amazon.awssdk.services.dynamodb.model.BackupDetails nativeValue) {
DafnySequence<? extends Character> backupArn;
backupArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupArn());
DafnySequence<? extends Character> backupName;
backupName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupName());
Option<Long> backupSizeBytes;
backupSizeBytes = Objects.nonNull(nativeValue.backupSizeBytes()) ?
Option.create_Some((nativeValue.backupSizeBytes()))
: Option.create_None();
BackupStatus backupStatus;
backupStatus = ToDafny.BackupStatus(nativeValue.backupStatus());
BackupType backupType;
backupType = ToDafny.BackupType(nativeValue.backupType());
DafnySequence<? extends Character> backupCreationDateTime;
backupCreationDateTime = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupCreationDateTime());
Option<DafnySequence<? extends Character>> backupExpiryDateTime;
backupExpiryDateTime = Objects.nonNull(nativeValue.backupExpiryDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupExpiryDateTime()))
: Option.create_None();
return new BackupDetails(backupArn, backupName, backupSizeBytes, backupStatus, backupType, backupCreationDateTime, backupExpiryDateTime);
}
public static DafnySequence<? extends BackupSummary> BackupSummaries(
List<software.amazon.awssdk.services.dynamodb.model.BackupSummary> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::BackupSummary,
BackupSummary._typeDescriptor());
}
public static BackupSummary BackupSummary(
software.amazon.awssdk.services.dynamodb.model.BackupSummary nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableId;
tableId = Objects.nonNull(nativeValue.tableId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> backupArn;
backupArn = Objects.nonNull(nativeValue.backupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> backupName;
backupName = Objects.nonNull(nativeValue.backupName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> backupCreationDateTime;
backupCreationDateTime = Objects.nonNull(nativeValue.backupCreationDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupCreationDateTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> backupExpiryDateTime;
backupExpiryDateTime = Objects.nonNull(nativeValue.backupExpiryDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupExpiryDateTime()))
: Option.create_None();
Option<BackupStatus> backupStatus;
backupStatus = Objects.nonNull(nativeValue.backupStatus()) ?
Option.create_Some(ToDafny.BackupStatus(nativeValue.backupStatus()))
: Option.create_None();
Option<BackupType> backupType;
backupType = Objects.nonNull(nativeValue.backupType()) ?
Option.create_Some(ToDafny.BackupType(nativeValue.backupType()))
: Option.create_None();
Option<Long> backupSizeBytes;
backupSizeBytes = Objects.nonNull(nativeValue.backupSizeBytes()) ?
Option.create_Some((nativeValue.backupSizeBytes()))
: Option.create_None();
return new BackupSummary(tableName, tableId, tableArn, backupArn, backupName, backupCreationDateTime, backupExpiryDateTime, backupStatus, backupType, backupSizeBytes);
}
public static BatchExecuteStatementInput BatchExecuteStatementInput(
BatchExecuteStatementRequest nativeValue) {
DafnySequence<? extends BatchStatementRequest> statements;
statements = ToDafny.PartiQLBatchRequest(nativeValue.statements());
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
return new BatchExecuteStatementInput(statements, returnConsumedCapacity);
}
public static BatchExecuteStatementOutput BatchExecuteStatementOutput(
BatchExecuteStatementResponse nativeValue) {
Option<DafnySequence<? extends BatchStatementResponse>> responses;
responses = (Objects.nonNull(nativeValue.responses()) && nativeValue.responses().size() > 0) ?
Option.create_Some(ToDafny.PartiQLBatchResponse(nativeValue.responses()))
: Option.create_None();
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
return new BatchExecuteStatementOutput(responses, consumedCapacity);
}
public static BatchGetItemInput BatchGetItemInput(BatchGetItemRequest nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends KeysAndAttributes> requestItems;
requestItems = ToDafny.BatchGetRequestMap(nativeValue.requestItems());
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
return new BatchGetItemInput(requestItems, returnConsumedCapacity);
}
public static BatchGetItemOutput BatchGetItemOutput(BatchGetItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>>>> responses;
responses = (Objects.nonNull(nativeValue.responses()) && nativeValue.responses().size() > 0) ?
Option.create_Some(ToDafny.BatchGetResponseMap(nativeValue.responses()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends KeysAndAttributes>> unprocessedKeys;
unprocessedKeys = (Objects.nonNull(nativeValue.unprocessedKeys()) && nativeValue.unprocessedKeys().size() > 0) ?
Option.create_Some(ToDafny.BatchGetRequestMap(nativeValue.unprocessedKeys()))
: Option.create_None();
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
return new BatchGetItemOutput(responses, unprocessedKeys, consumedCapacity);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends KeysAndAttributes> BatchGetRequestMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::KeysAndAttributes);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>>> BatchGetResponseMap(
Map<String, List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>>> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ItemList);
}
public static BatchStatementError BatchStatementError(
software.amazon.awssdk.services.dynamodb.model.BatchStatementError nativeValue) {
Option<BatchStatementErrorCodeEnum> code;
code = Objects.nonNull(nativeValue.code()) ?
Option.create_Some(ToDafny.BatchStatementErrorCodeEnum(nativeValue.code()))
: Option.create_None();
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.message()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()))
: Option.create_None();
return new BatchStatementError(code, message);
}
public static BatchStatementRequest BatchStatementRequest(
software.amazon.awssdk.services.dynamodb.model.BatchStatementRequest nativeValue) {
DafnySequence<? extends Character> statement;
statement = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.statement());
Option<DafnySequence<? extends AttributeValue>> parameters;
parameters = (Objects.nonNull(nativeValue.parameters()) && nativeValue.parameters().size() > 0) ?
Option.create_Some(ToDafny.PreparedStatementParameters(nativeValue.parameters()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
return new BatchStatementRequest(statement, parameters, consistentRead);
}
public static BatchStatementResponse BatchStatementResponse(
software.amazon.awssdk.services.dynamodb.model.BatchStatementResponse nativeValue) {
Option<BatchStatementError> error;
error = Objects.nonNull(nativeValue.error()) ?
Option.create_Some(ToDafny.BatchStatementError(nativeValue.error()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> item;
item = (Objects.nonNull(nativeValue.item()) && nativeValue.item().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.item()))
: Option.create_None();
return new BatchStatementResponse(error, tableName, item);
}
public static BatchWriteItemInput BatchWriteItemInput(BatchWriteItemRequest nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends WriteRequest>> requestItems;
requestItems = ToDafny.BatchWriteItemRequestMap(nativeValue.requestItems());
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<ReturnItemCollectionMetrics> returnItemCollectionMetrics;
returnItemCollectionMetrics = Objects.nonNull(nativeValue.returnItemCollectionMetrics()) ?
Option.create_Some(ToDafny.ReturnItemCollectionMetrics(nativeValue.returnItemCollectionMetrics()))
: Option.create_None();
return new BatchWriteItemInput(requestItems, returnConsumedCapacity, returnItemCollectionMetrics);
}
public static BatchWriteItemOutput BatchWriteItemOutput(BatchWriteItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends WriteRequest>>> unprocessedItems;
unprocessedItems = (Objects.nonNull(nativeValue.unprocessedItems()) && nativeValue.unprocessedItems().size() > 0) ?
Option.create_Some(ToDafny.BatchWriteItemRequestMap(nativeValue.unprocessedItems()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends ItemCollectionMetrics>>> itemCollectionMetrics;
itemCollectionMetrics = (Objects.nonNull(nativeValue.itemCollectionMetrics()) && nativeValue.itemCollectionMetrics().size() > 0) ?
Option.create_Some(ToDafny.ItemCollectionMetricsPerTable(nativeValue.itemCollectionMetrics()))
: Option.create_None();
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
return new BatchWriteItemOutput(unprocessedItems, itemCollectionMetrics, consumedCapacity);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends WriteRequest>> BatchWriteItemRequestMap(
Map<String, List<software.amazon.awssdk.services.dynamodb.model.WriteRequest>> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::WriteRequests);
}
public static BillingModeSummary BillingModeSummary(
software.amazon.awssdk.services.dynamodb.model.BillingModeSummary nativeValue) {
Option<BillingMode> billingMode;
billingMode = Objects.nonNull(nativeValue.billingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingMode()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastUpdateToPayPerRequestDateTime;
lastUpdateToPayPerRequestDateTime = Objects.nonNull(nativeValue.lastUpdateToPayPerRequestDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastUpdateToPayPerRequestDateTime()))
: Option.create_None();
return new BillingModeSummary(billingMode, lastUpdateToPayPerRequestDateTime);
}
public static DafnySequence<? extends DafnySequence<? extends Byte>> BinarySetAttributeValue(
List<ByteBuffer> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::ByteSequence,
DafnySequence._typeDescriptor(TypeDescriptor.BYTE));
}
public static CancellationReason CancellationReason(
software.amazon.awssdk.services.dynamodb.model.CancellationReason nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> item;
item = (Objects.nonNull(nativeValue.item()) && nativeValue.item().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.item()))
: Option.create_None();
Option<DafnySequence<? extends Character>> code;
code = Objects.nonNull(nativeValue.code()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.code()))
: Option.create_None();
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.message()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message()))
: Option.create_None();
return new CancellationReason(item, code, message);
}
public static DafnySequence<? extends CancellationReason> CancellationReasonList(
List<software.amazon.awssdk.services.dynamodb.model.CancellationReason> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::CancellationReason,
CancellationReason._typeDescriptor());
}
public static Capacity Capacity(
software.amazon.awssdk.services.dynamodb.model.Capacity nativeValue) {
Option<DafnySequence<? extends Byte>> readCapacityUnits;
readCapacityUnits = Objects.nonNull(nativeValue.readCapacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.readCapacityUnits()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> writeCapacityUnits;
writeCapacityUnits = Objects.nonNull(nativeValue.writeCapacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.writeCapacityUnits()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> capacityUnits;
capacityUnits = Objects.nonNull(nativeValue.capacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.capacityUnits()))
: Option.create_None();
return new Capacity(readCapacityUnits, writeCapacityUnits, capacityUnits);
}
public static Condition Condition(
software.amazon.awssdk.services.dynamodb.model.Condition nativeValue) {
Option<DafnySequence<? extends AttributeValue>> attributeValueList;
attributeValueList = (Objects.nonNull(nativeValue.attributeValueList()) && nativeValue.attributeValueList().size() > 0) ?
Option.create_Some(ToDafny.AttributeValueList(nativeValue.attributeValueList()))
: Option.create_None();
ComparisonOperator comparisonOperator;
comparisonOperator = ToDafny.ComparisonOperator(nativeValue.comparisonOperator());
return new Condition(attributeValueList, comparisonOperator);
}
public static ConditionCheck ConditionCheck(
software.amazon.awssdk.services.dynamodb.model.ConditionCheck nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends Character> conditionExpression;
conditionExpression = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
Option<ReturnValuesOnConditionCheckFailure> returnValuesOnConditionCheckFailure;
returnValuesOnConditionCheckFailure = Objects.nonNull(nativeValue.returnValuesOnConditionCheckFailure()) ?
Option.create_Some(ToDafny.ReturnValuesOnConditionCheckFailure(nativeValue.returnValuesOnConditionCheckFailure()))
: Option.create_None();
return new ConditionCheck(key, tableName, conditionExpression, expressionAttributeNames, expressionAttributeValues, returnValuesOnConditionCheckFailure);
}
public static ConsumedCapacity ConsumedCapacity(
software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> capacityUnits;
capacityUnits = Objects.nonNull(nativeValue.capacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.capacityUnits()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> readCapacityUnits;
readCapacityUnits = Objects.nonNull(nativeValue.readCapacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.readCapacityUnits()))
: Option.create_None();
Option<DafnySequence<? extends Byte>> writeCapacityUnits;
writeCapacityUnits = Objects.nonNull(nativeValue.writeCapacityUnits()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.Double(nativeValue.writeCapacityUnits()))
: Option.create_None();
Option<Capacity> table;
table = Objects.nonNull(nativeValue.table()) ?
Option.create_Some(ToDafny.Capacity(nativeValue.table()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends Capacity>> localSecondaryIndexes;
localSecondaryIndexes = (Objects.nonNull(nativeValue.localSecondaryIndexes()) && nativeValue.localSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.SecondaryIndexesCapacityMap(nativeValue.localSecondaryIndexes()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends Capacity>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.SecondaryIndexesCapacityMap(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
return new ConsumedCapacity(tableName, capacityUnits, readCapacityUnits, writeCapacityUnits, table, localSecondaryIndexes, globalSecondaryIndexes);
}
public static DafnySequence<? extends ConsumedCapacity> ConsumedCapacityMultiple(
List<software.amazon.awssdk.services.dynamodb.model.ConsumedCapacity> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ConsumedCapacity,
ConsumedCapacity._typeDescriptor());
}
public static ContinuousBackupsDescription ContinuousBackupsDescription(
software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsDescription nativeValue) {
ContinuousBackupsStatus continuousBackupsStatus;
continuousBackupsStatus = ToDafny.ContinuousBackupsStatus(nativeValue.continuousBackupsStatus());
Option<PointInTimeRecoveryDescription> pointInTimeRecoveryDescription;
pointInTimeRecoveryDescription = Objects.nonNull(nativeValue.pointInTimeRecoveryDescription()) ?
Option.create_Some(ToDafny.PointInTimeRecoveryDescription(nativeValue.pointInTimeRecoveryDescription()))
: Option.create_None();
return new ContinuousBackupsDescription(continuousBackupsStatus, pointInTimeRecoveryDescription);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> ContributorInsightsRuleList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends ContributorInsightsSummary> ContributorInsightsSummaries(
List<software.amazon.awssdk.services.dynamodb.model.ContributorInsightsSummary> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ContributorInsightsSummary,
ContributorInsightsSummary._typeDescriptor());
}
public static ContributorInsightsSummary ContributorInsightsSummary(
software.amazon.awssdk.services.dynamodb.model.ContributorInsightsSummary nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<ContributorInsightsStatus> contributorInsightsStatus;
contributorInsightsStatus = Objects.nonNull(nativeValue.contributorInsightsStatus()) ?
Option.create_Some(ToDafny.ContributorInsightsStatus(nativeValue.contributorInsightsStatus()))
: Option.create_None();
return new ContributorInsightsSummary(tableName, indexName, contributorInsightsStatus);
}
public static CreateBackupInput CreateBackupInput(CreateBackupRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends Character> backupName;
backupName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupName());
return new CreateBackupInput(tableName, backupName);
}
public static CreateBackupOutput CreateBackupOutput(CreateBackupResponse nativeValue) {
Option<BackupDetails> backupDetails;
backupDetails = Objects.nonNull(nativeValue.backupDetails()) ?
Option.create_Some(ToDafny.BackupDetails(nativeValue.backupDetails()))
: Option.create_None();
return new CreateBackupOutput(backupDetails);
}
public static CreateGlobalSecondaryIndexAction CreateGlobalSecondaryIndexAction(
software.amazon.awssdk.services.dynamodb.model.CreateGlobalSecondaryIndexAction nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
Projection projection;
projection = ToDafny.Projection(nativeValue.projection());
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
return new CreateGlobalSecondaryIndexAction(indexName, keySchema, projection, provisionedThroughput);
}
public static CreateGlobalTableInput CreateGlobalTableInput(
CreateGlobalTableRequest nativeValue) {
DafnySequence<? extends Character> globalTableName;
globalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName());
DafnySequence<? extends Replica> replicationGroup;
replicationGroup = ToDafny.ReplicaList(nativeValue.replicationGroup());
return new CreateGlobalTableInput(globalTableName, replicationGroup);
}
public static CreateGlobalTableOutput CreateGlobalTableOutput(
CreateGlobalTableResponse nativeValue) {
Option<GlobalTableDescription> globalTableDescription;
globalTableDescription = Objects.nonNull(nativeValue.globalTableDescription()) ?
Option.create_Some(ToDafny.GlobalTableDescription(nativeValue.globalTableDescription()))
: Option.create_None();
return new CreateGlobalTableOutput(globalTableDescription);
}
public static CreateReplicaAction CreateReplicaAction(
software.amazon.awssdk.services.dynamodb.model.CreateReplicaAction nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
return new CreateReplicaAction(regionName);
}
public static CreateReplicationGroupMemberAction CreateReplicationGroupMemberAction(
software.amazon.awssdk.services.dynamodb.model.CreateReplicationGroupMemberAction nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
Option<DafnySequence<? extends Character>> kMSMasterKeyId;
kMSMasterKeyId = Objects.nonNull(nativeValue.kmsMasterKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsMasterKeyId()))
: Option.create_None();
Option<ProvisionedThroughputOverride> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughputOverride(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndex>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<TableClass> tableClassOverride;
tableClassOverride = Objects.nonNull(nativeValue.tableClassOverride()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.tableClassOverride()))
: Option.create_None();
return new CreateReplicationGroupMemberAction(regionName, kMSMasterKeyId, provisionedThroughputOverride, globalSecondaryIndexes, tableClassOverride);
}
public static CreateTableInput CreateTableInput(CreateTableRequest nativeValue) {
DafnySequence<? extends AttributeDefinition> attributeDefinitions;
attributeDefinitions = ToDafny.AttributeDefinitions(nativeValue.attributeDefinitions());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
Option<DafnySequence<? extends LocalSecondaryIndex>> localSecondaryIndexes;
localSecondaryIndexes = (Objects.nonNull(nativeValue.localSecondaryIndexes()) && nativeValue.localSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.LocalSecondaryIndexList(nativeValue.localSecondaryIndexes()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndex>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<BillingMode> billingMode;
billingMode = Objects.nonNull(nativeValue.billingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingMode()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
Option<StreamSpecification> streamSpecification;
streamSpecification = Objects.nonNull(nativeValue.streamSpecification()) ?
Option.create_Some(ToDafny.StreamSpecification(nativeValue.streamSpecification()))
: Option.create_None();
Option<SSESpecification> sSESpecification;
sSESpecification = Objects.nonNull(nativeValue.sseSpecification()) ?
Option.create_Some(ToDafny.SSESpecification(nativeValue.sseSpecification()))
: Option.create_None();
Option<DafnySequence<? extends Tag>> tags;
tags = (Objects.nonNull(nativeValue.tags()) && nativeValue.tags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.tags()))
: Option.create_None();
Option<TableClass> tableClass;
tableClass = Objects.nonNull(nativeValue.tableClass()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.tableClass()))
: Option.create_None();
return new CreateTableInput(attributeDefinitions, tableName, keySchema, localSecondaryIndexes, globalSecondaryIndexes, billingMode, provisionedThroughput, streamSpecification, sSESpecification, tags, tableClass);
}
public static CreateTableOutput CreateTableOutput(CreateTableResponse nativeValue) {
Option<TableDescription> tableDescription;
tableDescription = Objects.nonNull(nativeValue.tableDescription()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.tableDescription()))
: Option.create_None();
return new CreateTableOutput(tableDescription);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> CsvHeaderList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static CsvOptions CsvOptions(
software.amazon.awssdk.services.dynamodb.model.CsvOptions nativeValue) {
Option<DafnySequence<? extends Character>> delimiter;
delimiter = Objects.nonNull(nativeValue.delimiter()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.delimiter()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> headerList;
headerList = (Objects.nonNull(nativeValue.headerList()) && nativeValue.headerList().size() > 0) ?
Option.create_Some(ToDafny.CsvHeaderList(nativeValue.headerList()))
: Option.create_None();
return new CsvOptions(delimiter, headerList);
}
public static Delete Delete(software.amazon.awssdk.services.dynamodb.model.Delete nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
Option<ReturnValuesOnConditionCheckFailure> returnValuesOnConditionCheckFailure;
returnValuesOnConditionCheckFailure = Objects.nonNull(nativeValue.returnValuesOnConditionCheckFailure()) ?
Option.create_Some(ToDafny.ReturnValuesOnConditionCheckFailure(nativeValue.returnValuesOnConditionCheckFailure()))
: Option.create_None();
return new Delete(key, tableName, conditionExpression, expressionAttributeNames, expressionAttributeValues, returnValuesOnConditionCheckFailure);
}
public static DeleteBackupInput DeleteBackupInput(DeleteBackupRequest nativeValue) {
DafnySequence<? extends Character> backupArn;
backupArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupArn());
return new DeleteBackupInput(backupArn);
}
public static DeleteBackupOutput DeleteBackupOutput(DeleteBackupResponse nativeValue) {
Option<BackupDescription> backupDescription;
backupDescription = Objects.nonNull(nativeValue.backupDescription()) ?
Option.create_Some(ToDafny.BackupDescription(nativeValue.backupDescription()))
: Option.create_None();
return new DeleteBackupOutput(backupDescription);
}
public static DeleteGlobalSecondaryIndexAction DeleteGlobalSecondaryIndexAction(
software.amazon.awssdk.services.dynamodb.model.DeleteGlobalSecondaryIndexAction nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
return new DeleteGlobalSecondaryIndexAction(indexName);
}
public static DeleteItemInput DeleteItemInput(DeleteItemRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends ExpectedAttributeValue>> expected;
expected = (Objects.nonNull(nativeValue.expected()) && nativeValue.expected().size() > 0) ?
Option.create_Some(ToDafny.ExpectedAttributeMap(nativeValue.expected()))
: Option.create_None();
Option<ConditionalOperator> conditionalOperator;
conditionalOperator = Objects.nonNull(nativeValue.conditionalOperator()) ?
Option.create_Some(ToDafny.ConditionalOperator(nativeValue.conditionalOperator()))
: Option.create_None();
Option<ReturnValue> returnValues;
returnValues = Objects.nonNull(nativeValue.returnValues()) ?
Option.create_Some(ToDafny.ReturnValue(nativeValue.returnValues()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<ReturnItemCollectionMetrics> returnItemCollectionMetrics;
returnItemCollectionMetrics = Objects.nonNull(nativeValue.returnItemCollectionMetrics()) ?
Option.create_Some(ToDafny.ReturnItemCollectionMetrics(nativeValue.returnItemCollectionMetrics()))
: Option.create_None();
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
return new DeleteItemInput(tableName, key, expected, conditionalOperator, returnValues, returnConsumedCapacity, returnItemCollectionMetrics, conditionExpression, expressionAttributeNames, expressionAttributeValues);
}
public static DeleteItemOutput DeleteItemOutput(DeleteItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> attributes;
attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.attributes()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
Option<ItemCollectionMetrics> itemCollectionMetrics;
itemCollectionMetrics = Objects.nonNull(nativeValue.itemCollectionMetrics()) ?
Option.create_Some(ToDafny.ItemCollectionMetrics(nativeValue.itemCollectionMetrics()))
: Option.create_None();
return new DeleteItemOutput(attributes, consumedCapacity, itemCollectionMetrics);
}
public static DeleteReplicaAction DeleteReplicaAction(
software.amazon.awssdk.services.dynamodb.model.DeleteReplicaAction nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
return new DeleteReplicaAction(regionName);
}
public static DeleteReplicationGroupMemberAction DeleteReplicationGroupMemberAction(
software.amazon.awssdk.services.dynamodb.model.DeleteReplicationGroupMemberAction nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
return new DeleteReplicationGroupMemberAction(regionName);
}
public static DeleteRequest DeleteRequest(
software.amazon.awssdk.services.dynamodb.model.DeleteRequest nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
return new DeleteRequest(key);
}
public static DeleteTableInput DeleteTableInput(DeleteTableRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DeleteTableInput(tableName);
}
public static DeleteTableOutput DeleteTableOutput(DeleteTableResponse nativeValue) {
Option<TableDescription> tableDescription;
tableDescription = Objects.nonNull(nativeValue.tableDescription()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.tableDescription()))
: Option.create_None();
return new DeleteTableOutput(tableDescription);
}
public static DescribeBackupInput DescribeBackupInput(DescribeBackupRequest nativeValue) {
DafnySequence<? extends Character> backupArn;
backupArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupArn());
return new DescribeBackupInput(backupArn);
}
public static DescribeBackupOutput DescribeBackupOutput(DescribeBackupResponse nativeValue) {
Option<BackupDescription> backupDescription;
backupDescription = Objects.nonNull(nativeValue.backupDescription()) ?
Option.create_Some(ToDafny.BackupDescription(nativeValue.backupDescription()))
: Option.create_None();
return new DescribeBackupOutput(backupDescription);
}
public static DescribeContinuousBackupsInput DescribeContinuousBackupsInput(
DescribeContinuousBackupsRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DescribeContinuousBackupsInput(tableName);
}
public static DescribeContinuousBackupsOutput DescribeContinuousBackupsOutput(
DescribeContinuousBackupsResponse nativeValue) {
Option<ContinuousBackupsDescription> continuousBackupsDescription;
continuousBackupsDescription = Objects.nonNull(nativeValue.continuousBackupsDescription()) ?
Option.create_Some(ToDafny.ContinuousBackupsDescription(nativeValue.continuousBackupsDescription()))
: Option.create_None();
return new DescribeContinuousBackupsOutput(continuousBackupsDescription);
}
public static DescribeContributorInsightsInput DescribeContributorInsightsInput(
DescribeContributorInsightsRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
return new DescribeContributorInsightsInput(tableName, indexName);
}
public static DescribeContributorInsightsOutput DescribeContributorInsightsOutput(
DescribeContributorInsightsResponse nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> contributorInsightsRuleList;
contributorInsightsRuleList = (Objects.nonNull(nativeValue.contributorInsightsRuleList()) && nativeValue.contributorInsightsRuleList().size() > 0) ?
Option.create_Some(ToDafny.ContributorInsightsRuleList(nativeValue.contributorInsightsRuleList()))
: Option.create_None();
Option<ContributorInsightsStatus> contributorInsightsStatus;
contributorInsightsStatus = Objects.nonNull(nativeValue.contributorInsightsStatus()) ?
Option.create_Some(ToDafny.ContributorInsightsStatus(nativeValue.contributorInsightsStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastUpdateDateTime;
lastUpdateDateTime = Objects.nonNull(nativeValue.lastUpdateDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastUpdateDateTime()))
: Option.create_None();
Option<FailureException> failureException;
failureException = Objects.nonNull(nativeValue.failureException()) ?
Option.create_Some(ToDafny.FailureException(nativeValue.failureException()))
: Option.create_None();
return new DescribeContributorInsightsOutput(tableName, indexName, contributorInsightsRuleList, contributorInsightsStatus, lastUpdateDateTime, failureException);
}
public static DescribeEndpointsRequest DescribeEndpointsRequest(
software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsRequest nativeValue) {
return new DescribeEndpointsRequest();
}
public static DescribeEndpointsResponse DescribeEndpointsResponse(
software.amazon.awssdk.services.dynamodb.model.DescribeEndpointsResponse nativeValue) {
DafnySequence<? extends Endpoint> endpoints;
endpoints = ToDafny.Endpoints(nativeValue.endpoints());
return new DescribeEndpointsResponse(endpoints);
}
public static DescribeExportInput DescribeExportInput(DescribeExportRequest nativeValue) {
DafnySequence<? extends Character> exportArn;
exportArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportArn());
return new DescribeExportInput(exportArn);
}
public static DescribeExportOutput DescribeExportOutput(DescribeExportResponse nativeValue) {
Option<ExportDescription> exportDescription;
exportDescription = Objects.nonNull(nativeValue.exportDescription()) ?
Option.create_Some(ToDafny.ExportDescription(nativeValue.exportDescription()))
: Option.create_None();
return new DescribeExportOutput(exportDescription);
}
public static DescribeGlobalTableInput DescribeGlobalTableInput(
DescribeGlobalTableRequest nativeValue) {
DafnySequence<? extends Character> globalTableName;
globalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName());
return new DescribeGlobalTableInput(globalTableName);
}
public static DescribeGlobalTableOutput DescribeGlobalTableOutput(
DescribeGlobalTableResponse nativeValue) {
Option<GlobalTableDescription> globalTableDescription;
globalTableDescription = Objects.nonNull(nativeValue.globalTableDescription()) ?
Option.create_Some(ToDafny.GlobalTableDescription(nativeValue.globalTableDescription()))
: Option.create_None();
return new DescribeGlobalTableOutput(globalTableDescription);
}
public static DescribeGlobalTableSettingsInput DescribeGlobalTableSettingsInput(
DescribeGlobalTableSettingsRequest nativeValue) {
DafnySequence<? extends Character> globalTableName;
globalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName());
return new DescribeGlobalTableSettingsInput(globalTableName);
}
public static DescribeGlobalTableSettingsOutput DescribeGlobalTableSettingsOutput(
DescribeGlobalTableSettingsResponse nativeValue) {
Option<DafnySequence<? extends Character>> globalTableName;
globalTableName = Objects.nonNull(nativeValue.globalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaSettingsDescription>> replicaSettings;
replicaSettings = (Objects.nonNull(nativeValue.replicaSettings()) && nativeValue.replicaSettings().size() > 0) ?
Option.create_Some(ToDafny.ReplicaSettingsDescriptionList(nativeValue.replicaSettings()))
: Option.create_None();
return new DescribeGlobalTableSettingsOutput(globalTableName, replicaSettings);
}
public static DescribeImportInput DescribeImportInput(DescribeImportRequest nativeValue) {
DafnySequence<? extends Character> importArn;
importArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.importArn());
return new DescribeImportInput(importArn);
}
public static DescribeImportOutput DescribeImportOutput(DescribeImportResponse nativeValue) {
ImportTableDescription importTableDescription;
importTableDescription = ToDafny.ImportTableDescription(nativeValue.importTableDescription());
return new DescribeImportOutput(importTableDescription);
}
public static DescribeKinesisStreamingDestinationInput DescribeKinesisStreamingDestinationInput(
DescribeKinesisStreamingDestinationRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DescribeKinesisStreamingDestinationInput(tableName);
}
public static DescribeKinesisStreamingDestinationOutput DescribeKinesisStreamingDestinationOutput(
DescribeKinesisStreamingDestinationResponse nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends KinesisDataStreamDestination>> kinesisDataStreamDestinations;
kinesisDataStreamDestinations = (Objects.nonNull(nativeValue.kinesisDataStreamDestinations()) && nativeValue.kinesisDataStreamDestinations().size() > 0) ?
Option.create_Some(ToDafny.KinesisDataStreamDestinations(nativeValue.kinesisDataStreamDestinations()))
: Option.create_None();
return new DescribeKinesisStreamingDestinationOutput(tableName, kinesisDataStreamDestinations);
}
public static DescribeLimitsInput DescribeLimitsInput(DescribeLimitsRequest nativeValue) {
return new DescribeLimitsInput();
}
public static DescribeLimitsOutput DescribeLimitsOutput(DescribeLimitsResponse nativeValue) {
Option<Long> accountMaxReadCapacityUnits;
accountMaxReadCapacityUnits = Objects.nonNull(nativeValue.accountMaxReadCapacityUnits()) ?
Option.create_Some((nativeValue.accountMaxReadCapacityUnits()))
: Option.create_None();
Option<Long> accountMaxWriteCapacityUnits;
accountMaxWriteCapacityUnits = Objects.nonNull(nativeValue.accountMaxWriteCapacityUnits()) ?
Option.create_Some((nativeValue.accountMaxWriteCapacityUnits()))
: Option.create_None();
Option<Long> tableMaxReadCapacityUnits;
tableMaxReadCapacityUnits = Objects.nonNull(nativeValue.tableMaxReadCapacityUnits()) ?
Option.create_Some((nativeValue.tableMaxReadCapacityUnits()))
: Option.create_None();
Option<Long> tableMaxWriteCapacityUnits;
tableMaxWriteCapacityUnits = Objects.nonNull(nativeValue.tableMaxWriteCapacityUnits()) ?
Option.create_Some((nativeValue.tableMaxWriteCapacityUnits()))
: Option.create_None();
return new DescribeLimitsOutput(accountMaxReadCapacityUnits, accountMaxWriteCapacityUnits, tableMaxReadCapacityUnits, tableMaxWriteCapacityUnits);
}
public static DescribeTableInput DescribeTableInput(DescribeTableRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DescribeTableInput(tableName);
}
public static DescribeTableOutput DescribeTableOutput(DescribeTableResponse nativeValue) {
Option<TableDescription> table;
table = Objects.nonNull(nativeValue.table()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.table()))
: Option.create_None();
return new DescribeTableOutput(table);
}
public static DescribeTableReplicaAutoScalingInput DescribeTableReplicaAutoScalingInput(
DescribeTableReplicaAutoScalingRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DescribeTableReplicaAutoScalingInput(tableName);
}
public static DescribeTableReplicaAutoScalingOutput DescribeTableReplicaAutoScalingOutput(
DescribeTableReplicaAutoScalingResponse nativeValue) {
Option<TableAutoScalingDescription> tableAutoScalingDescription;
tableAutoScalingDescription = Objects.nonNull(nativeValue.tableAutoScalingDescription()) ?
Option.create_Some(ToDafny.TableAutoScalingDescription(nativeValue.tableAutoScalingDescription()))
: Option.create_None();
return new DescribeTableReplicaAutoScalingOutput(tableAutoScalingDescription);
}
public static DescribeTimeToLiveInput DescribeTimeToLiveInput(
DescribeTimeToLiveRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
return new DescribeTimeToLiveInput(tableName);
}
public static DescribeTimeToLiveOutput DescribeTimeToLiveOutput(
DescribeTimeToLiveResponse nativeValue) {
Option<TimeToLiveDescription> timeToLiveDescription;
timeToLiveDescription = Objects.nonNull(nativeValue.timeToLiveDescription()) ?
Option.create_Some(ToDafny.TimeToLiveDescription(nativeValue.timeToLiveDescription()))
: Option.create_None();
return new DescribeTimeToLiveOutput(timeToLiveDescription);
}
public static DisableKinesisStreamingDestinationInput DisableKinesisStreamingDestinationInput(
DisableKinesisStreamingDestinationRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends Character> streamArn;
streamArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.streamArn());
return new DisableKinesisStreamingDestinationInput(tableName, streamArn);
}
public static DisableKinesisStreamingDestinationOutput DisableKinesisStreamingDestinationOutput(
DisableKinesisStreamingDestinationResponse nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> streamArn;
streamArn = Objects.nonNull(nativeValue.streamArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.streamArn()))
: Option.create_None();
Option<DestinationStatus> destinationStatus;
destinationStatus = Objects.nonNull(nativeValue.destinationStatus()) ?
Option.create_Some(ToDafny.DestinationStatus(nativeValue.destinationStatus()))
: Option.create_None();
return new DisableKinesisStreamingDestinationOutput(tableName, streamArn, destinationStatus);
}
public static EnableKinesisStreamingDestinationInput EnableKinesisStreamingDestinationInput(
EnableKinesisStreamingDestinationRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends Character> streamArn;
streamArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.streamArn());
return new EnableKinesisStreamingDestinationInput(tableName, streamArn);
}
public static EnableKinesisStreamingDestinationOutput EnableKinesisStreamingDestinationOutput(
EnableKinesisStreamingDestinationResponse nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> streamArn;
streamArn = Objects.nonNull(nativeValue.streamArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.streamArn()))
: Option.create_None();
Option<DestinationStatus> destinationStatus;
destinationStatus = Objects.nonNull(nativeValue.destinationStatus()) ?
Option.create_Some(ToDafny.DestinationStatus(nativeValue.destinationStatus()))
: Option.create_None();
return new EnableKinesisStreamingDestinationOutput(tableName, streamArn, destinationStatus);
}
public static Endpoint Endpoint(
software.amazon.awssdk.services.dynamodb.model.Endpoint nativeValue) {
DafnySequence<? extends Character> address;
address = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.address());
Long cachePeriodInMinutes;
cachePeriodInMinutes = (nativeValue.cachePeriodInMinutes());
return new Endpoint(address, cachePeriodInMinutes);
}
public static DafnySequence<? extends Endpoint> Endpoints(
List<software.amazon.awssdk.services.dynamodb.model.Endpoint> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Endpoint,
Endpoint._typeDescriptor());
}
public static ExecuteStatementInput ExecuteStatementInput(ExecuteStatementRequest nativeValue) {
DafnySequence<? extends Character> statement;
statement = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.statement());
Option<DafnySequence<? extends AttributeValue>> parameters;
parameters = (Objects.nonNull(nativeValue.parameters()) && nativeValue.parameters().size() > 0) ?
Option.create_Some(ToDafny.PreparedStatementParameters(nativeValue.parameters()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
return new ExecuteStatementInput(statement, parameters, consistentRead, nextToken, returnConsumedCapacity, limit);
}
public static ExecuteStatementOutput ExecuteStatementOutput(
ExecuteStatementResponse nativeValue) {
Option<DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>>> items;
items = (Objects.nonNull(nativeValue.items()) && nativeValue.items().size() > 0) ?
Option.create_Some(ToDafny.ItemList(nativeValue.items()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> lastEvaluatedKey;
lastEvaluatedKey = (Objects.nonNull(nativeValue.lastEvaluatedKey()) && nativeValue.lastEvaluatedKey().size() > 0) ?
Option.create_Some(ToDafny.Key(nativeValue.lastEvaluatedKey()))
: Option.create_None();
return new ExecuteStatementOutput(items, nextToken, consumedCapacity, lastEvaluatedKey);
}
public static ExecuteTransactionInput ExecuteTransactionInput(
ExecuteTransactionRequest nativeValue) {
DafnySequence<? extends ParameterizedStatement> transactStatements;
transactStatements = ToDafny.ParameterizedStatements(nativeValue.transactStatements());
Option<DafnySequence<? extends Character>> clientRequestToken;
clientRequestToken = Objects.nonNull(nativeValue.clientRequestToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientRequestToken()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
return new ExecuteTransactionInput(transactStatements, clientRequestToken, returnConsumedCapacity);
}
public static ExecuteTransactionOutput ExecuteTransactionOutput(
ExecuteTransactionResponse nativeValue) {
Option<DafnySequence<? extends ItemResponse>> responses;
responses = (Objects.nonNull(nativeValue.responses()) && nativeValue.responses().size() > 0) ?
Option.create_Some(ToDafny.ItemResponseList(nativeValue.responses()))
: Option.create_None();
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
return new ExecuteTransactionOutput(responses, consumedCapacity);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends ExpectedAttributeValue> ExpectedAttributeMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.ExpectedAttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ExpectedAttributeValue);
}
public static ExpectedAttributeValue ExpectedAttributeValue(
software.amazon.awssdk.services.dynamodb.model.ExpectedAttributeValue nativeValue) {
Option<AttributeValue> value;
value = Objects.nonNull(nativeValue.value()) ?
Option.create_Some(ToDafny.AttributeValue(nativeValue.value()))
: Option.create_None();
Option<Boolean> exists;
exists = Objects.nonNull(nativeValue.exists()) ?
Option.create_Some((nativeValue.exists()))
: Option.create_None();
Option<ComparisonOperator> comparisonOperator;
comparisonOperator = Objects.nonNull(nativeValue.comparisonOperator()) ?
Option.create_Some(ToDafny.ComparisonOperator(nativeValue.comparisonOperator()))
: Option.create_None();
Option<DafnySequence<? extends AttributeValue>> attributeValueList;
attributeValueList = (Objects.nonNull(nativeValue.attributeValueList()) && nativeValue.attributeValueList().size() > 0) ?
Option.create_Some(ToDafny.AttributeValueList(nativeValue.attributeValueList()))
: Option.create_None();
return new ExpectedAttributeValue(value, exists, comparisonOperator, attributeValueList);
}
public static ExportDescription ExportDescription(
software.amazon.awssdk.services.dynamodb.model.ExportDescription nativeValue) {
Option<DafnySequence<? extends Character>> exportArn;
exportArn = Objects.nonNull(nativeValue.exportArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportArn()))
: Option.create_None();
Option<ExportStatus> exportStatus;
exportStatus = Objects.nonNull(nativeValue.exportStatus()) ?
Option.create_Some(ToDafny.ExportStatus(nativeValue.exportStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> startTime;
startTime = Objects.nonNull(nativeValue.startTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.startTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> endTime;
endTime = Objects.nonNull(nativeValue.endTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.endTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> exportManifest;
exportManifest = Objects.nonNull(nativeValue.exportManifest()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportManifest()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableId;
tableId = Objects.nonNull(nativeValue.tableId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> exportTime;
exportTime = Objects.nonNull(nativeValue.exportTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> clientToken;
clientToken = Objects.nonNull(nativeValue.clientToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientToken()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3Bucket;
s3Bucket = Objects.nonNull(nativeValue.s3Bucket()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3Bucket()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3BucketOwner;
s3BucketOwner = Objects.nonNull(nativeValue.s3BucketOwner()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3BucketOwner()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3Prefix;
s3Prefix = Objects.nonNull(nativeValue.s3Prefix()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3Prefix()))
: Option.create_None();
Option<S3SseAlgorithm> s3SseAlgorithm;
s3SseAlgorithm = Objects.nonNull(nativeValue.s3SseAlgorithm()) ?
Option.create_Some(ToDafny.S3SseAlgorithm(nativeValue.s3SseAlgorithm()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3SseKmsKeyId;
s3SseKmsKeyId = Objects.nonNull(nativeValue.s3SseKmsKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3SseKmsKeyId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> failureCode;
failureCode = Objects.nonNull(nativeValue.failureCode()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.failureCode()))
: Option.create_None();
Option<DafnySequence<? extends Character>> failureMessage;
failureMessage = Objects.nonNull(nativeValue.failureMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.failureMessage()))
: Option.create_None();
Option<ExportFormat> exportFormat;
exportFormat = Objects.nonNull(nativeValue.exportFormat()) ?
Option.create_Some(ToDafny.ExportFormat(nativeValue.exportFormat()))
: Option.create_None();
Option<Long> billedSizeBytes;
billedSizeBytes = Objects.nonNull(nativeValue.billedSizeBytes()) ?
Option.create_Some((nativeValue.billedSizeBytes()))
: Option.create_None();
Option<Long> itemCount;
itemCount = Objects.nonNull(nativeValue.itemCount()) ?
Option.create_Some((nativeValue.itemCount()))
: Option.create_None();
return new ExportDescription(exportArn, exportStatus, startTime, endTime, exportManifest, tableArn, tableId, exportTime, clientToken, s3Bucket, s3BucketOwner, s3Prefix, s3SseAlgorithm, s3SseKmsKeyId, failureCode, failureMessage, exportFormat, billedSizeBytes, itemCount);
}
public static DafnySequence<? extends ExportSummary> ExportSummaries(
List<software.amazon.awssdk.services.dynamodb.model.ExportSummary> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ExportSummary,
ExportSummary._typeDescriptor());
}
public static ExportSummary ExportSummary(
software.amazon.awssdk.services.dynamodb.model.ExportSummary nativeValue) {
Option<DafnySequence<? extends Character>> exportArn;
exportArn = Objects.nonNull(nativeValue.exportArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportArn()))
: Option.create_None();
Option<ExportStatus> exportStatus;
exportStatus = Objects.nonNull(nativeValue.exportStatus()) ?
Option.create_Some(ToDafny.ExportStatus(nativeValue.exportStatus()))
: Option.create_None();
return new ExportSummary(exportArn, exportStatus);
}
public static ExportTableToPointInTimeInput ExportTableToPointInTimeInput(
ExportTableToPointInTimeRequest nativeValue) {
DafnySequence<? extends Character> tableArn;
tableArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn());
Option<DafnySequence<? extends Character>> exportTime;
exportTime = Objects.nonNull(nativeValue.exportTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exportTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> clientToken;
clientToken = Objects.nonNull(nativeValue.clientToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientToken()))
: Option.create_None();
DafnySequence<? extends Character> s3Bucket;
s3Bucket = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3Bucket());
Option<DafnySequence<? extends Character>> s3BucketOwner;
s3BucketOwner = Objects.nonNull(nativeValue.s3BucketOwner()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3BucketOwner()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3Prefix;
s3Prefix = Objects.nonNull(nativeValue.s3Prefix()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3Prefix()))
: Option.create_None();
Option<S3SseAlgorithm> s3SseAlgorithm;
s3SseAlgorithm = Objects.nonNull(nativeValue.s3SseAlgorithm()) ?
Option.create_Some(ToDafny.S3SseAlgorithm(nativeValue.s3SseAlgorithm()))
: Option.create_None();
Option<DafnySequence<? extends Character>> s3SseKmsKeyId;
s3SseKmsKeyId = Objects.nonNull(nativeValue.s3SseKmsKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3SseKmsKeyId()))
: Option.create_None();
Option<ExportFormat> exportFormat;
exportFormat = Objects.nonNull(nativeValue.exportFormat()) ?
Option.create_Some(ToDafny.ExportFormat(nativeValue.exportFormat()))
: Option.create_None();
return new ExportTableToPointInTimeInput(tableArn, exportTime, clientToken, s3Bucket, s3BucketOwner, s3Prefix, s3SseAlgorithm, s3SseKmsKeyId, exportFormat);
}
public static ExportTableToPointInTimeOutput ExportTableToPointInTimeOutput(
ExportTableToPointInTimeResponse nativeValue) {
Option<ExportDescription> exportDescription;
exportDescription = Objects.nonNull(nativeValue.exportDescription()) ?
Option.create_Some(ToDafny.ExportDescription(nativeValue.exportDescription()))
: Option.create_None();
return new ExportTableToPointInTimeOutput(exportDescription);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>> ExpressionAttributeNameMap(
Map<String, String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> ExpressionAttributeValueMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static FailureException FailureException(
software.amazon.awssdk.services.dynamodb.model.FailureException nativeValue) {
Option<DafnySequence<? extends Character>> exceptionName;
exceptionName = Objects.nonNull(nativeValue.exceptionName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exceptionName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> exceptionDescription;
exceptionDescription = Objects.nonNull(nativeValue.exceptionDescription()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exceptionDescription()))
: Option.create_None();
return new FailureException(exceptionName, exceptionDescription);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends Condition> FilterConditionMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.Condition> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Condition);
}
public static Get Get(software.amazon.awssdk.services.dynamodb.model.Get nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> projectionExpression;
projectionExpression = Objects.nonNull(nativeValue.projectionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.projectionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
return new Get(key, tableName, projectionExpression, expressionAttributeNames);
}
public static GetItemInput GetItemInput(GetItemRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> attributesToGet;
attributesToGet = (Objects.nonNull(nativeValue.attributesToGet()) && nativeValue.attributesToGet().size() > 0) ?
Option.create_Some(ToDafny.AttributeNameList(nativeValue.attributesToGet()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<DafnySequence<? extends Character>> projectionExpression;
projectionExpression = Objects.nonNull(nativeValue.projectionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.projectionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
return new GetItemInput(tableName, key, attributesToGet, consistentRead, returnConsumedCapacity, projectionExpression, expressionAttributeNames);
}
public static GetItemOutput GetItemOutput(GetItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> item;
item = (Objects.nonNull(nativeValue.item()) && nativeValue.item().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.item()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
return new GetItemOutput(item, consumedCapacity);
}
public static GlobalSecondaryIndex GlobalSecondaryIndex(
software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndex nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
Projection projection;
projection = ToDafny.Projection(nativeValue.projection());
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
return new GlobalSecondaryIndex(indexName, keySchema, projection, provisionedThroughput);
}
public static GlobalSecondaryIndexAutoScalingUpdate GlobalSecondaryIndexAutoScalingUpdate(
software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexAutoScalingUpdate nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> provisionedWriteCapacityAutoScalingUpdate;
provisionedWriteCapacityAutoScalingUpdate = Objects.nonNull(nativeValue.provisionedWriteCapacityAutoScalingUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.provisionedWriteCapacityAutoScalingUpdate()))
: Option.create_None();
return new GlobalSecondaryIndexAutoScalingUpdate(indexName, provisionedWriteCapacityAutoScalingUpdate);
}
public static DafnySequence<? extends GlobalSecondaryIndexAutoScalingUpdate> GlobalSecondaryIndexAutoScalingUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexAutoScalingUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalSecondaryIndexAutoScalingUpdate,
GlobalSecondaryIndexAutoScalingUpdate._typeDescriptor());
}
public static GlobalSecondaryIndexDescription GlobalSecondaryIndexDescription(
software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexDescription nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends KeySchemaElement>> keySchema;
keySchema = (Objects.nonNull(nativeValue.keySchema()) && nativeValue.keySchema().size() > 0) ?
Option.create_Some(ToDafny.KeySchema(nativeValue.keySchema()))
: Option.create_None();
Option<Projection> projection;
projection = Objects.nonNull(nativeValue.projection()) ?
Option.create_Some(ToDafny.Projection(nativeValue.projection()))
: Option.create_None();
Option<IndexStatus> indexStatus;
indexStatus = Objects.nonNull(nativeValue.indexStatus()) ?
Option.create_Some(ToDafny.IndexStatus(nativeValue.indexStatus()))
: Option.create_None();
Option<Boolean> backfilling;
backfilling = Objects.nonNull(nativeValue.backfilling()) ?
Option.create_Some((nativeValue.backfilling()))
: Option.create_None();
Option<ProvisionedThroughputDescription> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughputDescription(nativeValue.provisionedThroughput()))
: Option.create_None();
Option<Long> indexSizeBytes;
indexSizeBytes = Objects.nonNull(nativeValue.indexSizeBytes()) ?
Option.create_Some((nativeValue.indexSizeBytes()))
: Option.create_None();
Option<Long> itemCount;
itemCount = Objects.nonNull(nativeValue.itemCount()) ?
Option.create_Some((nativeValue.itemCount()))
: Option.create_None();
Option<DafnySequence<? extends Character>> indexArn;
indexArn = Objects.nonNull(nativeValue.indexArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexArn()))
: Option.create_None();
return new GlobalSecondaryIndexDescription(indexName, keySchema, projection, indexStatus, backfilling, provisionedThroughput, indexSizeBytes, itemCount, indexArn);
}
public static DafnySequence<? extends GlobalSecondaryIndexDescription> GlobalSecondaryIndexDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalSecondaryIndexDescription,
GlobalSecondaryIndexDescription._typeDescriptor());
}
public static DafnySequence<? extends GlobalSecondaryIndexInfo> GlobalSecondaryIndexes(
List<software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexInfo> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalSecondaryIndexInfo,
GlobalSecondaryIndexInfo._typeDescriptor());
}
public static GlobalSecondaryIndexInfo GlobalSecondaryIndexInfo(
software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexInfo nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends KeySchemaElement>> keySchema;
keySchema = (Objects.nonNull(nativeValue.keySchema()) && nativeValue.keySchema().size() > 0) ?
Option.create_Some(ToDafny.KeySchema(nativeValue.keySchema()))
: Option.create_None();
Option<Projection> projection;
projection = Objects.nonNull(nativeValue.projection()) ?
Option.create_Some(ToDafny.Projection(nativeValue.projection()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
return new GlobalSecondaryIndexInfo(indexName, keySchema, projection, provisionedThroughput);
}
public static DafnySequence<? extends GlobalSecondaryIndex> GlobalSecondaryIndexList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndex> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalSecondaryIndex,
GlobalSecondaryIndex._typeDescriptor());
}
public static GlobalSecondaryIndexUpdate GlobalSecondaryIndexUpdate(
software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexUpdate nativeValue) {
Option<UpdateGlobalSecondaryIndexAction> update;
update = Objects.nonNull(nativeValue.update()) ?
Option.create_Some(ToDafny.UpdateGlobalSecondaryIndexAction(nativeValue.update()))
: Option.create_None();
Option<CreateGlobalSecondaryIndexAction> create;
create = Objects.nonNull(nativeValue.create()) ?
Option.create_Some(ToDafny.CreateGlobalSecondaryIndexAction(nativeValue.create()))
: Option.create_None();
Option<DeleteGlobalSecondaryIndexAction> delete;
delete = Objects.nonNull(nativeValue.delete()) ?
Option.create_Some(ToDafny.DeleteGlobalSecondaryIndexAction(nativeValue.delete()))
: Option.create_None();
return new GlobalSecondaryIndexUpdate(update, create, delete);
}
public static DafnySequence<? extends GlobalSecondaryIndexUpdate> GlobalSecondaryIndexUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalSecondaryIndexUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalSecondaryIndexUpdate,
GlobalSecondaryIndexUpdate._typeDescriptor());
}
public static GlobalTable GlobalTable(
software.amazon.awssdk.services.dynamodb.model.GlobalTable nativeValue) {
Option<DafnySequence<? extends Character>> globalTableName;
globalTableName = Objects.nonNull(nativeValue.globalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName()))
: Option.create_None();
Option<DafnySequence<? extends Replica>> replicationGroup;
replicationGroup = (Objects.nonNull(nativeValue.replicationGroup()) && nativeValue.replicationGroup().size() > 0) ?
Option.create_Some(ToDafny.ReplicaList(nativeValue.replicationGroup()))
: Option.create_None();
return new GlobalTable(globalTableName, replicationGroup);
}
public static GlobalTableDescription GlobalTableDescription(
software.amazon.awssdk.services.dynamodb.model.GlobalTableDescription nativeValue) {
Option<DafnySequence<? extends ReplicaDescription>> replicationGroup;
replicationGroup = (Objects.nonNull(nativeValue.replicationGroup()) && nativeValue.replicationGroup().size() > 0) ?
Option.create_Some(ToDafny.ReplicaDescriptionList(nativeValue.replicationGroup()))
: Option.create_None();
Option<DafnySequence<? extends Character>> globalTableArn;
globalTableArn = Objects.nonNull(nativeValue.globalTableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDateTime;
creationDateTime = Objects.nonNull(nativeValue.creationDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDateTime()))
: Option.create_None();
Option<GlobalTableStatus> globalTableStatus;
globalTableStatus = Objects.nonNull(nativeValue.globalTableStatus()) ?
Option.create_Some(ToDafny.GlobalTableStatus(nativeValue.globalTableStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> globalTableName;
globalTableName = Objects.nonNull(nativeValue.globalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName()))
: Option.create_None();
return new GlobalTableDescription(replicationGroup, globalTableArn, creationDateTime, globalTableStatus, globalTableName);
}
public static GlobalTableGlobalSecondaryIndexSettingsUpdate GlobalTableGlobalSecondaryIndexSettingsUpdate(
software.amazon.awssdk.services.dynamodb.model.GlobalTableGlobalSecondaryIndexSettingsUpdate nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
Option<Long> provisionedWriteCapacityUnits;
provisionedWriteCapacityUnits = Objects.nonNull(nativeValue.provisionedWriteCapacityUnits()) ?
Option.create_Some((nativeValue.provisionedWriteCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> provisionedWriteCapacityAutoScalingSettingsUpdate;
provisionedWriteCapacityAutoScalingSettingsUpdate = Objects.nonNull(nativeValue.provisionedWriteCapacityAutoScalingSettingsUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.provisionedWriteCapacityAutoScalingSettingsUpdate()))
: Option.create_None();
return new GlobalTableGlobalSecondaryIndexSettingsUpdate(indexName, provisionedWriteCapacityUnits, provisionedWriteCapacityAutoScalingSettingsUpdate);
}
public static DafnySequence<? extends GlobalTableGlobalSecondaryIndexSettingsUpdate> GlobalTableGlobalSecondaryIndexSettingsUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalTableGlobalSecondaryIndexSettingsUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalTableGlobalSecondaryIndexSettingsUpdate,
GlobalTableGlobalSecondaryIndexSettingsUpdate._typeDescriptor());
}
public static DafnySequence<? extends GlobalTable> GlobalTableList(
List<software.amazon.awssdk.services.dynamodb.model.GlobalTable> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::GlobalTable,
GlobalTable._typeDescriptor());
}
public static ImportSummary ImportSummary(
software.amazon.awssdk.services.dynamodb.model.ImportSummary nativeValue) {
Option<DafnySequence<? extends Character>> importArn;
importArn = Objects.nonNull(nativeValue.importArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.importArn()))
: Option.create_None();
Option<ImportStatus> importStatus;
importStatus = Objects.nonNull(nativeValue.importStatus()) ?
Option.create_Some(ToDafny.ImportStatus(nativeValue.importStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<S3BucketSource> s3BucketSource;
s3BucketSource = Objects.nonNull(nativeValue.s3BucketSource()) ?
Option.create_Some(ToDafny.S3BucketSource(nativeValue.s3BucketSource()))
: Option.create_None();
Option<DafnySequence<? extends Character>> cloudWatchLogGroupArn;
cloudWatchLogGroupArn = Objects.nonNull(nativeValue.cloudWatchLogGroupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudWatchLogGroupArn()))
: Option.create_None();
Option<InputFormat> inputFormat;
inputFormat = Objects.nonNull(nativeValue.inputFormat()) ?
Option.create_Some(ToDafny.InputFormat(nativeValue.inputFormat()))
: Option.create_None();
Option<DafnySequence<? extends Character>> startTime;
startTime = Objects.nonNull(nativeValue.startTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.startTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> endTime;
endTime = Objects.nonNull(nativeValue.endTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.endTime()))
: Option.create_None();
return new ImportSummary(importArn, importStatus, tableArn, s3BucketSource, cloudWatchLogGroupArn, inputFormat, startTime, endTime);
}
public static DafnySequence<? extends ImportSummary> ImportSummaryList(
List<software.amazon.awssdk.services.dynamodb.model.ImportSummary> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ImportSummary,
ImportSummary._typeDescriptor());
}
public static ImportTableDescription ImportTableDescription(
software.amazon.awssdk.services.dynamodb.model.ImportTableDescription nativeValue) {
Option<DafnySequence<? extends Character>> importArn;
importArn = Objects.nonNull(nativeValue.importArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.importArn()))
: Option.create_None();
Option<ImportStatus> importStatus;
importStatus = Objects.nonNull(nativeValue.importStatus()) ?
Option.create_Some(ToDafny.ImportStatus(nativeValue.importStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableId;
tableId = Objects.nonNull(nativeValue.tableId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableId()))
: Option.create_None();
Option<DafnySequence<? extends Character>> clientToken;
clientToken = Objects.nonNull(nativeValue.clientToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientToken()))
: Option.create_None();
Option<S3BucketSource> s3BucketSource;
s3BucketSource = Objects.nonNull(nativeValue.s3BucketSource()) ?
Option.create_Some(ToDafny.S3BucketSource(nativeValue.s3BucketSource()))
: Option.create_None();
Option<Long> errorCount;
errorCount = Objects.nonNull(nativeValue.errorCount()) ?
Option.create_Some((nativeValue.errorCount()))
: Option.create_None();
Option<DafnySequence<? extends Character>> cloudWatchLogGroupArn;
cloudWatchLogGroupArn = Objects.nonNull(nativeValue.cloudWatchLogGroupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.cloudWatchLogGroupArn()))
: Option.create_None();
Option<InputFormat> inputFormat;
inputFormat = Objects.nonNull(nativeValue.inputFormat()) ?
Option.create_Some(ToDafny.InputFormat(nativeValue.inputFormat()))
: Option.create_None();
Option<InputFormatOptions> inputFormatOptions;
inputFormatOptions = Objects.nonNull(nativeValue.inputFormatOptions()) ?
Option.create_Some(ToDafny.InputFormatOptions(nativeValue.inputFormatOptions()))
: Option.create_None();
Option<InputCompressionType> inputCompressionType;
inputCompressionType = Objects.nonNull(nativeValue.inputCompressionType()) ?
Option.create_Some(ToDafny.InputCompressionType(nativeValue.inputCompressionType()))
: Option.create_None();
Option<TableCreationParameters> tableCreationParameters;
tableCreationParameters = Objects.nonNull(nativeValue.tableCreationParameters()) ?
Option.create_Some(ToDafny.TableCreationParameters(nativeValue.tableCreationParameters()))
: Option.create_None();
Option<DafnySequence<? extends Character>> startTime;
startTime = Objects.nonNull(nativeValue.startTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.startTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> endTime;
endTime = Objects.nonNull(nativeValue.endTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.endTime()))
: Option.create_None();
Option<Long> processedSizeBytes;
processedSizeBytes = Objects.nonNull(nativeValue.processedSizeBytes()) ?
Option.create_Some((nativeValue.processedSizeBytes()))
: Option.create_None();
Option<Long> processedItemCount;
processedItemCount = Objects.nonNull(nativeValue.processedItemCount()) ?
Option.create_Some((nativeValue.processedItemCount()))
: Option.create_None();
Option<Long> importedItemCount;
importedItemCount = Objects.nonNull(nativeValue.importedItemCount()) ?
Option.create_Some((nativeValue.importedItemCount()))
: Option.create_None();
Option<DafnySequence<? extends Character>> failureCode;
failureCode = Objects.nonNull(nativeValue.failureCode()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.failureCode()))
: Option.create_None();
Option<DafnySequence<? extends Character>> failureMessage;
failureMessage = Objects.nonNull(nativeValue.failureMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.failureMessage()))
: Option.create_None();
return new ImportTableDescription(importArn, importStatus, tableArn, tableId, clientToken, s3BucketSource, errorCount, cloudWatchLogGroupArn, inputFormat, inputFormatOptions, inputCompressionType, tableCreationParameters, startTime, endTime, processedSizeBytes, processedItemCount, importedItemCount, failureCode, failureMessage);
}
public static ImportTableInput ImportTableInput(ImportTableRequest nativeValue) {
Option<DafnySequence<? extends Character>> clientToken;
clientToken = Objects.nonNull(nativeValue.clientToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientToken()))
: Option.create_None();
S3BucketSource s3BucketSource;
s3BucketSource = ToDafny.S3BucketSource(nativeValue.s3BucketSource());
InputFormat inputFormat;
inputFormat = ToDafny.InputFormat(nativeValue.inputFormat());
Option<InputFormatOptions> inputFormatOptions;
inputFormatOptions = Objects.nonNull(nativeValue.inputFormatOptions()) ?
Option.create_Some(ToDafny.InputFormatOptions(nativeValue.inputFormatOptions()))
: Option.create_None();
Option<InputCompressionType> inputCompressionType;
inputCompressionType = Objects.nonNull(nativeValue.inputCompressionType()) ?
Option.create_Some(ToDafny.InputCompressionType(nativeValue.inputCompressionType()))
: Option.create_None();
TableCreationParameters tableCreationParameters;
tableCreationParameters = ToDafny.TableCreationParameters(nativeValue.tableCreationParameters());
return new ImportTableInput(clientToken, s3BucketSource, inputFormat, inputFormatOptions, inputCompressionType, tableCreationParameters);
}
public static ImportTableOutput ImportTableOutput(ImportTableResponse nativeValue) {
ImportTableDescription importTableDescription;
importTableDescription = ToDafny.ImportTableDescription(nativeValue.importTableDescription());
return new ImportTableOutput(importTableDescription);
}
public static InputFormatOptions InputFormatOptions(
software.amazon.awssdk.services.dynamodb.model.InputFormatOptions nativeValue) {
Option<CsvOptions> csv;
csv = Objects.nonNull(nativeValue.csv()) ?
Option.create_Some(ToDafny.CsvOptions(nativeValue.csv()))
: Option.create_None();
return new InputFormatOptions(csv);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> ItemCollectionKeyAttributeMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static ItemCollectionMetrics ItemCollectionMetrics(
software.amazon.awssdk.services.dynamodb.model.ItemCollectionMetrics nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> itemCollectionKey;
itemCollectionKey = (Objects.nonNull(nativeValue.itemCollectionKey()) && nativeValue.itemCollectionKey().size() > 0) ?
Option.create_Some(ToDafny.ItemCollectionKeyAttributeMap(nativeValue.itemCollectionKey()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Byte>>> sizeEstimateRangeGB;
sizeEstimateRangeGB = (Objects.nonNull(nativeValue.sizeEstimateRangeGB()) && nativeValue.sizeEstimateRangeGB().size() > 0) ?
Option.create_Some(ToDafny.ItemCollectionSizeEstimateRange(nativeValue.sizeEstimateRangeGB()))
: Option.create_None();
return new ItemCollectionMetrics(itemCollectionKey, sizeEstimateRangeGB);
}
public static DafnySequence<? extends ItemCollectionMetrics> ItemCollectionMetricsMultiple(
List<software.amazon.awssdk.services.dynamodb.model.ItemCollectionMetrics> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ItemCollectionMetrics,
ItemCollectionMetrics._typeDescriptor());
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends ItemCollectionMetrics>> ItemCollectionMetricsPerTable(
Map<String, List<software.amazon.awssdk.services.dynamodb.model.ItemCollectionMetrics>> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ItemCollectionMetricsMultiple);
}
public static DafnySequence<? extends DafnySequence<? extends Byte>> ItemCollectionSizeEstimateRange(
List<Double> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::Double,
ItemCollectionSizeEstimateBound._typeDescriptor());
}
@SuppressWarnings("unchecked")
public static DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> ItemList(
List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>> nativeValue) {
return
(dafny.DafnySequence<? extends dafny.DafnyMap<? extends dafny.DafnySequence<? extends java.lang.Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)
software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeMap,
TypeDescriptor.referenceWithInitializer(dafny.DafnyMap.class, () -> dafny.DafnyMap.<dafny.DafnySequence<? extends Character>,AttributeValue> empty()));
}
public static ItemResponse ItemResponse(
software.amazon.awssdk.services.dynamodb.model.ItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> item;
item = (Objects.nonNull(nativeValue.item()) && nativeValue.item().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.item()))
: Option.create_None();
return new ItemResponse(item);
}
public static DafnySequence<? extends ItemResponse> ItemResponseList(
List<software.amazon.awssdk.services.dynamodb.model.ItemResponse> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ItemResponse,
ItemResponse._typeDescriptor());
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> Key(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends Condition> KeyConditions(
Map<String, software.amazon.awssdk.services.dynamodb.model.Condition> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Condition);
}
@SuppressWarnings("unchecked")
public static DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> KeyList(
List<Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue>> nativeValue) {
return
(dafny.DafnySequence<? extends dafny.DafnyMap<? extends dafny.DafnySequence<? extends java.lang.Character>, ? extends software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeValue>>)
software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Key,
TypeDescriptor.referenceWithInitializer(dafny.DafnyMap.class, () -> dafny.DafnyMap.<dafny.DafnySequence<? extends Character>,AttributeValue> empty()));
}
public static KeysAndAttributes KeysAndAttributes(
software.amazon.awssdk.services.dynamodb.model.KeysAndAttributes nativeValue) {
DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> keys;
keys = ToDafny.KeyList(nativeValue.keys());
Option<DafnySequence<? extends DafnySequence<? extends Character>>> attributesToGet;
attributesToGet = (Objects.nonNull(nativeValue.attributesToGet()) && nativeValue.attributesToGet().size() > 0) ?
Option.create_Some(ToDafny.AttributeNameList(nativeValue.attributesToGet()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
Option<DafnySequence<? extends Character>> projectionExpression;
projectionExpression = Objects.nonNull(nativeValue.projectionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.projectionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
return new KeysAndAttributes(keys, attributesToGet, consistentRead, projectionExpression, expressionAttributeNames);
}
public static DafnySequence<? extends KeySchemaElement> KeySchema(
List<software.amazon.awssdk.services.dynamodb.model.KeySchemaElement> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::KeySchemaElement,
KeySchemaElement._typeDescriptor());
}
public static KeySchemaElement KeySchemaElement(
software.amazon.awssdk.services.dynamodb.model.KeySchemaElement nativeValue) {
DafnySequence<? extends Character> attributeName;
attributeName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.attributeName());
KeyType keyType;
keyType = ToDafny.KeyType(nativeValue.keyType());
return new KeySchemaElement(attributeName, keyType);
}
public static KinesisDataStreamDestination KinesisDataStreamDestination(
software.amazon.awssdk.services.dynamodb.model.KinesisDataStreamDestination nativeValue) {
Option<DafnySequence<? extends Character>> streamArn;
streamArn = Objects.nonNull(nativeValue.streamArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.streamArn()))
: Option.create_None();
Option<DestinationStatus> destinationStatus;
destinationStatus = Objects.nonNull(nativeValue.destinationStatus()) ?
Option.create_Some(ToDafny.DestinationStatus(nativeValue.destinationStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> destinationStatusDescription;
destinationStatusDescription = Objects.nonNull(nativeValue.destinationStatusDescription()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.destinationStatusDescription()))
: Option.create_None();
return new KinesisDataStreamDestination(streamArn, destinationStatus, destinationStatusDescription);
}
public static DafnySequence<? extends KinesisDataStreamDestination> KinesisDataStreamDestinations(
List<software.amazon.awssdk.services.dynamodb.model.KinesisDataStreamDestination> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::KinesisDataStreamDestination,
KinesisDataStreamDestination._typeDescriptor());
}
public static DafnySequence<? extends AttributeValue> ListAttributeValue(
List<software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue,
AttributeValue._typeDescriptor());
}
public static ListBackupsInput ListBackupsInput(ListBackupsRequest nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> timeRangeLowerBound;
timeRangeLowerBound = Objects.nonNull(nativeValue.timeRangeLowerBound()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.timeRangeLowerBound()))
: Option.create_None();
Option<DafnySequence<? extends Character>> timeRangeUpperBound;
timeRangeUpperBound = Objects.nonNull(nativeValue.timeRangeUpperBound()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.timeRangeUpperBound()))
: Option.create_None();
Option<DafnySequence<? extends Character>> exclusiveStartBackupArn;
exclusiveStartBackupArn = Objects.nonNull(nativeValue.exclusiveStartBackupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exclusiveStartBackupArn()))
: Option.create_None();
Option<BackupTypeFilter> backupType;
backupType = Objects.nonNull(nativeValue.backupType()) ?
Option.create_Some(ToDafny.BackupTypeFilter(nativeValue.backupType()))
: Option.create_None();
return new ListBackupsInput(tableName, limit, timeRangeLowerBound, timeRangeUpperBound, exclusiveStartBackupArn, backupType);
}
public static ListBackupsOutput ListBackupsOutput(ListBackupsResponse nativeValue) {
Option<DafnySequence<? extends BackupSummary>> backupSummaries;
backupSummaries = (Objects.nonNull(nativeValue.backupSummaries()) && nativeValue.backupSummaries().size() > 0) ?
Option.create_Some(ToDafny.BackupSummaries(nativeValue.backupSummaries()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastEvaluatedBackupArn;
lastEvaluatedBackupArn = Objects.nonNull(nativeValue.lastEvaluatedBackupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastEvaluatedBackupArn()))
: Option.create_None();
return new ListBackupsOutput(backupSummaries, lastEvaluatedBackupArn);
}
public static ListContributorInsightsInput ListContributorInsightsInput(
ListContributorInsightsRequest nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
Option<Integer> maxResults;
maxResults = Objects.nonNull(nativeValue.maxResults()) ?
Option.create_Some((nativeValue.maxResults()))
: Option.create_None();
return new ListContributorInsightsInput(tableName, nextToken, maxResults);
}
public static ListContributorInsightsOutput ListContributorInsightsOutput(
ListContributorInsightsResponse nativeValue) {
Option<DafnySequence<? extends ContributorInsightsSummary>> contributorInsightsSummaries;
contributorInsightsSummaries = (Objects.nonNull(nativeValue.contributorInsightsSummaries()) && nativeValue.contributorInsightsSummaries().size() > 0) ?
Option.create_Some(ToDafny.ContributorInsightsSummaries(nativeValue.contributorInsightsSummaries()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListContributorInsightsOutput(contributorInsightsSummaries, nextToken);
}
public static ListExportsInput ListExportsInput(ListExportsRequest nativeValue) {
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<Integer> maxResults;
maxResults = Objects.nonNull(nativeValue.maxResults()) ?
Option.create_Some((nativeValue.maxResults()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListExportsInput(tableArn, maxResults, nextToken);
}
public static ListExportsOutput ListExportsOutput(ListExportsResponse nativeValue) {
Option<DafnySequence<? extends ExportSummary>> exportSummaries;
exportSummaries = (Objects.nonNull(nativeValue.exportSummaries()) && nativeValue.exportSummaries().size() > 0) ?
Option.create_Some(ToDafny.ExportSummaries(nativeValue.exportSummaries()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListExportsOutput(exportSummaries, nextToken);
}
public static ListGlobalTablesInput ListGlobalTablesInput(ListGlobalTablesRequest nativeValue) {
Option<DafnySequence<? extends Character>> exclusiveStartGlobalTableName;
exclusiveStartGlobalTableName = Objects.nonNull(nativeValue.exclusiveStartGlobalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exclusiveStartGlobalTableName()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<DafnySequence<? extends Character>> regionName;
regionName = Objects.nonNull(nativeValue.regionName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName()))
: Option.create_None();
return new ListGlobalTablesInput(exclusiveStartGlobalTableName, limit, regionName);
}
public static ListGlobalTablesOutput ListGlobalTablesOutput(
ListGlobalTablesResponse nativeValue) {
Option<DafnySequence<? extends GlobalTable>> globalTables;
globalTables = (Objects.nonNull(nativeValue.globalTables()) && nativeValue.globalTables().size() > 0) ?
Option.create_Some(ToDafny.GlobalTableList(nativeValue.globalTables()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastEvaluatedGlobalTableName;
lastEvaluatedGlobalTableName = Objects.nonNull(nativeValue.lastEvaluatedGlobalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastEvaluatedGlobalTableName()))
: Option.create_None();
return new ListGlobalTablesOutput(globalTables, lastEvaluatedGlobalTableName);
}
public static ListImportsInput ListImportsInput(ListImportsRequest nativeValue) {
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<Integer> pageSize;
pageSize = Objects.nonNull(nativeValue.pageSize()) ?
Option.create_Some((nativeValue.pageSize()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListImportsInput(tableArn, pageSize, nextToken);
}
public static ListImportsOutput ListImportsOutput(ListImportsResponse nativeValue) {
Option<DafnySequence<? extends ImportSummary>> importSummaryList;
importSummaryList = (Objects.nonNull(nativeValue.importSummaryList()) && nativeValue.importSummaryList().size() > 0) ?
Option.create_Some(ToDafny.ImportSummaryList(nativeValue.importSummaryList()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListImportsOutput(importSummaryList, nextToken);
}
public static ListTablesInput ListTablesInput(ListTablesRequest nativeValue) {
Option<DafnySequence<? extends Character>> exclusiveStartTableName;
exclusiveStartTableName = Objects.nonNull(nativeValue.exclusiveStartTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.exclusiveStartTableName()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
return new ListTablesInput(exclusiveStartTableName, limit);
}
public static ListTablesOutput ListTablesOutput(ListTablesResponse nativeValue) {
Option<DafnySequence<? extends DafnySequence<? extends Character>>> tableNames;
tableNames = (Objects.nonNull(nativeValue.tableNames()) && nativeValue.tableNames().size() > 0) ?
Option.create_Some(ToDafny.TableNameList(nativeValue.tableNames()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastEvaluatedTableName;
lastEvaluatedTableName = Objects.nonNull(nativeValue.lastEvaluatedTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastEvaluatedTableName()))
: Option.create_None();
return new ListTablesOutput(tableNames, lastEvaluatedTableName);
}
public static ListTagsOfResourceInput ListTagsOfResourceInput(
ListTagsOfResourceRequest nativeValue) {
DafnySequence<? extends Character> resourceArn;
resourceArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.resourceArn());
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListTagsOfResourceInput(resourceArn, nextToken);
}
public static ListTagsOfResourceOutput ListTagsOfResourceOutput(
ListTagsOfResourceResponse nativeValue) {
Option<DafnySequence<? extends Tag>> tags;
tags = (Objects.nonNull(nativeValue.tags()) && nativeValue.tags().size() > 0) ?
Option.create_Some(ToDafny.TagList(nativeValue.tags()))
: Option.create_None();
Option<DafnySequence<? extends Character>> nextToken;
nextToken = Objects.nonNull(nativeValue.nextToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.nextToken()))
: Option.create_None();
return new ListTagsOfResourceOutput(tags, nextToken);
}
public static LocalSecondaryIndex LocalSecondaryIndex(
software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndex nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
Projection projection;
projection = ToDafny.Projection(nativeValue.projection());
return new LocalSecondaryIndex(indexName, keySchema, projection);
}
public static LocalSecondaryIndexDescription LocalSecondaryIndexDescription(
software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexDescription nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends KeySchemaElement>> keySchema;
keySchema = (Objects.nonNull(nativeValue.keySchema()) && nativeValue.keySchema().size() > 0) ?
Option.create_Some(ToDafny.KeySchema(nativeValue.keySchema()))
: Option.create_None();
Option<Projection> projection;
projection = Objects.nonNull(nativeValue.projection()) ?
Option.create_Some(ToDafny.Projection(nativeValue.projection()))
: Option.create_None();
Option<Long> indexSizeBytes;
indexSizeBytes = Objects.nonNull(nativeValue.indexSizeBytes()) ?
Option.create_Some((nativeValue.indexSizeBytes()))
: Option.create_None();
Option<Long> itemCount;
itemCount = Objects.nonNull(nativeValue.itemCount()) ?
Option.create_Some((nativeValue.itemCount()))
: Option.create_None();
Option<DafnySequence<? extends Character>> indexArn;
indexArn = Objects.nonNull(nativeValue.indexArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexArn()))
: Option.create_None();
return new LocalSecondaryIndexDescription(indexName, keySchema, projection, indexSizeBytes, itemCount, indexArn);
}
public static DafnySequence<? extends LocalSecondaryIndexDescription> LocalSecondaryIndexDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::LocalSecondaryIndexDescription,
LocalSecondaryIndexDescription._typeDescriptor());
}
public static DafnySequence<? extends LocalSecondaryIndexInfo> LocalSecondaryIndexes(
List<software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexInfo> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::LocalSecondaryIndexInfo,
LocalSecondaryIndexInfo._typeDescriptor());
}
public static LocalSecondaryIndexInfo LocalSecondaryIndexInfo(
software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndexInfo nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends KeySchemaElement>> keySchema;
keySchema = (Objects.nonNull(nativeValue.keySchema()) && nativeValue.keySchema().size() > 0) ?
Option.create_Some(ToDafny.KeySchema(nativeValue.keySchema()))
: Option.create_None();
Option<Projection> projection;
projection = Objects.nonNull(nativeValue.projection()) ?
Option.create_Some(ToDafny.Projection(nativeValue.projection()))
: Option.create_None();
return new LocalSecondaryIndexInfo(indexName, keySchema, projection);
}
public static DafnySequence<? extends LocalSecondaryIndex> LocalSecondaryIndexList(
List<software.amazon.awssdk.services.dynamodb.model.LocalSecondaryIndex> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::LocalSecondaryIndex,
LocalSecondaryIndex._typeDescriptor());
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> MapAttributeValue(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> NonKeyAttributeNameList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends DafnySequence<? extends Character>> NumberSetAttributeValue(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static ParameterizedStatement ParameterizedStatement(
software.amazon.awssdk.services.dynamodb.model.ParameterizedStatement nativeValue) {
DafnySequence<? extends Character> statement;
statement = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.statement());
Option<DafnySequence<? extends AttributeValue>> parameters;
parameters = (Objects.nonNull(nativeValue.parameters()) && nativeValue.parameters().size() > 0) ?
Option.create_Some(ToDafny.PreparedStatementParameters(nativeValue.parameters()))
: Option.create_None();
return new ParameterizedStatement(statement, parameters);
}
public static DafnySequence<? extends ParameterizedStatement> ParameterizedStatements(
List<software.amazon.awssdk.services.dynamodb.model.ParameterizedStatement> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ParameterizedStatement,
ParameterizedStatement._typeDescriptor());
}
public static DafnySequence<? extends BatchStatementRequest> PartiQLBatchRequest(
List<software.amazon.awssdk.services.dynamodb.model.BatchStatementRequest> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::BatchStatementRequest,
BatchStatementRequest._typeDescriptor());
}
public static DafnySequence<? extends BatchStatementResponse> PartiQLBatchResponse(
List<software.amazon.awssdk.services.dynamodb.model.BatchStatementResponse> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::BatchStatementResponse,
BatchStatementResponse._typeDescriptor());
}
public static PointInTimeRecoveryDescription PointInTimeRecoveryDescription(
software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryDescription nativeValue) {
Option<PointInTimeRecoveryStatus> pointInTimeRecoveryStatus;
pointInTimeRecoveryStatus = Objects.nonNull(nativeValue.pointInTimeRecoveryStatus()) ?
Option.create_Some(ToDafny.PointInTimeRecoveryStatus(nativeValue.pointInTimeRecoveryStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> earliestRestorableDateTime;
earliestRestorableDateTime = Objects.nonNull(nativeValue.earliestRestorableDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.earliestRestorableDateTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> latestRestorableDateTime;
latestRestorableDateTime = Objects.nonNull(nativeValue.latestRestorableDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.latestRestorableDateTime()))
: Option.create_None();
return new PointInTimeRecoveryDescription(pointInTimeRecoveryStatus, earliestRestorableDateTime, latestRestorableDateTime);
}
public static PointInTimeRecoverySpecification PointInTimeRecoverySpecification(
software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoverySpecification nativeValue) {
Boolean pointInTimeRecoveryEnabled;
pointInTimeRecoveryEnabled = (nativeValue.pointInTimeRecoveryEnabled());
return new PointInTimeRecoverySpecification(pointInTimeRecoveryEnabled);
}
public static DafnySequence<? extends AttributeValue> PreparedStatementParameters(
List<software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue,
AttributeValue._typeDescriptor());
}
public static Projection Projection(
software.amazon.awssdk.services.dynamodb.model.Projection nativeValue) {
Option<ProjectionType> projectionType;
projectionType = Objects.nonNull(nativeValue.projectionType()) ?
Option.create_Some(ToDafny.ProjectionType(nativeValue.projectionType()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> nonKeyAttributes;
nonKeyAttributes = (Objects.nonNull(nativeValue.nonKeyAttributes()) && nativeValue.nonKeyAttributes().size() > 0) ?
Option.create_Some(ToDafny.NonKeyAttributeNameList(nativeValue.nonKeyAttributes()))
: Option.create_None();
return new Projection(projectionType, nonKeyAttributes);
}
public static ProvisionedThroughput ProvisionedThroughput(
software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughput nativeValue) {
Long readCapacityUnits;
readCapacityUnits = (nativeValue.readCapacityUnits());
Long writeCapacityUnits;
writeCapacityUnits = (nativeValue.writeCapacityUnits());
return new ProvisionedThroughput(readCapacityUnits, writeCapacityUnits);
}
public static ProvisionedThroughputDescription ProvisionedThroughputDescription(
software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputDescription nativeValue) {
Option<DafnySequence<? extends Character>> lastIncreaseDateTime;
lastIncreaseDateTime = Objects.nonNull(nativeValue.lastIncreaseDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastIncreaseDateTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastDecreaseDateTime;
lastDecreaseDateTime = Objects.nonNull(nativeValue.lastDecreaseDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastDecreaseDateTime()))
: Option.create_None();
Option<Long> numberOfDecreasesToday;
numberOfDecreasesToday = Objects.nonNull(nativeValue.numberOfDecreasesToday()) ?
Option.create_Some((nativeValue.numberOfDecreasesToday()))
: Option.create_None();
Option<Long> readCapacityUnits;
readCapacityUnits = Objects.nonNull(nativeValue.readCapacityUnits()) ?
Option.create_Some((nativeValue.readCapacityUnits()))
: Option.create_None();
Option<Long> writeCapacityUnits;
writeCapacityUnits = Objects.nonNull(nativeValue.writeCapacityUnits()) ?
Option.create_Some((nativeValue.writeCapacityUnits()))
: Option.create_None();
return new ProvisionedThroughputDescription(lastIncreaseDateTime, lastDecreaseDateTime, numberOfDecreasesToday, readCapacityUnits, writeCapacityUnits);
}
public static ProvisionedThroughputOverride ProvisionedThroughputOverride(
software.amazon.awssdk.services.dynamodb.model.ProvisionedThroughputOverride nativeValue) {
Option<Long> readCapacityUnits;
readCapacityUnits = Objects.nonNull(nativeValue.readCapacityUnits()) ?
Option.create_Some((nativeValue.readCapacityUnits()))
: Option.create_None();
return new ProvisionedThroughputOverride(readCapacityUnits);
}
public static Put Put(software.amazon.awssdk.services.dynamodb.model.Put nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> item;
item = ToDafny.PutItemInputAttributeMap(nativeValue.item());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
Option<ReturnValuesOnConditionCheckFailure> returnValuesOnConditionCheckFailure;
returnValuesOnConditionCheckFailure = Objects.nonNull(nativeValue.returnValuesOnConditionCheckFailure()) ?
Option.create_Some(ToDafny.ReturnValuesOnConditionCheckFailure(nativeValue.returnValuesOnConditionCheckFailure()))
: Option.create_None();
return new Put(item, tableName, conditionExpression, expressionAttributeNames, expressionAttributeValues, returnValuesOnConditionCheckFailure);
}
public static PutItemInput PutItemInput(PutItemRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> item;
item = ToDafny.PutItemInputAttributeMap(nativeValue.item());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends ExpectedAttributeValue>> expected;
expected = (Objects.nonNull(nativeValue.expected()) && nativeValue.expected().size() > 0) ?
Option.create_Some(ToDafny.ExpectedAttributeMap(nativeValue.expected()))
: Option.create_None();
Option<ReturnValue> returnValues;
returnValues = Objects.nonNull(nativeValue.returnValues()) ?
Option.create_Some(ToDafny.ReturnValue(nativeValue.returnValues()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<ReturnItemCollectionMetrics> returnItemCollectionMetrics;
returnItemCollectionMetrics = Objects.nonNull(nativeValue.returnItemCollectionMetrics()) ?
Option.create_Some(ToDafny.ReturnItemCollectionMetrics(nativeValue.returnItemCollectionMetrics()))
: Option.create_None();
Option<ConditionalOperator> conditionalOperator;
conditionalOperator = Objects.nonNull(nativeValue.conditionalOperator()) ?
Option.create_Some(ToDafny.ConditionalOperator(nativeValue.conditionalOperator()))
: Option.create_None();
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
return new PutItemInput(tableName, item, expected, returnValues, returnConsumedCapacity, returnItemCollectionMetrics, conditionalOperator, conditionExpression, expressionAttributeNames, expressionAttributeValues);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> PutItemInputAttributeMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::AttributeValue);
}
public static PutItemOutput PutItemOutput(PutItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> attributes;
attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.attributes()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
Option<ItemCollectionMetrics> itemCollectionMetrics;
itemCollectionMetrics = Objects.nonNull(nativeValue.itemCollectionMetrics()) ?
Option.create_Some(ToDafny.ItemCollectionMetrics(nativeValue.itemCollectionMetrics()))
: Option.create_None();
return new PutItemOutput(attributes, consumedCapacity, itemCollectionMetrics);
}
public static PutRequest PutRequest(
software.amazon.awssdk.services.dynamodb.model.PutRequest nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> item;
item = ToDafny.PutItemInputAttributeMap(nativeValue.item());
return new PutRequest(item);
}
public static QueryInput QueryInput(QueryRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<Select> select;
select = Objects.nonNull(nativeValue.select()) ?
Option.create_Some(ToDafny.Select(nativeValue.select()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> attributesToGet;
attributesToGet = (Objects.nonNull(nativeValue.attributesToGet()) && nativeValue.attributesToGet().size() > 0) ?
Option.create_Some(ToDafny.AttributeNameList(nativeValue.attributesToGet()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends Condition>> keyConditions;
keyConditions = (Objects.nonNull(nativeValue.keyConditions()) && nativeValue.keyConditions().size() > 0) ?
Option.create_Some(ToDafny.KeyConditions(nativeValue.keyConditions()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends Condition>> queryFilter;
queryFilter = (Objects.nonNull(nativeValue.queryFilter()) && nativeValue.queryFilter().size() > 0) ?
Option.create_Some(ToDafny.FilterConditionMap(nativeValue.queryFilter()))
: Option.create_None();
Option<ConditionalOperator> conditionalOperator;
conditionalOperator = Objects.nonNull(nativeValue.conditionalOperator()) ?
Option.create_Some(ToDafny.ConditionalOperator(nativeValue.conditionalOperator()))
: Option.create_None();
Option<Boolean> scanIndexForward;
scanIndexForward = Objects.nonNull(nativeValue.scanIndexForward()) ?
Option.create_Some((nativeValue.scanIndexForward()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> exclusiveStartKey;
exclusiveStartKey = (Objects.nonNull(nativeValue.exclusiveStartKey()) && nativeValue.exclusiveStartKey().size() > 0) ?
Option.create_Some(ToDafny.Key(nativeValue.exclusiveStartKey()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<DafnySequence<? extends Character>> projectionExpression;
projectionExpression = Objects.nonNull(nativeValue.projectionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.projectionExpression()))
: Option.create_None();
Option<DafnySequence<? extends Character>> filterExpression;
filterExpression = Objects.nonNull(nativeValue.filterExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.filterExpression()))
: Option.create_None();
Option<DafnySequence<? extends Character>> keyConditionExpression;
keyConditionExpression = Objects.nonNull(nativeValue.keyConditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyConditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
return new QueryInput(tableName, indexName, select, attributesToGet, limit, consistentRead, keyConditions, queryFilter, conditionalOperator, scanIndexForward, exclusiveStartKey, returnConsumedCapacity, projectionExpression, filterExpression, keyConditionExpression, expressionAttributeNames, expressionAttributeValues);
}
public static QueryOutput QueryOutput(QueryResponse nativeValue) {
Option<DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>>> items;
items = (Objects.nonNull(nativeValue.items()) && nativeValue.items().size() > 0) ?
Option.create_Some(ToDafny.ItemList(nativeValue.items()))
: Option.create_None();
Option<Integer> count;
count = Objects.nonNull(nativeValue.count()) ?
Option.create_Some((nativeValue.count()))
: Option.create_None();
Option<Integer> scannedCount;
scannedCount = Objects.nonNull(nativeValue.scannedCount()) ?
Option.create_Some((nativeValue.scannedCount()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> lastEvaluatedKey;
lastEvaluatedKey = (Objects.nonNull(nativeValue.lastEvaluatedKey()) && nativeValue.lastEvaluatedKey().size() > 0) ?
Option.create_Some(ToDafny.Key(nativeValue.lastEvaluatedKey()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
return new QueryOutput(items, count, scannedCount, lastEvaluatedKey, consumedCapacity);
}
public static Replica Replica(
software.amazon.awssdk.services.dynamodb.model.Replica nativeValue) {
Option<DafnySequence<? extends Character>> regionName;
regionName = Objects.nonNull(nativeValue.regionName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName()))
: Option.create_None();
return new Replica(regionName);
}
public static ReplicaAutoScalingDescription ReplicaAutoScalingDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingDescription nativeValue) {
Option<DafnySequence<? extends Character>> regionName;
regionName = Objects.nonNull(nativeValue.regionName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndexAutoScalingDescription>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexAutoScalingDescriptionList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<AutoScalingSettingsDescription> replicaProvisionedReadCapacityAutoScalingSettings;
replicaProvisionedReadCapacityAutoScalingSettings = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.replicaProvisionedReadCapacityAutoScalingSettings()))
: Option.create_None();
Option<AutoScalingSettingsDescription> replicaProvisionedWriteCapacityAutoScalingSettings;
replicaProvisionedWriteCapacityAutoScalingSettings = Objects.nonNull(nativeValue.replicaProvisionedWriteCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.replicaProvisionedWriteCapacityAutoScalingSettings()))
: Option.create_None();
Option<ReplicaStatus> replicaStatus;
replicaStatus = Objects.nonNull(nativeValue.replicaStatus()) ?
Option.create_Some(ToDafny.ReplicaStatus(nativeValue.replicaStatus()))
: Option.create_None();
return new ReplicaAutoScalingDescription(regionName, globalSecondaryIndexes, replicaProvisionedReadCapacityAutoScalingSettings, replicaProvisionedWriteCapacityAutoScalingSettings, replicaStatus);
}
public static DafnySequence<? extends ReplicaAutoScalingDescription> ReplicaAutoScalingDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaAutoScalingDescription,
ReplicaAutoScalingDescription._typeDescriptor());
}
public static ReplicaAutoScalingUpdate ReplicaAutoScalingUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingUpdate nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndexAutoScalingUpdate>> replicaGlobalSecondaryIndexUpdates;
replicaGlobalSecondaryIndexUpdates = (Objects.nonNull(nativeValue.replicaGlobalSecondaryIndexUpdates()) && nativeValue.replicaGlobalSecondaryIndexUpdates().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexAutoScalingUpdateList(nativeValue.replicaGlobalSecondaryIndexUpdates()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> replicaProvisionedReadCapacityAutoScalingUpdate;
replicaProvisionedReadCapacityAutoScalingUpdate = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityAutoScalingUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.replicaProvisionedReadCapacityAutoScalingUpdate()))
: Option.create_None();
return new ReplicaAutoScalingUpdate(regionName, replicaGlobalSecondaryIndexUpdates, replicaProvisionedReadCapacityAutoScalingUpdate);
}
public static DafnySequence<? extends ReplicaAutoScalingUpdate> ReplicaAutoScalingUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaAutoScalingUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaAutoScalingUpdate,
ReplicaAutoScalingUpdate._typeDescriptor());
}
public static ReplicaDescription ReplicaDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaDescription nativeValue) {
Option<DafnySequence<? extends Character>> regionName;
regionName = Objects.nonNull(nativeValue.regionName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName()))
: Option.create_None();
Option<ReplicaStatus> replicaStatus;
replicaStatus = Objects.nonNull(nativeValue.replicaStatus()) ?
Option.create_Some(ToDafny.ReplicaStatus(nativeValue.replicaStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> replicaStatusDescription;
replicaStatusDescription = Objects.nonNull(nativeValue.replicaStatusDescription()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.replicaStatusDescription()))
: Option.create_None();
Option<DafnySequence<? extends Character>> replicaStatusPercentProgress;
replicaStatusPercentProgress = Objects.nonNull(nativeValue.replicaStatusPercentProgress()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.replicaStatusPercentProgress()))
: Option.create_None();
Option<DafnySequence<? extends Character>> kMSMasterKeyId;
kMSMasterKeyId = Objects.nonNull(nativeValue.kmsMasterKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsMasterKeyId()))
: Option.create_None();
Option<ProvisionedThroughputOverride> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughputOverride(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndexDescription>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexDescriptionList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<DafnySequence<? extends Character>> replicaInaccessibleDateTime;
replicaInaccessibleDateTime = Objects.nonNull(nativeValue.replicaInaccessibleDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.replicaInaccessibleDateTime()))
: Option.create_None();
Option<TableClassSummary> replicaTableClassSummary;
replicaTableClassSummary = Objects.nonNull(nativeValue.replicaTableClassSummary()) ?
Option.create_Some(ToDafny.TableClassSummary(nativeValue.replicaTableClassSummary()))
: Option.create_None();
return new ReplicaDescription(regionName, replicaStatus, replicaStatusDescription, replicaStatusPercentProgress, kMSMasterKeyId, provisionedThroughputOverride, globalSecondaryIndexes, replicaInaccessibleDateTime, replicaTableClassSummary);
}
public static DafnySequence<? extends ReplicaDescription> ReplicaDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaDescription,
ReplicaDescription._typeDescriptor());
}
public static ReplicaGlobalSecondaryIndex ReplicaGlobalSecondaryIndex(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndex nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
Option<ProvisionedThroughputOverride> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughputOverride(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndex(indexName, provisionedThroughputOverride);
}
public static ReplicaGlobalSecondaryIndexAutoScalingDescription ReplicaGlobalSecondaryIndexAutoScalingDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingDescription nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<IndexStatus> indexStatus;
indexStatus = Objects.nonNull(nativeValue.indexStatus()) ?
Option.create_Some(ToDafny.IndexStatus(nativeValue.indexStatus()))
: Option.create_None();
Option<AutoScalingSettingsDescription> provisionedReadCapacityAutoScalingSettings;
provisionedReadCapacityAutoScalingSettings = Objects.nonNull(nativeValue.provisionedReadCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.provisionedReadCapacityAutoScalingSettings()))
: Option.create_None();
Option<AutoScalingSettingsDescription> provisionedWriteCapacityAutoScalingSettings;
provisionedWriteCapacityAutoScalingSettings = Objects.nonNull(nativeValue.provisionedWriteCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.provisionedWriteCapacityAutoScalingSettings()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndexAutoScalingDescription(indexName, indexStatus, provisionedReadCapacityAutoScalingSettings, provisionedWriteCapacityAutoScalingSettings);
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndexAutoScalingDescription> ReplicaGlobalSecondaryIndexAutoScalingDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndexAutoScalingDescription,
ReplicaGlobalSecondaryIndexAutoScalingDescription._typeDescriptor());
}
public static ReplicaGlobalSecondaryIndexAutoScalingUpdate ReplicaGlobalSecondaryIndexAutoScalingUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingUpdate nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> provisionedReadCapacityAutoScalingUpdate;
provisionedReadCapacityAutoScalingUpdate = Objects.nonNull(nativeValue.provisionedReadCapacityAutoScalingUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.provisionedReadCapacityAutoScalingUpdate()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndexAutoScalingUpdate(indexName, provisionedReadCapacityAutoScalingUpdate);
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndexAutoScalingUpdate> ReplicaGlobalSecondaryIndexAutoScalingUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexAutoScalingUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndexAutoScalingUpdate,
ReplicaGlobalSecondaryIndexAutoScalingUpdate._typeDescriptor());
}
public static ReplicaGlobalSecondaryIndexDescription ReplicaGlobalSecondaryIndexDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexDescription nativeValue) {
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<ProvisionedThroughputOverride> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughputOverride(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndexDescription(indexName, provisionedThroughputOverride);
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndexDescription> ReplicaGlobalSecondaryIndexDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndexDescription,
ReplicaGlobalSecondaryIndexDescription._typeDescriptor());
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndex> ReplicaGlobalSecondaryIndexList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndex> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndex,
ReplicaGlobalSecondaryIndex._typeDescriptor());
}
public static ReplicaGlobalSecondaryIndexSettingsDescription ReplicaGlobalSecondaryIndexSettingsDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsDescription nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
Option<IndexStatus> indexStatus;
indexStatus = Objects.nonNull(nativeValue.indexStatus()) ?
Option.create_Some(ToDafny.IndexStatus(nativeValue.indexStatus()))
: Option.create_None();
Option<Long> provisionedReadCapacityUnits;
provisionedReadCapacityUnits = Objects.nonNull(nativeValue.provisionedReadCapacityUnits()) ?
Option.create_Some((nativeValue.provisionedReadCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsDescription> provisionedReadCapacityAutoScalingSettings;
provisionedReadCapacityAutoScalingSettings = Objects.nonNull(nativeValue.provisionedReadCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.provisionedReadCapacityAutoScalingSettings()))
: Option.create_None();
Option<Long> provisionedWriteCapacityUnits;
provisionedWriteCapacityUnits = Objects.nonNull(nativeValue.provisionedWriteCapacityUnits()) ?
Option.create_Some((nativeValue.provisionedWriteCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsDescription> provisionedWriteCapacityAutoScalingSettings;
provisionedWriteCapacityAutoScalingSettings = Objects.nonNull(nativeValue.provisionedWriteCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.provisionedWriteCapacityAutoScalingSettings()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndexSettingsDescription(indexName, indexStatus, provisionedReadCapacityUnits, provisionedReadCapacityAutoScalingSettings, provisionedWriteCapacityUnits, provisionedWriteCapacityAutoScalingSettings);
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndexSettingsDescription> ReplicaGlobalSecondaryIndexSettingsDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndexSettingsDescription,
ReplicaGlobalSecondaryIndexSettingsDescription._typeDescriptor());
}
public static ReplicaGlobalSecondaryIndexSettingsUpdate ReplicaGlobalSecondaryIndexSettingsUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsUpdate nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
Option<Long> provisionedReadCapacityUnits;
provisionedReadCapacityUnits = Objects.nonNull(nativeValue.provisionedReadCapacityUnits()) ?
Option.create_Some((nativeValue.provisionedReadCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> provisionedReadCapacityAutoScalingSettingsUpdate;
provisionedReadCapacityAutoScalingSettingsUpdate = Objects.nonNull(nativeValue.provisionedReadCapacityAutoScalingSettingsUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.provisionedReadCapacityAutoScalingSettingsUpdate()))
: Option.create_None();
return new ReplicaGlobalSecondaryIndexSettingsUpdate(indexName, provisionedReadCapacityUnits, provisionedReadCapacityAutoScalingSettingsUpdate);
}
public static DafnySequence<? extends ReplicaGlobalSecondaryIndexSettingsUpdate> ReplicaGlobalSecondaryIndexSettingsUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaGlobalSecondaryIndexSettingsUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaGlobalSecondaryIndexSettingsUpdate,
ReplicaGlobalSecondaryIndexSettingsUpdate._typeDescriptor());
}
public static DafnySequence<? extends Replica> ReplicaList(
List<software.amazon.awssdk.services.dynamodb.model.Replica> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Replica,
Replica._typeDescriptor());
}
public static ReplicaSettingsDescription ReplicaSettingsDescription(
software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsDescription nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
Option<ReplicaStatus> replicaStatus;
replicaStatus = Objects.nonNull(nativeValue.replicaStatus()) ?
Option.create_Some(ToDafny.ReplicaStatus(nativeValue.replicaStatus()))
: Option.create_None();
Option<BillingModeSummary> replicaBillingModeSummary;
replicaBillingModeSummary = Objects.nonNull(nativeValue.replicaBillingModeSummary()) ?
Option.create_Some(ToDafny.BillingModeSummary(nativeValue.replicaBillingModeSummary()))
: Option.create_None();
Option<Long> replicaProvisionedReadCapacityUnits;
replicaProvisionedReadCapacityUnits = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityUnits()) ?
Option.create_Some((nativeValue.replicaProvisionedReadCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsDescription> replicaProvisionedReadCapacityAutoScalingSettings;
replicaProvisionedReadCapacityAutoScalingSettings = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.replicaProvisionedReadCapacityAutoScalingSettings()))
: Option.create_None();
Option<Long> replicaProvisionedWriteCapacityUnits;
replicaProvisionedWriteCapacityUnits = Objects.nonNull(nativeValue.replicaProvisionedWriteCapacityUnits()) ?
Option.create_Some((nativeValue.replicaProvisionedWriteCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsDescription> replicaProvisionedWriteCapacityAutoScalingSettings;
replicaProvisionedWriteCapacityAutoScalingSettings = Objects.nonNull(nativeValue.replicaProvisionedWriteCapacityAutoScalingSettings()) ?
Option.create_Some(ToDafny.AutoScalingSettingsDescription(nativeValue.replicaProvisionedWriteCapacityAutoScalingSettings()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndexSettingsDescription>> replicaGlobalSecondaryIndexSettings;
replicaGlobalSecondaryIndexSettings = (Objects.nonNull(nativeValue.replicaGlobalSecondaryIndexSettings()) && nativeValue.replicaGlobalSecondaryIndexSettings().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexSettingsDescriptionList(nativeValue.replicaGlobalSecondaryIndexSettings()))
: Option.create_None();
Option<TableClassSummary> replicaTableClassSummary;
replicaTableClassSummary = Objects.nonNull(nativeValue.replicaTableClassSummary()) ?
Option.create_Some(ToDafny.TableClassSummary(nativeValue.replicaTableClassSummary()))
: Option.create_None();
return new ReplicaSettingsDescription(regionName, replicaStatus, replicaBillingModeSummary, replicaProvisionedReadCapacityUnits, replicaProvisionedReadCapacityAutoScalingSettings, replicaProvisionedWriteCapacityUnits, replicaProvisionedWriteCapacityAutoScalingSettings, replicaGlobalSecondaryIndexSettings, replicaTableClassSummary);
}
public static DafnySequence<? extends ReplicaSettingsDescription> ReplicaSettingsDescriptionList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsDescription> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaSettingsDescription,
ReplicaSettingsDescription._typeDescriptor());
}
public static ReplicaSettingsUpdate ReplicaSettingsUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsUpdate nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
Option<Long> replicaProvisionedReadCapacityUnits;
replicaProvisionedReadCapacityUnits = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityUnits()) ?
Option.create_Some((nativeValue.replicaProvisionedReadCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> replicaProvisionedReadCapacityAutoScalingSettingsUpdate;
replicaProvisionedReadCapacityAutoScalingSettingsUpdate = Objects.nonNull(nativeValue.replicaProvisionedReadCapacityAutoScalingSettingsUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.replicaProvisionedReadCapacityAutoScalingSettingsUpdate()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndexSettingsUpdate>> replicaGlobalSecondaryIndexSettingsUpdate;
replicaGlobalSecondaryIndexSettingsUpdate = (Objects.nonNull(nativeValue.replicaGlobalSecondaryIndexSettingsUpdate()) && nativeValue.replicaGlobalSecondaryIndexSettingsUpdate().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexSettingsUpdateList(nativeValue.replicaGlobalSecondaryIndexSettingsUpdate()))
: Option.create_None();
Option<TableClass> replicaTableClass;
replicaTableClass = Objects.nonNull(nativeValue.replicaTableClass()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.replicaTableClass()))
: Option.create_None();
return new ReplicaSettingsUpdate(regionName, replicaProvisionedReadCapacityUnits, replicaProvisionedReadCapacityAutoScalingSettingsUpdate, replicaGlobalSecondaryIndexSettingsUpdate, replicaTableClass);
}
public static DafnySequence<? extends ReplicaSettingsUpdate> ReplicaSettingsUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaSettingsUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaSettingsUpdate,
ReplicaSettingsUpdate._typeDescriptor());
}
public static ReplicationGroupUpdate ReplicationGroupUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicationGroupUpdate nativeValue) {
Option<CreateReplicationGroupMemberAction> create;
create = Objects.nonNull(nativeValue.create()) ?
Option.create_Some(ToDafny.CreateReplicationGroupMemberAction(nativeValue.create()))
: Option.create_None();
Option<UpdateReplicationGroupMemberAction> update;
update = Objects.nonNull(nativeValue.update()) ?
Option.create_Some(ToDafny.UpdateReplicationGroupMemberAction(nativeValue.update()))
: Option.create_None();
Option<DeleteReplicationGroupMemberAction> delete;
delete = Objects.nonNull(nativeValue.delete()) ?
Option.create_Some(ToDafny.DeleteReplicationGroupMemberAction(nativeValue.delete()))
: Option.create_None();
return new ReplicationGroupUpdate(create, update, delete);
}
public static DafnySequence<? extends ReplicationGroupUpdate> ReplicationGroupUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicationGroupUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicationGroupUpdate,
ReplicationGroupUpdate._typeDescriptor());
}
public static ReplicaUpdate ReplicaUpdate(
software.amazon.awssdk.services.dynamodb.model.ReplicaUpdate nativeValue) {
Option<CreateReplicaAction> create;
create = Objects.nonNull(nativeValue.create()) ?
Option.create_Some(ToDafny.CreateReplicaAction(nativeValue.create()))
: Option.create_None();
Option<DeleteReplicaAction> delete;
delete = Objects.nonNull(nativeValue.delete()) ?
Option.create_Some(ToDafny.DeleteReplicaAction(nativeValue.delete()))
: Option.create_None();
return new ReplicaUpdate(create, delete);
}
public static DafnySequence<? extends ReplicaUpdate> ReplicaUpdateList(
List<software.amazon.awssdk.services.dynamodb.model.ReplicaUpdate> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::ReplicaUpdate,
ReplicaUpdate._typeDescriptor());
}
public static RestoreSummary RestoreSummary(
software.amazon.awssdk.services.dynamodb.model.RestoreSummary nativeValue) {
Option<DafnySequence<? extends Character>> sourceBackupArn;
sourceBackupArn = Objects.nonNull(nativeValue.sourceBackupArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceBackupArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> sourceTableArn;
sourceTableArn = Objects.nonNull(nativeValue.sourceTableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceTableArn()))
: Option.create_None();
DafnySequence<? extends Character> restoreDateTime;
restoreDateTime = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.restoreDateTime());
Boolean restoreInProgress;
restoreInProgress = (nativeValue.restoreInProgress());
return new RestoreSummary(sourceBackupArn, sourceTableArn, restoreDateTime, restoreInProgress);
}
public static RestoreTableFromBackupInput RestoreTableFromBackupInput(
RestoreTableFromBackupRequest nativeValue) {
DafnySequence<? extends Character> targetTableName;
targetTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.targetTableName());
DafnySequence<? extends Character> backupArn;
backupArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.backupArn());
Option<BillingMode> billingModeOverride;
billingModeOverride = Objects.nonNull(nativeValue.billingModeOverride()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingModeOverride()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndex>> globalSecondaryIndexOverride;
globalSecondaryIndexOverride = (Objects.nonNull(nativeValue.globalSecondaryIndexOverride()) && nativeValue.globalSecondaryIndexOverride().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexList(nativeValue.globalSecondaryIndexOverride()))
: Option.create_None();
Option<DafnySequence<? extends LocalSecondaryIndex>> localSecondaryIndexOverride;
localSecondaryIndexOverride = (Objects.nonNull(nativeValue.localSecondaryIndexOverride()) && nativeValue.localSecondaryIndexOverride().size() > 0) ?
Option.create_Some(ToDafny.LocalSecondaryIndexList(nativeValue.localSecondaryIndexOverride()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
Option<SSESpecification> sSESpecificationOverride;
sSESpecificationOverride = Objects.nonNull(nativeValue.sseSpecificationOverride()) ?
Option.create_Some(ToDafny.SSESpecification(nativeValue.sseSpecificationOverride()))
: Option.create_None();
return new RestoreTableFromBackupInput(targetTableName, backupArn, billingModeOverride, globalSecondaryIndexOverride, localSecondaryIndexOverride, provisionedThroughputOverride, sSESpecificationOverride);
}
public static RestoreTableFromBackupOutput RestoreTableFromBackupOutput(
RestoreTableFromBackupResponse nativeValue) {
Option<TableDescription> tableDescription;
tableDescription = Objects.nonNull(nativeValue.tableDescription()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.tableDescription()))
: Option.create_None();
return new RestoreTableFromBackupOutput(tableDescription);
}
public static RestoreTableToPointInTimeInput RestoreTableToPointInTimeInput(
RestoreTableToPointInTimeRequest nativeValue) {
Option<DafnySequence<? extends Character>> sourceTableArn;
sourceTableArn = Objects.nonNull(nativeValue.sourceTableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceTableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> sourceTableName;
sourceTableName = Objects.nonNull(nativeValue.sourceTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.sourceTableName()))
: Option.create_None();
DafnySequence<? extends Character> targetTableName;
targetTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.targetTableName());
Option<Boolean> useLatestRestorableTime;
useLatestRestorableTime = Objects.nonNull(nativeValue.useLatestRestorableTime()) ?
Option.create_Some((nativeValue.useLatestRestorableTime()))
: Option.create_None();
Option<DafnySequence<? extends Character>> restoreDateTime;
restoreDateTime = Objects.nonNull(nativeValue.restoreDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.restoreDateTime()))
: Option.create_None();
Option<BillingMode> billingModeOverride;
billingModeOverride = Objects.nonNull(nativeValue.billingModeOverride()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingModeOverride()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndex>> globalSecondaryIndexOverride;
globalSecondaryIndexOverride = (Objects.nonNull(nativeValue.globalSecondaryIndexOverride()) && nativeValue.globalSecondaryIndexOverride().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexList(nativeValue.globalSecondaryIndexOverride()))
: Option.create_None();
Option<DafnySequence<? extends LocalSecondaryIndex>> localSecondaryIndexOverride;
localSecondaryIndexOverride = (Objects.nonNull(nativeValue.localSecondaryIndexOverride()) && nativeValue.localSecondaryIndexOverride().size() > 0) ?
Option.create_Some(ToDafny.LocalSecondaryIndexList(nativeValue.localSecondaryIndexOverride()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
Option<SSESpecification> sSESpecificationOverride;
sSESpecificationOverride = Objects.nonNull(nativeValue.sseSpecificationOverride()) ?
Option.create_Some(ToDafny.SSESpecification(nativeValue.sseSpecificationOverride()))
: Option.create_None();
return new RestoreTableToPointInTimeInput(sourceTableArn, sourceTableName, targetTableName, useLatestRestorableTime, restoreDateTime, billingModeOverride, globalSecondaryIndexOverride, localSecondaryIndexOverride, provisionedThroughputOverride, sSESpecificationOverride);
}
public static RestoreTableToPointInTimeOutput RestoreTableToPointInTimeOutput(
RestoreTableToPointInTimeResponse nativeValue) {
Option<TableDescription> tableDescription;
tableDescription = Objects.nonNull(nativeValue.tableDescription()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.tableDescription()))
: Option.create_None();
return new RestoreTableToPointInTimeOutput(tableDescription);
}
public static S3BucketSource S3BucketSource(
software.amazon.awssdk.services.dynamodb.model.S3BucketSource nativeValue) {
Option<DafnySequence<? extends Character>> s3BucketOwner;
s3BucketOwner = Objects.nonNull(nativeValue.s3BucketOwner()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3BucketOwner()))
: Option.create_None();
DafnySequence<? extends Character> s3Bucket;
s3Bucket = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3Bucket());
Option<DafnySequence<? extends Character>> s3KeyPrefix;
s3KeyPrefix = Objects.nonNull(nativeValue.s3KeyPrefix()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.s3KeyPrefix()))
: Option.create_None();
return new S3BucketSource(s3BucketOwner, s3Bucket, s3KeyPrefix);
}
public static ScanInput ScanInput(ScanRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<DafnySequence<? extends DafnySequence<? extends Character>>> attributesToGet;
attributesToGet = (Objects.nonNull(nativeValue.attributesToGet()) && nativeValue.attributesToGet().size() > 0) ?
Option.create_Some(ToDafny.AttributeNameList(nativeValue.attributesToGet()))
: Option.create_None();
Option<Integer> limit;
limit = Objects.nonNull(nativeValue.limit()) ?
Option.create_Some((nativeValue.limit()))
: Option.create_None();
Option<Select> select;
select = Objects.nonNull(nativeValue.select()) ?
Option.create_Some(ToDafny.Select(nativeValue.select()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends Condition>> scanFilter;
scanFilter = (Objects.nonNull(nativeValue.scanFilter()) && nativeValue.scanFilter().size() > 0) ?
Option.create_Some(ToDafny.FilterConditionMap(nativeValue.scanFilter()))
: Option.create_None();
Option<ConditionalOperator> conditionalOperator;
conditionalOperator = Objects.nonNull(nativeValue.conditionalOperator()) ?
Option.create_Some(ToDafny.ConditionalOperator(nativeValue.conditionalOperator()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> exclusiveStartKey;
exclusiveStartKey = (Objects.nonNull(nativeValue.exclusiveStartKey()) && nativeValue.exclusiveStartKey().size() > 0) ?
Option.create_Some(ToDafny.Key(nativeValue.exclusiveStartKey()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<Integer> totalSegments;
totalSegments = Objects.nonNull(nativeValue.totalSegments()) ?
Option.create_Some((nativeValue.totalSegments()))
: Option.create_None();
Option<Integer> segment;
segment = Objects.nonNull(nativeValue.segment()) ?
Option.create_Some((nativeValue.segment()))
: Option.create_None();
Option<DafnySequence<? extends Character>> projectionExpression;
projectionExpression = Objects.nonNull(nativeValue.projectionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.projectionExpression()))
: Option.create_None();
Option<DafnySequence<? extends Character>> filterExpression;
filterExpression = Objects.nonNull(nativeValue.filterExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.filterExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
Option<Boolean> consistentRead;
consistentRead = Objects.nonNull(nativeValue.consistentRead()) ?
Option.create_Some((nativeValue.consistentRead()))
: Option.create_None();
return new ScanInput(tableName, indexName, attributesToGet, limit, select, scanFilter, conditionalOperator, exclusiveStartKey, returnConsumedCapacity, totalSegments, segment, projectionExpression, filterExpression, expressionAttributeNames, expressionAttributeValues, consistentRead);
}
public static ScanOutput ScanOutput(ScanResponse nativeValue) {
Option<DafnySequence<? extends DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>>> items;
items = (Objects.nonNull(nativeValue.items()) && nativeValue.items().size() > 0) ?
Option.create_Some(ToDafny.ItemList(nativeValue.items()))
: Option.create_None();
Option<Integer> count;
count = Objects.nonNull(nativeValue.count()) ?
Option.create_Some((nativeValue.count()))
: Option.create_None();
Option<Integer> scannedCount;
scannedCount = Objects.nonNull(nativeValue.scannedCount()) ?
Option.create_Some((nativeValue.scannedCount()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> lastEvaluatedKey;
lastEvaluatedKey = (Objects.nonNull(nativeValue.lastEvaluatedKey()) && nativeValue.lastEvaluatedKey().size() > 0) ?
Option.create_Some(ToDafny.Key(nativeValue.lastEvaluatedKey()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
return new ScanOutput(items, count, scannedCount, lastEvaluatedKey, consumedCapacity);
}
public static DafnyMap<? extends DafnySequence<? extends Character>, ? extends Capacity> SecondaryIndexesCapacityMap(
Map<String, software.amazon.awssdk.services.dynamodb.model.Capacity> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToMap(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Capacity);
}
public static SourceTableDetails SourceTableDetails(
software.amazon.awssdk.services.dynamodb.model.SourceTableDetails nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends Character> tableId;
tableId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableId());
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<Long> tableSizeBytes;
tableSizeBytes = Objects.nonNull(nativeValue.tableSizeBytes()) ?
Option.create_Some((nativeValue.tableSizeBytes()))
: Option.create_None();
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
DafnySequence<? extends Character> tableCreationDateTime;
tableCreationDateTime = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableCreationDateTime());
ProvisionedThroughput provisionedThroughput;
provisionedThroughput = ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput());
Option<Long> itemCount;
itemCount = Objects.nonNull(nativeValue.itemCount()) ?
Option.create_Some((nativeValue.itemCount()))
: Option.create_None();
Option<BillingMode> billingMode;
billingMode = Objects.nonNull(nativeValue.billingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingMode()))
: Option.create_None();
return new SourceTableDetails(tableName, tableId, tableArn, tableSizeBytes, keySchema, tableCreationDateTime, provisionedThroughput, itemCount, billingMode);
}
public static SourceTableFeatureDetails SourceTableFeatureDetails(
software.amazon.awssdk.services.dynamodb.model.SourceTableFeatureDetails nativeValue) {
Option<DafnySequence<? extends LocalSecondaryIndexInfo>> localSecondaryIndexes;
localSecondaryIndexes = (Objects.nonNull(nativeValue.localSecondaryIndexes()) && nativeValue.localSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.LocalSecondaryIndexes(nativeValue.localSecondaryIndexes()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndexInfo>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexes(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<StreamSpecification> streamDescription;
streamDescription = Objects.nonNull(nativeValue.streamDescription()) ?
Option.create_Some(ToDafny.StreamSpecification(nativeValue.streamDescription()))
: Option.create_None();
Option<TimeToLiveDescription> timeToLiveDescription;
timeToLiveDescription = Objects.nonNull(nativeValue.timeToLiveDescription()) ?
Option.create_Some(ToDafny.TimeToLiveDescription(nativeValue.timeToLiveDescription()))
: Option.create_None();
Option<SSEDescription> sSEDescription;
sSEDescription = Objects.nonNull(nativeValue.sseDescription()) ?
Option.create_Some(ToDafny.SSEDescription(nativeValue.sseDescription()))
: Option.create_None();
return new SourceTableFeatureDetails(localSecondaryIndexes, globalSecondaryIndexes, streamDescription, timeToLiveDescription, sSEDescription);
}
public static SSEDescription SSEDescription(
software.amazon.awssdk.services.dynamodb.model.SSEDescription nativeValue) {
Option<SSEStatus> status;
status = Objects.nonNull(nativeValue.status()) ?
Option.create_Some(ToDafny.SSEStatus(nativeValue.status()))
: Option.create_None();
Option<SSEType> sSEType;
sSEType = Objects.nonNull(nativeValue.sseType()) ?
Option.create_Some(ToDafny.SSEType(nativeValue.sseType()))
: Option.create_None();
Option<DafnySequence<? extends Character>> kMSMasterKeyArn;
kMSMasterKeyArn = Objects.nonNull(nativeValue.kmsMasterKeyArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsMasterKeyArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> inaccessibleEncryptionDateTime;
inaccessibleEncryptionDateTime = Objects.nonNull(nativeValue.inaccessibleEncryptionDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.inaccessibleEncryptionDateTime()))
: Option.create_None();
return new SSEDescription(status, sSEType, kMSMasterKeyArn, inaccessibleEncryptionDateTime);
}
public static SSESpecification SSESpecification(
software.amazon.awssdk.services.dynamodb.model.SSESpecification nativeValue) {
Option<Boolean> enabled;
enabled = Objects.nonNull(nativeValue.enabled()) ?
Option.create_Some((nativeValue.enabled()))
: Option.create_None();
Option<SSEType> sSEType;
sSEType = Objects.nonNull(nativeValue.sseType()) ?
Option.create_Some(ToDafny.SSEType(nativeValue.sseType()))
: Option.create_None();
Option<DafnySequence<? extends Character>> kMSMasterKeyId;
kMSMasterKeyId = Objects.nonNull(nativeValue.kmsMasterKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsMasterKeyId()))
: Option.create_None();
return new SSESpecification(enabled, sSEType, kMSMasterKeyId);
}
public static StreamSpecification StreamSpecification(
software.amazon.awssdk.services.dynamodb.model.StreamSpecification nativeValue) {
Boolean streamEnabled;
streamEnabled = (nativeValue.streamEnabled());
Option<StreamViewType> streamViewType;
streamViewType = Objects.nonNull(nativeValue.streamViewType()) ?
Option.create_Some(ToDafny.StreamViewType(nativeValue.streamViewType()))
: Option.create_None();
return new StreamSpecification(streamEnabled, streamViewType);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> StringSetAttributeValue(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static TableAutoScalingDescription TableAutoScalingDescription(
software.amazon.awssdk.services.dynamodb.model.TableAutoScalingDescription nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<TableStatus> tableStatus;
tableStatus = Objects.nonNull(nativeValue.tableStatus()) ?
Option.create_Some(ToDafny.TableStatus(nativeValue.tableStatus()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaAutoScalingDescription>> replicas;
replicas = (Objects.nonNull(nativeValue.replicas()) && nativeValue.replicas().size() > 0) ?
Option.create_Some(ToDafny.ReplicaAutoScalingDescriptionList(nativeValue.replicas()))
: Option.create_None();
return new TableAutoScalingDescription(tableName, tableStatus, replicas);
}
public static TableClassSummary TableClassSummary(
software.amazon.awssdk.services.dynamodb.model.TableClassSummary nativeValue) {
Option<TableClass> tableClass;
tableClass = Objects.nonNull(nativeValue.tableClass()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.tableClass()))
: Option.create_None();
Option<DafnySequence<? extends Character>> lastUpdateDateTime;
lastUpdateDateTime = Objects.nonNull(nativeValue.lastUpdateDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.lastUpdateDateTime()))
: Option.create_None();
return new TableClassSummary(tableClass, lastUpdateDateTime);
}
public static TableCreationParameters TableCreationParameters(
software.amazon.awssdk.services.dynamodb.model.TableCreationParameters nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnySequence<? extends AttributeDefinition> attributeDefinitions;
attributeDefinitions = ToDafny.AttributeDefinitions(nativeValue.attributeDefinitions());
DafnySequence<? extends KeySchemaElement> keySchema;
keySchema = ToDafny.KeySchema(nativeValue.keySchema());
Option<BillingMode> billingMode;
billingMode = Objects.nonNull(nativeValue.billingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingMode()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
Option<SSESpecification> sSESpecification;
sSESpecification = Objects.nonNull(nativeValue.sseSpecification()) ?
Option.create_Some(ToDafny.SSESpecification(nativeValue.sseSpecification()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndex>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
return new TableCreationParameters(tableName, attributeDefinitions, keySchema, billingMode, provisionedThroughput, sSESpecification, globalSecondaryIndexes);
}
public static TableDescription TableDescription(
software.amazon.awssdk.services.dynamodb.model.TableDescription nativeValue) {
Option<DafnySequence<? extends AttributeDefinition>> attributeDefinitions;
attributeDefinitions = (Objects.nonNull(nativeValue.attributeDefinitions()) && nativeValue.attributeDefinitions().size() > 0) ?
Option.create_Some(ToDafny.AttributeDefinitions(nativeValue.attributeDefinitions()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends KeySchemaElement>> keySchema;
keySchema = (Objects.nonNull(nativeValue.keySchema()) && nativeValue.keySchema().size() > 0) ?
Option.create_Some(ToDafny.KeySchema(nativeValue.keySchema()))
: Option.create_None();
Option<TableStatus> tableStatus;
tableStatus = Objects.nonNull(nativeValue.tableStatus()) ?
Option.create_Some(ToDafny.TableStatus(nativeValue.tableStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> creationDateTime;
creationDateTime = Objects.nonNull(nativeValue.creationDateTime()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.creationDateTime()))
: Option.create_None();
Option<ProvisionedThroughputDescription> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughputDescription(nativeValue.provisionedThroughput()))
: Option.create_None();
Option<Long> tableSizeBytes;
tableSizeBytes = Objects.nonNull(nativeValue.tableSizeBytes()) ?
Option.create_Some((nativeValue.tableSizeBytes()))
: Option.create_None();
Option<Long> itemCount;
itemCount = Objects.nonNull(nativeValue.itemCount()) ?
Option.create_Some((nativeValue.itemCount()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableArn;
tableArn = Objects.nonNull(nativeValue.tableArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> tableId;
tableId = Objects.nonNull(nativeValue.tableId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableId()))
: Option.create_None();
Option<BillingModeSummary> billingModeSummary;
billingModeSummary = Objects.nonNull(nativeValue.billingModeSummary()) ?
Option.create_Some(ToDafny.BillingModeSummary(nativeValue.billingModeSummary()))
: Option.create_None();
Option<DafnySequence<? extends LocalSecondaryIndexDescription>> localSecondaryIndexes;
localSecondaryIndexes = (Objects.nonNull(nativeValue.localSecondaryIndexes()) && nativeValue.localSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.LocalSecondaryIndexDescriptionList(nativeValue.localSecondaryIndexes()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndexDescription>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexDescriptionList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<StreamSpecification> streamSpecification;
streamSpecification = Objects.nonNull(nativeValue.streamSpecification()) ?
Option.create_Some(ToDafny.StreamSpecification(nativeValue.streamSpecification()))
: Option.create_None();
Option<DafnySequence<? extends Character>> latestStreamLabel;
latestStreamLabel = Objects.nonNull(nativeValue.latestStreamLabel()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.latestStreamLabel()))
: Option.create_None();
Option<DafnySequence<? extends Character>> latestStreamArn;
latestStreamArn = Objects.nonNull(nativeValue.latestStreamArn()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.latestStreamArn()))
: Option.create_None();
Option<DafnySequence<? extends Character>> globalTableVersion;
globalTableVersion = Objects.nonNull(nativeValue.globalTableVersion()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableVersion()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaDescription>> replicas;
replicas = (Objects.nonNull(nativeValue.replicas()) && nativeValue.replicas().size() > 0) ?
Option.create_Some(ToDafny.ReplicaDescriptionList(nativeValue.replicas()))
: Option.create_None();
Option<RestoreSummary> restoreSummary;
restoreSummary = Objects.nonNull(nativeValue.restoreSummary()) ?
Option.create_Some(ToDafny.RestoreSummary(nativeValue.restoreSummary()))
: Option.create_None();
Option<SSEDescription> sSEDescription;
sSEDescription = Objects.nonNull(nativeValue.sseDescription()) ?
Option.create_Some(ToDafny.SSEDescription(nativeValue.sseDescription()))
: Option.create_None();
Option<ArchivalSummary> archivalSummary;
archivalSummary = Objects.nonNull(nativeValue.archivalSummary()) ?
Option.create_Some(ToDafny.ArchivalSummary(nativeValue.archivalSummary()))
: Option.create_None();
Option<TableClassSummary> tableClassSummary;
tableClassSummary = Objects.nonNull(nativeValue.tableClassSummary()) ?
Option.create_Some(ToDafny.TableClassSummary(nativeValue.tableClassSummary()))
: Option.create_None();
return new TableDescription(attributeDefinitions, tableName, keySchema, tableStatus, creationDateTime, provisionedThroughput, tableSizeBytes, itemCount, tableArn, tableId, billingModeSummary, localSecondaryIndexes, globalSecondaryIndexes, streamSpecification, latestStreamLabel, latestStreamArn, globalTableVersion, replicas, restoreSummary, sSEDescription, archivalSummary, tableClassSummary);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> TableNameList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static Tag Tag(software.amazon.awssdk.services.dynamodb.model.Tag nativeValue) {
DafnySequence<? extends Character> key;
key = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.key());
DafnySequence<? extends Character> value;
value = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.value());
return new Tag(key, value);
}
public static DafnySequence<? extends DafnySequence<? extends Character>> TagKeyList(
List<String> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.smithy.dafny.conversion.ToDafny.Simple::CharacterSequence,
DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static DafnySequence<? extends Tag> TagList(
List<software.amazon.awssdk.services.dynamodb.model.Tag> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::Tag,
Tag._typeDescriptor());
}
public static TagResourceInput TagResourceInput(TagResourceRequest nativeValue) {
DafnySequence<? extends Character> resourceArn;
resourceArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.resourceArn());
DafnySequence<? extends Tag> tags;
tags = ToDafny.TagList(nativeValue.tags());
return new TagResourceInput(resourceArn, tags);
}
public static TimeToLiveDescription TimeToLiveDescription(
software.amazon.awssdk.services.dynamodb.model.TimeToLiveDescription nativeValue) {
Option<TimeToLiveStatus> timeToLiveStatus;
timeToLiveStatus = Objects.nonNull(nativeValue.timeToLiveStatus()) ?
Option.create_Some(ToDafny.TimeToLiveStatus(nativeValue.timeToLiveStatus()))
: Option.create_None();
Option<DafnySequence<? extends Character>> attributeName;
attributeName = Objects.nonNull(nativeValue.attributeName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.attributeName()))
: Option.create_None();
return new TimeToLiveDescription(timeToLiveStatus, attributeName);
}
public static TimeToLiveSpecification TimeToLiveSpecification(
software.amazon.awssdk.services.dynamodb.model.TimeToLiveSpecification nativeValue) {
Boolean enabled;
enabled = (nativeValue.enabled());
DafnySequence<? extends Character> attributeName;
attributeName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.attributeName());
return new TimeToLiveSpecification(enabled, attributeName);
}
public static TransactGetItem TransactGetItem(
software.amazon.awssdk.services.dynamodb.model.TransactGetItem nativeValue) {
Get get;
get = ToDafny.Get(nativeValue.get());
return new TransactGetItem(get);
}
public static DafnySequence<? extends TransactGetItem> TransactGetItemList(
List<software.amazon.awssdk.services.dynamodb.model.TransactGetItem> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::TransactGetItem,
TransactGetItem._typeDescriptor());
}
public static TransactGetItemsInput TransactGetItemsInput(TransactGetItemsRequest nativeValue) {
DafnySequence<? extends TransactGetItem> transactItems;
transactItems = ToDafny.TransactGetItemList(nativeValue.transactItems());
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
return new TransactGetItemsInput(transactItems, returnConsumedCapacity);
}
public static TransactGetItemsOutput TransactGetItemsOutput(
TransactGetItemsResponse nativeValue) {
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
Option<DafnySequence<? extends ItemResponse>> responses;
responses = (Objects.nonNull(nativeValue.responses()) && nativeValue.responses().size() > 0) ?
Option.create_Some(ToDafny.ItemResponseList(nativeValue.responses()))
: Option.create_None();
return new TransactGetItemsOutput(consumedCapacity, responses);
}
public static TransactWriteItem TransactWriteItem(
software.amazon.awssdk.services.dynamodb.model.TransactWriteItem nativeValue) {
Option<ConditionCheck> conditionCheck;
conditionCheck = Objects.nonNull(nativeValue.conditionCheck()) ?
Option.create_Some(ToDafny.ConditionCheck(nativeValue.conditionCheck()))
: Option.create_None();
Option<Put> put;
put = Objects.nonNull(nativeValue.put()) ?
Option.create_Some(ToDafny.Put(nativeValue.put()))
: Option.create_None();
Option<Delete> delete;
delete = Objects.nonNull(nativeValue.delete()) ?
Option.create_Some(ToDafny.Delete(nativeValue.delete()))
: Option.create_None();
Option<Update> update;
update = Objects.nonNull(nativeValue.update()) ?
Option.create_Some(ToDafny.Update(nativeValue.update()))
: Option.create_None();
return new TransactWriteItem(conditionCheck, put, delete, update);
}
public static DafnySequence<? extends TransactWriteItem> TransactWriteItemList(
List<software.amazon.awssdk.services.dynamodb.model.TransactWriteItem> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::TransactWriteItem,
TransactWriteItem._typeDescriptor());
}
public static TransactWriteItemsInput TransactWriteItemsInput(
TransactWriteItemsRequest nativeValue) {
DafnySequence<? extends TransactWriteItem> transactItems;
transactItems = ToDafny.TransactWriteItemList(nativeValue.transactItems());
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<ReturnItemCollectionMetrics> returnItemCollectionMetrics;
returnItemCollectionMetrics = Objects.nonNull(nativeValue.returnItemCollectionMetrics()) ?
Option.create_Some(ToDafny.ReturnItemCollectionMetrics(nativeValue.returnItemCollectionMetrics()))
: Option.create_None();
Option<DafnySequence<? extends Character>> clientRequestToken;
clientRequestToken = Objects.nonNull(nativeValue.clientRequestToken()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.clientRequestToken()))
: Option.create_None();
return new TransactWriteItemsInput(transactItems, returnConsumedCapacity, returnItemCollectionMetrics, clientRequestToken);
}
public static TransactWriteItemsOutput TransactWriteItemsOutput(
TransactWriteItemsResponse nativeValue) {
Option<DafnySequence<? extends ConsumedCapacity>> consumedCapacity;
consumedCapacity = (Objects.nonNull(nativeValue.consumedCapacity()) && nativeValue.consumedCapacity().size() > 0) ?
Option.create_Some(ToDafny.ConsumedCapacityMultiple(nativeValue.consumedCapacity()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends ItemCollectionMetrics>>> itemCollectionMetrics;
itemCollectionMetrics = (Objects.nonNull(nativeValue.itemCollectionMetrics()) && nativeValue.itemCollectionMetrics().size() > 0) ?
Option.create_Some(ToDafny.ItemCollectionMetricsPerTable(nativeValue.itemCollectionMetrics()))
: Option.create_None();
return new TransactWriteItemsOutput(consumedCapacity, itemCollectionMetrics);
}
public static UntagResourceInput UntagResourceInput(UntagResourceRequest nativeValue) {
DafnySequence<? extends Character> resourceArn;
resourceArn = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.resourceArn());
DafnySequence<? extends DafnySequence<? extends Character>> tagKeys;
tagKeys = ToDafny.TagKeyList(nativeValue.tagKeys());
return new UntagResourceInput(resourceArn, tagKeys);
}
public static Update Update(software.amazon.awssdk.services.dynamodb.model.Update nativeValue) {
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
DafnySequence<? extends Character> updateExpression;
updateExpression = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.updateExpression());
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
Option<ReturnValuesOnConditionCheckFailure> returnValuesOnConditionCheckFailure;
returnValuesOnConditionCheckFailure = Objects.nonNull(nativeValue.returnValuesOnConditionCheckFailure()) ?
Option.create_Some(ToDafny.ReturnValuesOnConditionCheckFailure(nativeValue.returnValuesOnConditionCheckFailure()))
: Option.create_None();
return new Update(key, updateExpression, tableName, conditionExpression, expressionAttributeNames, expressionAttributeValues, returnValuesOnConditionCheckFailure);
}
public static UpdateContinuousBackupsInput UpdateContinuousBackupsInput(
UpdateContinuousBackupsRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
PointInTimeRecoverySpecification pointInTimeRecoverySpecification;
pointInTimeRecoverySpecification = ToDafny.PointInTimeRecoverySpecification(nativeValue.pointInTimeRecoverySpecification());
return new UpdateContinuousBackupsInput(tableName, pointInTimeRecoverySpecification);
}
public static UpdateContinuousBackupsOutput UpdateContinuousBackupsOutput(
UpdateContinuousBackupsResponse nativeValue) {
Option<ContinuousBackupsDescription> continuousBackupsDescription;
continuousBackupsDescription = Objects.nonNull(nativeValue.continuousBackupsDescription()) ?
Option.create_Some(ToDafny.ContinuousBackupsDescription(nativeValue.continuousBackupsDescription()))
: Option.create_None();
return new UpdateContinuousBackupsOutput(continuousBackupsDescription);
}
public static UpdateContributorInsightsInput UpdateContributorInsightsInput(
UpdateContributorInsightsRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
ContributorInsightsAction contributorInsightsAction;
contributorInsightsAction = ToDafny.ContributorInsightsAction(nativeValue.contributorInsightsAction());
return new UpdateContributorInsightsInput(tableName, indexName, contributorInsightsAction);
}
public static UpdateContributorInsightsOutput UpdateContributorInsightsOutput(
UpdateContributorInsightsResponse nativeValue) {
Option<DafnySequence<? extends Character>> tableName;
tableName = Objects.nonNull(nativeValue.tableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName()))
: Option.create_None();
Option<DafnySequence<? extends Character>> indexName;
indexName = Objects.nonNull(nativeValue.indexName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName()))
: Option.create_None();
Option<ContributorInsightsStatus> contributorInsightsStatus;
contributorInsightsStatus = Objects.nonNull(nativeValue.contributorInsightsStatus()) ?
Option.create_Some(ToDafny.ContributorInsightsStatus(nativeValue.contributorInsightsStatus()))
: Option.create_None();
return new UpdateContributorInsightsOutput(tableName, indexName, contributorInsightsStatus);
}
public static UpdateGlobalSecondaryIndexAction UpdateGlobalSecondaryIndexAction(
software.amazon.awssdk.services.dynamodb.model.UpdateGlobalSecondaryIndexAction nativeValue) {
DafnySequence<? extends Character> indexName;
indexName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.indexName());
ProvisionedThroughput provisionedThroughput;
provisionedThroughput = ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput());
return new UpdateGlobalSecondaryIndexAction(indexName, provisionedThroughput);
}
public static UpdateGlobalTableInput UpdateGlobalTableInput(
UpdateGlobalTableRequest nativeValue) {
DafnySequence<? extends Character> globalTableName;
globalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName());
DafnySequence<? extends ReplicaUpdate> replicaUpdates;
replicaUpdates = ToDafny.ReplicaUpdateList(nativeValue.replicaUpdates());
return new UpdateGlobalTableInput(globalTableName, replicaUpdates);
}
public static UpdateGlobalTableOutput UpdateGlobalTableOutput(
UpdateGlobalTableResponse nativeValue) {
Option<GlobalTableDescription> globalTableDescription;
globalTableDescription = Objects.nonNull(nativeValue.globalTableDescription()) ?
Option.create_Some(ToDafny.GlobalTableDescription(nativeValue.globalTableDescription()))
: Option.create_None();
return new UpdateGlobalTableOutput(globalTableDescription);
}
public static UpdateGlobalTableSettingsInput UpdateGlobalTableSettingsInput(
UpdateGlobalTableSettingsRequest nativeValue) {
DafnySequence<? extends Character> globalTableName;
globalTableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName());
Option<BillingMode> globalTableBillingMode;
globalTableBillingMode = Objects.nonNull(nativeValue.globalTableBillingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.globalTableBillingMode()))
: Option.create_None();
Option<Long> globalTableProvisionedWriteCapacityUnits;
globalTableProvisionedWriteCapacityUnits = Objects.nonNull(nativeValue.globalTableProvisionedWriteCapacityUnits()) ?
Option.create_Some((nativeValue.globalTableProvisionedWriteCapacityUnits()))
: Option.create_None();
Option<AutoScalingSettingsUpdate> globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate;
globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate = Objects.nonNull(nativeValue.globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate()))
: Option.create_None();
Option<DafnySequence<? extends GlobalTableGlobalSecondaryIndexSettingsUpdate>> globalTableGlobalSecondaryIndexSettingsUpdate;
globalTableGlobalSecondaryIndexSettingsUpdate = (Objects.nonNull(nativeValue.globalTableGlobalSecondaryIndexSettingsUpdate()) && nativeValue.globalTableGlobalSecondaryIndexSettingsUpdate().size() > 0) ?
Option.create_Some(ToDafny.GlobalTableGlobalSecondaryIndexSettingsUpdateList(nativeValue.globalTableGlobalSecondaryIndexSettingsUpdate()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaSettingsUpdate>> replicaSettingsUpdate;
replicaSettingsUpdate = (Objects.nonNull(nativeValue.replicaSettingsUpdate()) && nativeValue.replicaSettingsUpdate().size() > 0) ?
Option.create_Some(ToDafny.ReplicaSettingsUpdateList(nativeValue.replicaSettingsUpdate()))
: Option.create_None();
return new UpdateGlobalTableSettingsInput(globalTableName, globalTableBillingMode, globalTableProvisionedWriteCapacityUnits, globalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, globalTableGlobalSecondaryIndexSettingsUpdate, replicaSettingsUpdate);
}
public static UpdateGlobalTableSettingsOutput UpdateGlobalTableSettingsOutput(
UpdateGlobalTableSettingsResponse nativeValue) {
Option<DafnySequence<? extends Character>> globalTableName;
globalTableName = Objects.nonNull(nativeValue.globalTableName()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.globalTableName()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaSettingsDescription>> replicaSettings;
replicaSettings = (Objects.nonNull(nativeValue.replicaSettings()) && nativeValue.replicaSettings().size() > 0) ?
Option.create_Some(ToDafny.ReplicaSettingsDescriptionList(nativeValue.replicaSettings()))
: Option.create_None();
return new UpdateGlobalTableSettingsOutput(globalTableName, replicaSettings);
}
public static UpdateItemInput UpdateItemInput(UpdateItemRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue> key;
key = ToDafny.Key(nativeValue.key());
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValueUpdate>> attributeUpdates;
attributeUpdates = (Objects.nonNull(nativeValue.attributeUpdates()) && nativeValue.attributeUpdates().size() > 0) ?
Option.create_Some(ToDafny.AttributeUpdates(nativeValue.attributeUpdates()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends ExpectedAttributeValue>> expected;
expected = (Objects.nonNull(nativeValue.expected()) && nativeValue.expected().size() > 0) ?
Option.create_Some(ToDafny.ExpectedAttributeMap(nativeValue.expected()))
: Option.create_None();
Option<ConditionalOperator> conditionalOperator;
conditionalOperator = Objects.nonNull(nativeValue.conditionalOperator()) ?
Option.create_Some(ToDafny.ConditionalOperator(nativeValue.conditionalOperator()))
: Option.create_None();
Option<ReturnValue> returnValues;
returnValues = Objects.nonNull(nativeValue.returnValues()) ?
Option.create_Some(ToDafny.ReturnValue(nativeValue.returnValues()))
: Option.create_None();
Option<ReturnConsumedCapacity> returnConsumedCapacity;
returnConsumedCapacity = Objects.nonNull(nativeValue.returnConsumedCapacity()) ?
Option.create_Some(ToDafny.ReturnConsumedCapacity(nativeValue.returnConsumedCapacity()))
: Option.create_None();
Option<ReturnItemCollectionMetrics> returnItemCollectionMetrics;
returnItemCollectionMetrics = Objects.nonNull(nativeValue.returnItemCollectionMetrics()) ?
Option.create_Some(ToDafny.ReturnItemCollectionMetrics(nativeValue.returnItemCollectionMetrics()))
: Option.create_None();
Option<DafnySequence<? extends Character>> updateExpression;
updateExpression = Objects.nonNull(nativeValue.updateExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.updateExpression()))
: Option.create_None();
Option<DafnySequence<? extends Character>> conditionExpression;
conditionExpression = Objects.nonNull(nativeValue.conditionExpression()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.conditionExpression()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends DafnySequence<? extends Character>>> expressionAttributeNames;
expressionAttributeNames = (Objects.nonNull(nativeValue.expressionAttributeNames()) && nativeValue.expressionAttributeNames().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeNameMap(nativeValue.expressionAttributeNames()))
: Option.create_None();
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> expressionAttributeValues;
expressionAttributeValues = (Objects.nonNull(nativeValue.expressionAttributeValues()) && nativeValue.expressionAttributeValues().size() > 0) ?
Option.create_Some(ToDafny.ExpressionAttributeValueMap(nativeValue.expressionAttributeValues()))
: Option.create_None();
return new UpdateItemInput(tableName, key, attributeUpdates, expected, conditionalOperator, returnValues, returnConsumedCapacity, returnItemCollectionMetrics, updateExpression, conditionExpression, expressionAttributeNames, expressionAttributeValues);
}
public static UpdateItemOutput UpdateItemOutput(UpdateItemResponse nativeValue) {
Option<DafnyMap<? extends DafnySequence<? extends Character>, ? extends AttributeValue>> attributes;
attributes = (Objects.nonNull(nativeValue.attributes()) && nativeValue.attributes().size() > 0) ?
Option.create_Some(ToDafny.AttributeMap(nativeValue.attributes()))
: Option.create_None();
Option<ConsumedCapacity> consumedCapacity;
consumedCapacity = Objects.nonNull(nativeValue.consumedCapacity()) ?
Option.create_Some(ToDafny.ConsumedCapacity(nativeValue.consumedCapacity()))
: Option.create_None();
Option<ItemCollectionMetrics> itemCollectionMetrics;
itemCollectionMetrics = Objects.nonNull(nativeValue.itemCollectionMetrics()) ?
Option.create_Some(ToDafny.ItemCollectionMetrics(nativeValue.itemCollectionMetrics()))
: Option.create_None();
return new UpdateItemOutput(attributes, consumedCapacity, itemCollectionMetrics);
}
public static UpdateReplicationGroupMemberAction UpdateReplicationGroupMemberAction(
software.amazon.awssdk.services.dynamodb.model.UpdateReplicationGroupMemberAction nativeValue) {
DafnySequence<? extends Character> regionName;
regionName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.regionName());
Option<DafnySequence<? extends Character>> kMSMasterKeyId;
kMSMasterKeyId = Objects.nonNull(nativeValue.kmsMasterKeyId()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.kmsMasterKeyId()))
: Option.create_None();
Option<ProvisionedThroughputOverride> provisionedThroughputOverride;
provisionedThroughputOverride = Objects.nonNull(nativeValue.provisionedThroughputOverride()) ?
Option.create_Some(ToDafny.ProvisionedThroughputOverride(nativeValue.provisionedThroughputOverride()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaGlobalSecondaryIndex>> globalSecondaryIndexes;
globalSecondaryIndexes = (Objects.nonNull(nativeValue.globalSecondaryIndexes()) && nativeValue.globalSecondaryIndexes().size() > 0) ?
Option.create_Some(ToDafny.ReplicaGlobalSecondaryIndexList(nativeValue.globalSecondaryIndexes()))
: Option.create_None();
Option<TableClass> tableClassOverride;
tableClassOverride = Objects.nonNull(nativeValue.tableClassOverride()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.tableClassOverride()))
: Option.create_None();
return new UpdateReplicationGroupMemberAction(regionName, kMSMasterKeyId, provisionedThroughputOverride, globalSecondaryIndexes, tableClassOverride);
}
public static UpdateTableInput UpdateTableInput(UpdateTableRequest nativeValue) {
Option<DafnySequence<? extends AttributeDefinition>> attributeDefinitions;
attributeDefinitions = (Objects.nonNull(nativeValue.attributeDefinitions()) && nativeValue.attributeDefinitions().size() > 0) ?
Option.create_Some(ToDafny.AttributeDefinitions(nativeValue.attributeDefinitions()))
: Option.create_None();
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<BillingMode> billingMode;
billingMode = Objects.nonNull(nativeValue.billingMode()) ?
Option.create_Some(ToDafny.BillingMode(nativeValue.billingMode()))
: Option.create_None();
Option<ProvisionedThroughput> provisionedThroughput;
provisionedThroughput = Objects.nonNull(nativeValue.provisionedThroughput()) ?
Option.create_Some(ToDafny.ProvisionedThroughput(nativeValue.provisionedThroughput()))
: Option.create_None();
Option<DafnySequence<? extends GlobalSecondaryIndexUpdate>> globalSecondaryIndexUpdates;
globalSecondaryIndexUpdates = (Objects.nonNull(nativeValue.globalSecondaryIndexUpdates()) && nativeValue.globalSecondaryIndexUpdates().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexUpdateList(nativeValue.globalSecondaryIndexUpdates()))
: Option.create_None();
Option<StreamSpecification> streamSpecification;
streamSpecification = Objects.nonNull(nativeValue.streamSpecification()) ?
Option.create_Some(ToDafny.StreamSpecification(nativeValue.streamSpecification()))
: Option.create_None();
Option<SSESpecification> sSESpecification;
sSESpecification = Objects.nonNull(nativeValue.sseSpecification()) ?
Option.create_Some(ToDafny.SSESpecification(nativeValue.sseSpecification()))
: Option.create_None();
Option<DafnySequence<? extends ReplicationGroupUpdate>> replicaUpdates;
replicaUpdates = (Objects.nonNull(nativeValue.replicaUpdates()) && nativeValue.replicaUpdates().size() > 0) ?
Option.create_Some(ToDafny.ReplicationGroupUpdateList(nativeValue.replicaUpdates()))
: Option.create_None();
Option<TableClass> tableClass;
tableClass = Objects.nonNull(nativeValue.tableClass()) ?
Option.create_Some(ToDafny.TableClass(nativeValue.tableClass()))
: Option.create_None();
return new UpdateTableInput(attributeDefinitions, tableName, billingMode, provisionedThroughput, globalSecondaryIndexUpdates, streamSpecification, sSESpecification, replicaUpdates, tableClass);
}
public static UpdateTableOutput UpdateTableOutput(UpdateTableResponse nativeValue) {
Option<TableDescription> tableDescription;
tableDescription = Objects.nonNull(nativeValue.tableDescription()) ?
Option.create_Some(ToDafny.TableDescription(nativeValue.tableDescription()))
: Option.create_None();
return new UpdateTableOutput(tableDescription);
}
public static UpdateTableReplicaAutoScalingInput UpdateTableReplicaAutoScalingInput(
UpdateTableReplicaAutoScalingRequest nativeValue) {
Option<DafnySequence<? extends GlobalSecondaryIndexAutoScalingUpdate>> globalSecondaryIndexUpdates;
globalSecondaryIndexUpdates = (Objects.nonNull(nativeValue.globalSecondaryIndexUpdates()) && nativeValue.globalSecondaryIndexUpdates().size() > 0) ?
Option.create_Some(ToDafny.GlobalSecondaryIndexAutoScalingUpdateList(nativeValue.globalSecondaryIndexUpdates()))
: Option.create_None();
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
Option<AutoScalingSettingsUpdate> provisionedWriteCapacityAutoScalingUpdate;
provisionedWriteCapacityAutoScalingUpdate = Objects.nonNull(nativeValue.provisionedWriteCapacityAutoScalingUpdate()) ?
Option.create_Some(ToDafny.AutoScalingSettingsUpdate(nativeValue.provisionedWriteCapacityAutoScalingUpdate()))
: Option.create_None();
Option<DafnySequence<? extends ReplicaAutoScalingUpdate>> replicaUpdates;
replicaUpdates = (Objects.nonNull(nativeValue.replicaUpdates()) && nativeValue.replicaUpdates().size() > 0) ?
Option.create_Some(ToDafny.ReplicaAutoScalingUpdateList(nativeValue.replicaUpdates()))
: Option.create_None();
return new UpdateTableReplicaAutoScalingInput(globalSecondaryIndexUpdates, tableName, provisionedWriteCapacityAutoScalingUpdate, replicaUpdates);
}
public static UpdateTableReplicaAutoScalingOutput UpdateTableReplicaAutoScalingOutput(
UpdateTableReplicaAutoScalingResponse nativeValue) {
Option<TableAutoScalingDescription> tableAutoScalingDescription;
tableAutoScalingDescription = Objects.nonNull(nativeValue.tableAutoScalingDescription()) ?
Option.create_Some(ToDafny.TableAutoScalingDescription(nativeValue.tableAutoScalingDescription()))
: Option.create_None();
return new UpdateTableReplicaAutoScalingOutput(tableAutoScalingDescription);
}
public static UpdateTimeToLiveInput UpdateTimeToLiveInput(UpdateTimeToLiveRequest nativeValue) {
DafnySequence<? extends Character> tableName;
tableName = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.tableName());
TimeToLiveSpecification timeToLiveSpecification;
timeToLiveSpecification = ToDafny.TimeToLiveSpecification(nativeValue.timeToLiveSpecification());
return new UpdateTimeToLiveInput(tableName, timeToLiveSpecification);
}
public static UpdateTimeToLiveOutput UpdateTimeToLiveOutput(
UpdateTimeToLiveResponse nativeValue) {
Option<TimeToLiveSpecification> timeToLiveSpecification;
timeToLiveSpecification = Objects.nonNull(nativeValue.timeToLiveSpecification()) ?
Option.create_Some(ToDafny.TimeToLiveSpecification(nativeValue.timeToLiveSpecification()))
: Option.create_None();
return new UpdateTimeToLiveOutput(timeToLiveSpecification);
}
public static WriteRequest WriteRequest(
software.amazon.awssdk.services.dynamodb.model.WriteRequest nativeValue) {
Option<PutRequest> putRequest;
putRequest = Objects.nonNull(nativeValue.putRequest()) ?
Option.create_Some(ToDafny.PutRequest(nativeValue.putRequest()))
: Option.create_None();
Option<DeleteRequest> deleteRequest;
deleteRequest = Objects.nonNull(nativeValue.deleteRequest()) ?
Option.create_Some(ToDafny.DeleteRequest(nativeValue.deleteRequest()))
: Option.create_None();
return new WriteRequest(putRequest, deleteRequest);
}
public static DafnySequence<? extends WriteRequest> WriteRequests(
List<software.amazon.awssdk.services.dynamodb.model.WriteRequest> nativeValue) {
return software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue,
software.amazon.cryptography.services.dynamodb.internaldafny.ToDafny::WriteRequest,
WriteRequest._typeDescriptor());
}
public static Error Error(BackupInUseException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_BackupInUseException(message);
}
public static Error Error(BackupNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_BackupNotFoundException(message);
}
public static Error Error(ConditionalCheckFailedException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ConditionalCheckFailedException(message);
}
public static Error Error(ContinuousBackupsUnavailableException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ContinuousBackupsUnavailableException(message);
}
public static Error Error(DuplicateItemException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_DuplicateItemException(message);
}
public static Error Error(ExportConflictException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ExportConflictException(message);
}
public static Error Error(ExportNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ExportNotFoundException(message);
}
public static Error Error(GlobalTableAlreadyExistsException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_GlobalTableAlreadyExistsException(message);
}
public static Error Error(GlobalTableNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_GlobalTableNotFoundException(message);
}
public static Error Error(IdempotentParameterMismatchException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_IdempotentParameterMismatchException(message);
}
public static Error Error(ImportConflictException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ImportConflictException(message);
}
public static Error Error(ImportNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ImportNotFoundException(message);
}
public static Error Error(IndexNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_IndexNotFoundException(message);
}
public static Error Error(InternalServerErrorException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InternalServerError(message);
}
public static Error Error(InvalidExportTimeException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidExportTimeException(message);
}
public static Error Error(InvalidRestoreTimeException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_InvalidRestoreTimeException(message);
}
public static Error Error(ItemCollectionSizeLimitExceededException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ItemCollectionSizeLimitExceededException(message);
}
public static Error Error(LimitExceededException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_LimitExceededException(message);
}
public static Error Error(PointInTimeRecoveryUnavailableException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_PointInTimeRecoveryUnavailableException(message);
}
public static Error Error(ProvisionedThroughputExceededException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ProvisionedThroughputExceededException(message);
}
public static Error Error(ReplicaAlreadyExistsException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ReplicaAlreadyExistsException(message);
}
public static Error Error(ReplicaNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ReplicaNotFoundException(message);
}
public static Error Error(RequestLimitExceededException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_RequestLimitExceeded(message);
}
public static Error Error(ResourceInUseException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ResourceInUseException(message);
}
public static Error Error(ResourceNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_ResourceNotFoundException(message);
}
public static Error Error(TableAlreadyExistsException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TableAlreadyExistsException(message);
}
public static Error Error(TableInUseException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TableInUseException(message);
}
public static Error Error(TableNotFoundException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TableNotFoundException(message);
}
public static Error Error(TransactionCanceledException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
Option<DafnySequence<? extends CancellationReason>> cancellationReasons;
cancellationReasons = (Objects.nonNull(nativeValue.cancellationReasons()) && nativeValue.cancellationReasons().size() > 0) ?
Option.create_Some(ToDafny.CancellationReasonList(nativeValue.cancellationReasons()))
: Option.create_None();
return new Error_TransactionCanceledException(message, cancellationReasons);
}
public static Error Error(TransactionConflictException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TransactionConflictException(message);
}
public static Error Error(TransactionInProgressException nativeValue) {
Option<DafnySequence<? extends Character>> message;
message = Objects.nonNull(nativeValue.getMessage()) ?
Option.create_Some(software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage()))
: Option.create_None();
return new Error_TransactionInProgressException(message);
}
public static AttributeAction AttributeAction(
software.amazon.awssdk.services.dynamodb.model.AttributeAction nativeValue) {
switch (nativeValue) {
case ADD: {
return AttributeAction.create_ADD();
}
case PUT: {
return AttributeAction.create_PUT();
}
case DELETE: {
return AttributeAction.create_DELETE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.AttributeAction.");
}
}
}
public static BackupStatus BackupStatus(
software.amazon.awssdk.services.dynamodb.model.BackupStatus nativeValue) {
switch (nativeValue) {
case CREATING: {
return BackupStatus.create_CREATING();
}
case DELETED: {
return BackupStatus.create_DELETED();
}
case AVAILABLE: {
return BackupStatus.create_AVAILABLE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupStatus.");
}
}
}
public static BackupType BackupType(
software.amazon.awssdk.services.dynamodb.model.BackupType nativeValue) {
switch (nativeValue) {
case USER: {
return BackupType.create_USER();
}
case SYSTEM: {
return BackupType.create_SYSTEM();
}
case AWS_BACKUP: {
return BackupType.create_AWS__BACKUP();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupType.");
}
}
}
public static BackupTypeFilter BackupTypeFilter(
software.amazon.awssdk.services.dynamodb.model.BackupTypeFilter nativeValue) {
switch (nativeValue) {
case USER: {
return BackupTypeFilter.create_USER();
}
case SYSTEM: {
return BackupTypeFilter.create_SYSTEM();
}
case AWS_BACKUP: {
return BackupTypeFilter.create_AWS__BACKUP();
}
case ALL: {
return BackupTypeFilter.create_ALL();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.BackupTypeFilter.");
}
}
}
public static BatchStatementErrorCodeEnum BatchStatementErrorCodeEnum(
software.amazon.awssdk.services.dynamodb.model.BatchStatementErrorCodeEnum nativeValue) {
switch (nativeValue) {
case CONDITIONAL_CHECK_FAILED: {
return BatchStatementErrorCodeEnum.create_ConditionalCheckFailed();
}
case ITEM_COLLECTION_SIZE_LIMIT_EXCEEDED: {
return BatchStatementErrorCodeEnum.create_ItemCollectionSizeLimitExceeded();
}
case REQUEST_LIMIT_EXCEEDED: {
return BatchStatementErrorCodeEnum.create_RequestLimitExceeded();
}
case VALIDATION_ERROR: {
return BatchStatementErrorCodeEnum.create_ValidationError();
}
case PROVISIONED_THROUGHPUT_EXCEEDED: {
return BatchStatementErrorCodeEnum.create_ProvisionedThroughputExceeded();
}
case TRANSACTION_CONFLICT: {
return BatchStatementErrorCodeEnum.create_TransactionConflict();
}
case THROTTLING_ERROR: {
return BatchStatementErrorCodeEnum.create_ThrottlingError();
}
case INTERNAL_SERVER_ERROR: {
return BatchStatementErrorCodeEnum.create_InternalServerError();
}
case RESOURCE_NOT_FOUND: {
return BatchStatementErrorCodeEnum.create_ResourceNotFound();
}
case ACCESS_DENIED: {
return BatchStatementErrorCodeEnum.create_AccessDenied();
}
case DUPLICATE_ITEM: {
return BatchStatementErrorCodeEnum.create_DuplicateItem();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.BatchStatementErrorCodeEnum.");
}
}
}
public static BillingMode BillingMode(
software.amazon.awssdk.services.dynamodb.model.BillingMode nativeValue) {
switch (nativeValue) {
case PROVISIONED: {
return BillingMode.create_PROVISIONED();
}
case PAY_PER_REQUEST: {
return BillingMode.create_PAY__PER__REQUEST();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.BillingMode.");
}
}
}
public static ComparisonOperator ComparisonOperator(
software.amazon.awssdk.services.dynamodb.model.ComparisonOperator nativeValue) {
switch (nativeValue) {
case EQ: {
return ComparisonOperator.create_EQ();
}
case NE: {
return ComparisonOperator.create_NE();
}
case IN: {
return ComparisonOperator.create_IN();
}
case LE: {
return ComparisonOperator.create_LE();
}
case LT: {
return ComparisonOperator.create_LT();
}
case GE: {
return ComparisonOperator.create_GE();
}
case GT: {
return ComparisonOperator.create_GT();
}
case BETWEEN: {
return ComparisonOperator.create_BETWEEN();
}
case NOT_NULL: {
return ComparisonOperator.create_NOT__NULL();
}
case NULL: {
return ComparisonOperator.create_NULL();
}
case CONTAINS: {
return ComparisonOperator.create_CONTAINS();
}
case NOT_CONTAINS: {
return ComparisonOperator.create_NOT__CONTAINS();
}
case BEGINS_WITH: {
return ComparisonOperator.create_BEGINS__WITH();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ComparisonOperator.");
}
}
}
public static ConditionalOperator ConditionalOperator(
software.amazon.awssdk.services.dynamodb.model.ConditionalOperator nativeValue) {
switch (nativeValue) {
case AND: {
return ConditionalOperator.create_AND();
}
case OR: {
return ConditionalOperator.create_OR();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ConditionalOperator.");
}
}
}
public static ContinuousBackupsStatus ContinuousBackupsStatus(
software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsStatus nativeValue) {
switch (nativeValue) {
case ENABLED: {
return ContinuousBackupsStatus.create_ENABLED();
}
case DISABLED: {
return ContinuousBackupsStatus.create_DISABLED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ContinuousBackupsStatus.");
}
}
}
public static ContributorInsightsAction ContributorInsightsAction(
software.amazon.awssdk.services.dynamodb.model.ContributorInsightsAction nativeValue) {
switch (nativeValue) {
case ENABLE: {
return ContributorInsightsAction.create_ENABLE();
}
case DISABLE: {
return ContributorInsightsAction.create_DISABLE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsAction.");
}
}
}
public static ContributorInsightsStatus ContributorInsightsStatus(
software.amazon.awssdk.services.dynamodb.model.ContributorInsightsStatus nativeValue) {
switch (nativeValue) {
case ENABLING: {
return ContributorInsightsStatus.create_ENABLING();
}
case ENABLED: {
return ContributorInsightsStatus.create_ENABLED();
}
case DISABLING: {
return ContributorInsightsStatus.create_DISABLING();
}
case DISABLED: {
return ContributorInsightsStatus.create_DISABLED();
}
case FAILED: {
return ContributorInsightsStatus.create_FAILED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ContributorInsightsStatus.");
}
}
}
public static DestinationStatus DestinationStatus(
software.amazon.awssdk.services.dynamodb.model.DestinationStatus nativeValue) {
switch (nativeValue) {
case ENABLING: {
return DestinationStatus.create_ENABLING();
}
case ACTIVE: {
return DestinationStatus.create_ACTIVE();
}
case DISABLING: {
return DestinationStatus.create_DISABLING();
}
case DISABLED: {
return DestinationStatus.create_DISABLED();
}
case ENABLE_FAILED: {
return DestinationStatus.create_ENABLE__FAILED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.DestinationStatus.");
}
}
}
public static ExportFormat ExportFormat(
software.amazon.awssdk.services.dynamodb.model.ExportFormat nativeValue) {
switch (nativeValue) {
case DYNAMODB_JSON: {
return ExportFormat.create_DYNAMODB__JSON();
}
case ION: {
return ExportFormat.create_ION();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportFormat.");
}
}
}
public static ExportStatus ExportStatus(
software.amazon.awssdk.services.dynamodb.model.ExportStatus nativeValue) {
switch (nativeValue) {
case IN_PROGRESS: {
return ExportStatus.create_IN__PROGRESS();
}
case COMPLETED: {
return ExportStatus.create_COMPLETED();
}
case FAILED: {
return ExportStatus.create_FAILED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ExportStatus.");
}
}
}
public static GlobalTableStatus GlobalTableStatus(
software.amazon.awssdk.services.dynamodb.model.GlobalTableStatus nativeValue) {
switch (nativeValue) {
case CREATING: {
return GlobalTableStatus.create_CREATING();
}
case ACTIVE: {
return GlobalTableStatus.create_ACTIVE();
}
case DELETING: {
return GlobalTableStatus.create_DELETING();
}
case UPDATING: {
return GlobalTableStatus.create_UPDATING();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.GlobalTableStatus.");
}
}
}
public static ImportStatus ImportStatus(
software.amazon.awssdk.services.dynamodb.model.ImportStatus nativeValue) {
switch (nativeValue) {
case IN_PROGRESS: {
return ImportStatus.create_IN__PROGRESS();
}
case COMPLETED: {
return ImportStatus.create_COMPLETED();
}
case CANCELLING: {
return ImportStatus.create_CANCELLING();
}
case CANCELLED: {
return ImportStatus.create_CANCELLED();
}
case FAILED: {
return ImportStatus.create_FAILED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ImportStatus.");
}
}
}
public static IndexStatus IndexStatus(
software.amazon.awssdk.services.dynamodb.model.IndexStatus nativeValue) {
switch (nativeValue) {
case CREATING: {
return IndexStatus.create_CREATING();
}
case UPDATING: {
return IndexStatus.create_UPDATING();
}
case DELETING: {
return IndexStatus.create_DELETING();
}
case ACTIVE: {
return IndexStatus.create_ACTIVE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.IndexStatus.");
}
}
}
public static InputCompressionType InputCompressionType(
software.amazon.awssdk.services.dynamodb.model.InputCompressionType nativeValue) {
switch (nativeValue) {
case GZIP: {
return InputCompressionType.create_GZIP();
}
case ZSTD: {
return InputCompressionType.create_ZSTD();
}
case NONE: {
return InputCompressionType.create_NONE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.InputCompressionType.");
}
}
}
public static InputFormat InputFormat(
software.amazon.awssdk.services.dynamodb.model.InputFormat nativeValue) {
switch (nativeValue) {
case DYNAMODB_JSON: {
return InputFormat.create_DYNAMODB__JSON();
}
case ION: {
return InputFormat.create_ION();
}
case CSV: {
return InputFormat.create_CSV();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.InputFormat.");
}
}
}
public static KeyType KeyType(
software.amazon.awssdk.services.dynamodb.model.KeyType nativeValue) {
switch (nativeValue) {
case HASH: {
return KeyType.create_HASH();
}
case RANGE: {
return KeyType.create_RANGE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.KeyType.");
}
}
}
public static PointInTimeRecoveryStatus PointInTimeRecoveryStatus(
software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryStatus nativeValue) {
switch (nativeValue) {
case ENABLED: {
return PointInTimeRecoveryStatus.create_ENABLED();
}
case DISABLED: {
return PointInTimeRecoveryStatus.create_DISABLED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.PointInTimeRecoveryStatus.");
}
}
}
public static ProjectionType ProjectionType(
software.amazon.awssdk.services.dynamodb.model.ProjectionType nativeValue) {
switch (nativeValue) {
case ALL: {
return ProjectionType.create_ALL();
}
case KEYS_ONLY: {
return ProjectionType.create_KEYS__ONLY();
}
case INCLUDE: {
return ProjectionType.create_INCLUDE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ProjectionType.");
}
}
}
public static ReplicaStatus ReplicaStatus(
software.amazon.awssdk.services.dynamodb.model.ReplicaStatus nativeValue) {
switch (nativeValue) {
case CREATING: {
return ReplicaStatus.create_CREATING();
}
case CREATION_FAILED: {
return ReplicaStatus.create_CREATION__FAILED();
}
case UPDATING: {
return ReplicaStatus.create_UPDATING();
}
case DELETING: {
return ReplicaStatus.create_DELETING();
}
case ACTIVE: {
return ReplicaStatus.create_ACTIVE();
}
case REGION_DISABLED: {
return ReplicaStatus.create_REGION__DISABLED();
}
case INACCESSIBLE_ENCRYPTION_CREDENTIALS: {
return ReplicaStatus.create_INACCESSIBLE__ENCRYPTION__CREDENTIALS();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ReplicaStatus.");
}
}
}
public static ReturnConsumedCapacity ReturnConsumedCapacity(
software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity nativeValue) {
switch (nativeValue) {
case INDEXES: {
return ReturnConsumedCapacity.create_INDEXES();
}
case TOTAL: {
return ReturnConsumedCapacity.create_TOTAL();
}
case NONE: {
return ReturnConsumedCapacity.create_NONE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnConsumedCapacity.");
}
}
}
public static ReturnItemCollectionMetrics ReturnItemCollectionMetrics(
software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics nativeValue) {
switch (nativeValue) {
case SIZE: {
return ReturnItemCollectionMetrics.create_SIZE();
}
case NONE: {
return ReturnItemCollectionMetrics.create_NONE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnItemCollectionMetrics.");
}
}
}
public static ReturnValue ReturnValue(
software.amazon.awssdk.services.dynamodb.model.ReturnValue nativeValue) {
switch (nativeValue) {
case NONE: {
return ReturnValue.create_NONE();
}
case ALL_OLD: {
return ReturnValue.create_ALL__OLD();
}
case UPDATED_OLD: {
return ReturnValue.create_UPDATED__OLD();
}
case ALL_NEW: {
return ReturnValue.create_ALL__NEW();
}
case UPDATED_NEW: {
return ReturnValue.create_UPDATED__NEW();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValue.");
}
}
}
public static ReturnValuesOnConditionCheckFailure ReturnValuesOnConditionCheckFailure(
software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure nativeValue) {
switch (nativeValue) {
case ALL_OLD: {
return ReturnValuesOnConditionCheckFailure.create_ALL__OLD();
}
case NONE: {
return ReturnValuesOnConditionCheckFailure.create_NONE();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ReturnValuesOnConditionCheckFailure.");
}
}
}
public static S3SseAlgorithm S3SseAlgorithm(
software.amazon.awssdk.services.dynamodb.model.S3SseAlgorithm nativeValue) {
switch (nativeValue) {
case AES256: {
return S3SseAlgorithm.create_AES256();
}
case KMS: {
return S3SseAlgorithm.create_KMS();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.S3SseAlgorithm.");
}
}
}
public static ScalarAttributeType ScalarAttributeType(
software.amazon.awssdk.services.dynamodb.model.ScalarAttributeType nativeValue) {
switch (nativeValue) {
case S: {
return ScalarAttributeType.create_S();
}
case N: {
return ScalarAttributeType.create_N();
}
case B: {
return ScalarAttributeType.create_B();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.ScalarAttributeType.");
}
}
}
public static Select Select(software.amazon.awssdk.services.dynamodb.model.Select nativeValue) {
switch (nativeValue) {
case ALL_ATTRIBUTES: {
return Select.create_ALL__ATTRIBUTES();
}
case ALL_PROJECTED_ATTRIBUTES: {
return Select.create_ALL__PROJECTED__ATTRIBUTES();
}
case SPECIFIC_ATTRIBUTES: {
return Select.create_SPECIFIC__ATTRIBUTES();
}
case COUNT: {
return Select.create_COUNT();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.Select.");
}
}
}
public static SSEStatus SSEStatus(
software.amazon.awssdk.services.dynamodb.model.SSEStatus nativeValue) {
switch (nativeValue) {
case ENABLING: {
return SSEStatus.create_ENABLING();
}
case ENABLED: {
return SSEStatus.create_ENABLED();
}
case DISABLING: {
return SSEStatus.create_DISABLING();
}
case DISABLED: {
return SSEStatus.create_DISABLED();
}
case UPDATING: {
return SSEStatus.create_UPDATING();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEStatus.");
}
}
}
public static SSEType SSEType(
software.amazon.awssdk.services.dynamodb.model.SSEType nativeValue) {
switch (nativeValue) {
case AES256: {
return SSEType.create_AES256();
}
case KMS: {
return SSEType.create_KMS();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.SSEType.");
}
}
}
public static StreamViewType StreamViewType(
software.amazon.awssdk.services.dynamodb.model.StreamViewType nativeValue) {
switch (nativeValue) {
case NEW_IMAGE: {
return StreamViewType.create_NEW__IMAGE();
}
case OLD_IMAGE: {
return StreamViewType.create_OLD__IMAGE();
}
case NEW_AND_OLD_IMAGES: {
return StreamViewType.create_NEW__AND__OLD__IMAGES();
}
case KEYS_ONLY: {
return StreamViewType.create_KEYS__ONLY();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.StreamViewType.");
}
}
}
public static TableClass TableClass(
software.amazon.awssdk.services.dynamodb.model.TableClass nativeValue) {
switch (nativeValue) {
case STANDARD: {
return TableClass.create_STANDARD();
}
case STANDARD_INFREQUENT_ACCESS: {
return TableClass.create_STANDARD__INFREQUENT__ACCESS();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.TableClass.");
}
}
}
public static TableStatus TableStatus(
software.amazon.awssdk.services.dynamodb.model.TableStatus nativeValue) {
switch (nativeValue) {
case CREATING: {
return TableStatus.create_CREATING();
}
case UPDATING: {
return TableStatus.create_UPDATING();
}
case DELETING: {
return TableStatus.create_DELETING();
}
case ACTIVE: {
return TableStatus.create_ACTIVE();
}
case INACCESSIBLE_ENCRYPTION_CREDENTIALS: {
return TableStatus.create_INACCESSIBLE__ENCRYPTION__CREDENTIALS();
}
case ARCHIVING: {
return TableStatus.create_ARCHIVING();
}
case ARCHIVED: {
return TableStatus.create_ARCHIVED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.TableStatus.");
}
}
}
public static TimeToLiveStatus TimeToLiveStatus(
software.amazon.awssdk.services.dynamodb.model.TimeToLiveStatus nativeValue) {
switch (nativeValue) {
case ENABLING: {
return TimeToLiveStatus.create_ENABLING();
}
case DISABLING: {
return TimeToLiveStatus.create_DISABLING();
}
case ENABLED: {
return TimeToLiveStatus.create_ENABLED();
}
case DISABLED: {
return TimeToLiveStatus.create_DISABLED();
}
default: {
throw new RuntimeException("Cannot convert " + nativeValue + " to software.amazon.cryptography.services.dynamodb.internaldafny.types.TimeToLiveStatus.");
}
}
}
public static AttributeAction AttributeAction(String nativeValue) {
return AttributeAction(software.amazon.awssdk.services.dynamodb.model.AttributeAction.fromValue(nativeValue));
}
public static BackupStatus BackupStatus(String nativeValue) {
return BackupStatus(software.amazon.awssdk.services.dynamodb.model.BackupStatus.fromValue(nativeValue));
}
public static BackupType BackupType(String nativeValue) {
return BackupType(software.amazon.awssdk.services.dynamodb.model.BackupType.fromValue(nativeValue));
}
public static BackupTypeFilter BackupTypeFilter(String nativeValue) {
return BackupTypeFilter(software.amazon.awssdk.services.dynamodb.model.BackupTypeFilter.fromValue(nativeValue));
}
public static BatchStatementErrorCodeEnum BatchStatementErrorCodeEnum(String nativeValue) {
return BatchStatementErrorCodeEnum(software.amazon.awssdk.services.dynamodb.model.BatchStatementErrorCodeEnum.fromValue(nativeValue));
}
public static BillingMode BillingMode(String nativeValue) {
return BillingMode(software.amazon.awssdk.services.dynamodb.model.BillingMode.fromValue(nativeValue));
}
public static ComparisonOperator ComparisonOperator(String nativeValue) {
return ComparisonOperator(software.amazon.awssdk.services.dynamodb.model.ComparisonOperator.fromValue(nativeValue));
}
public static ConditionalOperator ConditionalOperator(String nativeValue) {
return ConditionalOperator(software.amazon.awssdk.services.dynamodb.model.ConditionalOperator.fromValue(nativeValue));
}
public static ContinuousBackupsStatus ContinuousBackupsStatus(String nativeValue) {
return ContinuousBackupsStatus(software.amazon.awssdk.services.dynamodb.model.ContinuousBackupsStatus.fromValue(nativeValue));
}
public static ContributorInsightsAction ContributorInsightsAction(String nativeValue) {
return ContributorInsightsAction(software.amazon.awssdk.services.dynamodb.model.ContributorInsightsAction.fromValue(nativeValue));
}
public static ContributorInsightsStatus ContributorInsightsStatus(String nativeValue) {
return ContributorInsightsStatus(software.amazon.awssdk.services.dynamodb.model.ContributorInsightsStatus.fromValue(nativeValue));
}
public static DestinationStatus DestinationStatus(String nativeValue) {
return DestinationStatus(software.amazon.awssdk.services.dynamodb.model.DestinationStatus.fromValue(nativeValue));
}
public static ExportFormat ExportFormat(String nativeValue) {
return ExportFormat(software.amazon.awssdk.services.dynamodb.model.ExportFormat.fromValue(nativeValue));
}
public static ExportStatus ExportStatus(String nativeValue) {
return ExportStatus(software.amazon.awssdk.services.dynamodb.model.ExportStatus.fromValue(nativeValue));
}
public static GlobalTableStatus GlobalTableStatus(String nativeValue) {
return GlobalTableStatus(software.amazon.awssdk.services.dynamodb.model.GlobalTableStatus.fromValue(nativeValue));
}
public static ImportStatus ImportStatus(String nativeValue) {
return ImportStatus(software.amazon.awssdk.services.dynamodb.model.ImportStatus.fromValue(nativeValue));
}
public static IndexStatus IndexStatus(String nativeValue) {
return IndexStatus(software.amazon.awssdk.services.dynamodb.model.IndexStatus.fromValue(nativeValue));
}
public static InputCompressionType InputCompressionType(String nativeValue) {
return InputCompressionType(software.amazon.awssdk.services.dynamodb.model.InputCompressionType.fromValue(nativeValue));
}
public static InputFormat InputFormat(String nativeValue) {
return InputFormat(software.amazon.awssdk.services.dynamodb.model.InputFormat.fromValue(nativeValue));
}
public static KeyType KeyType(String nativeValue) {
return KeyType(software.amazon.awssdk.services.dynamodb.model.KeyType.fromValue(nativeValue));
}
public static PointInTimeRecoveryStatus PointInTimeRecoveryStatus(String nativeValue) {
return PointInTimeRecoveryStatus(software.amazon.awssdk.services.dynamodb.model.PointInTimeRecoveryStatus.fromValue(nativeValue));
}
public static ProjectionType ProjectionType(String nativeValue) {
return ProjectionType(software.amazon.awssdk.services.dynamodb.model.ProjectionType.fromValue(nativeValue));
}
public static ReplicaStatus ReplicaStatus(String nativeValue) {
return ReplicaStatus(software.amazon.awssdk.services.dynamodb.model.ReplicaStatus.fromValue(nativeValue));
}
public static ReturnConsumedCapacity ReturnConsumedCapacity(String nativeValue) {
return ReturnConsumedCapacity(software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity.fromValue(nativeValue));
}
public static ReturnItemCollectionMetrics ReturnItemCollectionMetrics(String nativeValue) {
return ReturnItemCollectionMetrics(software.amazon.awssdk.services.dynamodb.model.ReturnItemCollectionMetrics.fromValue(nativeValue));
}
public static ReturnValue ReturnValue(String nativeValue) {
return ReturnValue(software.amazon.awssdk.services.dynamodb.model.ReturnValue.fromValue(nativeValue));
}
public static ReturnValuesOnConditionCheckFailure ReturnValuesOnConditionCheckFailure(
String nativeValue) {
return ReturnValuesOnConditionCheckFailure(software.amazon.awssdk.services.dynamodb.model.ReturnValuesOnConditionCheckFailure.fromValue(nativeValue));
}
public static S3SseAlgorithm S3SseAlgorithm(String nativeValue) {
return S3SseAlgorithm(software.amazon.awssdk.services.dynamodb.model.S3SseAlgorithm.fromValue(nativeValue));
}
public static ScalarAttributeType ScalarAttributeType(String nativeValue) {
return ScalarAttributeType(software.amazon.awssdk.services.dynamodb.model.ScalarAttributeType.fromValue(nativeValue));
}
public static Select Select(String nativeValue) {
return Select(software.amazon.awssdk.services.dynamodb.model.Select.fromValue(nativeValue));
}
public static SSEStatus SSEStatus(String nativeValue) {
return SSEStatus(software.amazon.awssdk.services.dynamodb.model.SSEStatus.fromValue(nativeValue));
}
public static SSEType SSEType(String nativeValue) {
return SSEType(software.amazon.awssdk.services.dynamodb.model.SSEType.fromValue(nativeValue));
}
public static StreamViewType StreamViewType(String nativeValue) {
return StreamViewType(software.amazon.awssdk.services.dynamodb.model.StreamViewType.fromValue(nativeValue));
}
public static TableClass TableClass(String nativeValue) {
return TableClass(software.amazon.awssdk.services.dynamodb.model.TableClass.fromValue(nativeValue));
}
public static TableStatus TableStatus(String nativeValue) {
return TableStatus(software.amazon.awssdk.services.dynamodb.model.TableStatus.fromValue(nativeValue));
}
public static TimeToLiveStatus TimeToLiveStatus(String nativeValue) {
return TimeToLiveStatus(software.amazon.awssdk.services.dynamodb.model.TimeToLiveStatus.fromValue(nativeValue));
}
public static Error Error(DynamoDbException nativeValue) {
// BEGIN MANUAL EDIT
return new Error_Opaque(nativeValue);
// END MANUAL EDIT
}
public static IDynamoDBClient DynamoDB_20120810(DynamoDbClient nativeValue) {
return new Shim(nativeValue, null);
}
}
| 414 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviderstestvectorkeys/internaldafny/__default.java
|
package software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny;
public class __default extends _ExternBase___default {
}
| 415 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviders/internaldafny
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/java/software/amazon/cryptography/materialproviders/internaldafny/wrapped/__default.java
|
package software.amazon.cryptography.materialproviders.internaldafny.wrapped;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.internaldafny.types.IAwsCryptographicMaterialProvidersClient;
import software.amazon.cryptography.materialproviders.internaldafny.types.MaterialProvidersConfig;
import Wrappers_Compile.Result;
import software.amazon.cryptography.materialproviders.MaterialProviders;
import software.amazon.cryptography.materialproviders.ToNative;
import software.amazon.cryptography.materialproviders.wrapped.TestMaterialProviders;
public class __default extends _ExternBase___default {
public static Result<IAwsCryptographicMaterialProvidersClient, Error> WrappedMaterialProviders(MaterialProvidersConfig config) {
software.amazon.cryptography.materialproviders.model.MaterialProvidersConfig wrappedConfig = ToNative.MaterialProvidersConfig(config);
software.amazon.cryptography.materialproviders.MaterialProviders impl = MaterialProviders.builder().MaterialProvidersConfig(wrappedConfig).build();
TestMaterialProviders wrappedClient = TestMaterialProviders.builder().impl(impl).build();
return Result.create_Success(wrappedClient);
}
}
| 416 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/ToNative.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys;
import java.lang.RuntimeException;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error_CollectionOfErrors;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error_KeyVectorException;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error_Opaque;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.IKeyVectorsClient;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.CollectionOfErrors;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.HierarchyKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KMSInfo;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyDescription;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyVectorException;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyVectorsConfig;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsMrkAware;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsMrkAwareDiscovery;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsRsaKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.OpaqueError;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.RawAES;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.RawRSA;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.StaticKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.TestVectorKeyringInput;
public class ToNative {
public static OpaqueError Error(Error_Opaque dafnyValue) {
OpaqueError.Builder nativeBuilder = OpaqueError.builder();
nativeBuilder.obj(dafnyValue.dtor_obj());
return nativeBuilder.build();
}
public static CollectionOfErrors Error(Error_CollectionOfErrors dafnyValue) {
CollectionOfErrors.Builder nativeBuilder = CollectionOfErrors.builder();
nativeBuilder.list(
software.amazon.smithy.dafny.conversion.ToNative.Aggregate.GenericToList(
dafnyValue.dtor_list(),
ToNative::Error));
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static KeyVectorException Error(Error_KeyVectorException dafnyValue) {
KeyVectorException.Builder nativeBuilder = KeyVectorException.builder();
nativeBuilder.message(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_message()));
return nativeBuilder.build();
}
public static RuntimeException Error(Error dafnyValue) {
if (dafnyValue.is_KeyVectorException()) {
return ToNative.Error((Error_KeyVectorException) dafnyValue);
}
if (dafnyValue.is_Opaque()) {
return ToNative.Error((Error_Opaque) dafnyValue);
}
if (dafnyValue.is_CollectionOfErrors()) {
return ToNative.Error((Error_CollectionOfErrors) dafnyValue);
}
OpaqueError.Builder nativeBuilder = OpaqueError.builder();
nativeBuilder.obj(dafnyValue);
return nativeBuilder.build();
}
public static GetKeyDescriptionInput GetKeyDescriptionInput(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionInput dafnyValue) {
GetKeyDescriptionInput.Builder nativeBuilder = GetKeyDescriptionInput.builder();
nativeBuilder.json(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_json()));
return nativeBuilder.build();
}
public static GetKeyDescriptionOutput GetKeyDescriptionOutput(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionOutput dafnyValue) {
GetKeyDescriptionOutput.Builder nativeBuilder = GetKeyDescriptionOutput.builder();
nativeBuilder.keyDescription(ToNative.KeyDescription(dafnyValue.dtor_keyDescription()));
return nativeBuilder.build();
}
public static HierarchyKeyring HierarchyKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.HierarchyKeyring dafnyValue) {
HierarchyKeyring.Builder nativeBuilder = HierarchyKeyring.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
return nativeBuilder.build();
}
public static KeyVectorsConfig KeyVectorsConfig(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyVectorsConfig dafnyValue) {
KeyVectorsConfig.Builder nativeBuilder = KeyVectorsConfig.builder();
nativeBuilder.keyManifiestPath(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyManifiestPath()));
return nativeBuilder.build();
}
public static KMSInfo KMSInfo(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KMSInfo dafnyValue) {
KMSInfo.Builder nativeBuilder = KMSInfo.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
return nativeBuilder.build();
}
public static KmsMrkAware KmsMrkAware(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsMrkAware dafnyValue) {
KmsMrkAware.Builder nativeBuilder = KmsMrkAware.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
return nativeBuilder.build();
}
public static KmsMrkAwareDiscovery KmsMrkAwareDiscovery(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsMrkAwareDiscovery dafnyValue) {
KmsMrkAwareDiscovery.Builder nativeBuilder = KmsMrkAwareDiscovery.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
nativeBuilder.defaultMrkRegion(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_defaultMrkRegion()));
if (dafnyValue.dtor_awsKmsDiscoveryFilter().is_Some()) {
nativeBuilder.awsKmsDiscoveryFilter(software.amazon.cryptography.materialproviders.ToNative.DiscoveryFilter(dafnyValue.dtor_awsKmsDiscoveryFilter().dtor_value()));
}
return nativeBuilder.build();
}
public static KmsRsaKeyring KmsRsaKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsRsaKeyring dafnyValue) {
KmsRsaKeyring.Builder nativeBuilder = KmsRsaKeyring.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
nativeBuilder.encryptionAlgorithm(software.amazon.cryptography.services.kms.internaldafny.ToNative.EncryptionAlgorithmSpec(dafnyValue.dtor_encryptionAlgorithm()));
return nativeBuilder.build();
}
public static RawAES RawAES(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.RawAES dafnyValue) {
RawAES.Builder nativeBuilder = RawAES.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
nativeBuilder.providerId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_providerId()));
return nativeBuilder.build();
}
public static RawRSA RawRSA(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.RawRSA dafnyValue) {
RawRSA.Builder nativeBuilder = RawRSA.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
nativeBuilder.providerId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_providerId()));
nativeBuilder.padding(software.amazon.cryptography.materialproviders.ToNative.PaddingScheme(dafnyValue.dtor_padding()));
return nativeBuilder.build();
}
public static SerializeKeyDescriptionInput SerializeKeyDescriptionInput(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionInput dafnyValue) {
SerializeKeyDescriptionInput.Builder nativeBuilder = SerializeKeyDescriptionInput.builder();
nativeBuilder.keyDescription(ToNative.KeyDescription(dafnyValue.dtor_keyDescription()));
return nativeBuilder.build();
}
public static SerializeKeyDescriptionOutput SerializeKeyDescriptionOutput(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionOutput dafnyValue) {
SerializeKeyDescriptionOutput.Builder nativeBuilder = SerializeKeyDescriptionOutput.builder();
nativeBuilder.json(software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyValue.dtor_json()));
return nativeBuilder.build();
}
public static StaticKeyring StaticKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.StaticKeyring dafnyValue) {
StaticKeyring.Builder nativeBuilder = StaticKeyring.builder();
nativeBuilder.keyId(software.amazon.smithy.dafny.conversion.ToNative.Simple.String(dafnyValue.dtor_keyId()));
return nativeBuilder.build();
}
public static TestVectorKeyringInput TestVectorKeyringInput(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.TestVectorKeyringInput dafnyValue) {
TestVectorKeyringInput.Builder nativeBuilder = TestVectorKeyringInput.builder();
nativeBuilder.keyDescription(ToNative.KeyDescription(dafnyValue.dtor_keyDescription()));
return nativeBuilder.build();
}
public static KeyDescription KeyDescription(
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyDescription dafnyValue) {
KeyDescription.Builder nativeBuilder = KeyDescription.builder();
if (dafnyValue.is_Kms()) {
nativeBuilder.Kms(ToNative.KMSInfo(dafnyValue.dtor_Kms()));
}
if (dafnyValue.is_KmsMrk()) {
nativeBuilder.KmsMrk(ToNative.KmsMrkAware(dafnyValue.dtor_KmsMrk()));
}
if (dafnyValue.is_KmsMrkDiscovery()) {
nativeBuilder.KmsMrkDiscovery(ToNative.KmsMrkAwareDiscovery(dafnyValue.dtor_KmsMrkDiscovery()));
}
if (dafnyValue.is_RSA()) {
nativeBuilder.RSA(ToNative.RawRSA(dafnyValue.dtor_RSA()));
}
if (dafnyValue.is_AES()) {
nativeBuilder.AES(ToNative.RawAES(dafnyValue.dtor_AES()));
}
if (dafnyValue.is_Static()) {
nativeBuilder.Static(ToNative.StaticKeyring(dafnyValue.dtor_Static()));
}
if (dafnyValue.is_KmsRsa()) {
nativeBuilder.KmsRsa(ToNative.KmsRsaKeyring(dafnyValue.dtor_KmsRsa()));
}
if (dafnyValue.is_Hierarchy()) {
nativeBuilder.Hierarchy(ToNative.HierarchyKeyring(dafnyValue.dtor_Hierarchy()));
}
return nativeBuilder.build();
}
public static KeyVectors KeyVectors(IKeyVectorsClient dafnyValue) {
return new KeyVectors(dafnyValue);
}
}
| 417 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/ToDafny.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys;
import Wrappers_Compile.Option;
import dafny.DafnySequence;
import java.lang.Byte;
import java.lang.Character;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.internaldafny.types.DiscoveryFilter;
import software.amazon.cryptography.materialproviders.internaldafny.types.PaddingScheme;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error_KeyVectorException;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.HierarchyKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.IKeyVectorsClient;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KMSInfo;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyDescription;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyVectorsConfig;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsMrkAware;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsMrkAwareDiscovery;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KmsRsaKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.RawAES;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.RawRSA;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.StaticKeyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.TestVectorKeyringInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.CollectionOfErrors;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyVectorException;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.OpaqueError;
import software.amazon.cryptography.services.kms.internaldafny.types.EncryptionAlgorithmSpec;
public class ToDafny {
public static Error Error(RuntimeException nativeValue) {
if (nativeValue instanceof KeyVectorException) {
return ToDafny.Error((KeyVectorException) nativeValue);
}
if (nativeValue instanceof OpaqueError) {
return ToDafny.Error((OpaqueError) nativeValue);
}
if (nativeValue instanceof CollectionOfErrors) {
return ToDafny.Error((CollectionOfErrors) nativeValue);
}
return Error.create_Opaque(nativeValue);
}
public static Error Error(OpaqueError nativeValue) {
return Error.create_Opaque(nativeValue.obj());
}
public static Error Error(CollectionOfErrors nativeValue) {
DafnySequence<? extends Error> list = software.amazon.smithy.dafny.conversion.ToDafny.Aggregate.GenericToSequence(
nativeValue.list(),
ToDafny::Error,
Error._typeDescriptor());
DafnySequence<? extends Character> message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.getMessage());
return Error.create_CollectionOfErrors(list, message);
}
public static GetKeyDescriptionInput GetKeyDescriptionInput(
software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionInput nativeValue) {
DafnySequence<? extends Byte> json;
json = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.json());
return new GetKeyDescriptionInput(json);
}
public static GetKeyDescriptionOutput GetKeyDescriptionOutput(
software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionOutput nativeValue) {
KeyDescription keyDescription;
keyDescription = ToDafny.KeyDescription(nativeValue.keyDescription());
return new GetKeyDescriptionOutput(keyDescription);
}
public static HierarchyKeyring HierarchyKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.model.HierarchyKeyring nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new HierarchyKeyring(keyId);
}
public static KeyVectorsConfig KeyVectorsConfig(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyVectorsConfig nativeValue) {
DafnySequence<? extends Character> keyManifiestPath;
keyManifiestPath = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyManifiestPath());
return new KeyVectorsConfig(keyManifiestPath);
}
public static KMSInfo KMSInfo(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KMSInfo nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new KMSInfo(keyId);
}
public static KmsMrkAware KmsMrkAware(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsMrkAware nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new KmsMrkAware(keyId);
}
public static KmsMrkAwareDiscovery KmsMrkAwareDiscovery(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsMrkAwareDiscovery nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> defaultMrkRegion;
defaultMrkRegion = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.defaultMrkRegion());
Option<DiscoveryFilter> awsKmsDiscoveryFilter;
awsKmsDiscoveryFilter = Objects.nonNull(nativeValue.awsKmsDiscoveryFilter()) ?
Option.create_Some(software.amazon.cryptography.materialproviders.ToDafny.DiscoveryFilter(nativeValue.awsKmsDiscoveryFilter()))
: Option.create_None();
return new KmsMrkAwareDiscovery(keyId, defaultMrkRegion, awsKmsDiscoveryFilter);
}
public static KmsRsaKeyring KmsRsaKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KmsRsaKeyring nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
EncryptionAlgorithmSpec encryptionAlgorithm;
encryptionAlgorithm = software.amazon.cryptography.services.kms.internaldafny.ToDafny.EncryptionAlgorithmSpec(nativeValue.encryptionAlgorithm());
return new KmsRsaKeyring(keyId, encryptionAlgorithm);
}
public static RawAES RawAES(
software.amazon.cryptography.materialproviderstestvectorkeys.model.RawAES nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> providerId;
providerId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.providerId());
return new RawAES(keyId, providerId);
}
public static RawRSA RawRSA(
software.amazon.cryptography.materialproviderstestvectorkeys.model.RawRSA nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
DafnySequence<? extends Character> providerId;
providerId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.providerId());
PaddingScheme padding;
padding = software.amazon.cryptography.materialproviders.ToDafny.PaddingScheme(nativeValue.padding());
return new RawRSA(keyId, providerId, padding);
}
public static SerializeKeyDescriptionInput SerializeKeyDescriptionInput(
software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionInput nativeValue) {
KeyDescription keyDescription;
keyDescription = ToDafny.KeyDescription(nativeValue.keyDescription());
return new SerializeKeyDescriptionInput(keyDescription);
}
public static SerializeKeyDescriptionOutput SerializeKeyDescriptionOutput(
software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionOutput nativeValue) {
DafnySequence<? extends Byte> json;
json = software.amazon.smithy.dafny.conversion.ToDafny.Simple.ByteSequence(nativeValue.json());
return new SerializeKeyDescriptionOutput(json);
}
public static StaticKeyring StaticKeyring(
software.amazon.cryptography.materialproviderstestvectorkeys.model.StaticKeyring nativeValue) {
DafnySequence<? extends Character> keyId;
keyId = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.keyId());
return new StaticKeyring(keyId);
}
public static TestVectorKeyringInput TestVectorKeyringInput(
software.amazon.cryptography.materialproviderstestvectorkeys.model.TestVectorKeyringInput nativeValue) {
KeyDescription keyDescription;
keyDescription = ToDafny.KeyDescription(nativeValue.keyDescription());
return new TestVectorKeyringInput(keyDescription);
}
public static Error Error(KeyVectorException nativeValue) {
DafnySequence<? extends Character> message;
message = software.amazon.smithy.dafny.conversion.ToDafny.Simple.CharacterSequence(nativeValue.message());
return new Error_KeyVectorException(message);
}
public static KeyDescription KeyDescription(
software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyDescription nativeValue) {
if (Objects.nonNull(nativeValue.Kms())) {
return KeyDescription.create_Kms(ToDafny.KMSInfo(nativeValue.Kms()));
}
if (Objects.nonNull(nativeValue.KmsMrk())) {
return KeyDescription.create_KmsMrk(ToDafny.KmsMrkAware(nativeValue.KmsMrk()));
}
if (Objects.nonNull(nativeValue.KmsMrkDiscovery())) {
return KeyDescription.create_KmsMrkDiscovery(ToDafny.KmsMrkAwareDiscovery(nativeValue.KmsMrkDiscovery()));
}
if (Objects.nonNull(nativeValue.RSA())) {
return KeyDescription.create_RSA(ToDafny.RawRSA(nativeValue.RSA()));
}
if (Objects.nonNull(nativeValue.AES())) {
return KeyDescription.create_AES(ToDafny.RawAES(nativeValue.AES()));
}
if (Objects.nonNull(nativeValue.Static())) {
return KeyDescription.create_Static(ToDafny.StaticKeyring(nativeValue.Static()));
}
if (Objects.nonNull(nativeValue.KmsRsa())) {
return KeyDescription.create_KmsRsa(ToDafny.KmsRsaKeyring(nativeValue.KmsRsa()));
}
if (Objects.nonNull(nativeValue.Hierarchy())) {
return KeyDescription.create_Hierarchy(ToDafny.HierarchyKeyring(nativeValue.Hierarchy()));
}
throw new IllegalArgumentException("Cannot convert " + nativeValue + " to software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyDescription.");
}
public static IKeyVectorsClient KeyVectors(KeyVectors nativeValue) {
return nativeValue.impl();
}
}
| 418 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/KeyVectors.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys;
import Wrappers_Compile.Result;
import java.lang.IllegalArgumentException;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.IKeyring;
import software.amazon.cryptography.materialproviders.Keyring;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.KeyVectorsClient;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.__default;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.Error;
import software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.IKeyVectorsClient;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.GetKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.KeyVectorsConfig;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionInput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.SerializeKeyDescriptionOutput;
import software.amazon.cryptography.materialproviderstestvectorkeys.model.TestVectorKeyringInput;
public class KeyVectors {
private final IKeyVectorsClient _impl;
protected KeyVectors(BuilderImpl builder) {
KeyVectorsConfig input = builder.KeyVectorsConfig();
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.KeyVectorsConfig dafnyValue = ToDafny.KeyVectorsConfig(input);
Result<KeyVectorsClient, Error> result = __default.KeyVectors(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
this._impl = result.dtor_value();
}
KeyVectors(IKeyVectorsClient impl) {
this._impl = impl;
}
public static Builder builder() {
return new BuilderImpl();
}
/**
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateTestVectorKeyring(TestVectorKeyringInput input) {
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.TestVectorKeyringInput dafnyValue = ToDafny.TestVectorKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateTestVectorKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
/**
* @return Outputs for creating a Keyring.
*/
public IKeyring CreateWappedTestVectorKeyring(TestVectorKeyringInput input) {
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.TestVectorKeyringInput dafnyValue = ToDafny.TestVectorKeyringInput(input);
Result<software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring, Error> result = this._impl.CreateWappedTestVectorKeyring(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return Keyring.wrap(result.dtor_value());
}
public GetKeyDescriptionOutput GetKeyDescription(GetKeyDescriptionInput input) {
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionInput dafnyValue = ToDafny.GetKeyDescriptionInput(input);
Result<software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.GetKeyDescriptionOutput, Error> result = this._impl.GetKeyDescription(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.GetKeyDescriptionOutput(result.dtor_value());
}
public SerializeKeyDescriptionOutput SerializeKeyDescription(SerializeKeyDescriptionInput input) {
software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionInput dafnyValue = ToDafny.SerializeKeyDescriptionInput(input);
Result<software.amazon.cryptography.materialproviderstestvectorkeys.internaldafny.types.SerializeKeyDescriptionOutput, Error> result = this._impl.SerializeKeyDescription(dafnyValue);
if (result.is_Failure()) {
throw ToNative.Error(result.dtor_error());
}
return ToNative.SerializeKeyDescriptionOutput(result.dtor_value());
}
protected IKeyVectorsClient impl() {
return this._impl;
}
public interface Builder {
Builder KeyVectorsConfig(KeyVectorsConfig KeyVectorsConfig);
KeyVectorsConfig KeyVectorsConfig();
KeyVectors build();
}
static class BuilderImpl implements Builder {
protected KeyVectorsConfig KeyVectorsConfig;
protected BuilderImpl() {
}
public Builder KeyVectorsConfig(KeyVectorsConfig KeyVectorsConfig) {
this.KeyVectorsConfig = KeyVectorsConfig;
return this;
}
public KeyVectorsConfig KeyVectorsConfig() {
return this.KeyVectorsConfig;
}
public KeyVectors build() {
if (Objects.isNull(this.KeyVectorsConfig())) {
throw new IllegalArgumentException("Missing value for required field `KeyVectorsConfig`");
}
return new KeyVectors(this);
}
}
}
| 419 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/GetKeyDescriptionOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class GetKeyDescriptionOutput {
private final KeyDescription keyDescription;
protected GetKeyDescriptionOutput(BuilderImpl builder) {
this.keyDescription = builder.keyDescription();
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyDescription(KeyDescription keyDescription);
KeyDescription keyDescription();
GetKeyDescriptionOutput build();
}
static class BuilderImpl implements Builder {
protected KeyDescription keyDescription;
protected BuilderImpl() {
}
protected BuilderImpl(GetKeyDescriptionOutput model) {
this.keyDescription = model.keyDescription();
}
public Builder keyDescription(KeyDescription keyDescription) {
this.keyDescription = keyDescription;
return this;
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public GetKeyDescriptionOutput build() {
if (Objects.isNull(this.keyDescription())) {
throw new IllegalArgumentException("Missing value for required field `keyDescription`");
}
return new GetKeyDescriptionOutput(this);
}
}
}
| 420 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/HierarchyKeyring.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class HierarchyKeyring {
private final String keyId;
protected HierarchyKeyring(BuilderImpl builder) {
this.keyId = builder.keyId();
}
public String keyId() {
return this.keyId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
HierarchyKeyring build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected BuilderImpl() {
}
protected BuilderImpl(HierarchyKeyring model) {
this.keyId = model.keyId();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public HierarchyKeyring build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
return new HierarchyKeyring(this);
}
}
}
| 421 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/SerializeKeyDescriptionOutput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class SerializeKeyDescriptionOutput {
private final ByteBuffer json;
protected SerializeKeyDescriptionOutput(BuilderImpl builder) {
this.json = builder.json();
}
public ByteBuffer json() {
return this.json;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder json(ByteBuffer json);
ByteBuffer json();
SerializeKeyDescriptionOutput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer json;
protected BuilderImpl() {
}
protected BuilderImpl(SerializeKeyDescriptionOutput model) {
this.json = model.json();
}
public Builder json(ByteBuffer json) {
this.json = json;
return this;
}
public ByteBuffer json() {
return this.json;
}
public SerializeKeyDescriptionOutput build() {
if (Objects.isNull(this.json())) {
throw new IllegalArgumentException("Missing value for required field `json`");
}
return new SerializeKeyDescriptionOutput(this);
}
}
}
| 422 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KeyVectorsConfig.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class KeyVectorsConfig {
private final String keyManifiestPath;
protected KeyVectorsConfig(BuilderImpl builder) {
this.keyManifiestPath = builder.keyManifiestPath();
}
public String keyManifiestPath() {
return this.keyManifiestPath;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyManifiestPath(String keyManifiestPath);
String keyManifiestPath();
KeyVectorsConfig build();
}
static class BuilderImpl implements Builder {
protected String keyManifiestPath;
protected BuilderImpl() {
}
protected BuilderImpl(KeyVectorsConfig model) {
this.keyManifiestPath = model.keyManifiestPath();
}
public Builder keyManifiestPath(String keyManifiestPath) {
this.keyManifiestPath = keyManifiestPath;
return this;
}
public String keyManifiestPath() {
return this.keyManifiestPath;
}
public KeyVectorsConfig build() {
if (Objects.isNull(this.keyManifiestPath())) {
throw new IllegalArgumentException("Missing value for required field `keyManifiestPath`");
}
return new KeyVectorsConfig(this);
}
}
}
| 423 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KMSInfo.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class KMSInfo {
private final String keyId;
protected KMSInfo(BuilderImpl builder) {
this.keyId = builder.keyId();
}
public String keyId() {
return this.keyId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
KMSInfo build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected BuilderImpl() {
}
protected BuilderImpl(KMSInfo model) {
this.keyId = model.keyId();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public KMSInfo build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
return new KMSInfo(this);
}
}
}
| 424 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KmsMrkAware.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class KmsMrkAware {
private final String keyId;
protected KmsMrkAware(BuilderImpl builder) {
this.keyId = builder.keyId();
}
public String keyId() {
return this.keyId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
KmsMrkAware build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected BuilderImpl() {
}
protected BuilderImpl(KmsMrkAware model) {
this.keyId = model.keyId();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public KmsMrkAware build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
return new KmsMrkAware(this);
}
}
}
| 425 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/TestVectorKeyringInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class TestVectorKeyringInput {
private final KeyDescription keyDescription;
protected TestVectorKeyringInput(BuilderImpl builder) {
this.keyDescription = builder.keyDescription();
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyDescription(KeyDescription keyDescription);
KeyDescription keyDescription();
TestVectorKeyringInput build();
}
static class BuilderImpl implements Builder {
protected KeyDescription keyDescription;
protected BuilderImpl() {
}
protected BuilderImpl(TestVectorKeyringInput model) {
this.keyDescription = model.keyDescription();
}
public Builder keyDescription(KeyDescription keyDescription) {
this.keyDescription = keyDescription;
return this;
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public TestVectorKeyringInput build() {
if (Objects.isNull(this.keyDescription())) {
throw new IllegalArgumentException("Missing value for required field `keyDescription`");
}
return new TestVectorKeyringInput(this);
}
}
}
| 426 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/RawAES.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class RawAES {
private final String keyId;
private final String providerId;
protected RawAES(BuilderImpl builder) {
this.keyId = builder.keyId();
this.providerId = builder.providerId();
}
public String keyId() {
return this.keyId;
}
public String providerId() {
return this.providerId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
Builder providerId(String providerId);
String providerId();
RawAES build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected String providerId;
protected BuilderImpl() {
}
protected BuilderImpl(RawAES model) {
this.keyId = model.keyId();
this.providerId = model.providerId();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public Builder providerId(String providerId) {
this.providerId = providerId;
return this;
}
public String providerId() {
return this.providerId;
}
public RawAES build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
if (Objects.isNull(this.providerId())) {
throw new IllegalArgumentException("Missing value for required field `providerId`");
}
return new RawAES(this);
}
}
}
| 427 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/RawRSA.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.model.PaddingScheme;
public class RawRSA {
private final String keyId;
private final String providerId;
private final PaddingScheme padding;
protected RawRSA(BuilderImpl builder) {
this.keyId = builder.keyId();
this.providerId = builder.providerId();
this.padding = builder.padding();
}
public String keyId() {
return this.keyId;
}
public String providerId() {
return this.providerId;
}
public PaddingScheme padding() {
return this.padding;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
Builder providerId(String providerId);
String providerId();
Builder padding(PaddingScheme padding);
PaddingScheme padding();
RawRSA build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected String providerId;
protected PaddingScheme padding;
protected BuilderImpl() {
}
protected BuilderImpl(RawRSA model) {
this.keyId = model.keyId();
this.providerId = model.providerId();
this.padding = model.padding();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public Builder providerId(String providerId) {
this.providerId = providerId;
return this;
}
public String providerId() {
return this.providerId;
}
public Builder padding(PaddingScheme padding) {
this.padding = padding;
return this;
}
public PaddingScheme padding() {
return this.padding;
}
public RawRSA build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
if (Objects.isNull(this.providerId())) {
throw new IllegalArgumentException("Missing value for required field `providerId`");
}
if (Objects.isNull(this.padding())) {
throw new IllegalArgumentException("Missing value for required field `padding`");
}
return new RawRSA(this);
}
}
}
| 428 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/StaticKeyring.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class StaticKeyring {
private final String keyId;
protected StaticKeyring(BuilderImpl builder) {
this.keyId = builder.keyId();
}
public String keyId() {
return this.keyId;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
StaticKeyring build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected BuilderImpl() {
}
protected BuilderImpl(StaticKeyring model) {
this.keyId = model.keyId();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public StaticKeyring build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
return new StaticKeyring(this);
}
}
}
| 429 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KeyDescription.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class KeyDescription {
private final KMSInfo Kms;
private final KmsMrkAware KmsMrk;
private final KmsMrkAwareDiscovery KmsMrkDiscovery;
private final RawRSA RSA;
private final RawAES AES;
private final StaticKeyring Static;
private final KmsRsaKeyring KmsRsa;
private final HierarchyKeyring Hierarchy;
protected KeyDescription(BuilderImpl builder) {
this.Kms = builder.Kms();
this.KmsMrk = builder.KmsMrk();
this.KmsMrkDiscovery = builder.KmsMrkDiscovery();
this.RSA = builder.RSA();
this.AES = builder.AES();
this.Static = builder.Static();
this.KmsRsa = builder.KmsRsa();
this.Hierarchy = builder.Hierarchy();
}
public KMSInfo Kms() {
return this.Kms;
}
public KmsMrkAware KmsMrk() {
return this.KmsMrk;
}
public KmsMrkAwareDiscovery KmsMrkDiscovery() {
return this.KmsMrkDiscovery;
}
public RawRSA RSA() {
return this.RSA;
}
public RawAES AES() {
return this.AES;
}
public StaticKeyring Static() {
return this.Static;
}
public KmsRsaKeyring KmsRsa() {
return this.KmsRsa;
}
public HierarchyKeyring Hierarchy() {
return this.Hierarchy;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder Kms(KMSInfo Kms);
KMSInfo Kms();
Builder KmsMrk(KmsMrkAware KmsMrk);
KmsMrkAware KmsMrk();
Builder KmsMrkDiscovery(KmsMrkAwareDiscovery KmsMrkDiscovery);
KmsMrkAwareDiscovery KmsMrkDiscovery();
Builder RSA(RawRSA RSA);
RawRSA RSA();
Builder AES(RawAES AES);
RawAES AES();
Builder Static(StaticKeyring Static);
StaticKeyring Static();
Builder KmsRsa(KmsRsaKeyring KmsRsa);
KmsRsaKeyring KmsRsa();
Builder Hierarchy(HierarchyKeyring Hierarchy);
HierarchyKeyring Hierarchy();
KeyDescription build();
}
static class BuilderImpl implements Builder {
protected KMSInfo Kms;
protected KmsMrkAware KmsMrk;
protected KmsMrkAwareDiscovery KmsMrkDiscovery;
protected RawRSA RSA;
protected RawAES AES;
protected StaticKeyring Static;
protected KmsRsaKeyring KmsRsa;
protected HierarchyKeyring Hierarchy;
protected BuilderImpl() {
}
protected BuilderImpl(KeyDescription model) {
this.Kms = model.Kms();
this.KmsMrk = model.KmsMrk();
this.KmsMrkDiscovery = model.KmsMrkDiscovery();
this.RSA = model.RSA();
this.AES = model.AES();
this.Static = model.Static();
this.KmsRsa = model.KmsRsa();
this.Hierarchy = model.Hierarchy();
}
public Builder Kms(KMSInfo Kms) {
this.Kms = Kms;
return this;
}
public KMSInfo Kms() {
return this.Kms;
}
public Builder KmsMrk(KmsMrkAware KmsMrk) {
this.KmsMrk = KmsMrk;
return this;
}
public KmsMrkAware KmsMrk() {
return this.KmsMrk;
}
public Builder KmsMrkDiscovery(KmsMrkAwareDiscovery KmsMrkDiscovery) {
this.KmsMrkDiscovery = KmsMrkDiscovery;
return this;
}
public KmsMrkAwareDiscovery KmsMrkDiscovery() {
return this.KmsMrkDiscovery;
}
public Builder RSA(RawRSA RSA) {
this.RSA = RSA;
return this;
}
public RawRSA RSA() {
return this.RSA;
}
public Builder AES(RawAES AES) {
this.AES = AES;
return this;
}
public RawAES AES() {
return this.AES;
}
public Builder Static(StaticKeyring Static) {
this.Static = Static;
return this;
}
public StaticKeyring Static() {
return this.Static;
}
public Builder KmsRsa(KmsRsaKeyring KmsRsa) {
this.KmsRsa = KmsRsa;
return this;
}
public KmsRsaKeyring KmsRsa() {
return this.KmsRsa;
}
public Builder Hierarchy(HierarchyKeyring Hierarchy) {
this.Hierarchy = Hierarchy;
return this;
}
public HierarchyKeyring Hierarchy() {
return this.Hierarchy;
}
public KeyDescription build() {
if (!onlyOneNonNull()) {
throw new IllegalArgumentException("`KeyDescription` is a Union. A Union MUST have one and only one value set.");
}
return new KeyDescription(this);
}
private boolean onlyOneNonNull() {
Object[] allValues = {this.Kms, this.KmsMrk, this.KmsMrkDiscovery, this.RSA, this.AES, this.Static, this.KmsRsa, this.Hierarchy};
boolean haveOneNonNull = false;
for (Object o : allValues) {
if (Objects.nonNull(o)) {
if (haveOneNonNull) {
return false;
}
haveOneNonNull = true;
}
}
return haveOneNonNull;
}
}
}
| 430 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KmsRsaKeyring.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
import software.amazon.awssdk.services.kms.model.EncryptionAlgorithmSpec;
public class KmsRsaKeyring {
private final String keyId;
private final EncryptionAlgorithmSpec encryptionAlgorithm;
protected KmsRsaKeyring(BuilderImpl builder) {
this.keyId = builder.keyId();
this.encryptionAlgorithm = builder.encryptionAlgorithm();
}
public String keyId() {
return this.keyId;
}
public EncryptionAlgorithmSpec encryptionAlgorithm() {
return this.encryptionAlgorithm;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
Builder encryptionAlgorithm(EncryptionAlgorithmSpec encryptionAlgorithm);
EncryptionAlgorithmSpec encryptionAlgorithm();
KmsRsaKeyring build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected EncryptionAlgorithmSpec encryptionAlgorithm;
protected BuilderImpl() {
}
protected BuilderImpl(KmsRsaKeyring model) {
this.keyId = model.keyId();
this.encryptionAlgorithm = model.encryptionAlgorithm();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public Builder encryptionAlgorithm(EncryptionAlgorithmSpec encryptionAlgorithm) {
this.encryptionAlgorithm = encryptionAlgorithm;
return this;
}
public EncryptionAlgorithmSpec encryptionAlgorithm() {
return this.encryptionAlgorithm;
}
public KmsRsaKeyring build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
if (Objects.isNull(this.encryptionAlgorithm())) {
throw new IllegalArgumentException("Missing value for required field `encryptionAlgorithm`");
}
return new KmsRsaKeyring(this);
}
}
}
| 431 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KmsMrkAwareDiscovery.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.model.DiscoveryFilter;
public class KmsMrkAwareDiscovery {
private final String keyId;
private final String defaultMrkRegion;
/**
* A filter which defines what AWS partition and AWS accounts a KMS Key may be in for a Keyring to be allowed to attempt to decrypt it.
*/
private final DiscoveryFilter awsKmsDiscoveryFilter;
protected KmsMrkAwareDiscovery(BuilderImpl builder) {
this.keyId = builder.keyId();
this.defaultMrkRegion = builder.defaultMrkRegion();
this.awsKmsDiscoveryFilter = builder.awsKmsDiscoveryFilter();
}
public String keyId() {
return this.keyId;
}
public String defaultMrkRegion() {
return this.defaultMrkRegion;
}
/**
* @return A filter which defines what AWS partition and AWS accounts a KMS Key may be in for a Keyring to be allowed to attempt to decrypt it.
*/
public DiscoveryFilter awsKmsDiscoveryFilter() {
return this.awsKmsDiscoveryFilter;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyId(String keyId);
String keyId();
Builder defaultMrkRegion(String defaultMrkRegion);
String defaultMrkRegion();
/**
* @param awsKmsDiscoveryFilter A filter which defines what AWS partition and AWS accounts a KMS Key may be in for a Keyring to be allowed to attempt to decrypt it.
*/
Builder awsKmsDiscoveryFilter(DiscoveryFilter awsKmsDiscoveryFilter);
/**
* @return A filter which defines what AWS partition and AWS accounts a KMS Key may be in for a Keyring to be allowed to attempt to decrypt it.
*/
DiscoveryFilter awsKmsDiscoveryFilter();
KmsMrkAwareDiscovery build();
}
static class BuilderImpl implements Builder {
protected String keyId;
protected String defaultMrkRegion;
protected DiscoveryFilter awsKmsDiscoveryFilter;
protected BuilderImpl() {
}
protected BuilderImpl(KmsMrkAwareDiscovery model) {
this.keyId = model.keyId();
this.defaultMrkRegion = model.defaultMrkRegion();
this.awsKmsDiscoveryFilter = model.awsKmsDiscoveryFilter();
}
public Builder keyId(String keyId) {
this.keyId = keyId;
return this;
}
public String keyId() {
return this.keyId;
}
public Builder defaultMrkRegion(String defaultMrkRegion) {
this.defaultMrkRegion = defaultMrkRegion;
return this;
}
public String defaultMrkRegion() {
return this.defaultMrkRegion;
}
public Builder awsKmsDiscoveryFilter(DiscoveryFilter awsKmsDiscoveryFilter) {
this.awsKmsDiscoveryFilter = awsKmsDiscoveryFilter;
return this;
}
public DiscoveryFilter awsKmsDiscoveryFilter() {
return this.awsKmsDiscoveryFilter;
}
public KmsMrkAwareDiscovery build() {
if (Objects.isNull(this.keyId())) {
throw new IllegalArgumentException("Missing value for required field `keyId`");
}
if (Objects.isNull(this.defaultMrkRegion())) {
throw new IllegalArgumentException("Missing value for required field `defaultMrkRegion`");
}
return new KmsMrkAwareDiscovery(this);
}
}
}
| 432 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/KeyVectorException.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class KeyVectorException extends RuntimeException {
protected KeyVectorException(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
KeyVectorException build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected BuilderImpl() {
}
protected BuilderImpl(KeyVectorException model) {
this.message = model.message();
this.cause = model.cause();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public KeyVectorException build() {
if (Objects.isNull(this.message())) {
throw new IllegalArgumentException("Missing value for required field `message`");
}
return new KeyVectorException(this);
}
}
}
| 433 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/OpaqueError.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
public class OpaqueError extends RuntimeException {
/**
* The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
private final Object obj;
protected OpaqueError(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
this.obj = builder.obj();
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
/**
* @return The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
public Object obj() {
return this.obj;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
/**
* @param obj The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
Builder obj(Object obj);
/**
* @return The unexpected object encountered. It MIGHT BE an Exception, but that is not guaranteed.
*/
Object obj();
OpaqueError build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected Object obj;
protected BuilderImpl() {
}
protected BuilderImpl(OpaqueError model) {
this.cause = model.getCause();
this.message = model.getMessage();
this.obj = model.obj();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public Builder obj(Object obj) {
this.obj = obj;
return this;
}
public Object obj() {
return this.obj;
}
public OpaqueError build() {
if (this.obj != null && this.cause == null && this.obj instanceof Throwable) {
this.cause = (Throwable) this.obj;
} else if (this.obj == null && this.cause != null) {
this.obj = this.cause;
}
return new OpaqueError(this);
}
}
}
| 434 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/SerializeKeyDescriptionInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.Objects;
public class SerializeKeyDescriptionInput {
private final KeyDescription keyDescription;
protected SerializeKeyDescriptionInput(BuilderImpl builder) {
this.keyDescription = builder.keyDescription();
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder keyDescription(KeyDescription keyDescription);
KeyDescription keyDescription();
SerializeKeyDescriptionInput build();
}
static class BuilderImpl implements Builder {
protected KeyDescription keyDescription;
protected BuilderImpl() {
}
protected BuilderImpl(SerializeKeyDescriptionInput model) {
this.keyDescription = model.keyDescription();
}
public Builder keyDescription(KeyDescription keyDescription) {
this.keyDescription = keyDescription;
return this;
}
public KeyDescription keyDescription() {
return this.keyDescription;
}
public SerializeKeyDescriptionInput build() {
if (Objects.isNull(this.keyDescription())) {
throw new IllegalArgumentException("Missing value for required field `keyDescription`");
}
return new SerializeKeyDescriptionInput(this);
}
}
}
| 435 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/GetKeyDescriptionInput.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.nio.ByteBuffer;
import java.util.Objects;
public class GetKeyDescriptionInput {
private final ByteBuffer json;
protected GetKeyDescriptionInput(BuilderImpl builder) {
this.json = builder.json();
}
public ByteBuffer json() {
return this.json;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
Builder json(ByteBuffer json);
ByteBuffer json();
GetKeyDescriptionInput build();
}
static class BuilderImpl implements Builder {
protected ByteBuffer json;
protected BuilderImpl() {
}
protected BuilderImpl(GetKeyDescriptionInput model) {
this.json = model.json();
}
public Builder json(ByteBuffer json) {
this.json = json;
return this;
}
public ByteBuffer json() {
return this.json;
}
public GetKeyDescriptionInput build() {
if (Objects.isNull(this.json())) {
throw new IllegalArgumentException("Missing value for required field `json`");
}
return new GetKeyDescriptionInput(this);
}
}
}
| 436 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviderstestvectorkeys/model/CollectionOfErrors.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviderstestvectorkeys.model;
import java.util.List;
public class CollectionOfErrors extends RuntimeException {
/**
* The list of Exceptions encountered.
*/
private final List<RuntimeException> list;
protected CollectionOfErrors(BuilderImpl builder) {
super(messageFromBuilder(builder), builder.cause());
this.list = builder.list();
}
private static String messageFromBuilder(Builder builder) {
if (builder.message() != null) {
return builder.message();
}
if (builder.cause() != null) {
return builder.cause().getMessage();
}
return null;
}
/**
* See {@link Throwable#getMessage()}.
*/
public String message() {
return this.getMessage();
}
/**
* See {@link Throwable#getCause()}.
*/
public Throwable cause() {
return this.getCause();
}
/**
* @return The list of Exceptions encountered.
*/
public List<RuntimeException> list() {
return this.list;
}
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public interface Builder {
/**
* @param message The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
Builder message(String message);
/**
* @return The detailed message. The detail message is saved for later retrieval by the {@link #getMessage()} method.
*/
String message();
/**
* @param cause The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Builder cause(Throwable cause);
/**
* @return The cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is permitted, and indicates that the cause is nonexistent or unknown.)
*/
Throwable cause();
/**
* @param list The list of Exceptions encountered.
*/
Builder list(List<RuntimeException> list);
/**
* @return The list of Exceptions encountered.
*/
List<RuntimeException> list();
CollectionOfErrors build();
}
static class BuilderImpl implements Builder {
protected String message;
protected Throwable cause;
protected List<RuntimeException> list;
protected BuilderImpl() {
}
protected BuilderImpl(CollectionOfErrors model) {
this.cause = model.getCause();
this.message = model.getMessage();
this.list = model.list();
}
public Builder message(String message) {
this.message = message;
return this;
}
public String message() {
return this.message;
}
public Builder cause(Throwable cause) {
this.cause = cause;
return this;
}
public Throwable cause() {
return this.cause;
}
public Builder list(List<RuntimeException> list) {
this.list = list;
return this;
}
public List<RuntimeException> list() {
return this.list;
}
public CollectionOfErrors build() {
return new CollectionOfErrors(this);
}
}
}
| 437 |
0 |
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders
|
Create_ds/aws-cryptographic-material-providers-library-java/TestVectorsAwsCryptographicMaterialProviders/runtimes/java/src/main/smithy-generated/software/amazon/cryptography/materialproviders/wrapped/TestMaterialProviders.java
|
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Do not modify this file. This file is machine generated, and any changes to it will be overwritten.
package software.amazon.cryptography.materialproviders.wrapped;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import dafny.Tuple0;
import java.lang.Byte;
import java.lang.IllegalArgumentException;
import java.lang.RuntimeException;
import java.nio.ByteBuffer;
import java.util.Objects;
import software.amazon.cryptography.materialproviders.MaterialProviders;
import software.amazon.cryptography.materialproviders.ToDafny;
import software.amazon.cryptography.materialproviders.ToNative;
import software.amazon.cryptography.materialproviders.internaldafny.types.AlgorithmSuiteInfo;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsHierarchicalKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkDiscoveryMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMrkMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateAwsKmsRsaKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateCryptographicMaterialsCacheInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultClientSupplierInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateDefaultCryptographicMaterialsManagerInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateMultiKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawAesKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRawRsaKeyringInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.CreateRequiredEncryptionContextCMMInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.DecryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.EncryptionMaterials;
import software.amazon.cryptography.materialproviders.internaldafny.types.Error;
import software.amazon.cryptography.materialproviders.internaldafny.types.IAwsCryptographicMaterialProvidersClient;
import software.amazon.cryptography.materialproviders.internaldafny.types.IClientSupplier;
import software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsCache;
import software.amazon.cryptography.materialproviders.internaldafny.types.ICryptographicMaterialsManager;
import software.amazon.cryptography.materialproviders.internaldafny.types.IKeyring;
import software.amazon.cryptography.materialproviders.internaldafny.types.InitializeDecryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.InitializeEncryptionMaterialsInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidDecryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidEncryptionMaterialsTransitionInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnDecryptInput;
import software.amazon.cryptography.materialproviders.internaldafny.types.ValidateCommitmentPolicyOnEncryptInput;
public class TestMaterialProviders implements IAwsCryptographicMaterialProvidersClient {
private final MaterialProviders _impl;
protected TestMaterialProviders(BuilderImpl builder) {
this._impl = builder.impl();
}
public static Builder builder() {
return new BuilderImpl();
}
public Result<IKeyring, Error> CreateAwsKmsDiscoveryKeyring(
CreateAwsKmsDiscoveryKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryKeyringInput nativeInput = ToNative.CreateAwsKmsDiscoveryKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsDiscoveryKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsDiscoveryMultiKeyring(
CreateAwsKmsDiscoveryMultiKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsDiscoveryMultiKeyringInput nativeInput = ToNative.CreateAwsKmsDiscoveryMultiKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsDiscoveryMultiKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsHierarchicalKeyring(
CreateAwsKmsHierarchicalKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsHierarchicalKeyringInput nativeInput = ToNative.CreateAwsKmsHierarchicalKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsHierarchicalKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsKeyring(CreateAwsKmsKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsKeyringInput nativeInput = ToNative.CreateAwsKmsKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsMrkDiscoveryKeyring(
CreateAwsKmsMrkDiscoveryKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryKeyringInput nativeInput = ToNative.CreateAwsKmsMrkDiscoveryKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsMrkDiscoveryKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsMrkDiscoveryMultiKeyring(
CreateAwsKmsMrkDiscoveryMultiKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkDiscoveryMultiKeyringInput nativeInput = ToNative.CreateAwsKmsMrkDiscoveryMultiKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsMrkDiscoveryMultiKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsMrkKeyring(CreateAwsKmsMrkKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkKeyringInput nativeInput = ToNative.CreateAwsKmsMrkKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsMrkKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsMrkMultiKeyring(
CreateAwsKmsMrkMultiKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMrkMultiKeyringInput nativeInput = ToNative.CreateAwsKmsMrkMultiKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsMrkMultiKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsMultiKeyring(
CreateAwsKmsMultiKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsMultiKeyringInput nativeInput = ToNative.CreateAwsKmsMultiKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsMultiKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateAwsKmsRsaKeyring(CreateAwsKmsRsaKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateAwsKmsRsaKeyringInput nativeInput = ToNative.CreateAwsKmsRsaKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateAwsKmsRsaKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<ICryptographicMaterialsCache, Error> CreateCryptographicMaterialsCache(
CreateCryptographicMaterialsCacheInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateCryptographicMaterialsCacheInput nativeInput = ToNative.CreateCryptographicMaterialsCacheInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.ICryptographicMaterialsCache nativeOutput = this._impl.CreateCryptographicMaterialsCache(nativeInput);
ICryptographicMaterialsCache dafnyOutput = ToDafny.CryptographicMaterialsCache(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IClientSupplier, Error> CreateDefaultClientSupplier(
CreateDefaultClientSupplierInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateDefaultClientSupplierInput nativeInput = ToNative.CreateDefaultClientSupplierInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IClientSupplier nativeOutput = this._impl.CreateDefaultClientSupplier(nativeInput);
IClientSupplier dafnyOutput = ToDafny.ClientSupplier(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<ICryptographicMaterialsManager, Error> CreateDefaultCryptographicMaterialsManager(
CreateDefaultCryptographicMaterialsManagerInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateDefaultCryptographicMaterialsManagerInput nativeInput = ToNative.CreateDefaultCryptographicMaterialsManagerInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.ICryptographicMaterialsManager nativeOutput = this._impl.CreateDefaultCryptographicMaterialsManager(nativeInput);
ICryptographicMaterialsManager dafnyOutput = ToDafny.CryptographicMaterialsManager(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateMultiKeyring(CreateMultiKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateMultiKeyringInput nativeInput = ToNative.CreateMultiKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateMultiKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateRawAesKeyring(CreateRawAesKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateRawAesKeyringInput nativeInput = ToNative.CreateRawAesKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateRawAesKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<IKeyring, Error> CreateRawRsaKeyring(CreateRawRsaKeyringInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateRawRsaKeyringInput nativeInput = ToNative.CreateRawRsaKeyringInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.IKeyring nativeOutput = this._impl.CreateRawRsaKeyring(nativeInput);
IKeyring dafnyOutput = ToDafny.Keyring(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<ICryptographicMaterialsManager, Error> CreateRequiredEncryptionContextCMM(
CreateRequiredEncryptionContextCMMInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.CreateRequiredEncryptionContextCMMInput nativeInput = ToNative.CreateRequiredEncryptionContextCMMInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.ICryptographicMaterialsManager nativeOutput = this._impl.CreateRequiredEncryptionContextCMM(nativeInput);
ICryptographicMaterialsManager dafnyOutput = ToDafny.CryptographicMaterialsManager(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> DecryptionMaterialsWithPlaintextDataKey(
DecryptionMaterials dafnyInput) {
software.amazon.cryptography.materialproviders.model.DecryptionMaterials nativeInput = ToNative.DecryptionMaterials(dafnyInput);
try {
this._impl.DecryptionMaterialsWithPlaintextDataKey(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> EncryptionMaterialsHasPlaintextDataKey(
EncryptionMaterials dafnyInput) {
software.amazon.cryptography.materialproviders.model.EncryptionMaterials nativeInput = ToNative.EncryptionMaterials(dafnyInput);
try {
this._impl.EncryptionMaterialsHasPlaintextDataKey(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<AlgorithmSuiteInfo, Error> GetAlgorithmSuiteInfo(
DafnySequence<? extends Byte> dafnyInput) {
ByteBuffer nativeInput = software.amazon.smithy.dafny.conversion.ToNative.Simple.ByteBuffer(dafnyInput);
try {
software.amazon.cryptography.materialproviders.model.AlgorithmSuiteInfo nativeOutput = this._impl.GetAlgorithmSuiteInfo(nativeInput);
AlgorithmSuiteInfo dafnyOutput = ToDafny.AlgorithmSuiteInfo(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<DecryptionMaterials, Error> InitializeDecryptionMaterials(
InitializeDecryptionMaterialsInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.InitializeDecryptionMaterialsInput nativeInput = ToNative.InitializeDecryptionMaterialsInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.model.DecryptionMaterials nativeOutput = this._impl.InitializeDecryptionMaterials(nativeInput);
DecryptionMaterials dafnyOutput = ToDafny.DecryptionMaterials(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<EncryptionMaterials, Error> InitializeEncryptionMaterials(
InitializeEncryptionMaterialsInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.InitializeEncryptionMaterialsInput nativeInput = ToNative.InitializeEncryptionMaterialsInput(dafnyInput);
try {
software.amazon.cryptography.materialproviders.model.EncryptionMaterials nativeOutput = this._impl.InitializeEncryptionMaterials(nativeInput);
EncryptionMaterials dafnyOutput = ToDafny.EncryptionMaterials(nativeOutput);
return Result.create_Success(dafnyOutput);
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> ValidAlgorithmSuiteInfo(AlgorithmSuiteInfo dafnyInput) {
software.amazon.cryptography.materialproviders.model.AlgorithmSuiteInfo nativeInput = ToNative.AlgorithmSuiteInfo(dafnyInput);
try {
this._impl.ValidAlgorithmSuiteInfo(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> ValidateCommitmentPolicyOnDecrypt(
ValidateCommitmentPolicyOnDecryptInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnDecryptInput nativeInput = ToNative.ValidateCommitmentPolicyOnDecryptInput(dafnyInput);
try {
this._impl.ValidateCommitmentPolicyOnDecrypt(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> ValidateCommitmentPolicyOnEncrypt(
ValidateCommitmentPolicyOnEncryptInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.ValidateCommitmentPolicyOnEncryptInput nativeInput = ToNative.ValidateCommitmentPolicyOnEncryptInput(dafnyInput);
try {
this._impl.ValidateCommitmentPolicyOnEncrypt(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> ValidDecryptionMaterialsTransition(
ValidDecryptionMaterialsTransitionInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.ValidDecryptionMaterialsTransitionInput nativeInput = ToNative.ValidDecryptionMaterialsTransitionInput(dafnyInput);
try {
this._impl.ValidDecryptionMaterialsTransition(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public Result<Tuple0, Error> ValidEncryptionMaterialsTransition(
ValidEncryptionMaterialsTransitionInput dafnyInput) {
software.amazon.cryptography.materialproviders.model.ValidEncryptionMaterialsTransitionInput nativeInput = ToNative.ValidEncryptionMaterialsTransitionInput(dafnyInput);
try {
this._impl.ValidEncryptionMaterialsTransition(nativeInput);
return Result.create_Success(Tuple0.create());
} catch (RuntimeException ex) {
return Result.create_Failure(ToDafny.Error(ex));
}
}
public interface Builder {
Builder impl(MaterialProviders impl);
MaterialProviders impl();
TestMaterialProviders build();
}
static class BuilderImpl implements Builder {
protected MaterialProviders impl;
protected BuilderImpl() {
}
public Builder impl(MaterialProviders impl) {
this.impl = impl;
return this;
}
public MaterialProviders impl() {
return this.impl;
}
public TestMaterialProviders build() {
if (Objects.isNull(this.impl())) {
throw new IllegalArgumentException("Missing value for required field `impl`");
}
return new TestMaterialProviders(this);
}
}
}
| 438 |
0 |
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas
|
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas/ptp/TestPtpGuiceModule.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.ptp;
import com.google.inject.AbstractModule;
import com.netflix.staash.mesh.InstanceRegistry;
import com.netflix.staash.mesh.client.ClientFactory;
import com.netflix.staash.mesh.client.memory.MemoryClientFactory;
import com.netflix.staash.mesh.db.TopicRegistry;
import com.netflix.staash.mesh.endpoints.ChordEndpointPolicy;
import com.netflix.staash.mesh.endpoints.EndpointPolicy;
import com.netflix.staash.mesh.seed.TopicSeed;
public class TestPtpGuiceModule extends AbstractModule {
@Override
protected void configure() {
bind(TopicSeed.class).to(DummyTopicSeed.class);
bind(TopicRegistry.class).asEagerSingleton();
bind(InstanceRegistry.class).asEagerSingleton();
bind(ClientFactory.class).to(MemoryClientFactory.class).asEagerSingleton();
bind(EndpointPolicy.class).to(ChordEndpointPolicy.class).asEagerSingleton();
// bind(TopicFactory.class).to(MemoryTopicFactory());
}
}
| 439 |
0 |
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas
|
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas/ptp/TestDriver.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.ptp;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import com.netflix.staash.mesh.InstanceRegistry;
import com.netflix.staash.mesh.client.ClientFactory;
import com.netflix.staash.mesh.client.memory.MemoryClientFactory;
import com.netflix.staash.mesh.db.Entry;
import com.netflix.staash.mesh.db.TopicRegistry;
import com.netflix.staash.mesh.db.memory.MemoryTopicFactory;
import com.netflix.staash.mesh.endpoints.ChordEndpointPolicy;
import com.netflix.staash.mesh.endpoints.EndpointPolicy;
import com.netflix.staash.mesh.server.Server;
public class TestDriver {
public static void main(String[] args) {
final ScheduledExecutorService executor = Executors.newScheduledThreadPool(10);
final TopicRegistry topics = new TopicRegistry(new MemoryTopicFactory());
final InstanceRegistry registry = new InstanceRegistry();
final ClientFactory factory = new MemoryClientFactory();
final EndpointPolicy endpointPolicy = new ChordEndpointPolicy();
topics.createTopic("test");
topics.addEntry("test", new Entry("Key1", "Value1", System.currentTimeMillis()));
topics.addEntry("test", new Entry("Key2", "Value2", System.currentTimeMillis()));
final AtomicInteger counter = new AtomicInteger();
final int instanceCount = 10;
final int asgCount = 10;
final long asgCreateDelay = 5;
// // Thread to add random server
// executor.execute(new Runnable() {
// @Override
// public void run() {
// long id = counter.incrementAndGet();
// if (id < asgCount) {
// for (int i = 0; i < instanceCount; i++) {
// try {
// Server server = new Server(registry, factory, endpointPolicy, "" + (id * instanceCount + i));
// server.start();
// }
// catch (Exception e) {
// e.printStackTrace();
// }
// }
// executor.schedule(this, asgCreateDelay, TimeUnit.SECONDS);
// }
// }
// });
//
// executor.scheduleAtFixedRate(new Runnable() {
// @Override
// public void run() {
// }
// }, 10, 10, TimeUnit.SECONDS);
//
// try {
// Thread.sleep(100000);
// } catch (InterruptedException e) {
// }
}
}
| 440 |
0 |
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas
|
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas/ptp/RandomServerProvider.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.ptp;
import java.util.concurrent.atomic.AtomicLong;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.netflix.staash.mesh.InstanceInfo;
import com.netflix.staash.mesh.InstanceRegistry;
import com.netflix.staash.mesh.client.ClientFactory;
import com.netflix.staash.mesh.endpoints.EndpointPolicy;
import com.netflix.staash.mesh.server.MemoryServer;
import com.netflix.staash.mesh.server.Server;
import com.netflix.staash.mesh.server.ServerFactory;
public class RandomServerProvider implements ServerFactory {
private final InstanceRegistry instanceRegistry;
private final ClientFactory clientFactory;
private final EndpointPolicy endpointPolicy;
private final AtomicLong counter = new AtomicLong();
@Inject
public RandomServerProvider(InstanceRegistry instanceRegistry, ClientFactory clientFactory, EndpointPolicy endpointPolicy) {
this.instanceRegistry = instanceRegistry;
this.clientFactory = clientFactory;
this.endpointPolicy = endpointPolicy;
}
@Override
public Server createServer(InstanceInfo ii) {
return new MemoryServer(instanceRegistry, clientFactory, endpointPolicy, "" + counter.incrementAndGet());
}
}
| 441 |
0 |
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas
|
Create_ds/staash/staash-mesh/src/test/java/com/netflix/paas/ptp/DummyTopicSeed.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.ptp;
import com.netflix.staash.mesh.db.Entry;
import com.netflix.staash.mesh.db.TopicRegistry;
import com.netflix.staash.mesh.db.memory.MemoryTopicFactory;
import com.netflix.staash.mesh.seed.TopicSeed;
public class DummyTopicSeed implements TopicSeed {
private static final String TOPIC_NAME = "test";
public DummyTopicSeed() {
final TopicRegistry topics = new TopicRegistry(new MemoryTopicFactory());
topics.createTopic(TOPIC_NAME);
topics.addEntry(TOPIC_NAME, new Entry("Key1", "Value1", System.currentTimeMillis()));
topics.addEntry(TOPIC_NAME, new Entry("Key2", "Value2", System.currentTimeMillis()));
}
}
| 442 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/CompareInstanceInfoByUuid.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh;
import java.util.Comparator;
public class CompareInstanceInfoByUuid implements Comparator<InstanceInfo>{
@Override
public int compare(InstanceInfo arg0, InstanceInfo arg1) {
return arg0.getUuid().compareTo(arg1.getUuid());
}
}
| 443 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/InstanceInfo.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh;
import java.util.UUID;
public class InstanceInfo {
private final UUID uuid;
private final String id;
public InstanceInfo(String id, UUID uuid) {
this.uuid = uuid;
this.id = id;
}
public UUID getUuid() {
return uuid;
}
public String getId() {
return id;
}
public String toString() {
return uuid.toString() + "(" + id + ")";
}
}
| 444 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/InstanceRegistry.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicReference;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
/**
* Registry for all active instances. Keeps track of a sorted list of instances.
*
* @author elandau
*
*/
public class InstanceRegistry {
private final Map<UUID, InstanceInfo> members = Maps.newHashMap();
private final AtomicReference<List<InstanceInfo>> ring = new AtomicReference<List<InstanceInfo>>(new ArrayList<InstanceInfo>());
private static final CompareInstanceInfoByUuid comparator = new CompareInstanceInfoByUuid();
/**
* A new instance has joined the ring
* @param node
*/
public synchronized void join(InstanceInfo node) {
members.put(node.getUuid(), node);
update();
}
/**
* An instance was removed from the the ring
* @param node
*/
public synchronized void leave(InstanceInfo node) {
members.remove(node.getUuid());
update();
}
/**
* Resort the ring
*/
private void update() {
List<InstanceInfo> list = Lists.newArrayList(members.values());
Collections.sort(list, comparator);
ring.set(list);
}
/**
* Return a sorted list of InstanceInfo. Sorted by UUID.
* @return
*/
public List<InstanceInfo> getMembers() {
return ring.get();
}
}
| 445 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/seed/TopicSeed.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.seed;
public interface TopicSeed {
}
| 446 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/messages/Message.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.messages;
public class Message {
private final Verb verb;
public Message(Verb verb) {
this.verb = verb;
}
public Verb getVerb() {
return this.verb;
}
}
| 447 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/messages/RequestHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.messages;
public interface RequestHandler {
void onMessage(Message message, AsyncResponse response);
}
| 448 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/messages/ResponseHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.messages;
public interface ResponseHandler {
}
| 449 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/messages/Verb.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.messages;
public enum Verb {
DIGEST_REQUEST,
DIGEST_RESPONSE,
DATA_REQUEST,
DATA_RESPONSE,
DATA_PUSH,
}
| 450 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/messages/AsyncResponse.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.messages;
public interface AsyncResponse {
void sendResponse(Message message, Message response);
}
| 451 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/endpoints/ChordEndpointPolicy.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.endpoints;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.Lists;
import com.netflix.staash.mesh.CompareInstanceInfoByUuid;
import com.netflix.staash.mesh.InstanceInfo;
/**
* Return a list of endpoints that are of exponential distance from the current position
*
* Example,
*
* pos + 1
* pos + 2
* pos + 4
* pos + 8
* ...
*
* @author elandau
*
*/
public class ChordEndpointPolicy implements EndpointPolicy {
private static final CompareInstanceInfoByUuid comparator = new CompareInstanceInfoByUuid();
private static double LOG_2 = Math.log(2);
@Override
public List<InstanceInfo> getEndpoints(InstanceInfo current, List<InstanceInfo> instances) {
int position = Collections.binarySearch(instances, current, comparator);
int size = instances.size();
int count = (int)Math.ceil(Math.log(size) / LOG_2);
List<InstanceInfo> endpoints = Lists.newArrayListWithCapacity(count);
int offset = 1;
for (int i = 0; i < count; i++) {
endpoints.add(instances.get((position + offset) % size));
offset *= 2;
}
return endpoints;
}
}
| 452 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/endpoints/CircularEndpointPolicy.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.endpoints;
import java.util.Collections;
import java.util.List;
import com.google.common.collect.Lists;
import com.netflix.staash.mesh.CompareInstanceInfoByUuid;
import com.netflix.staash.mesh.InstanceInfo;
public class CircularEndpointPolicy implements EndpointPolicy {
private static final CompareInstanceInfoByUuid comparator = new CompareInstanceInfoByUuid();
private final int replicationFactor;
public CircularEndpointPolicy(int replicationFactor) {
this.replicationFactor = replicationFactor;
}
@Override
public List<InstanceInfo> getEndpoints(InstanceInfo current, List<InstanceInfo> instances) {
int position = Collections.binarySearch(instances, current, comparator);
int size = instances.size();
List<InstanceInfo> endpoints = Lists.newArrayListWithCapacity(replicationFactor);
int count = Math.max(size-1, replicationFactor);
for (int i = 0; i < count; i++) {
endpoints.add(instances.get((position + i) % size));
}
return endpoints;
}
}
| 453 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/endpoints/EndpointPolicy.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.endpoints;
import java.util.List;
import com.netflix.staash.mesh.InstanceInfo;
public interface EndpointPolicy {
List<InstanceInfo> getEndpoints(InstanceInfo current, List<InstanceInfo> instances);
}
| 454 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/jersey/MeshServerResource.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.jersey;
import java.util.List;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@Path("/1/mesh")
public class MeshServerResource {
/**
* Return the list of topics and their metadata
* @return
*/
@GET
@Path("topic")
public List<String> getTopics() {
return null;
}
@GET
@Path("topic/{name}")
public void getTopicData(@PathParam("name") String topicName) {
}
/**
*
* @param topicName
*/
@POST
@Path("topic/{name}")
public void postTopic(@PathParam("name") String topicName) {
}
@POST
@Path("topic/{name}/{key}")
public void postTopicKey(@PathParam("name") String topicName, @PathParam("key") String key) {
}
@DELETE
@Path("topic/{name}")
public void deleteTopic(@PathParam("name") String topicName) {
}
@DELETE
@Path("topic/{name}/{key}")
public void deleteTopicKey(@PathParam("name") String topicName, @PathParam("key") String key) {
}
}
| 455 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/jersey/JsonMessageBodyReader.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.jersey;
import java.io.IOException;
import java.io.InputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Consumes;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyReader;
import javax.ws.rs.ext.Provider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
@Consumes({"application/json"})
@Provider
public class JsonMessageBodyReader implements MessageBodyReader<Object> {
private final ObjectMapper mapper;
public JsonMessageBodyReader() {
mapper = new ObjectMapper();
mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
}
@Override
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {
return mapper.canSerialize(type);
}
@Override
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, String> arg4, InputStream is) throws IOException, WebApplicationException {
return mapper.readValue(is, type);
}
}
| 456 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/jersey/JsonMessageBodyWriter.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.jersey;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* A MessageBodyWriter implementation that uses Jackson ObjectMapper to serialize objects to JSON.
*/
@Produces({"application/json"})
@Provider
public class JsonMessageBodyWriter implements MessageBodyWriter<Object> {
private final ObjectMapper mapper;
public JsonMessageBodyWriter() {
mapper = new ObjectMapper();
mapper.getSerializationConfig().setSerializationInclusion(JsonSerialize.Inclusion.NON_NULL);
}
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType) {
return mapper.canSerialize(type);
}
public long getSize(Object data, Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType) {
return -1;
}
public void writeTo(Object data, Class<?> type, Type genericType, Annotation[] annotations,
MediaType mediaType, MultivaluedMap<String, Object> headers, OutputStream out)
throws IOException, WebApplicationException {
mapper.writeValue(out, data);
out.flush();
}
}
| 457 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/MemoryServer.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.UUID;
import java.util.Map.Entry;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicLong;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.inject.Inject;
import com.netflix.staash.mesh.CompareInstanceInfoByUuid;
import com.netflix.staash.mesh.InstanceInfo;
import com.netflix.staash.mesh.InstanceRegistry;
import com.netflix.staash.mesh.client.Client;
import com.netflix.staash.mesh.client.ClientFactory;
import com.netflix.staash.mesh.db.TopicRegistry;
import com.netflix.staash.mesh.db.memory.MemoryTopicFactory;
import com.netflix.staash.mesh.endpoints.EndpointPolicy;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
import com.netflix.staash.mesh.messages.Verb;
import com.netflix.staash.mesh.server.handlers.DataPushHandler;
import com.netflix.staash.mesh.server.handlers.DataRequestHandler;
import com.netflix.staash.mesh.server.handlers.DataResponseHandler;
import com.netflix.staash.mesh.server.handlers.DigestRequestHandler;
import com.netflix.staash.mesh.server.handlers.DigestResponseHandler;
public class MemoryServer implements Server, RequestHandler {
private static final CompareInstanceInfoByUuid comparator = new CompareInstanceInfoByUuid();
private static final AtomicLong changeCounter = new AtomicLong();
private final InstanceRegistry instanceRegistry;
private final ClientFactory clientFactory;
private final ScheduledExecutorService executor = Executors.newScheduledThreadPool(2);
private final InstanceInfo instanceInfo;
private final EndpointPolicy endpointPolicy;
private final SortedMap<InstanceInfo, Client> peers = Maps.newTreeMap(comparator);
private long generationCounter = 0;
private Map<Verb, RequestHandler> verbHandlers = Maps.newEnumMap(Verb.class);
private TopicRegistry topics = new TopicRegistry(new MemoryTopicFactory());
@Inject
public MemoryServer(InstanceRegistry instanceRegistry, ClientFactory clientFactory, EndpointPolicy endpointPolicy, String id) {
this.instanceRegistry = instanceRegistry;
this.clientFactory = clientFactory;
this.instanceInfo = new InstanceInfo(id, UUID.randomUUID());
this.endpointPolicy = endpointPolicy;
verbHandlers.put(Verb.DATA_PUSH, new DataPushHandler());
verbHandlers.put(Verb.DATA_REQUEST, new DataRequestHandler());
verbHandlers.put(Verb.DATA_RESPONSE, new DataResponseHandler());
verbHandlers.put(Verb.DIGEST_REQUEST, new DigestRequestHandler());
verbHandlers.put(Verb.DIGEST_RESPONSE, new DigestResponseHandler());
}
public void start() {
System.out.println("Starting " + instanceInfo);
this.instanceRegistry.join(instanceInfo);
// executor.scheduleAtFixedRate(
// new RefreshRingRunnable(this, instanceRegistry),
// 10, 10, TimeUnit.SECONDS);
}
public void stop() {
System.out.println("Stopping " + instanceInfo);
this.instanceRegistry.leave(instanceInfo);
}
/**
* Update the list of all members in the ring
* @param ring
*/
public void setMembers(List<InstanceInfo> ring) {
List<InstanceInfo> instances = endpointPolicy.getEndpoints(instanceInfo, ring);
Collections.sort(instances, comparator);
List<InstanceInfo> toRemove = Lists.newArrayList();
List<InstanceInfo> toAdd = Lists.newArrayList();
List<InstanceInfo> toDisconnect = Lists.newArrayList();
int changeCount = 0;
for (Entry<InstanceInfo, Client> peer : peers.entrySet()) {
// Determine if peers have been removed from the ring
if (Collections.binarySearch(ring, peer.getKey(), comparator) < 0) {
toRemove.add(peer.getKey());
changeCount++;
}
// Determine if peers are no longer appropriate
else if (Collections.binarySearch(instances, peer.getKey(), comparator) < 0) {
toDisconnect.add(peer.getKey());
changeCount++;
}
}
// Add new peers
for (InstanceInfo peer : instances) {
if (!peers.containsKey(peer)) {
toAdd.add(peer);
changeCount++;
}
}
for (InstanceInfo ii : toRemove) {
removePeer(ii);
}
for (InstanceInfo ii : toDisconnect) {
disconnectPeer(ii);
}
for (InstanceInfo ii : toAdd) {
addPeer(ii);
}
generationCounter++;
if (generationCounter > 1 && changeCount != 0)
printPeers(changeCount);
}
/**
* Remove a peer that is no longer in the ring.
* @param instanceInfo
*/
private void removePeer(InstanceInfo instanceInfo) {
System.out.println("Removing peer " + this.instanceInfo + " -> " + instanceInfo);
Client client = peers.remove(instanceInfo);
client.shutdown();
}
/**
* Add a new peer connection
* @param instanceInfo
*/
private void addPeer(InstanceInfo instanceInfo) {
// System.out.println("Adding peer " + this.instanceInfo + " -> " + instanceInfo);
Client client = clientFactory.createClient(instanceInfo);
peers.put(instanceInfo, client);
boostrapClient(client);
}
/**
* Disconnect a peer that is no longer in our path
* @param instanceInfo
*/
private void disconnectPeer(InstanceInfo instanceInfo) {
System.out.println("Disconnect peer " + this.instanceInfo + " -> " + instanceInfo);
Client client = peers.remove(instanceInfo);
if (client != null) {
client.shutdown();
}
else {
System.out.println(instanceInfo + " > " + peers);
}
}
/**
* List all peers to which this server is connected
* @return
*/
public Iterable<InstanceInfo> listPeers() {
return peers.keySet();
}
private void boostrapClient(Client client) {
}
private void printPeers(int changeCount) {
changeCounter.addAndGet(changeCount);
StringBuilder sb = new StringBuilder();
sb.append(">>> " + instanceInfo + " (" + changeCount + " of " + peers.size() + " / " + changeCounter.get() + ") gen=" + generationCounter + "\n");
// for (Entry<InstanceInfo, Client> peer : peers.entrySet()) {
// sb.append(" " + peer.getKey()).append("\n");
// }
//
System.out.print(sb.toString());
}
@Override
public void onMessage(Message message, AsyncResponse response) {
try {
RequestHandler handler = verbHandlers.get(message.getVerb());
if (handler != null) {
handler.onMessage(message, response);
}
}
catch (Exception e) {
// Notify error
}
}
}
| 458 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/ServerFactory.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server;
import com.netflix.staash.mesh.InstanceInfo;
public interface ServerFactory {
Server createServer(InstanceInfo ii);
}
| 459 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/Server.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server;
/**
* P2P server
* @author elandau
*
*/
public interface Server {
}
| 460 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/Session.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server;
public interface Session {
}
| 461 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/tasks/RefreshRingRunnable.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.tasks;
import com.netflix.staash.mesh.InstanceRegistry;
import com.netflix.staash.mesh.server.Server;
public class RefreshRingRunnable implements Runnable {
private final Server server;
private final InstanceRegistry instanceRegistry;
public RefreshRingRunnable(Server server, InstanceRegistry instanceRegistry) {
this.server = server;
this.instanceRegistry = instanceRegistry;
}
@Override
public void run() {
try {
// server.(this.instanceRegistry.getMembers());
}
catch (Exception e) {
e.printStackTrace();
}
}
}
| 462 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/handlers/DataResponseHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.handlers;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
public class DataResponseHandler implements RequestHandler {
@Override
public void onMessage(Message message, AsyncResponse response) {
}
}
| 463 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/handlers/DigestResponseHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.handlers;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
public class DigestResponseHandler implements RequestHandler {
@Override
public void onMessage(Message message, AsyncResponse response) {
}
}
| 464 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/handlers/DataRequestHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.handlers;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
public class DataRequestHandler implements RequestHandler {
@Override
public void onMessage(Message message, AsyncResponse response) {
}
}
| 465 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/handlers/DataPushHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.handlers;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
public class DataPushHandler implements RequestHandler {
@Override
public void onMessage(Message message, AsyncResponse response) {
}
}
| 466 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/server/handlers/DigestRequestHandler.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.server.handlers;
import com.netflix.staash.mesh.messages.AsyncResponse;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.RequestHandler;
public class DigestRequestHandler implements RequestHandler {
@Override
public void onMessage(Message message, AsyncResponse response) {
}
}
| 467 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/TopicRegistry.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db;
import java.util.concurrent.ConcurrentMap;
import com.google.common.collect.Maps;
public class TopicRegistry {
private ConcurrentMap<String, Topic> topics = Maps.newConcurrentMap();
private TopicFactory topicFactory;
public TopicRegistry(TopicFactory topicFactory) {
this.topicFactory = topicFactory;
}
public boolean createTopic(String topicName) {
Topic topic = topicFactory.create(topicName);
if (null == topics.putIfAbsent(topicName, topic)) {
return true;
}
return false;
}
public boolean removeTopic(String topicName, long timestamp) {
Topic topic = topics.get(topicName);
if (topic != null) {
return topic.deleteTopic(timestamp);
}
return false;
}
public boolean addEntry(String topicName, Entry tuple) {
Topic topic = topics.get(topicName);
if (topic != null) {
return topic.upsert(tuple);
}
return false;
}
public Iterable<String> listTopics() {
return topics.keySet();
}
}
| 468 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/TopicFactory.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db;
public interface TopicFactory {
Topic create(String name);
}
| 469 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/Topic.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db;
public interface Topic {
/**
* Insert an entry into the topic
* @param tuple
* @return
*/
public boolean upsert(Entry tuple);
/**
* Read an entry from the topic
* @param key
* @return
*/
public Entry read(String key);
/**
* Delete an entry from the topic
* @param tuple
* @return
*/
public boolean delete(Entry tuple);
/**
* Get the topic name
* @return
*/
public String getName();
/**
* Get the deleted time of the topic.
* @return Time topic was deleted of 0 if it was not
*/
public long getDeletedTime();
/**
* Get the time when the topic was created
* @return
*/
public long getCreatedTime();
/**
* Get the number of entries in the topic
* @return
*/
public long getEntryCount();
/**
* Make the topic as having been deleted. Delete will only apply
* if the topic last modified timestamp is less than the deleted time
* @param timestamp
* @return
*/
public boolean deleteTopic(long timestamp);
}
| 470 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/Entry.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db;
public class Entry {
private String key;
private String value;
private long timestamp;
public Entry(String key, String value, long timestamp) {
this.key = key;
this.value = value;
this.timestamp = timestamp;
}
public Entry(String key, String value) {
this.key = key;
this.value = value;
this.timestamp = System.currentTimeMillis();
}
public String getKey() {
return key;
}
public String getValue() {
return value;
}
public long getTimestamp() {
return timestamp;
}
public boolean isDeleted() {
return this.value == null;
}
}
| 471 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/memory/MemoryTopic.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db.memory;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
import com.google.common.collect.Maps;
import com.netflix.staash.mesh.db.Entry;
import com.netflix.staash.mesh.db.Topic;
public class MemoryTopic implements Topic {
private final String name;
private final ConcurrentMap<String, EntryHolder> rows;
private volatile long deletedTimestamp;
private AtomicLong size = new AtomicLong(0);
public MemoryTopic(String name) {
this.name = name;
rows = Maps.newConcurrentMap();
}
@Override
public boolean deleteTopic(long timestamp) {
if (timestamp < deletedTimestamp) {
return false;
}
deletedTimestamp = timestamp;
for (java.util.Map.Entry<String, EntryHolder> entry : rows.entrySet()) {
if (entry.getValue().delete(deletedTimestamp)) {
size.incrementAndGet();
}
}
return true;
}
@Override
public boolean upsert(Entry entry) {
EntryHolder existing = rows.putIfAbsent(entry.getKey(), new EntryHolder(entry));
if (existing != null) {
return existing.set(entry);
}
size.incrementAndGet();
return true;
}
@Override
public Entry read(String key) {
EntryHolder holder = rows.get(key);
if (holder == null) {
return null;
}
return holder.getEntry();
}
@Override
public boolean delete(Entry entry) {
EntryHolder holder = rows.get(entry.getKey());
if (holder != null) {
if (holder.delete(entry.getTimestamp())) {
size.decrementAndGet();
return true;
}
}
return false;
}
@Override
public String getName() {
return name;
}
@Override
public long getCreatedTime() {
return 0;
}
@Override
public long getEntryCount() {
return size.get();
}
@Override
public long getDeletedTime() {
return 0;
}
}
| 472 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/memory/EntryHolder.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db.memory;
import com.netflix.staash.mesh.db.Entry;
public class EntryHolder {
private Entry tuple;
public EntryHolder(Entry tuple) {
this.tuple = tuple;
}
public synchronized boolean delete(long timestamp) {
if (timestamp > tuple.getTimestamp()) {
this.tuple = new Entry(tuple.getKey(), null, timestamp);
return true;
}
return false;
}
public synchronized boolean set(Entry tuple) {
if (tuple.getTimestamp() > this.tuple.getTimestamp()) {
this.tuple = tuple;
return true;
}
return false;
}
public synchronized boolean isDeleted() {
return this.tuple.getValue() == null;
}
public synchronized Entry getEntry() {
return tuple;
}
}
| 473 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/db/memory/MemoryTopicFactory.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.db.memory;
import com.netflix.staash.mesh.db.Topic;
import com.netflix.staash.mesh.db.TopicFactory;
public class MemoryTopicFactory implements TopicFactory {
@Override
public Topic create(String name) {
return new MemoryTopic(name);
}
}
| 474 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client/Client.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.client;
import com.netflix.staash.mesh.InstanceInfo;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.ResponseHandler;
/**
* Client of a PTP server
*
* @author elandau
*
*/
public interface Client {
InstanceInfo getInstanceInfo();
void sendMessage(Message request, ResponseHandler response);
void shutdown();
void connect();
}
| 475 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client/ClientFactory.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.client;
import com.netflix.staash.mesh.InstanceInfo;
public interface ClientFactory {
Client createClient(InstanceInfo instanceInfo);
}
| 476 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client/memory/MemoryClientFactory.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.client.memory;
import com.netflix.staash.mesh.InstanceInfo;
import com.netflix.staash.mesh.client.Client;
import com.netflix.staash.mesh.client.ClientFactory;
public class MemoryClientFactory implements ClientFactory {
@Override
public Client createClient(InstanceInfo instanceInfo) {
return new MemoryClient(instanceInfo);
}
}
| 477 |
0 |
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client
|
Create_ds/staash/staash-mesh/src/main/java/com/netflix/staash/mesh/client/memory/MemoryClient.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.staash.mesh.client.memory;
import com.netflix.staash.mesh.InstanceInfo;
import com.netflix.staash.mesh.client.Client;
import com.netflix.staash.mesh.messages.Message;
import com.netflix.staash.mesh.messages.ResponseHandler;
public class MemoryClient implements Client {
private final InstanceInfo instanceInfo;
public MemoryClient(InstanceInfo instanceInfo) {
this.instanceInfo = instanceInfo;
}
@Override
public InstanceInfo getInstanceInfo() {
return instanceInfo;
}
@Override
public void sendMessage(Message request, ResponseHandler response) {
// TODO Auto-generated method stub
}
@Override
public void shutdown() {
// TODO Auto-generated method stub
}
@Override
public void connect() {
// TODO Auto-generated method stub
}
}
| 478 |
0 |
Create_ds/staash/staash-tomcat/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-tomcat/src/main/java/com/netflix/staash/embedded/Tomcat7Server.java
|
package com.netflix.staash.embedded;
import org.apache.catalina.core.AprLifecycleListener;
import org.apache.catalina.core.StandardServer;
public class Tomcat7Server {
// public static void main(String[] args) throws Exception {
// String appBase = "src/main";
// Integer port = 8080;
//
// Tomcat tomcat = new Tomcat();
// tomcat.setPort(port);
//
// tomcat.setBaseDir(".");
// tomcat.getHost().setAppBase(appBase);
//
// String contextPath = "";
//
// // Add AprLifecycleListener
// //StandardServer server = (StandardServer)tomcat.getServer();
// //AprLifecycleListener listener = new AprLifecycleListener();
// // server.addLifecycleListener(listener);
// //server.addLifecycleListener(listener);
//
// tomcat.addWebapp(contextPath, appBase);
// tomcat.start();
// tomcat.getServer().await();
// }
}
| 479 |
0 |
Create_ds/staash/staash-tomcat/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-tomcat/src/main/java/com/netflix/staash/embedded/TomcatServer.java
|
package com.netflix.staash.embedded;
import org.apache.catalina.Engine;
import org.apache.catalina.Host;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.startup.Embedded;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TomcatServer {
private Embedded tomcat;
private int port;
private boolean isRunning;
private static final Logger LOG = LoggerFactory.getLogger(TomcatServer.class);
private static final boolean isInfo = LOG.isInfoEnabled();
public TomcatServer(String contextPath, int port, String appBase, boolean shutdownHook) {
if(contextPath == null || appBase == null || appBase.length() == 0) {
throw new IllegalArgumentException("Context path or appbase should not be null");
}
if(!contextPath.startsWith("/")) {
contextPath = "/" + contextPath;
}
this.port = port;
tomcat = new Embedded();
tomcat.setName("TomcatEmbeddedtomcat");
Host localHost = tomcat.createHost("localhost", appBase);
localHost.setAutoDeploy(false);
StandardContext rootContext = (StandardContext) tomcat.createContext(contextPath, "webapp");
rootContext.setDefaultWebXml("web.xml");
localHost.addChild(rootContext);
Engine engine = tomcat.createEngine();
engine.setDefaultHost(localHost.getName());
engine.setName("TomcatEngine");
engine.addChild(localHost);
tomcat.addEngine(engine);
Connector connector = tomcat.createConnector(localHost.getName(), port, false);
tomcat.addConnector(connector);
// register shutdown hook
if(shutdownHook) {
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run() {
if(isRunning) {
if(isInfo) LOG.info("Stopping the Tomcat tomcat, through shutdown hook");
try {
if (tomcat != null) {
tomcat.stop();
}
} catch (LifecycleException e) {
LOG.error("Error while stopping the Tomcat tomcat, through shutdown hook", e);
}
}
}
});
}
}
/**
* Start the tomcat embedded tomcat
*/
public void start() throws LifecycleException {
if(isRunning) {
LOG.warn("Tomcat tomcat is already running @ port={}; ignoring the start", port);
return;
}
if(isInfo) LOG.info("Starting the Tomcat tomcat @ port={}", port);
tomcat.setAwait(true);
tomcat.start();
isRunning = true;
}
/**
* Stop the tomcat embedded tomcat
*/
public void stop() throws LifecycleException {
if(!isRunning) {
LOG.warn("Tomcat tomcat is not running @ port={}", port);
return;
}
if(isInfo) LOG.info("Stopping the Tomcat tomcat");
tomcat.stop();
isRunning = false;
}
public boolean isRunning() {
return isRunning;
}
public static void main(String[] args) throws Exception{
TomcatServer tomcat = new TomcatServer("staash.war", 8080, "src/main", true);
tomcat.start();
Thread.sleep(1000000);
// TODO Auto-generated catch block
}
}
| 480 |
0 |
Create_ds/staash/staash-eureka/src/test/java/com/netflix
|
Create_ds/staash/staash-eureka/src/test/java/com/netflix/paas/EurekaNodeDiscoveryTest.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Supplier;
import com.google.common.collect.Lists;
import com.google.inject.AbstractModule;
import com.google.inject.Injector;
import com.google.inject.name.Names;
import com.netflix.astyanax.connectionpool.Host;
import com.netflix.governator.guice.LifecycleInjector;
import com.netflix.paas.cassandra.discovery.EurekaAstyanaxHostSupplier;
import com.netflix.paas.cassandra.discovery.EurekaModule;
public class EurekaNodeDiscoveryTest {
Logger LOG = LoggerFactory.getLogger(EurekaNodeDiscoveryTest.class);
@Test
@Ignore
public void testSupplier() {
List<AbstractModule> modules = Lists.newArrayList(
new AbstractModule() {
@Override
protected void configure() {
bind(String.class).annotatedWith(Names.named("groupName")).toInstance("testgroup");
}
},
new EurekaModule()
);
// Create the injector
Injector injector = LifecycleInjector.builder()
.withModules(modules)
.createInjector();
EurekaAstyanaxHostSupplier supplier = injector.getInstance(EurekaAstyanaxHostSupplier.class);
Supplier<List<Host>> list1 = supplier.getSupplier("cass_sandbox");
List<Host> hosts = list1.get();
LOG.info("cass_sandbox");
for (Host host:hosts) {
LOG.info(host.getHostName());
}
Supplier<List<Host>> list2 = supplier.getSupplier("ABCLOUD");
hosts = list2.get();
LOG.info("ABCLOUD");
for (Host host:hosts) {
LOG.info(host.getHostName());
}
Supplier<List<Host>> list3 = supplier.getSupplier("CASSS_PAAS");
hosts = list3.get();
LOG.info("casss_paas");
for (Host host:hosts) {
LOG.info(host.getHostName());
}
}
}
| 481 |
0 |
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra/discovery/EurekaClusterDiscoveryService.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.discovery;
import java.util.Collection;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.apache.commons.configuration.AbstractConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
import com.google.inject.Inject;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.discovery.DiscoveryManager;
import com.netflix.discovery.shared.Application;
/**
* Implementation of a cluster discovery service using Eureka
*
* @author elandau
*
*/
public class EurekaClusterDiscoveryService implements ClusterDiscoveryService {
private static final Logger LOG = LoggerFactory.getLogger(EurekaClusterDiscoveryService.class);
private static final String PROPERTY_MATCH = "com.netflix.paas.discovery.eureka.match";
private DiscoveryClient client;
private AbstractConfiguration config;
@Inject
public EurekaClusterDiscoveryService(AbstractConfiguration config) {
this.config = config;
initialize();
}
@PostConstruct
public void initialize() {
LOG.info("Initializing Eureka client");
client = DiscoveryManager.getInstance().getDiscoveryClient();
}
@PreDestroy
public void shutdown() {
// TODO: Move this somewhere else
LOG.info("Shutting down Eureka client");
DiscoveryManager.getInstance().shutdownComponent();
client = null;
}
@Override
public Collection<String> getClusterNames() {
final Pattern regex = Pattern.compile(this.config.getString(PROPERTY_MATCH));
return Collections2.filter(
Collections2.transform(client.getApplications().getRegisteredApplications(),
new Function<Application, String>() {
@Override
public String apply(Application app) {
return app.getName();
}
}),
new Predicate<String>() {
@Override
public boolean apply(String clusterName) {
Matcher m = regex.matcher(clusterName);
return m.matches();
}
});
}
@Override
public String getName() {
return "eureka";
}
}
| 482 |
0 |
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra/discovery/EurekaModule.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.discovery;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.inject.AbstractModule;
import com.google.inject.multibindings.MapBinder;
import com.netflix.appinfo.CloudInstanceConfig;
import com.netflix.discovery.DefaultEurekaClientConfig;
import com.netflix.discovery.DiscoveryManager;
import com.netflix.paas.cassandra.provider.HostSupplierProvider;
import com.netflix.paas.cassandra.tasks.ClusterDiscoveryTask;
import com.netflix.paas.cassandra.tasks.ClusterRefreshTask;
import com.netflix.paas.tasks.InlineTaskManager;
import com.netflix.paas.tasks.TaskManager;
public class EurekaModule extends AbstractModule {
private static final Logger LOG = LoggerFactory.getLogger(EurekaModule.class);
@Override
protected void configure() {
LOG.info("Configuring EurekaModule");
// Initialize eureka
// TODO: Move this to a bootstrap thingy
DiscoveryManager.getInstance().initComponent(
new CloudInstanceConfig(),
new DefaultEurekaClientConfig());
// Eureka - Astyanax integration
MapBinder<String, HostSupplierProvider> hostSuppliers = MapBinder.newMapBinder(binder(), String.class, HostSupplierProvider.class);
hostSuppliers.addBinding("eureka").to(EurekaAstyanaxHostSupplier.class);
//bind(ClusterDiscoveryService.class).to(EurekaClusterDiscoveryService.class).asEagerSingleton();
}
}
| 483 |
0 |
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-eureka/src/main/java/com/netflix/paas/cassandra/discovery/EurekaAstyanaxHostSupplier.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.discovery;
import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Predicate;
import com.google.common.base.Supplier;
import com.google.common.collect.Collections2;
import com.google.common.collect.Lists;
import com.netflix.appinfo.AmazonInfo;
import com.netflix.appinfo.InstanceInfo;
import com.netflix.appinfo.AmazonInfo.MetaDataKey;
import com.netflix.astyanax.connectionpool.Host;
import com.netflix.discovery.DiscoveryClient;
import com.netflix.discovery.DiscoveryManager;
import com.netflix.discovery.shared.Application;
import com.netflix.paas.cassandra.provider.HostSupplierProvider;
public class EurekaAstyanaxHostSupplier implements HostSupplierProvider {
private static final Logger LOG = LoggerFactory.getLogger(EurekaAstyanaxHostSupplier.class);
private final DiscoveryClient eurekaClient;
public EurekaAstyanaxHostSupplier() {
this.eurekaClient = DiscoveryManager.getInstance().getDiscoveryClient();
Preconditions.checkNotNull(this.eurekaClient);
}
@Override
public Supplier<List<Host>> getSupplier(final String clusterName) {
return new Supplier<List<Host>>() {
@Override
public List<Host> get() {
Application app = eurekaClient.getApplication(clusterName.toUpperCase());
List<Host> hosts = Lists.newArrayList();
if (app == null) {
LOG.warn("Cluster '{}' not found in eureka", new Object[]{clusterName});
}
else {
List<InstanceInfo> ins = app.getInstances();
if (ins != null && !ins.isEmpty()) {
hosts = Lists.newArrayList(Collections2.transform(
Collections2.filter(ins, new Predicate<InstanceInfo>() {
@Override
public boolean apply(InstanceInfo input) {
return input.getStatus() == InstanceInfo.InstanceStatus.UP;
}
}), new Function<InstanceInfo, Host>() {
@Override
public Host apply(InstanceInfo info) {
String[] parts = StringUtils.split(
StringUtils.split(info.getHostName(), ".")[0], '-');
Host host = new Host(info.getHostName(), info.getPort())
.addAlternateIpAddress(
StringUtils.join(new String[] { parts[1], parts[2], parts[3],
parts[4] }, "."))
.addAlternateIpAddress(info.getIPAddr())
.setId(info.getId());
try {
if (info.getDataCenterInfo() instanceof AmazonInfo) {
AmazonInfo amazonInfo = (AmazonInfo)info.getDataCenterInfo();
host.setRack(amazonInfo.get(MetaDataKey.availabilityZone));
}
}
catch (Throwable t) {
LOG.error("Error getting rack for host " + host.getName(), t);
}
return host;
}
}));
}
else {
LOG.warn("Cluster '{}' found in eureka but has no instances", new Object[]{clusterName});
}
}
return hosts;
}
};
}
}
| 484 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/core/StaashDeamon.java
|
package com.netflix.staash.test.core;
import org.apache.cassandra.service.CassandraDaemon;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
public class StaashDeamon extends CassandraDaemon {
private static final Logger logger = LoggerFactory.getLogger(StaashDeamon.class);
private static final StaashDeamon instance = new StaashDeamon();
public static void main(String[] args) {
System.setProperty("cassandra-foreground", "true");
System.setProperty("log4j.defaultInitOverride", "true");
System.setProperty("log4j.configuration", "log4j.properties");
instance.activate();
}
@Override
protected void setup() {
super.setup();
}
@Override
public void init(String[] arguments) throws IOException {
super.init(arguments);
}
@Override
public void start() {
super.start();
}
@Override
public void stop() {
super.stop();
}
}
| 485 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/core/RequiresKeyspace.java
|
package com.netflix.staash.test.core;
import org.apache.cassandra.locator.AbstractReplicationStrategy;
import org.apache.cassandra.locator.SimpleStrategy;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RequiresKeyspace {
String ksName();
int replication() default 1;
Class<? extends AbstractReplicationStrategy> strategy() default SimpleStrategy.class;
String strategyOptions() default "";
}
| 486 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/core/CassandraRunner.java
|
package com.netflix.staash.test.core;
import java.io.File;
import java.lang.annotation.Annotation;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.KSMetaData;
import org.apache.cassandra.db.ColumnFamilyType;
import org.apache.cassandra.db.marshal.CounterColumnType;
import org.apache.cassandra.db.marshal.TypeParser;
import org.apache.cassandra.exceptions.AlreadyExistsException;
import org.apache.cassandra.service.MigrationManager;
import org.apache.cassandra.service.StorageProxy;
import org.apache.cassandra.service.StorageService;
import org.junit.runner.notification.RunNotifier;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CassandraRunner extends BlockJUnit4ClassRunner {
private static final Logger logger = LoggerFactory.getLogger(CassandraRunner.class);
static StaashDeamon staashDaemon;
static ExecutorService executor = Executors.newSingleThreadExecutor();
public CassandraRunner(Class<?> klass) throws InitializationError {
super(klass);
logger.debug("CassandraRunner constructed with class {}", klass.getName());
}
@Override
protected void runChild(FrameworkMethod method, RunNotifier notifier) {
logger.debug("runChild invoked on method: " + method.getName());
RequiresKeyspace rk = method.getAnnotation(RequiresKeyspace.class);
RequiresColumnFamily rcf = method.getAnnotation(RequiresColumnFamily.class);
if ( rk != null ) {
maybeCreateKeyspace(rk, rcf);
} else if ( rcf != null ) {
maybeCreateColumnFamily(rcf);
}
super.runChild(method, notifier);
}
@Override
public void run(RunNotifier notifier) {
startCassandra();
RequiresKeyspace rk = null;
RequiresColumnFamily rcf = null;
for (Annotation ann : getTestClass().getAnnotations() ) {
if ( ann instanceof RequiresKeyspace ) {
rk = (RequiresKeyspace)ann;
} else if ( ann instanceof RequiresColumnFamily ) {
rcf = (RequiresColumnFamily)ann;
}
}
if ( rk != null ) {
maybeCreateKeyspace(rk, rcf);
} else if ( rcf != null ) {
maybeCreateColumnFamily(rcf);
}
super.run(notifier);
}
private void maybeCreateKeyspace(RequiresKeyspace rk, RequiresColumnFamily rcf) {
logger.debug("RequiresKeyspace annotation has keyspace name: {}", rk.ksName());
List<CFMetaData> cfs = extractColumnFamily(rcf);
try {
MigrationManager
.announceNewKeyspace(KSMetaData.newKeyspace(rk.ksName(),
rk.strategy(), KSMetaData.optsWithRF(rk.replication()), false, cfs));
} catch (AlreadyExistsException aee) {
logger.info("using existing Keyspace for " + rk.ksName());
if ( cfs.size() > 0 ) {
maybeTruncateSafely(rcf);
}
} catch (Exception ex) {
throw new RuntimeException("Failure creating keyspace for " + rk.ksName(),ex);
}
}
private List<CFMetaData> extractColumnFamily(RequiresColumnFamily rcf) {
logger.debug("RequiresColumnFamily has name: {} for ks: {}", rcf.cfName(), rcf.ksName());
List<CFMetaData> cfms = new ArrayList<CFMetaData>();
if ( rcf != null ) {
try {
cfms.add(new CFMetaData(rcf.ksName(), rcf.cfName(),
ColumnFamilyType.Standard, TypeParser.parse(rcf.comparator()), null));
} catch (Exception ex) {
throw new RuntimeException("unable to create column family for: " + rcf.cfName(), ex);
}
}
return cfms;
}
private void maybeCreateColumnFamily(RequiresColumnFamily rcf) {
try {
CFMetaData cfMetaData;
if ( rcf.isCounter() ) {
cfMetaData = new CFMetaData(rcf.ksName(), rcf.cfName(),
ColumnFamilyType.Standard, TypeParser.parse(rcf.comparator()), null)
.replicateOnWrite(false).defaultValidator(CounterColumnType.instance);
} else {
cfMetaData = new CFMetaData(rcf.ksName(), rcf.cfName(),
ColumnFamilyType.Standard, TypeParser.parse(rcf.comparator()), null);
}
MigrationManager.announceNewColumnFamily(cfMetaData);
} catch(AlreadyExistsException aee) {
logger.info("CF already exists for " + rcf.cfName());
maybeTruncateSafely(rcf);
} catch (Exception ex) {
throw new RuntimeException("Could not create CF for: " + rcf.cfName(), ex);
}
}
private void maybeTruncateSafely(RequiresColumnFamily rcf) {
if ( rcf != null && rcf.truncateExisting() ) {
try {
StorageProxy.truncateBlocking(rcf.ksName(), rcf.cfName());
} catch (Exception ex) {
throw new RuntimeException("Could not truncate column family: " + rcf.cfName(),ex);
}
}
}
private void startCassandra() {
if ( staashDaemon != null ) {
return;
}
deleteRecursive(new File("/tmp/staash_cache"));
deleteRecursive(new File ("/tmp/staash_data"));
deleteRecursive(new File ("/tmp/staash_log"));
System.setProperty("cassandra-foreground", "true");
System.setProperty("log4j.defaultInitOverride","true");
System.setProperty("log4j.configuration", "log4j.properties");
System.setProperty("cassandra.ring_delay_ms","1000");
System.setProperty("cassandra.start_rpc","true");
System.setProperty("cassandra.start_native_transport","true");
executor.execute(new Runnable() {
public void run() {
staashDaemon = new StaashDeamon();
staashDaemon.activate();
}
});
try {
TimeUnit.SECONDS.sleep(3);
}
catch (InterruptedException e) {
throw new AssertionError(e);
}
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
try {
logger.error("In shutdownHook");
stopCassandra();
} catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
private void stopCassandra() throws Exception {
if (staashDaemon != null) {
staashDaemon.deactivate();
StorageService.instance.stopClient();
}
executor.shutdown();
executor.shutdownNow();
}
private static boolean deleteRecursive(File path) {
if (!path.exists())
return false;
boolean ret = true;
if (path.isDirectory()){
for (File f : path.listFiles()){
ret = ret && deleteRecursive(f);
}
}
return ret && path.delete();
}
}
| 487 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/core/RequiresColumnFamily.java
|
package com.netflix.staash.test.core;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD})
public @interface RequiresColumnFamily {
String ksName();
String cfName();
boolean isCounter() default false;
String comparator() default "UTF8Type";
String defaultValidator() default "UTF8Type";
String keyValidator() default "UTF8Type";
boolean truncateExisting() default false;
}
| 488 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/core/SampleTest.java
|
package com.netflix.staash.test.core;
import java.util.Map;
import org.apache.cassandra.config.CFMetaData;
import org.apache.cassandra.config.KSMetaData;
import org.apache.cassandra.config.Schema;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(CassandraRunner.class)
@RequiresKeyspace(ksName = "myks")
@RequiresColumnFamily(ksName = "myks", cfName = "uuidtest", comparator = "org.apache.cassandra.db.marshal.UTF8Type", keyValidator = "org.apache.cassandra.db.marshal.UUIDType")
@SuppressWarnings({ "rawtypes", "unchecked" })
@Ignore
public class SampleTest {
@Test
@Ignore
public void mytest2() {
System.out.println("Hello World!");
for (String ks :Schema.instance.getTables()) {
KSMetaData ksm = Schema.instance.getKSMetaData(ks);
Map<String, CFMetaData> cfm = ksm.cfMetaData();
}
}
}
| 489 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/test/modules/TestStaashModule.java
|
package com.netflix.staash.test.modules;
import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import com.netflix.astyanax.AstyanaxContext;
import com.netflix.astyanax.Keyspace;
import com.netflix.astyanax.connectionpool.NodeDiscoveryType;
import com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl;
import com.netflix.astyanax.connectionpool.impl.ConnectionPoolType;
import com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor;
import com.netflix.astyanax.impl.AstyanaxConfigurationImpl;
import com.netflix.astyanax.thrift.ThriftFamilyFactory;
import com.netflix.staash.cassandra.discovery.EurekaAstyanaxHostSupplier;
import com.netflix.staash.connection.ConnectionFactory;
import com.netflix.staash.connection.PaasConnectionFactory;
import com.netflix.staash.rest.dao.AstyanaxMetaDaoImpl;
import com.netflix.staash.rest.dao.MetaDao;
import com.netflix.staash.rest.util.MetaConstants;
import com.netflix.staash.service.CacheService;
import com.netflix.staash.service.DataService;
import com.netflix.staash.service.MetaService;
import com.netflix.staash.service.PaasDataService;
import com.netflix.staash.service.PaasMetaService;
public class TestStaashModule extends AbstractModule {
@Provides
@Named("astmetaks")
@Singleton
Keyspace provideKeyspace() {
AstyanaxContext<Keyspace> keyspaceContext = new AstyanaxContext.Builder()
.forCluster("test cluster")
.forKeyspace(MetaConstants.META_KEY_SPACE)
.withAstyanaxConfiguration(
new AstyanaxConfigurationImpl()
.setDiscoveryType(
NodeDiscoveryType.NONE)
.setConnectionPoolType(
ConnectionPoolType.ROUND_ROBIN)
.setTargetCassandraVersion("1.2")
.setCqlVersion("3.0.0"))
// .withHostSupplier(hs.getSupplier(clustername))
.withConnectionPoolConfiguration(
new ConnectionPoolConfigurationImpl("localpool"
+ "_" + MetaConstants.META_KEY_SPACE)
.setSocketTimeout(30000)
.setMaxTimeoutWhenExhausted(20000)
.setMaxConnsPerHost(3).setInitConnsPerHost(1)
.setSeeds("localhost"+":"+"9160")) //uncomment for localhost
// .withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
.buildKeyspace(ThriftFamilyFactory.getInstance());
keyspaceContext.start();
Keyspace keyspace;
keyspace = keyspaceContext.getClient();
return keyspace;
}
@Provides
@Named("newmetadao")
@Singleton
MetaDao provideCqlMetaDaoNew(@Named("astmetaks") Keyspace keyspace) {
return new AstyanaxMetaDaoImpl(keyspace);
}
@Provides
MetaService providePaasMetaService(@Named("newmetadao") MetaDao metad, CacheService cache) {
ConnectionFactory fac = new PaasConnectionFactory("astyanax", null);
PaasMetaService metasvc = new PaasMetaService(metad, fac, cache);
return metasvc;
}
@Provides
ConnectionFactory provideConnectionFactory() {
return new PaasConnectionFactory("astyanax", null);
}
@Provides
DataService providePaasDataService( MetaService metasvc) {
ConnectionFactory fac = new PaasConnectionFactory("astyanax", null);
PaasDataService datasvc = new PaasDataService(metasvc, fac);
return datasvc;
}
@Provides
CacheService provideCacheService(@Named("newmetadao") MetaDao metad) {
return new CacheService(metad);
}
@Override
protected void configure() {
}
}
| 490 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web/tests/TableTest.java
|
package com.netflix.staash.web.tests;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.netflix.staash.json.JsonObject;
import com.netflix.staash.service.PaasDataService;
import com.netflix.staash.service.PaasMetaService;
import com.netflix.staash.test.core.CassandraRunner;
import com.netflix.staash.test.modules.TestStaashModule;
@RunWith(CassandraRunner.class)
public class TableTest {
public static PaasMetaService metasvc;
public static PaasDataService datasvc;
public static final String db = "unitdb1";
public static final String table = "table1";
public static final String tblpay = "{\"name\":\"table1\",\"columns\":\"username,friends,wall,status\",\"primarykey\":\"username\",\"storage\":\"cassandratest\"}";
public static final String insertPay1 = "{\"columns\":\"username,friends,wall,status\",\"values\":\"'rogerfederer','rafa#haas#tommy#sachin#beckham','getting ready for my next#out of wimbledon#out of french','looking fwd to my next match'\"}";
public static final String insertPay2 = "{\"columns\":\"username,friends,wall,status\",\"values\":\"'rafaelnadal','rafa#haas#tommy#sachin#beckham','getting ready for my next#out of wimbledon#out of french','looking fwd to my next match'\"}";
public static final String responseText1 = "{\"1\":{\"username\":\"rogerfederer\",\"friends\":\"rafa#haas#tommy#sachin#beckham\",\"status\":\"looking fwd to my next match\",\"wall\":\"getting ready for my next#out of wimbledon#out of french\"}}";
public static final String responseText2 = "{\"1\":{\"username\":\"rafaelnadal\",\"friends\":\"rafa#haas#tommy#sachin#beckham\",\"status\":\"looking fwd to my next match\",\"wall\":\"getting ready for my next#out of wimbledon#out of french\"}}";
@BeforeClass
public static void setup() {
TestStaashModule pmod = new TestStaashModule();
Injector inj = Guice.createInjector(pmod);
metasvc = inj.getInstance(PaasMetaService.class);
datasvc = inj.getInstance(PaasDataService.class);
StaashTestHelper.createTestStorage(metasvc);
StaashTestHelper.createTestDB(metasvc);
StaashTestHelper.createTestTable(metasvc,tblpay);
System.out.println("Done:");
}
@Test
public void testTableWriteRead() {
datasvc.writeRow(db, table, new JsonObject(insertPay1));
datasvc.writeRow(db, table, new JsonObject(insertPay2));
readRows();
}
private void readRows() {
String out = "";
out = datasvc.listRow(db, table, "username", "rogerfederer");
Assert.assertTrue("Did Not Get What Was Expected", out!=null?out.equals(responseText1):false);
System.out.println("out= "+out);
out = datasvc.listRow(db, table, "username", "rafaelnadal");
Assert.assertTrue("Did Not Get What Was Expected", out!=null?out.equals(responseText2):false);
System.out.println("out= "+out);
}
}
| 491 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web/tests/StaashTestHelper.java
|
/*******************************************************************************
* /*
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* *
******************************************************************************/
package com.netflix.staash.web.tests;
import com.netflix.staash.exception.StorageDoesNotExistException;
import com.netflix.staash.json.JsonObject;
import com.netflix.staash.rest.meta.entity.EntityType;
import com.netflix.staash.service.MetaService;
import com.netflix.staash.service.PaasDataService;
public class StaashTestHelper {
public static final String ServerUrl = "http://localhost:8080";
public static final String CreateDBUrl = "/paas/v1/admin";
public static final String CreateDBPayload = "{name: testdb}";
public static final String ListDBUrl = "/paas/v1/admin";
public static final String CreateStorageUrl = "http://localhost:8080/paas/v1/admin/storage";
public static final String CreateStoragePayloadCassandra = "{name:testStorageCass, type: cassandra, cluster:local, replicateto:newcluster";
public static final String ListStorage = "/paas/v1/admin/storage";
public static final String CreateTableUrl = "/paas/v1/admin/testdb";
public static final String CreateTablePayload = "{name:testtable, columns:user,friends,wall,status, primarykey:user, storage: teststoagecass}";
public static final String ListTablesUrl = "/paas/v1/admin/testdb";
public static final String InsertRowUrl = "/paas/v1/data/testdb/testtable";
public static final String InserRowUrlPayload = "{columns:user,friends,wall,status,values:rogerfed,rafanad,blahblah,blahblahblah}";
public static final String ReadRowUrl = "/paas/v1/data/testdb/testtable/username/rogerfed";
public static final String CreateTimeSeriesUrl = "/paa/v1/admin/timeseries/testdb";
public static final String CreateTimeSeriesPayload = "{\"name\":\"testseries\",\"msperiodicity\":10000,\"prefix\":\"rogerfed\"}";
public static final String ListTimeSeriesUrl = "/paas/v1/admin/timeseries/testdb";
public static final String CreateEventUrl = "/paas/v1/admin/timeseries/testdb/testseries";
public static final String CreateEventPayload = "{\"time\":1000000,\"event\":\"{tweet: enjoying a cruise}}\"";
public static final String ReadEventUrl = "/paas/v1/data/timeseries/testdb/testseries/time/100000/prefix/rogerfed";
public static final String storagePayload = "{\"name\": \"cassandratest\",\"type\": \"cassandra\",\"cluster\": \"localhost\",\"rf\":\"replication_factor:1\",\"strategy\":\"SimpleStrategy\"}";
public static final String dbPayload = "{\"name\":\"unitdb1\",\"rf\":\"replication_factor:1\",\"strategy\":\"SimpleStrategy\"}";
public static final String db = "unitdb1";
public static final String timeseries = "timeseries1";
public static final String storage = "cassandratest";
public static void createTestStorage(MetaService metasvc) {
try {
metasvc.writeMetaEntity(EntityType.STORAGE, storagePayload);
} catch (StorageDoesNotExistException e) {
e.printStackTrace();
}
}
public static void createTestDB(MetaService metasvc) {
try {
metasvc.writeMetaEntity(EntityType.DB, dbPayload);
} catch (StorageDoesNotExistException e) {
e.printStackTrace();
}
}
public static void createTestTimeSeries(MetaService metasvc, String tblpay) {
JsonObject pload = new JsonObject(tblpay);
pload.putString("db", db);
try {
metasvc.writeMetaEntity(EntityType.SERIES, pload.toString());
} catch (StorageDoesNotExistException e) {
e.printStackTrace();
}
}
public static void writeEvent(PaasDataService datasvc, JsonObject evPayload) {
datasvc.writeEvent(db, timeseries, evPayload);
}
public static void readEvent() {
}
/*
* Table Test
*/
public static void createTestTable(MetaService metasvc, String tblpay) {
JsonObject pload = new JsonObject(tblpay);
pload.putString("db", db);
try {
metasvc.writeMetaEntity(EntityType.TABLE, pload.toString());
} catch (StorageDoesNotExistException e) {
e.printStackTrace();
}
}
}
| 492 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web/tests/TestChunking.java
|
/*******************************************************************************
* /*
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* *
******************************************************************************/
package com.netflix.staash.web.tests;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.netflix.astyanax.AstyanaxContext;
import com.netflix.astyanax.Keyspace;
import com.netflix.astyanax.connectionpool.NodeDiscoveryType;
import com.netflix.astyanax.connectionpool.impl.ConnectionPoolConfigurationImpl;
import com.netflix.astyanax.connectionpool.impl.CountingConnectionPoolMonitor;
import com.netflix.astyanax.impl.AstyanaxConfigurationImpl;
import com.netflix.astyanax.recipes.storage.CassandraChunkedStorageProvider;
import com.netflix.astyanax.recipes.storage.ChunkedStorage;
import com.netflix.astyanax.recipes.storage.ChunkedStorageProvider;
import com.netflix.astyanax.recipes.storage.ObjectMetadata;
import com.netflix.astyanax.thrift.ThriftFamilyFactory;
import com.netflix.staash.test.core.RequiresColumnFamily;
import com.netflix.staash.test.core.RequiresKeyspace;
import com.netflix.staash.test.core.CassandraRunner;
@RunWith(CassandraRunner.class)
@RequiresKeyspace(ksName = "myks")
@RequiresColumnFamily(ksName = "myks", cfName = "chunks", comparator = "org.apache.cassandra.db.marshal.UTF8Type", keyValidator = "org.apache.cassandra.db.marshal.UTF8Type")
@SuppressWarnings({ "rawtypes", "unchecked" })
public class TestChunking {
Keyspace keyspace;
private static final String KS = "myks";
private static final String CF = "chunks";
private static final String ENC1 = "SHA-1";
private static final String ENC2 = "MD5";// optional, less strength
private static final String OBJASC = "testascii";
private static final String OBJBIN = "testbinary";
private static final String FILEASC = "chunktest.html";
private static final String FILEBIN = "test.exe";
@Before
public void setup() {
AstyanaxContext<Keyspace> context = new AstyanaxContext.Builder()
.forCluster("Test Cluster")
.forKeyspace(KS)
.withAstyanaxConfiguration(
new AstyanaxConfigurationImpl()
.setDiscoveryType(NodeDiscoveryType.RING_DESCRIBE))
.withConnectionPoolConfiguration(
new ConnectionPoolConfigurationImpl("MyConnectionPool")
.setPort(9160).setMaxConnsPerHost(1)
.setSeeds("127.0.0.1:9160"))
.withConnectionPoolMonitor(new CountingConnectionPoolMonitor())
.buildKeyspace(ThriftFamilyFactory.getInstance());
context.start();
keyspace = context.getClient();
}
@Test
@Ignore
public void chunktestbinary() throws IOException {
ChunkedStorageProvider provider = new CassandraChunkedStorageProvider(
keyspace, CF);
InputStream fis = null;
InputStream bis = null;
try {
fis = this.getClass().getClassLoader().getResource(FILEBIN)
.openStream();
ObjectMetadata meta = ChunkedStorage
.newWriter(provider, OBJBIN, fis).withChunkSize(0x1000)
.withConcurrencyLevel(8).withTtl(60) // Optional TTL for the
// entire object
.call();
Long writesize = meta.getObjectSize();
// Long readsize = readChunked("myks","chunks","test1");
byte[] written = new byte[writesize.intValue()];
bis =
this.getClass().getClassLoader().getResource(FILEBIN).openStream();
int i1 = ((BufferedInputStream)bis).read(written, 0,
writesize.intValue());
System.out.println("length read = "+i1);
byte[] read = readChunked(KS, CF, OBJBIN);
boolean cmp = compareMD5(written, read);
Assert.assertTrue(cmp == true);
Thread.sleep(1000);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Assert.fail(e.getMessage());
} finally {
if (fis != null)
fis.close();
if (bis!=null)
bis.close();
}
}
@Test
public void chunktestascii() throws IOException {
ChunkedStorageProvider provider = new CassandraChunkedStorageProvider(
keyspace, CF);
InputStream fis = null;
InputStream bis = null;
try {
fis = this.getClass().getClassLoader().getResource(FILEASC)
.openStream();
ObjectMetadata meta = ChunkedStorage
.newWriter(provider, OBJASC, fis).withChunkSize(0x1000)
.withConcurrencyLevel(8).withTtl(60) // Optional TTL for the
// entire object
.call();
Long writesize = meta.getObjectSize();
// Long readsize = readChunked("myks","chunks","test1");
byte[] written = new byte[writesize.intValue()];
bis =
this.getClass().getClassLoader().getResource("chunktest.html").openStream();
int i1 = ((BufferedInputStream)bis).read(written, 0,
writesize.intValue());
System.out.println("length read = "+i1);
byte[] read = readChunked(KS, CF, OBJASC);
boolean cmp = compareMD5(written, read);
Assert.assertTrue(cmp == true);
Thread.sleep(1000);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
Assert.fail(e.getMessage());
} finally {
if (fis != null)
fis.close();
if (bis!=null)
bis.close();
}
}
public boolean compareMD5(byte[] written, byte[] read) {
try {
MessageDigest md = MessageDigest.getInstance(ENC1);
byte[] wdigest = md.digest(written);
byte[] rdigest = md.digest(read);
return Arrays.equals(wdigest, rdigest);
} catch (NoSuchAlgorithmException e) {
// TODO Auto-generated catch block
throw new RuntimeException(e.getCause());
}
}
public byte[] readChunked(String db, String table, String objName)
throws Exception {
ChunkedStorageProvider provider = new CassandraChunkedStorageProvider(
keyspace, table);
ObjectMetadata meta = ChunkedStorage.newInfoReader(provider, objName)
.call();
ByteArrayOutputStream os = new ByteArrayOutputStream(meta
.getObjectSize().intValue());
meta = ChunkedStorage.newReader(provider, objName, os)
.withBatchSize(10).call();
return (os != null) ? os.toByteArray() : new byte[0];
}
}
| 493 |
0 |
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web
|
Create_ds/staash/staash-web/src/test/java/com/netflix/staash/web/tests/TimeSeriesTest.java
|
package com.netflix.staash.web.tests;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.netflix.staash.json.JsonObject;
import com.netflix.staash.service.PaasDataService;
import com.netflix.staash.service.PaasMetaService;
import com.netflix.staash.test.modules.TestStaashModule;
import com.netflix.staash.test.core.CassandraRunner;
//@RequiresKeyspace(ksName = "paasmetaks")
//@RequiresColumnFamily(ksName = "paasmetaks", cfName = "metacf", comparator = "org.apache.cassandra.db.marshal.UTF8Type", keyValidator = "org.apache.cassandra.db.marshal.UTF8Type")
//@SuppressWarnings({ "rawtypes", "unchecked" })
@RunWith(CassandraRunner.class)
public class TimeSeriesTest {
public static PaasMetaService metasvc;
public static PaasDataService datasvc;
public static final String db = "unitdb1";
public static final String timeseries = "testtimeseries1";
public static String timeseriespay = "{\"name\":\"timeseries1\",\"periodicity\":\"10000\",\"prefix\":\"server1\",\"storage\":\"cassandratest\"}";
@BeforeClass
public static void setup() {
TestStaashModule pmod = new TestStaashModule();
Injector inj = Guice.createInjector(pmod);
metasvc = inj.getInstance(PaasMetaService.class);
datasvc = inj.getInstance(PaasDataService.class);
StaashTestHelper.createTestStorage(metasvc);
StaashTestHelper.createTestDB(metasvc);
StaashTestHelper.createTestTimeSeries(metasvc, timeseriespay);
System.out.println("Done:");
}
@Test
public void testTimeseriesWriteRead() {
String payload1="{\"timestamp\":11000,\"event\":\"hi 11k event\",\"prefix\":\"source1\"}";
String payload2="{\"timestamp\":21000,\"event\":\"hi 21k event\",\"prefix\":\"source1\"}";
String payload3="{\"timestamp\":121000,\"event\":\"hi 121k event\",\"prefix\":\"source2\"}";
StaashTestHelper.writeEvent(datasvc, new JsonObject(payload1));
StaashTestHelper.writeEvent(datasvc, new JsonObject(payload2));
StaashTestHelper.writeEvent(datasvc, new JsonObject(payload3));
readTimeSeries();
}
private void readTimeSeries() {
String db = "unitdb1";
String table = "timeseries1";
String out = "";
out = datasvc.readEvent(db, table, "source2","121000");
assert out.equals("{\"1 Jan 1970 00:02:01 GMT\":\"hi 121k event\"}");
System.out.println("out= "+out);
out = datasvc.readEvent(db, table, "source1", "21000");
assert out.equals("{\"1 Jan 1970 00:00:21 GMT\":\"hi 21k event\"}");
System.out.println("out= "+out);
out = datasvc.readEvent(db, table, "source1", "11000");
assert out.equals("{\"1 Jan 1970 00:00:11 GMT\":\"hi 11k event\"}");
System.out.println("out= "+out);
}
}
| 494 |
0 |
Create_ds/staash/staash-web/src/main/java/com/netflix/staash
|
Create_ds/staash/staash-web/src/main/java/com/netflix/staash/web/GuiceServletConfig.java
|
/*******************************************************************************
* /*
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
* *
******************************************************************************/
package com.netflix.staash.web;
import com.google.inject.Injector;
import com.google.inject.servlet.GuiceServletContextListener;
import com.netflix.governator.guice.LifecycleInjector;
import com.netflix.staash.cassandra.discovery.EurekaModule;
import com.netflix.staash.rest.modules.PaasPropertiesModule;
import com.netflix.staash.rest.resources.StaashAdminResourceImpl;
import com.netflix.staash.rest.resources.StaashDataResourceImpl;
import com.sun.jersey.guice.JerseyServletModule;
import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
public class GuiceServletConfig extends GuiceServletContextListener {
@Override
protected Injector getInjector() {
return LifecycleInjector.builder()
.withModules(
new EurekaModule(),
new PaasPropertiesModule(),
new JerseyServletModule() {
@Override
protected void configureServlets() {
bind(GuiceContainer.class).asEagerSingleton();
bind(StaashAdminResourceImpl.class);
bind(StaashDataResourceImpl.class);
serve("/*").with(GuiceContainer.class);
}
}
)
.createInjector();
}
}
| 495 |
0 |
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra/provider/AstyanaxThriftTest.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.provider;
import junit.framework.Assert;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.collect.ImmutableMap;
import com.google.inject.AbstractModule;
import com.google.inject.Injector;
import com.google.inject.Scopes;
import com.google.inject.name.Names;
import com.netflix.astyanax.Keyspace;
import com.netflix.astyanax.util.SingletonEmbeddedCassandra;
import com.netflix.governator.guice.LifecycleInjector;
import com.netflix.governator.lifecycle.LifecycleManager;
import com.netflix.paas.PaasBootstrap;
import com.netflix.paas.PaasModule;
import com.netflix.paas.cassandra.CassandraPaasModule;
import com.netflix.paas.cassandra.PaasCassandraBootstrap;
import com.netflix.paas.cassandra.admin.CassandraClusterAdminResource;
import com.netflix.paas.cassandra.admin.CassandraClusterAdminResourceFactory;
import com.netflix.paas.cassandra.discovery.ClusterDiscoveryService;
import com.netflix.paas.cassandra.discovery.LocalClusterDiscoveryService;
import com.netflix.paas.cassandra.entity.ColumnFamilyEntity;
import com.netflix.paas.cassandra.entity.KeyspaceEntity;
import com.netflix.paas.cassandra.keys.ClusterKey;
import com.netflix.paas.cassandra.keys.KeyspaceKey;
import com.netflix.paas.cassandra.provider.KeyspaceClientProvider;
import com.netflix.paas.cassandra.resources.AstyanaxThriftDataTableResource;
import com.netflix.paas.data.QueryResult;
import com.netflix.paas.data.RowData;
import com.netflix.paas.data.SchemalessRows;
import com.netflix.paas.resources.TableDataResource;
public class AstyanaxThriftTest {
private static final Logger LOG = LoggerFactory.getLogger(AstyanaxThriftTest.class)
;
private static Injector injector;
private static final String CLUSTER_NAME = "local";
private static final String KEYSPACE_NAME = "Keyspace1";
private static final String CF_NAME = "ColumnFamily1";
private static final String LOCAL_DISCOVERY_TYPE = "local";
// @BeforeClass
// @Ignore
// public static void initialize() throws Exception {
//
// System.setProperty("com.netflix.paas.title", "HelloPaas");
// System.setProperty("com.netflix.paas.cassandra.dcs", "us-east");
// System.setProperty("com.netflix.paas.schema.configuration.type", "astyanax");
// System.setProperty("com.netflix.paas.schema.configuration.discovery", "local");
// System.setProperty("com.netflix.paas.schema.configuration.cluster", "cass_sandbox");
// System.setProperty("com.netflix.paas.schema.configuration.keyspace", "paas");
// System.setProperty("com.netflix.paas.schema.configuration.strategy_options.replication_factor", "1");
// System.setProperty("com.netflix.paas.schema.configuration.strategy_class", "SimpleStrategy");
// System.setProperty("com.netflix.paas.schema.audit", "configuration");
//
// SingletonEmbeddedCassandra.getInstance();
//
// // Create the injector
// injector = LifecycleInjector.builder()
// .withModules(
// new PaasModule(),
// new CassandraPaasModule(),
// new AbstractModule() {
// @Override
// protected void configure() {
// bind(String.class).annotatedWith(Names.named("groupName")).toInstance("UnitTest1");
// bind(ClusterDiscoveryService.class).to(LocalClusterDiscoveryService.class).in(Scopes.SINGLETON);
//
// bind(PaasBootstrap.class).asEagerSingleton();
// bind(PaasCassandraBootstrap.class).asEagerSingleton();
// }
// })
// .createInjector();
//
// LifecycleManager manager = injector.getInstance(LifecycleManager.class);
// manager.start();
//
// CassandraClusterAdminResourceFactory factory = injector.getInstance(CassandraClusterAdminResourceFactory.class);
//
// // Create Keyspace
// CassandraClusterAdminResource admin = factory.get(new ClusterKey(CLUSTER_NAME, "local"));
// admin.createKeyspace(KeyspaceEntity.builder()
// .withName(KEYSPACE_NAME)
// .withOptions(ImmutableMap.<String, String>builder()
// .put("strategy_class", "SimpleStrategy")
// .put("strategy_options.replication_factor", "1")
// .build())
// .build());
//
// // Create column family
// admin.createColumnFamily(KEYSPACE_NAME, ColumnFamilyEntity.builder()
// .withName(CF_NAME)
// .withOptions(ImmutableMap.<String, String>builder()
// .put("comparator_type", "LongType")
// .put("key_validation_class", "LongType")
// .build())
// .build());
//
// // Create DB from cluster
//
// }
@AfterClass
public static void shutdown() {
}
@Test
@Ignore
public void testReadData() throws Exception {
KeyspaceClientProvider clientProvider = injector.getInstance(KeyspaceClientProvider.class);
Keyspace keyspace = clientProvider.acquireKeyspace(new KeyspaceKey(new ClusterKey(LOCAL_DISCOVERY_TYPE, CLUSTER_NAME), KEYSPACE_NAME));
//
// // Create the keyspace and column family
// keyspace.createKeyspace(new Properties());
// Properties props = new Properties();
// props.setProperty("name", CF_NAME);
// props.setProperty("comparator_type", "LongType");
// props.setProperty("key_validation_class", "LongType");
// keyspace.createColumnFamily(props);
//
// // Add some data
TableDataResource thriftDataTableResource = new AstyanaxThriftDataTableResource(keyspace, CF_NAME);
String rowKey = "100";
SchemalessRows.Builder builder = SchemalessRows.builder();
builder.addRow(rowKey, ImmutableMap.<String, String>builder().put("1", "11").put("2", "22").build());
RowData dr = new RowData();
dr.setSrows(builder.build());
// thriftDataTableResource.updateRow(rowKey, dr);
QueryResult result;
result = thriftDataTableResource.readRow(rowKey, 1, null, null, false);
// Assert.assertEquals(1, Iterables.getFirst(result.getSrows().getRows(), null).getColumns().size());
LOG.info(result.toString());
result = thriftDataTableResource.readRow(rowKey, 10, null, null, false);
// Assert.assertEquals(2, Iterables.getFirst(result.getRows(), null).getColumns().size());
LOG.info(result.toString());
}
@Test
@Ignore
public void testAdmin() {
}
}
| 496 |
0 |
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra/provider/LocalClusterClientProvider.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.provider;
import com.netflix.astyanax.Cluster;
import com.netflix.paas.cassandra.keys.ClusterKey;
public class LocalClusterClientProvider implements ClusterClientProvider {
@Override
public Cluster acquireCluster(ClusterKey clusterName) {
return null;
}
@Override
public void releaseCluster(ClusterKey clusterName) {
}
}
| 497 |
0 |
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra
|
Create_ds/staash/staash-astyanax/src/test/java/com/netflix/paas/cassandra/provider/SingletonEmbeddedCassandra.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.cassandra.provider;
import com.netflix.astyanax.test.EmbeddedCassandra;
public class SingletonEmbeddedCassandra {
private final EmbeddedCassandra cassandra;
private static class Holder {
private final static SingletonEmbeddedCassandra instance = new SingletonEmbeddedCassandra();
}
public static SingletonEmbeddedCassandra getInstance() {
return Holder.instance;
}
public SingletonEmbeddedCassandra() {
try {
cassandra = new EmbeddedCassandra();
cassandra.start();
} catch (Exception e) {
throw new RuntimeException("Failed to start embedded cassandra", e);
}
}
public void finalize() {
try {
cassandra.stop();
}
catch (Exception e) {
}
}
}
| 498 |
0 |
Create_ds/staash/staash-astyanax/src/main/java/com/netflix/paas/dao
|
Create_ds/staash/staash-astyanax/src/main/java/com/netflix/paas/dao/meta/CqlMetaDaoImpl.java
|
/*******************************************************************************
* /***
* *
* * Copyright 2013 Netflix, Inc.
* *
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * You may obtain a copy of the License at
* *
* * http://www.apache.org/licenses/LICENSE-2.0
* *
* * Unless required by applicable law or agreed to in writing, software
* * distributed under the License is distributed on an "AS IS" BASIS,
* * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * See the License for the specific language governing permissions and
* * limitations under the License.
* *
******************************************************************************/
package com.netflix.paas.dao.meta;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.cassandra.config.ColumnDefinition;
import org.apache.cassandra.cql3.ColumnSpecification;
import org.apache.cassandra.thrift.CqlResult;
import org.apache.cassandra.thrift.CqlRow;
import org.apache.cassandra.transport.messages.ResultMessage;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.ColumnDefinitions.Definition;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
import com.datastax.driver.core.Session;
import com.datastax.driver.core.exceptions.AlreadyExistsException;
import com.datastax.driver.core.exceptions.DriverException;
import com.google.inject.Inject;
import com.netflix.paas.json.JsonObject;
import com.netflix.paas.meta.dao.MetaDao;
import com.netflix.paas.meta.entity.Entity;
import com.netflix.paas.meta.entity.PaasDBEntity;
import com.netflix.paas.meta.entity.PaasTableEntity;
import com.netflix.paas.util.Pair;
import static com.datastax.driver.core.querybuilder.QueryBuilder.*;
public class CqlMetaDaoImpl implements MetaDao{
private Cluster cluster;
private Session session;
private static boolean schemaCreated = false;
private static final String metaks = "paasmetaks";
private static final String metacf = "metacf";
@Inject
public CqlMetaDaoImpl(Cluster cluster) {
this.cluster = cluster;
this.session = this.cluster.connect();
maybeCreateMetaSchema();
}
@Override
public void writeMetaEntity(Entity entity) {
//if (entity instanceof PaasDBEntity) {
//implies its a create request
//insert into the meta some values for this dbentity
//wait for creation of the actual keyspace
try {
session.execute(String.format(PaasUtils.INSERT_FORMAT, metaks+"."+metacf, entity.getRowKey(),entity.getName(),entity.getPayLoad()));
} catch (AlreadyExistsException e) {
// It's ok, ignore
}
//}
if (entity instanceof PaasTableEntity) {
//first create/check if schema db exists
PaasTableEntity tableEnt = (PaasTableEntity)entity;
try {
String schemaName = tableEnt.getSchemaName();
session.execute(String.format(PaasUtils.CREATE_KEYSPACE_SIMPLE_FORMAT, schemaName, 1));
} catch (AlreadyExistsException e) {
// It's ok, ignore
}
//if schema/db already exists now create the table
String query = BuildQuery(tableEnt);
Print(query);
session.execute(query);
//List<String> primaryKeys = entity.getPrimaryKey();
}
}
public void writeRow(String db, String table,JsonObject rowObj) {
String query = BuildRowInsertQuery(db, table, rowObj);
Print(query);
session.execute(query);
}
private String BuildRowInsertQuery(String db, String table, JsonObject rowObj) {
// TODO Auto-generated method stub
String columns = rowObj.getString("columns");
String values = rowObj.getString("values");
return "INSERT INTO"+" "+db+"."+table+"("+columns+")"+" VALUES("+values+");";
}
private void Print(String str) {
// TODO Auto-generated method stub
System.out.println(str);
}
private String BuildQuery(PaasTableEntity tableEnt) {
// TODO Auto-generated method stub
String schema = tableEnt.getSchemaName();
String tableName = tableEnt.getName();
List<Pair<String, String>> columns = tableEnt.getColumns();
String primary = tableEnt.getPrimarykey();
String colStrs = "";
for (Pair<String, String> colPair:columns) {
colStrs = colStrs+colPair.getRight()+" "+colPair.getLeft()+", ";
}
String primarykeys = tableEnt.getPrimarykey();
String PRIMARYSTR = "PRIMARY KEY("+primarykeys+")";
return "CREATE TABLE "+schema+"."+tableName+" ("+colStrs+" "+PRIMARYSTR+");";
}
public void maybeCreateMetaSchema() {
try {
if (schemaCreated)
return;
try {
session.execute(String.format(PaasUtils.CREATE_KEYSPACE_SIMPLE_FORMAT, metaks, 1));
} catch (AlreadyExistsException e) {
// It's ok, ignore
}
session.execute("USE " + metaks);
for (String tableDef : getTableDefinitions()) {
try {
session.execute(tableDef);
} catch (AlreadyExistsException e) {
// It's ok, ignore
}
}
schemaCreated = true;
} catch (DriverException e) {
throw e;
}
}
protected Collection<String> getTableDefinitions() {
// String sparse = "CREATE TABLE sparse (\n"
// + " k text,\n"
// + " c1 int,\n"
// + " c2 float,\n"
// + " l list<text>,\n"
// + " v int,\n"
// + " PRIMARY KEY (k, c1, c2)\n"
// + ");";
//
// String st = "CREATE TABLE static (\n"
// + " k text,\n"
// + " i int,\n"
// + " m map<text, timeuuid>,\n"
// + " v int,\n"
// + " PRIMARY KEY (k)\n"
// + ");";
//
// String compactStatic = "CREATE TABLE compact_static (\n"
// + " k text,\n"
// + " i int,\n"
// + " t timeuuid,\n"
// + " v int,\n"
// + " PRIMARY KEY (k)\n"
// + ") WITH COMPACT STORAGE;";
//similar to old paas.db table, contains only the metadata about the paas entities
String metaDynamic = "CREATE TABLE metacf (\n"
+ " key text,\n"
+ " column1 text,\n"
+ " value text,\n"
+ " PRIMARY KEY (key, column1)\n"
+ ") WITH COMPACT STORAGE;";
// String compactComposite = "CREATE TABLE compact_composite (\n"
// + " k text,\n"
// + " c1 int,\n"
// + " c2 float,\n"
// + " c3 double,\n"
// + " v timeuuid,\n"
// + " PRIMARY KEY (k, c1, c2, c3)\n"
// + ") WITH COMPACT STORAGE;";
// String withOptions = "CREATE TABLE with_options (\n"
// + " k text,\n"
// + " i int,\n"
// + " PRIMARY KEY (k)\n"
// + ") WITH read_repair_chance = 0.5\n"
// + " AND dclocal_read_repair_chance = 0.6\n"
// + " AND replicate_on_write = true\n"
// + " AND gc_grace_seconds = 42\n"
// + " AND bloom_filter_fp_chance = 0.01\n"
// + " AND caching = ALL\n"
// + " AND comment = 'My awesome table'\n"
// + " AND compaction = { 'class' : 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'sstable_size_in_mb' : 15 }\n"
// + " AND compression = { 'sstable_compression' : 'org.apache.cassandra.io.compress.SnappyCompressor', 'chunk_length_kb' : 128 };";
List<String> allDefs = new ArrayList<String>();
allDefs.add(metaDynamic);
return allDefs;
}
@Override
public Entity readMetaEntity(String rowKey) {
// TODO Auto-generated method stub
return null;
}
@Override
public String listRow(String db, String table, String keycol, String key) {
// TODO Auto-generated method stub
String query = select().all().from(db, table).where(eq(keycol,key)).getQueryString();
ResultSet rs = session.execute(query);
return convertResultSet(rs);
}
private String convertResultSet(ResultSet rs) {
// TODO Auto-generated method stub
String colStr = "";
String rowStr = "";
JsonObject response = new JsonObject();
List<Row> rows = rs.all();
if (!rows.isEmpty() && rows.size()==1) {
rowStr = rows.get(0).toString();
}
ColumnDefinitions colDefs = rs.getColumnDefinitions();
colStr = colDefs.toString();
response.putString("columns", colStr.substring(8,colStr.length()-1));
response.putString("values", rowStr.substring(4,rowStr.length()-1));
return response.toString();
// for (Row ro:rows) {
// Print(ro.toString());
//// ro.getColumnDefinitions()
// }
// return null;
// if (rm.kind == ResultMessage.Kind.ROWS) {
// //ToDo maybe processInternal
// boolean bSwitch = true;
// if (bSwitch) {
// ResultMessage.Rows cqlRows = (ResultMessage.Rows) rm;
// List<ColumnSpecification> columnSpecs = cqlRows.result.metadata.names;
//
// for (List<ByteBuffer> row : cqlRows.result.rows) {
// Map<String,Object> map = new HashMap<String,Object>();
// int i = 0;
// for (ByteBuffer bytes : row) {
// ColumnSpecification specs = columnSpecs.get(i++);
// if (specs.name!=null && specs.type!=null && bytes!=null && bytes.hasRemaining()) {
// System.out.println("name = "+specs.name.toString()+" ,type= "+specs.type.compose(bytes));
// map.put(specs.name.toString(), specs.type.compose(bytes));
// }
// }
// returnRows.add(map);
// }
// } else {
// boolean convert = true;;
// CqlResult result = rm.toThriftResult();
// List<CqlRow> rows = result.getRows();
// for (CqlRow row: rows) {
// List<org.apache.cassandra.thrift.Column> columns = row.getColumns();
// for (org.apache.cassandra.thrift.Column c: columns){
// HashMap<String,Object> m = new HashMap<String,Object>();
// if (convert) {
// m.put("name" , TypeHelper.getCqlTyped(result.schema.name_types.get(c.name), c.name) );
// m.put("value" , TypeHelper.getCqlTyped(result.schema.name_types.get(c.name), c.value) );
// } else {
// m.put("value", TypeHelper.getBytes(c.value));
// m.put("name", TypeHelper.getBytes(c.name));
// }
// returnRows.add(m);
// }
// }
// }
// }
// JsonObject response = new JsonObject();
// JsonArray array = new JsonArray();
// for (Map<String,Object> m : returnRows) {
// array.add(new JsonObject(m));
// }
// response.putString(Long.toString(counter.incrementAndGet()), "OK");
// response.putArray(Long.toString(counter.incrementAndGet()), array);
// String testQry = "CREATE KEYSPACE testdb WITH REPLICATION = {'class' : 'SimpleStrategy', 'replication_factor': 1};";
//// create("testdb",1);
// return response.toString();
// return null;
// }
}
}
| 499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.