zio.aws.workmail.model.BookingOptions.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-workmail_2.12 Show documentation
Show all versions of zio-aws-workmail_2.12 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.workmail.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters._
final case class BookingOptions(
autoAcceptRequests: Optional[Boolean] = Optional.Absent,
autoDeclineRecurringRequests: Optional[Boolean] = Optional.Absent,
autoDeclineConflictingRequests: Optional[Boolean] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.workmail.model.BookingOptions = {
import BookingOptions.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.workmail.model.BookingOptions
.builder()
.optionallyWith(
autoAcceptRequests.map(value => value: java.lang.Boolean)
)(_.autoAcceptRequests)
.optionallyWith(
autoDeclineRecurringRequests.map(value => value: java.lang.Boolean)
)(_.autoDeclineRecurringRequests)
.optionallyWith(
autoDeclineConflictingRequests.map(value => value: java.lang.Boolean)
)(_.autoDeclineConflictingRequests)
.build()
}
def asReadOnly: zio.aws.workmail.model.BookingOptions.ReadOnly =
zio.aws.workmail.model.BookingOptions.wrap(buildAwsValue())
}
object BookingOptions {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.workmail.model.BookingOptions
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.workmail.model.BookingOptions =
zio.aws.workmail.model.BookingOptions(
autoAcceptRequests.map(value => value),
autoDeclineRecurringRequests.map(value => value),
autoDeclineConflictingRequests.map(value => value)
)
def autoAcceptRequests: Optional[Boolean]
def autoDeclineRecurringRequests: Optional[Boolean]
def autoDeclineConflictingRequests: Optional[Boolean]
def getAutoAcceptRequests: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField("autoAcceptRequests", autoAcceptRequests)
def getAutoDeclineRecurringRequests: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField(
"autoDeclineRecurringRequests",
autoDeclineRecurringRequests
)
def getAutoDeclineConflictingRequests: ZIO[Any, AwsError, Boolean] =
AwsError.unwrapOptionField(
"autoDeclineConflictingRequests",
autoDeclineConflictingRequests
)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.workmail.model.BookingOptions
) extends zio.aws.workmail.model.BookingOptions.ReadOnly {
override val autoAcceptRequests: Optional[Boolean] = zio.aws.core.internal
.optionalFromNullable(impl.autoAcceptRequests())
.map(value => value: Boolean)
override val autoDeclineRecurringRequests: Optional[Boolean] =
zio.aws.core.internal
.optionalFromNullable(impl.autoDeclineRecurringRequests())
.map(value => value: Boolean)
override val autoDeclineConflictingRequests: Optional[Boolean] =
zio.aws.core.internal
.optionalFromNullable(impl.autoDeclineConflictingRequests())
.map(value => value: Boolean)
}
def wrap(
impl: software.amazon.awssdk.services.workmail.model.BookingOptions
): zio.aws.workmail.model.BookingOptions.ReadOnly = new Wrapper(impl)
}