zio.aws.snowdevicemanagement.model.DeviceSummary.scala Maven / Gradle / Ivy
The newest version!
package zio.aws.snowdevicemanagement.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.snowdevicemanagement.model.primitives.ManagedDeviceId
import scala.jdk.CollectionConverters._
final case class DeviceSummary(
associatedWithJob: Optional[String] = Optional.Absent,
managedDeviceArn: Optional[String] = Optional.Absent,
managedDeviceId: Optional[ManagedDeviceId] = Optional.Absent,
tags: Optional[Map[String, String]] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.snowdevicemanagement.model.DeviceSummary = {
import DeviceSummary.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.snowdevicemanagement.model.DeviceSummary
.builder()
.optionallyWith(associatedWithJob.map(value => value: java.lang.String))(
_.associatedWithJob
)
.optionallyWith(managedDeviceArn.map(value => value: java.lang.String))(
_.managedDeviceArn
)
.optionallyWith(
managedDeviceId.map(value =>
ManagedDeviceId.unwrap(value): java.lang.String
)
)(_.managedDeviceId)
.optionallyWith(
tags.map(value =>
value
.map({ case (key, value) =>
(key: java.lang.String) -> (value: java.lang.String)
})
.asJava
)
)(_.tags)
.build()
}
def asReadOnly: zio.aws.snowdevicemanagement.model.DeviceSummary.ReadOnly =
zio.aws.snowdevicemanagement.model.DeviceSummary.wrap(buildAwsValue())
}
object DeviceSummary {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.snowdevicemanagement.model.DeviceSummary
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.snowdevicemanagement.model.DeviceSummary =
zio.aws.snowdevicemanagement.model.DeviceSummary(
associatedWithJob.map(value => value),
managedDeviceArn.map(value => value),
managedDeviceId.map(value => value),
tags.map(value => value)
)
def associatedWithJob: Optional[String]
def managedDeviceArn: Optional[String]
def managedDeviceId: Optional[ManagedDeviceId]
def tags: Optional[Map[String, String]]
def getAssociatedWithJob: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("associatedWithJob", associatedWithJob)
def getManagedDeviceArn: ZIO[Any, AwsError, String] =
AwsError.unwrapOptionField("managedDeviceArn", managedDeviceArn)
def getManagedDeviceId: ZIO[Any, AwsError, ManagedDeviceId] =
AwsError.unwrapOptionField("managedDeviceId", managedDeviceId)
def getTags: ZIO[Any, AwsError, Map[String, String]] =
AwsError.unwrapOptionField("tags", tags)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.DeviceSummary
) extends zio.aws.snowdevicemanagement.model.DeviceSummary.ReadOnly {
override val associatedWithJob: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.associatedWithJob())
.map(value => value: String)
override val managedDeviceArn: Optional[String] = zio.aws.core.internal
.optionalFromNullable(impl.managedDeviceArn())
.map(value => value: String)
override val managedDeviceId: Optional[ManagedDeviceId] =
zio.aws.core.internal
.optionalFromNullable(impl.managedDeviceId())
.map(value =>
zio.aws.snowdevicemanagement.model.primitives.ManagedDeviceId(value)
)
override val tags: Optional[Map[String, String]] = zio.aws.core.internal
.optionalFromNullable(impl.tags())
.map(value =>
value.asScala
.map({ case (key, value) =>
(key: String) -> (value: String)
})
.toMap
)
}
def wrap(
impl: software.amazon.awssdk.services.snowdevicemanagement.model.DeviceSummary
): zio.aws.snowdevicemanagement.model.DeviceSummary.ReadOnly = new Wrapper(
impl
)
}