zio.aws.lightsail.model.AddOn.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-lightsail_3 Show documentation
Show all versions of zio-aws-lightsail_3 Show documentation
Low-level AWS wrapper for ZIO
The newest version!
package zio.aws.lightsail.model
import zio.aws.lightsail.model.primitives.TimeOfDay
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class AddOn(
name: Optional[String] = Optional.Absent,
status: Optional[String] = Optional.Absent,
snapshotTimeOfDay: Optional[TimeOfDay] = Optional.Absent,
nextSnapshotTimeOfDay: Optional[TimeOfDay] = Optional.Absent,
threshold: Optional[String] = Optional.Absent,
duration: Optional[String] = Optional.Absent
) {
def buildAwsValue(): software.amazon.awssdk.services.lightsail.model.AddOn = {
import AddOn.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.lightsail.model.AddOn
.builder()
.optionallyWith(name.map(value => value: java.lang.String))(_.name)
.optionallyWith(status.map(value => value: java.lang.String))(_.status)
.optionallyWith(
snapshotTimeOfDay.map(value =>
TimeOfDay.unwrap(value): java.lang.String
)
)(_.snapshotTimeOfDay)
.optionallyWith(
nextSnapshotTimeOfDay.map(value =>
TimeOfDay.unwrap(value): java.lang.String
)
)(_.nextSnapshotTimeOfDay)
.optionallyWith(threshold.map(value => value: java.lang.String))(
_.threshold
)
.optionallyWith(duration.map(value => value: java.lang.String))(
_.duration
)
.build()
}
def asReadOnly: zio.aws.lightsail.model.AddOn.ReadOnly =
zio.aws.lightsail.model.AddOn.wrap(buildAwsValue())
}
object AddOn {
private lazy val zioAwsBuilderHelper
: BuilderHelper[software.amazon.awssdk.services.lightsail.model.AddOn] =
BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.lightsail.model.AddOn =
zio.aws.lightsail.model.AddOn(
name.map(value => value),
status.map(value => value),
snapshotTimeOfDay.map(value => value),
nextSnapshotTimeOfDay.map(value => value),
threshold.map(value => value),
duration.map(value => value)
)
def name: Optional[String]
def status: Optional[String]
def snapshotTimeOfDay: Optional[TimeOfDay]
def nextSnapshotTimeOfDay: Optional[TimeOfDay]
def threshold: Optional[String]
def duration: Optional[String]
def getName: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("name", name)
def getStatus: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("status", status)
def getSnapshotTimeOfDay: ZIO[Any, AwsError, TimeOfDay] =
AwsError.unwrapOptionField("snapshotTimeOfDay", snapshotTimeOfDay)
def getNextSnapshotTimeOfDay: ZIO[Any, AwsError, TimeOfDay] =
AwsError.unwrapOptionField("nextSnapshotTimeOfDay", nextSnapshotTimeOfDay)
def getThreshold: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("threshold", threshold)
def getDuration: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("duration", duration)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.lightsail.model.AddOn
) extends zio.aws.lightsail.model.AddOn.ReadOnly {
override val name: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.name())
.map(value => value: String)
override val status: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.status())
.map(value => value: String)
override val snapshotTimeOfDay: Optional[TimeOfDay] = zio.aws.core.internal
.optionalFromNullable(impl.snapshotTimeOfDay())
.map(value => zio.aws.lightsail.model.primitives.TimeOfDay(value))
override val nextSnapshotTimeOfDay: Optional[TimeOfDay] =
zio.aws.core.internal
.optionalFromNullable(impl.nextSnapshotTimeOfDay())
.map(value => zio.aws.lightsail.model.primitives.TimeOfDay(value))
override val threshold: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.threshold())
.map(value => value: String)
override val duration: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.duration())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.lightsail.model.AddOn
): zio.aws.lightsail.model.AddOn.ReadOnly = new Wrapper(impl)
}