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

zio.aws.workmail.model.AvailabilityConfiguration.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.workmail.model.primitives.{Timestamp, DomainName}
import scala.jdk.CollectionConverters._
final case class AvailabilityConfiguration(
    domainName: Optional[DomainName] = Optional.Absent,
    providerType: Optional[zio.aws.workmail.model.AvailabilityProviderType] =
      Optional.Absent,
    ewsProvider: Optional[
      zio.aws.workmail.model.RedactedEwsAvailabilityProvider
    ] = Optional.Absent,
    lambdaProvider: Optional[
      zio.aws.workmail.model.LambdaAvailabilityProvider
    ] = Optional.Absent,
    dateCreated: Optional[Timestamp] = Optional.Absent,
    dateModified: Optional[Timestamp] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.AvailabilityConfiguration = {
    import AvailabilityConfiguration.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.AvailabilityConfiguration
      .builder()
      .optionallyWith(
        domainName.map(value => DomainName.unwrap(value): java.lang.String)
      )(_.domainName)
      .optionallyWith(providerType.map(value => value.unwrap))(_.providerType)
      .optionallyWith(ewsProvider.map(value => value.buildAwsValue()))(
        _.ewsProvider
      )
      .optionallyWith(lambdaProvider.map(value => value.buildAwsValue()))(
        _.lambdaProvider
      )
      .optionallyWith(
        dateCreated.map(value => Timestamp.unwrap(value): Instant)
      )(_.dateCreated)
      .optionallyWith(
        dateModified.map(value => Timestamp.unwrap(value): Instant)
      )(_.dateModified)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.AvailabilityConfiguration.ReadOnly =
    zio.aws.workmail.model.AvailabilityConfiguration.wrap(buildAwsValue())
}
object AvailabilityConfiguration {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.AvailabilityConfiguration
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.AvailabilityConfiguration =
      zio.aws.workmail.model.AvailabilityConfiguration(
        domainName.map(value => value),
        providerType.map(value => value),
        ewsProvider.map(value => value.asEditable),
        lambdaProvider.map(value => value.asEditable),
        dateCreated.map(value => value),
        dateModified.map(value => value)
      )
    def domainName: Optional[DomainName]
    def providerType: Optional[zio.aws.workmail.model.AvailabilityProviderType]
    def ewsProvider: Optional[
      zio.aws.workmail.model.RedactedEwsAvailabilityProvider.ReadOnly
    ]
    def lambdaProvider
        : Optional[zio.aws.workmail.model.LambdaAvailabilityProvider.ReadOnly]
    def dateCreated: Optional[Timestamp]
    def dateModified: Optional[Timestamp]
    def getDomainName: ZIO[Any, AwsError, DomainName] =
      AwsError.unwrapOptionField("domainName", domainName)
    def getProviderType
        : ZIO[Any, AwsError, zio.aws.workmail.model.AvailabilityProviderType] =
      AwsError.unwrapOptionField("providerType", providerType)
    def getEwsProvider: ZIO[
      Any,
      AwsError,
      zio.aws.workmail.model.RedactedEwsAvailabilityProvider.ReadOnly
    ] = AwsError.unwrapOptionField("ewsProvider", ewsProvider)
    def getLambdaProvider: ZIO[
      Any,
      AwsError,
      zio.aws.workmail.model.LambdaAvailabilityProvider.ReadOnly
    ] = AwsError.unwrapOptionField("lambdaProvider", lambdaProvider)
    def getDateCreated: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("dateCreated", dateCreated)
    def getDateModified: ZIO[Any, AwsError, Timestamp] =
      AwsError.unwrapOptionField("dateModified", dateModified)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.AvailabilityConfiguration
  ) extends zio.aws.workmail.model.AvailabilityConfiguration.ReadOnly {
    override val domainName: Optional[DomainName] = zio.aws.core.internal
      .optionalFromNullable(impl.domainName())
      .map(value => zio.aws.workmail.model.primitives.DomainName(value))
    override val providerType
        : Optional[zio.aws.workmail.model.AvailabilityProviderType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.providerType())
        .map(value =>
          zio.aws.workmail.model.AvailabilityProviderType.wrap(value)
        )
    override val ewsProvider: Optional[
      zio.aws.workmail.model.RedactedEwsAvailabilityProvider.ReadOnly
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.ewsProvider())
      .map(value =>
        zio.aws.workmail.model.RedactedEwsAvailabilityProvider.wrap(value)
      )
    override val lambdaProvider
        : Optional[zio.aws.workmail.model.LambdaAvailabilityProvider.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lambdaProvider())
        .map(value =>
          zio.aws.workmail.model.LambdaAvailabilityProvider.wrap(value)
        )
    override val dateCreated: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.dateCreated())
      .map(value => zio.aws.workmail.model.primitives.Timestamp(value))
    override val dateModified: Optional[Timestamp] = zio.aws.core.internal
      .optionalFromNullable(impl.dateModified())
      .map(value => zio.aws.workmail.model.primitives.Timestamp(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.AvailabilityConfiguration
  ): zio.aws.workmail.model.AvailabilityConfiguration.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy