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

software.amazon.cryptography.materialproviders.model.GetEncryptionMaterialsInput Maven / Gradle / Ivy

// 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.Map;
import java.util.Objects;

public class GetEncryptionMaterialsInput {

  private final Map encryptionContext;

  private final CommitmentPolicy commitmentPolicy;

  private final AlgorithmSuiteId algorithmSuiteId;

  private final Long maxPlaintextLength;

  private final List requiredEncryptionContextKeys;

  protected GetEncryptionMaterialsInput(BuilderImpl builder) {
    this.encryptionContext = builder.encryptionContext();
    this.commitmentPolicy = builder.commitmentPolicy();
    this.algorithmSuiteId = builder.algorithmSuiteId();
    this.maxPlaintextLength = builder.maxPlaintextLength();
    this.requiredEncryptionContextKeys =
      builder.requiredEncryptionContextKeys();
  }

  public Map encryptionContext() {
    return this.encryptionContext;
  }

  public CommitmentPolicy commitmentPolicy() {
    return this.commitmentPolicy;
  }

  public AlgorithmSuiteId algorithmSuiteId() {
    return this.algorithmSuiteId;
  }

  public Long maxPlaintextLength() {
    return this.maxPlaintextLength;
  }

  public List requiredEncryptionContextKeys() {
    return this.requiredEncryptionContextKeys;
  }

  public Builder toBuilder() {
    return new BuilderImpl(this);
  }

  public static Builder builder() {
    return new BuilderImpl();
  }

  public interface Builder {
    Builder encryptionContext(Map encryptionContext);

    Map encryptionContext();

    Builder commitmentPolicy(CommitmentPolicy commitmentPolicy);

    CommitmentPolicy commitmentPolicy();

    Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId);

    AlgorithmSuiteId algorithmSuiteId();

    Builder maxPlaintextLength(Long maxPlaintextLength);

    Long maxPlaintextLength();

    Builder requiredEncryptionContextKeys(
      List requiredEncryptionContextKeys
    );

    List requiredEncryptionContextKeys();

    GetEncryptionMaterialsInput build();
  }

  static class BuilderImpl implements Builder {

    protected Map encryptionContext;

    protected CommitmentPolicy commitmentPolicy;

    protected AlgorithmSuiteId algorithmSuiteId;

    protected Long maxPlaintextLength;

    protected List requiredEncryptionContextKeys;

    protected BuilderImpl() {}

    protected BuilderImpl(GetEncryptionMaterialsInput model) {
      this.encryptionContext = model.encryptionContext();
      this.commitmentPolicy = model.commitmentPolicy();
      this.algorithmSuiteId = model.algorithmSuiteId();
      this.maxPlaintextLength = model.maxPlaintextLength();
      this.requiredEncryptionContextKeys =
        model.requiredEncryptionContextKeys();
    }

    public Builder encryptionContext(Map encryptionContext) {
      this.encryptionContext = encryptionContext;
      return this;
    }

    public Map encryptionContext() {
      return this.encryptionContext;
    }

    public Builder commitmentPolicy(CommitmentPolicy commitmentPolicy) {
      this.commitmentPolicy = commitmentPolicy;
      return this;
    }

    public CommitmentPolicy commitmentPolicy() {
      return this.commitmentPolicy;
    }

    public Builder algorithmSuiteId(AlgorithmSuiteId algorithmSuiteId) {
      this.algorithmSuiteId = algorithmSuiteId;
      return this;
    }

    public AlgorithmSuiteId algorithmSuiteId() {
      return this.algorithmSuiteId;
    }

    public Builder maxPlaintextLength(Long maxPlaintextLength) {
      this.maxPlaintextLength = maxPlaintextLength;
      return this;
    }

    public Long maxPlaintextLength() {
      return this.maxPlaintextLength;
    }

    public Builder requiredEncryptionContextKeys(
      List requiredEncryptionContextKeys
    ) {
      this.requiredEncryptionContextKeys = requiredEncryptionContextKeys;
      return this;
    }

    public List requiredEncryptionContextKeys() {
      return this.requiredEncryptionContextKeys;
    }

    public GetEncryptionMaterialsInput build() {
      if (Objects.isNull(this.encryptionContext())) {
        throw new IllegalArgumentException(
          "Missing value for required field `encryptionContext`"
        );
      }
      if (Objects.isNull(this.commitmentPolicy())) {
        throw new IllegalArgumentException(
          "Missing value for required field `commitmentPolicy`"
        );
      }
      return new GetEncryptionMaterialsInput(this);
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy