zio.aws.lightsail.model.LogEvent.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 java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.lightsail.model.primitives.IsoDate
import scala.jdk.CollectionConverters.*
final case class LogEvent(
createdAt: Optional[IsoDate] = Optional.Absent,
message: Optional[String] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.lightsail.model.LogEvent = {
import LogEvent.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.lightsail.model.LogEvent
.builder()
.optionallyWith(createdAt.map(value => IsoDate.unwrap(value): Instant))(
_.createdAt
)
.optionallyWith(message.map(value => value: java.lang.String))(_.message)
.build()
}
def asReadOnly: zio.aws.lightsail.model.LogEvent.ReadOnly =
zio.aws.lightsail.model.LogEvent.wrap(buildAwsValue())
}
object LogEvent {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.lightsail.model.LogEvent
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.lightsail.model.LogEvent = zio.aws.lightsail.model
.LogEvent(createdAt.map(value => value), message.map(value => value))
def createdAt: Optional[IsoDate]
def message: Optional[String]
def getCreatedAt: ZIO[Any, AwsError, IsoDate] =
AwsError.unwrapOptionField("createdAt", createdAt)
def getMessage: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("message", message)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.lightsail.model.LogEvent
) extends zio.aws.lightsail.model.LogEvent.ReadOnly {
override val createdAt: Optional[IsoDate] = zio.aws.core.internal
.optionalFromNullable(impl.createdAt())
.map(value => zio.aws.lightsail.model.primitives.IsoDate(value))
override val message: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.message())
.map(value => value: String)
}
def wrap(
impl: software.amazon.awssdk.services.lightsail.model.LogEvent
): zio.aws.lightsail.model.LogEvent.ReadOnly = new Wrapper(impl)
}