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

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

There is a newer version: 7.28.29.5
Show newest version
package zio.aws.workmail.model
import zio.aws.workmail.model.primitives.{
  BooleanObject,
  OrganizationId,
  NewResourceDescription,
  EntityIdentifier,
  ResourceName
}
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class UpdateResourceRequest(
    organizationId: OrganizationId,
    resourceId: EntityIdentifier,
    name: Optional[ResourceName] = Optional.Absent,
    bookingOptions: Optional[zio.aws.workmail.model.BookingOptions] =
      Optional.Absent,
    description: Optional[NewResourceDescription] = Optional.Absent,
    `type`: Optional[zio.aws.workmail.model.ResourceType] = Optional.Absent,
    hiddenFromGlobalAddressList: Optional[BooleanObject] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.workmail.model.UpdateResourceRequest = {
    import UpdateResourceRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.workmail.model.UpdateResourceRequest
      .builder()
      .organizationId(OrganizationId.unwrap(organizationId): java.lang.String)
      .resourceId(EntityIdentifier.unwrap(resourceId): java.lang.String)
      .optionallyWith(
        name.map(value => ResourceName.unwrap(value): java.lang.String)
      )(_.name)
      .optionallyWith(bookingOptions.map(value => value.buildAwsValue()))(
        _.bookingOptions
      )
      .optionallyWith(
        description.map(value =>
          NewResourceDescription.unwrap(value): java.lang.String
        )
      )(_.description)
      .optionallyWith(`type`.map(value => value.unwrap))(_.`type`)
      .optionallyWith(
        hiddenFromGlobalAddressList.map(value => value: java.lang.Boolean)
      )(_.hiddenFromGlobalAddressList)
      .build()
  }
  def asReadOnly: zio.aws.workmail.model.UpdateResourceRequest.ReadOnly =
    zio.aws.workmail.model.UpdateResourceRequest.wrap(buildAwsValue())
}
object UpdateResourceRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.workmail.model.UpdateResourceRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.workmail.model.UpdateResourceRequest =
      zio.aws.workmail.model.UpdateResourceRequest(
        organizationId,
        resourceId,
        name.map(value => value),
        bookingOptions.map(value => value.asEditable),
        description.map(value => value),
        `type`.map(value => value),
        hiddenFromGlobalAddressList.map(value => value)
      )
    def organizationId: OrganizationId
    def resourceId: EntityIdentifier
    def name: Optional[ResourceName]
    def bookingOptions: Optional[zio.aws.workmail.model.BookingOptions.ReadOnly]
    def description: Optional[NewResourceDescription]
    def `type`: Optional[zio.aws.workmail.model.ResourceType]
    def hiddenFromGlobalAddressList: Optional[BooleanObject]
    def getOrganizationId: ZIO[Any, Nothing, OrganizationId] =
      ZIO.succeed(organizationId)
    def getResourceId: ZIO[Any, Nothing, EntityIdentifier] =
      ZIO.succeed(resourceId)
    def getName: ZIO[Any, AwsError, ResourceName] =
      AwsError.unwrapOptionField("name", name)
    def getBookingOptions
        : ZIO[Any, AwsError, zio.aws.workmail.model.BookingOptions.ReadOnly] =
      AwsError.unwrapOptionField("bookingOptions", bookingOptions)
    def getDescription: ZIO[Any, AwsError, NewResourceDescription] =
      AwsError.unwrapOptionField("description", description)
    def getType: ZIO[Any, AwsError, zio.aws.workmail.model.ResourceType] =
      AwsError.unwrapOptionField("type", `type`)
    def getHiddenFromGlobalAddressList: ZIO[Any, AwsError, BooleanObject] =
      AwsError.unwrapOptionField(
        "hiddenFromGlobalAddressList",
        hiddenFromGlobalAddressList
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.workmail.model.UpdateResourceRequest
  ) extends zio.aws.workmail.model.UpdateResourceRequest.ReadOnly {
    override val organizationId: OrganizationId =
      zio.aws.workmail.model.primitives.OrganizationId(impl.organizationId())
    override val resourceId: EntityIdentifier =
      zio.aws.workmail.model.primitives.EntityIdentifier(impl.resourceId())
    override val name: Optional[ResourceName] = zio.aws.core.internal
      .optionalFromNullable(impl.name())
      .map(value => zio.aws.workmail.model.primitives.ResourceName(value))
    override val bookingOptions
        : Optional[zio.aws.workmail.model.BookingOptions.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.bookingOptions())
        .map(value => zio.aws.workmail.model.BookingOptions.wrap(value))
    override val description: Optional[NewResourceDescription] =
      zio.aws.core.internal
        .optionalFromNullable(impl.description())
        .map(value =>
          zio.aws.workmail.model.primitives.NewResourceDescription(value)
        )
    override val `type`: Optional[zio.aws.workmail.model.ResourceType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.`type`())
        .map(value => zio.aws.workmail.model.ResourceType.wrap(value))
    override val hiddenFromGlobalAddressList: Optional[BooleanObject] =
      zio.aws.core.internal
        .optionalFromNullable(impl.hiddenFromGlobalAddressList())
        .map(value => value: BooleanObject)
  }
  def wrap(
      impl: software.amazon.awssdk.services.workmail.model.UpdateResourceRequest
  ): zio.aws.workmail.model.UpdateResourceRequest.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy