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

zio.aws.emrcontainers.model.SecurityConfiguration.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.emrcontainers.model
import zio.aws.emrcontainers.model.primitives.{
  Date,
  ResourceIdString,
  SecurityConfigurationArn,
  StringEmpty256,
  String128,
  RequestIdentityUserArn,
  ResourceNameString
}
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import scala.jdk.CollectionConverters._
final case class SecurityConfiguration(
    id: Optional[ResourceIdString] = Optional.Absent,
    name: Optional[ResourceNameString] = Optional.Absent,
    arn: Optional[SecurityConfigurationArn] = Optional.Absent,
    createdAt: Optional[Date] = Optional.Absent,
    createdBy: Optional[RequestIdentityUserArn] = Optional.Absent,
    securityConfigurationData: Optional[
      zio.aws.emrcontainers.model.SecurityConfigurationData
    ] = Optional.Absent,
    tags: Optional[Map[String128, StringEmpty256]] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.emrcontainers.model.SecurityConfiguration = {
    import SecurityConfiguration.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.emrcontainers.model.SecurityConfiguration
      .builder()
      .optionallyWith(
        id.map(value => ResourceIdString.unwrap(value): java.lang.String)
      )(_.id)
      .optionallyWith(
        name.map(value => ResourceNameString.unwrap(value): java.lang.String)
      )(_.name)
      .optionallyWith(
        arn.map(value =>
          SecurityConfigurationArn.unwrap(value): java.lang.String
        )
      )(_.arn)
      .optionallyWith(createdAt.map(value => Date.unwrap(value): Instant))(
        _.createdAt
      )
      .optionallyWith(
        createdBy.map(value =>
          RequestIdentityUserArn.unwrap(value): java.lang.String
        )
      )(_.createdBy)
      .optionallyWith(
        securityConfigurationData.map(value => value.buildAwsValue())
      )(_.securityConfigurationData)
      .optionallyWith(
        tags.map(value =>
          value
            .map({ case (key, value) =>
              (String128.unwrap(key): java.lang.String) -> (StringEmpty256
                .unwrap(value): java.lang.String)
            })
            .asJava
        )
      )(_.tags)
      .build()
  }
  def asReadOnly: zio.aws.emrcontainers.model.SecurityConfiguration.ReadOnly =
    zio.aws.emrcontainers.model.SecurityConfiguration.wrap(buildAwsValue())
}
object SecurityConfiguration {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.emrcontainers.model.SecurityConfiguration
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.emrcontainers.model.SecurityConfiguration =
      zio.aws.emrcontainers.model.SecurityConfiguration(
        id.map(value => value),
        name.map(value => value),
        arn.map(value => value),
        createdAt.map(value => value),
        createdBy.map(value => value),
        securityConfigurationData.map(value => value.asEditable),
        tags.map(value => value)
      )
    def id: Optional[ResourceIdString]
    def name: Optional[ResourceNameString]
    def arn: Optional[SecurityConfigurationArn]
    def createdAt: Optional[Date]
    def createdBy: Optional[RequestIdentityUserArn]
    def securityConfigurationData: Optional[
      zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly
    ]
    def tags: Optional[Map[String128, StringEmpty256]]
    def getId: ZIO[Any, AwsError, ResourceIdString] =
      AwsError.unwrapOptionField("id", id)
    def getName: ZIO[Any, AwsError, ResourceNameString] =
      AwsError.unwrapOptionField("name", name)
    def getArn: ZIO[Any, AwsError, SecurityConfigurationArn] =
      AwsError.unwrapOptionField("arn", arn)
    def getCreatedAt: ZIO[Any, AwsError, Date] =
      AwsError.unwrapOptionField("createdAt", createdAt)
    def getCreatedBy: ZIO[Any, AwsError, RequestIdentityUserArn] =
      AwsError.unwrapOptionField("createdBy", createdBy)
    def getSecurityConfigurationData: ZIO[
      Any,
      AwsError,
      zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly
    ] = AwsError.unwrapOptionField(
      "securityConfigurationData",
      securityConfigurationData
    )
    def getTags: ZIO[Any, AwsError, Map[String128, StringEmpty256]] =
      AwsError.unwrapOptionField("tags", tags)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.emrcontainers.model.SecurityConfiguration
  ) extends zio.aws.emrcontainers.model.SecurityConfiguration.ReadOnly {
    override val id: Optional[ResourceIdString] = zio.aws.core.internal
      .optionalFromNullable(impl.id())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.ResourceIdString(value)
      )
    override val name: Optional[ResourceNameString] = zio.aws.core.internal
      .optionalFromNullable(impl.name())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.ResourceNameString(value)
      )
    override val arn: Optional[SecurityConfigurationArn] = zio.aws.core.internal
      .optionalFromNullable(impl.arn())
      .map(value =>
        zio.aws.emrcontainers.model.primitives.SecurityConfigurationArn(value)
      )
    override val createdAt: Optional[Date] = zio.aws.core.internal
      .optionalFromNullable(impl.createdAt())
      .map(value => zio.aws.emrcontainers.model.primitives.Date(value))
    override val createdBy: Optional[RequestIdentityUserArn] =
      zio.aws.core.internal
        .optionalFromNullable(impl.createdBy())
        .map(value =>
          zio.aws.emrcontainers.model.primitives.RequestIdentityUserArn(value)
        )
    override val securityConfigurationData: Optional[
      zio.aws.emrcontainers.model.SecurityConfigurationData.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.securityConfigurationData())
      .map(value =>
        zio.aws.emrcontainers.model.SecurityConfigurationData.wrap(value)
      )
    override val tags: Optional[Map[String128, StringEmpty256]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.tags())
        .map(value =>
          value.asScala
            .map({ case (key, value) =>
              zio.aws.emrcontainers.model.primitives.String128(
                key
              ) -> zio.aws.emrcontainers.model.primitives.StringEmpty256(value)
            })
            .toMap
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.emrcontainers.model.SecurityConfiguration
  ): zio.aws.emrcontainers.model.SecurityConfiguration.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy