All Downloads are FREE. Search and download functionalities are using the official Maven repository.

AwsArnParsing_Compile.__default Maven / Gradle / Ivy

The newest version!
// Class __default
// Dafny class __default compiled into Java
package AwsArnParsing_Compile;

import software.amazon.cryptography.keystore.internaldafny.types.*;
import software.amazon.cryptography.materialproviders.internaldafny.types.*;

@SuppressWarnings({"unchecked", "deprecation"})
public class __default {
  public __default() {
  }
  public static boolean ValidAwsKmsResource(AwsResource resource) {
    return ((resource).Valid()) && ((((resource).dtor_resourceType()).equals(dafny.DafnySequence.asString("key"))) || (((resource).dtor_resourceType()).equals(dafny.DafnySequence.asString("alias"))));
  }
  public static boolean ValidAwsKmsArn(AwsArn arn) {
    return (((arn).Valid()) && (((arn).dtor_service()).equals(dafny.DafnySequence.asString("kms")))) && (__default.ValidAwsKmsResource((arn).dtor_resource()));
  }
  public static Wrappers_Compile.Result> ParseAwsKmsRawResources(dafny.DafnySequence identifier) {
    dafny.DafnySequence> _0_info = StandardLibrary_Compile.__default.Split(dafny.TypeDescriptor.CHAR, identifier, '/');
    Wrappers_Compile.Outcome> _1_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), !(((dafny.DafnySequence)(java.lang.Object)((_0_info).select(dafny.Helpers.toInt((java.math.BigInteger.ZERO)))))).equals(dafny.DafnySequence.asString("key")), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed raw key id: "), identifier));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_1_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsKmsResource._typeDescriptor());
    } else if (java.util.Objects.equals(java.math.BigInteger.valueOf((_0_info).length()), java.math.BigInteger.ONE)) {
      return __default.ParseAwsKmsResources(dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("key/"), identifier));
    } else {
      return __default.ParseAwsKmsResources(identifier);
    }
  }
  public static Wrappers_Compile.Result> ParseAwsKmsResources(dafny.DafnySequence identifier) {
    dafny.DafnySequence> _0_info = StandardLibrary_Compile.__default.Split(dafny.TypeDescriptor.CHAR, identifier, '/');
    Wrappers_Compile.Outcome> _1_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), (java.math.BigInteger.valueOf((_0_info).length())).compareTo(java.math.BigInteger.ONE) > 0, dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed resource: "), identifier));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_1_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsResource._typeDescriptor());
    } else {
      dafny.DafnySequence _2_resourceType = ((dafny.DafnySequence)(java.lang.Object)((_0_info).select(dafny.Helpers.toInt((java.math.BigInteger.ZERO)))));
      dafny.DafnySequence _3_value = StandardLibrary_Compile.__default.Join(dafny.TypeDescriptor.CHAR, (_0_info).drop(java.math.BigInteger.ONE), dafny.DafnySequence.asString("/"));
      AwsResource _4_resource = AwsArnParsing_Compile.AwsResource.create(_2_resourceType, _3_value);
      Wrappers_Compile.Outcome> _5_valueOrError1 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), __default.ValidAwsKmsResource(_4_resource), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed resource: "), identifier));
      if ((_5_valueOrError1).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_5_valueOrError1).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsResource._typeDescriptor());
      } else {
        return Wrappers_Compile.Result.>create_Success(AwsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), _4_resource);
      }
    }
  }
  public static boolean ValidAmazonDynamodbResource(AwsResource resource) {
    return ((resource).Valid()) && (((resource).dtor_resourceType()).equals(dafny.DafnySequence.asString("table")));
  }
  public static boolean ValidAmazonDynamodbArn(AwsArn arn) {
    return (((arn).Valid()) && (((arn).dtor_service()).equals(dafny.DafnySequence.asString("dynamodb")))) && (__default.ValidAmazonDynamodbResource((arn).dtor_resource()));
  }
  public static Wrappers_Compile.Result> ParseAmazonDynamodbResources(dafny.DafnySequence identifier) {
    Wrappers_Compile.Option, dafny.DafnySequence>> _0_info = StandardLibrary_Compile.__default.SplitOnce_q(dafny.TypeDescriptor.CHAR, identifier, '/');
    Wrappers_Compile.Outcome> _1_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), (_0_info).is_Some(), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed resource: "), identifier));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_1_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsResource._typeDescriptor());
    } else {
      dafny.DafnySequence _2_resourceType = ((_0_info).dtor_value()).dtor__0();
      dafny.DafnySequence _3_value = ((_0_info).dtor_value()).dtor__1();
      Wrappers_Compile.Outcome> _4_valueOrError1 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.services.dynamodb.internaldafny.types.__default.IsValid__TableName(_3_value), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Table Name invalid: "), identifier));
      if ((_4_valueOrError1).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_4_valueOrError1).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsResource._typeDescriptor());
      } else {
        AwsResource _5_resource = AwsArnParsing_Compile.AwsResource.create(_2_resourceType, _3_value);
        Wrappers_Compile.Outcome> _6_valueOrError2 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), __default.ValidAmazonDynamodbResource(_5_resource), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed resource: "), identifier));
        if ((_6_valueOrError2).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
          return (_6_valueOrError2).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsResource._typeDescriptor());
        } else {
          return Wrappers_Compile.Result.>create_Success(AwsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), _5_resource);
        }
      }
    }
  }
  public static Wrappers_Compile.Result> ParseAwsKmsArn(dafny.DafnySequence identifier) {
    dafny.DafnySequence> _0_components = StandardLibrary_Compile.__default.Split(dafny.TypeDescriptor.CHAR, identifier, ':');
    Wrappers_Compile.Outcome> _1_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), java.util.Objects.equals(java.math.BigInteger.valueOf(6L), java.math.BigInteger.valueOf((_0_components).length())), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed arn: "), identifier));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_1_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
    } else {
      Wrappers_Compile.Result> _2_valueOrError1 = __default.ParseAwsKmsResources(((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(5L)))))));
      if ((_2_valueOrError1).IsFailure(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_2_valueOrError1).PropagateFailure(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
      } else {
        AwsResource _3_resource = (_2_valueOrError1).Extract(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
        AwsArn _4_arn = AwsArnParsing_Compile.AwsArn.create(((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.ZERO))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.ONE))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(2L)))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(3L)))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(4L)))))), _3_resource);
        Wrappers_Compile.Outcome> _5_valueOrError2 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), __default.ValidAwsKmsArn(_4_arn), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed Arn:"), identifier));
        if ((_5_valueOrError2).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
          return (_5_valueOrError2).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
        } else {
          return Wrappers_Compile.Result.>create_Success(AwsArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), _4_arn);
        }
      }
    }
  }
  public static Wrappers_Compile.Result> ParseAmazonDynamodbTableArn(dafny.DafnySequence identifier) {
    dafny.DafnySequence> _0_components = StandardLibrary_Compile.__default.Split(dafny.TypeDescriptor.CHAR, identifier, ':');
    Wrappers_Compile.Outcome> _1_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), java.util.Objects.equals(java.math.BigInteger.valueOf(6L), java.math.BigInteger.valueOf((_0_components).length())), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed arn: "), identifier));
    if ((_1_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_1_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
    } else {
      Wrappers_Compile.Result> _2_valueOrError1 = __default.ParseAmazonDynamodbResources(((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(5L)))))));
      if ((_2_valueOrError1).IsFailure(AmazonDynamodbResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_2_valueOrError1).PropagateFailure(AmazonDynamodbResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
      } else {
        AwsResource _3_resource = (_2_valueOrError1).Extract(AmazonDynamodbResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
        AwsArn _4_arn = AwsArnParsing_Compile.AwsArn.create(((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.ZERO))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.ONE))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(2L)))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(3L)))))), ((dafny.DafnySequence)(java.lang.Object)((_0_components).select(dafny.Helpers.toInt((java.math.BigInteger.valueOf(4L)))))), _3_resource);
        Wrappers_Compile.Outcome> _5_valueOrError2 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), __default.ValidAmazonDynamodbArn(_4_arn), dafny.DafnySequence.concatenate(dafny.DafnySequence.asString("Malformed Arn:"), identifier));
        if ((_5_valueOrError2).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
          return (_5_valueOrError2).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArn._typeDescriptor());
        } else {
          return Wrappers_Compile.Result.>create_Success(AwsArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), _4_arn);
        }
      }
    }
  }
  public static Wrappers_Compile.Result> ParseAwsKmsIdentifier(dafny.DafnySequence identifier) {
    if ((dafny.DafnySequence.asString("arn:")).isPrefixOf(identifier)) {
      Wrappers_Compile.Result> _0_valueOrError0 = __default.ParseAwsKmsArn(identifier);
      if ((_0_valueOrError0).IsFailure(AwsKmsArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_0_valueOrError0).PropagateFailure(AwsKmsArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsKmsIdentifier._typeDescriptor());
      } else {
        AwsArn _1_arn = (_0_valueOrError0).Extract(AwsKmsArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
        return Wrappers_Compile.Result.>create_Success(AwsKmsIdentifier._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArnParsing_Compile.AwsKmsIdentifier.create_AwsKmsArnIdentifier(_1_arn));
      }
    } else {
      Wrappers_Compile.Result> _2_valueOrError1 = __default.ParseAwsKmsRawResources(identifier);
      if ((_2_valueOrError1).IsFailure(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_2_valueOrError1).PropagateFailure(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsKmsIdentifier._typeDescriptor());
      } else {
        AwsResource _3_r = (_2_valueOrError1).Extract(AwsKmsResource._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
        return Wrappers_Compile.Result.>create_Success(AwsKmsIdentifier._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsArnParsing_Compile.AwsKmsIdentifier.create_AwsKmsRawResourceIdentifier(_3_r));
      }
    }
  }
  public static Wrappers_Compile.Result, dafny.DafnySequence> ParseAmazonDynamodbTableName(dafny.DafnySequence identifier) {
    Wrappers_Compile.Result> _0_valueOrError0 = __default.ParseAmazonDynamodbTableArn(identifier);
    if ((_0_valueOrError0).IsFailure(AmazonDynamodbTableArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_0_valueOrError0).>PropagateFailure(AmazonDynamodbTableArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
    } else {
      AwsArn _1_arn = (_0_valueOrError0).Extract(AmazonDynamodbTableArn._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
      AmazonDynamodbTableName _2_tableArn = AwsArnParsing_Compile.AmazonDynamodbTableName.create(_1_arn);
      dafny.DafnySequence _3_tableName = (_2_tableArn).GetTableName();
      return Wrappers_Compile.Result., dafny.DafnySequence>create_Success(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), _3_tableName);
    }
  }
  public static boolean IsMultiRegionAwsKmsArn(AwsArn arn) {
    return __default.IsMultiRegionAwsKmsResource((arn).dtor_resource());
  }
  public static boolean IsMultiRegionAwsKmsIdentifier(AwsKmsIdentifier identifier) {
    AwsKmsIdentifier _source0 = identifier;
    if (_source0.is_AwsKmsArnIdentifier()) {
      AwsArn _0___mcc_h0 = ((AwsArnParsing_Compile.AwsKmsIdentifier_AwsKmsArnIdentifier)_source0)._a;
      AwsArn _1_arn = _0___mcc_h0;
      return __default.IsMultiRegionAwsKmsArn(_1_arn);
    } else {
      AwsResource _2___mcc_h1 = ((AwsArnParsing_Compile.AwsKmsIdentifier_AwsKmsRawResourceIdentifier)_source0)._r;
      AwsResource _3_r = _2___mcc_h1;
      return __default.IsMultiRegionAwsKmsResource(_3_r);
    }
  }
  public static boolean IsMultiRegionAwsKmsResource(AwsResource resource) {
    return (((resource).dtor_resourceType()).equals(dafny.DafnySequence.asString("key"))) && ((dafny.DafnySequence.asString("mrk-")).isPrefixOf((resource).dtor_value()));
  }
  public static Wrappers_Compile.Option> GetRegion(AwsKmsIdentifier identifier) {
    AwsKmsIdentifier _source0 = identifier;
    if (_source0.is_AwsKmsArnIdentifier()) {
      AwsArn _0___mcc_h0 = ((AwsArnParsing_Compile.AwsKmsIdentifier_AwsKmsArnIdentifier)_source0)._a;
      AwsArn _1_a = _0___mcc_h0;
      return Wrappers_Compile.Option.>create_Some(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), (_1_a).dtor_region());
    } else {
      AwsResource _2___mcc_h1 = ((AwsArnParsing_Compile.AwsKmsIdentifier_AwsKmsRawResourceIdentifier)_source0)._r;
      return Wrappers_Compile.Option.>create_None(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR));
    }
  }
  public static Wrappers_Compile.Result> IsAwsKmsIdentifierString(dafny.DafnySequence s) {
    Wrappers_Compile.Outcome> _0_valueOrError0 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), UTF8.__default.IsASCIIString(s), dafny.DafnySequence.asString("Not a valid ASCII string."));
    if ((_0_valueOrError0).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
      return (_0_valueOrError0).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsKmsIdentifier._typeDescriptor());
    } else {
      Wrappers_Compile.Outcome> _1_valueOrError1 = Wrappers_Compile.__default.>Need(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), ((java.math.BigInteger.valueOf((s).length())).signum() == 1) && ((java.math.BigInteger.valueOf((s).length())).compareTo(__default.MAX__AWS__KMS__IDENTIFIER__LENGTH()) <= 0), dafny.DafnySequence.asString("Identifier exceeds maximum length."));
      if ((_1_valueOrError1).IsFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR))) {
        return (_1_valueOrError1).PropagateFailure(dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), AwsKmsIdentifier._typeDescriptor());
      } else {
        return __default.ParseAwsKmsIdentifier(s);
      }
    }
  }
  public static software.amazon.cryptography.materialproviders.internaldafny.types.Error Error(dafny.DafnySequence s) {
    return software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(s);
  }
  public static Wrappers_Compile.Result ValidateDdbTableArn(dafny.DafnySequence tableArn) {
    Wrappers_Compile.Result, software.amazon.cryptography.materialproviders.internaldafny.types.Error> _0_valueOrError0 = (__default.ParseAmazonDynamodbTableName(tableArn)).MapFailure(software.amazon.cryptography.services.dynamodb.internaldafny.types.TableName._typeDescriptor(), dafny.DafnySequence._typeDescriptor(dafny.TypeDescriptor.CHAR), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), __default::Error);
    if ((_0_valueOrError0).IsFailure(software.amazon.cryptography.services.dynamodb.internaldafny.types.TableName._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
      return (_0_valueOrError0).PropagateFailure(software.amazon.cryptography.services.dynamodb.internaldafny.types.TableName._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0._typeDescriptor());
    } else {
      dafny.DafnySequence _1___v1 = (_0_valueOrError0).Extract(software.amazon.cryptography.services.dynamodb.internaldafny.types.TableName._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor());
      Wrappers_Compile.Outcome _2_valueOrError1 = Wrappers_Compile.__default.Need(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), UTF8.__default.IsASCIIString(tableArn), software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(dafny.DafnySequence.asString("Table Arn is not ASCII")));
      if ((_2_valueOrError1).IsFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
        return (_2_valueOrError1).PropagateFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0._typeDescriptor());
      } else {
        Wrappers_Compile.Outcome _3_valueOrError2 = Wrappers_Compile.__default.Need(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), software.amazon.cryptography.services.dynamodb.internaldafny.types.__default.IsValid__TableName((__default.ParseAmazonDynamodbTableName(tableArn)).dtor_value()), software.amazon.cryptography.materialproviders.internaldafny.types.Error.create_AwsCryptographicMaterialProvidersException(dafny.DafnySequence.asString("Table Name is too long")));
        if ((_3_valueOrError2).IsFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor())) {
          return (_3_valueOrError2).PropagateFailure(software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0._typeDescriptor());
        } else {
          return Wrappers_Compile.Result.create_Success(dafny.Tuple0._typeDescriptor(), software.amazon.cryptography.materialproviders.internaldafny.types.Error._typeDescriptor(), dafny.Tuple0.create());
        }
      }
    }
  }
  public static java.math.BigInteger MAX__AWS__KMS__IDENTIFIER__LENGTH()
  {
    return java.math.BigInteger.valueOf(2048L);
  }
  @Override
  public java.lang.String toString() {
    return "AwsArnParsing._default";
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy