zio.aws.nimble.model.StreamConfiguration.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-nimble_3 Show documentation
Show all versions of zio-aws-nimble_3 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.nimble.model
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.nimble.model.primitives.{
StreamingImageId,
StreamConfigurationMaxStoppedSessionLengthInMinutes,
StreamConfigurationMaxSessionLengthInMinutes
}
import java.lang.Integer
import scala.jdk.CollectionConverters.*
final case class StreamConfiguration(
automaticTerminationMode: Optional[
zio.aws.nimble.model.AutomaticTerminationMode
] = Optional.Absent,
clipboardMode: zio.aws.nimble.model.StreamingClipboardMode,
ec2InstanceTypes: Iterable[zio.aws.nimble.model.StreamingInstanceType],
maxSessionLengthInMinutes: Optional[
StreamConfigurationMaxSessionLengthInMinutes
] = Optional.Absent,
maxStoppedSessionLengthInMinutes: Optional[
StreamConfigurationMaxStoppedSessionLengthInMinutes
] = Optional.Absent,
sessionBackup: Optional[
zio.aws.nimble.model.StreamConfigurationSessionBackup
] = Optional.Absent,
sessionPersistenceMode: Optional[
zio.aws.nimble.model.SessionPersistenceMode
] = Optional.Absent,
sessionStorage: Optional[
zio.aws.nimble.model.StreamConfigurationSessionStorage
] = Optional.Absent,
streamingImageIds: Iterable[StreamingImageId],
volumeConfiguration: Optional[zio.aws.nimble.model.VolumeConfiguration] =
Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.nimble.model.StreamConfiguration = {
import StreamConfiguration.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.nimble.model.StreamConfiguration
.builder()
.optionallyWith(automaticTerminationMode.map(value => value.unwrap))(
_.automaticTerminationMode
)
.clipboardMode(clipboardMode.unwrap)
.ec2InstanceTypesWithStrings(ec2InstanceTypes.map { item =>
item.unwrap.toString
}.asJavaCollection)
.optionallyWith(
maxSessionLengthInMinutes.map(value =>
StreamConfigurationMaxSessionLengthInMinutes.unwrap(value): Integer
)
)(_.maxSessionLengthInMinutes)
.optionallyWith(
maxStoppedSessionLengthInMinutes.map(value =>
StreamConfigurationMaxStoppedSessionLengthInMinutes.unwrap(
value
): Integer
)
)(_.maxStoppedSessionLengthInMinutes)
.optionallyWith(sessionBackup.map(value => value.buildAwsValue()))(
_.sessionBackup
)
.optionallyWith(sessionPersistenceMode.map(value => value.unwrap))(
_.sessionPersistenceMode
)
.optionallyWith(sessionStorage.map(value => value.buildAwsValue()))(
_.sessionStorage
)
.streamingImageIds(streamingImageIds.map { item =>
StreamingImageId.unwrap(item): java.lang.String
}.asJavaCollection)
.optionallyWith(volumeConfiguration.map(value => value.buildAwsValue()))(
_.volumeConfiguration
)
.build()
}
def asReadOnly: zio.aws.nimble.model.StreamConfiguration.ReadOnly =
zio.aws.nimble.model.StreamConfiguration.wrap(buildAwsValue())
}
object StreamConfiguration {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.nimble.model.StreamConfiguration
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.nimble.model.StreamConfiguration =
zio.aws.nimble.model.StreamConfiguration(
automaticTerminationMode.map(value => value),
clipboardMode,
ec2InstanceTypes,
maxSessionLengthInMinutes.map(value => value),
maxStoppedSessionLengthInMinutes.map(value => value),
sessionBackup.map(value => value.asEditable),
sessionPersistenceMode.map(value => value),
sessionStorage.map(value => value.asEditable),
streamingImageIds,
volumeConfiguration.map(value => value.asEditable)
)
def automaticTerminationMode
: Optional[zio.aws.nimble.model.AutomaticTerminationMode]
def clipboardMode: zio.aws.nimble.model.StreamingClipboardMode
def ec2InstanceTypes: List[zio.aws.nimble.model.StreamingInstanceType]
def maxSessionLengthInMinutes
: Optional[StreamConfigurationMaxSessionLengthInMinutes]
def maxStoppedSessionLengthInMinutes
: Optional[StreamConfigurationMaxStoppedSessionLengthInMinutes]
def sessionBackup: Optional[
zio.aws.nimble.model.StreamConfigurationSessionBackup.ReadOnly
]
def sessionPersistenceMode
: Optional[zio.aws.nimble.model.SessionPersistenceMode]
def sessionStorage: Optional[
zio.aws.nimble.model.StreamConfigurationSessionStorage.ReadOnly
]
def streamingImageIds: List[StreamingImageId]
def volumeConfiguration
: Optional[zio.aws.nimble.model.VolumeConfiguration.ReadOnly]
def getAutomaticTerminationMode
: ZIO[Any, AwsError, zio.aws.nimble.model.AutomaticTerminationMode] =
AwsError.unwrapOptionField(
"automaticTerminationMode",
automaticTerminationMode
)
def getClipboardMode
: ZIO[Any, Nothing, zio.aws.nimble.model.StreamingClipboardMode] =
ZIO.succeed(clipboardMode)
def getEc2InstanceTypes
: ZIO[Any, Nothing, List[zio.aws.nimble.model.StreamingInstanceType]] =
ZIO.succeed(ec2InstanceTypes)
def getMaxSessionLengthInMinutes
: ZIO[Any, AwsError, StreamConfigurationMaxSessionLengthInMinutes] =
AwsError.unwrapOptionField(
"maxSessionLengthInMinutes",
maxSessionLengthInMinutes
)
def getMaxStoppedSessionLengthInMinutes: ZIO[
Any,
AwsError,
StreamConfigurationMaxStoppedSessionLengthInMinutes
] = AwsError.unwrapOptionField(
"maxStoppedSessionLengthInMinutes",
maxStoppedSessionLengthInMinutes
)
def getSessionBackup: ZIO[
Any,
AwsError,
zio.aws.nimble.model.StreamConfigurationSessionBackup.ReadOnly
] = AwsError.unwrapOptionField("sessionBackup", sessionBackup)
def getSessionPersistenceMode
: ZIO[Any, AwsError, zio.aws.nimble.model.SessionPersistenceMode] =
AwsError.unwrapOptionField(
"sessionPersistenceMode",
sessionPersistenceMode
)
def getSessionStorage: ZIO[
Any,
AwsError,
zio.aws.nimble.model.StreamConfigurationSessionStorage.ReadOnly
] = AwsError.unwrapOptionField("sessionStorage", sessionStorage)
def getStreamingImageIds: ZIO[Any, Nothing, List[StreamingImageId]] =
ZIO.succeed(streamingImageIds)
def getVolumeConfiguration: ZIO[
Any,
AwsError,
zio.aws.nimble.model.VolumeConfiguration.ReadOnly
] = AwsError.unwrapOptionField("volumeConfiguration", volumeConfiguration)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.nimble.model.StreamConfiguration
) extends zio.aws.nimble.model.StreamConfiguration.ReadOnly {
override val automaticTerminationMode
: Optional[zio.aws.nimble.model.AutomaticTerminationMode] =
zio.aws.core.internal
.optionalFromNullable(impl.automaticTerminationMode())
.map(value => zio.aws.nimble.model.AutomaticTerminationMode.wrap(value))
override val clipboardMode: zio.aws.nimble.model.StreamingClipboardMode =
zio.aws.nimble.model.StreamingClipboardMode.wrap(impl.clipboardMode())
override val ec2InstanceTypes
: List[zio.aws.nimble.model.StreamingInstanceType] = impl
.ec2InstanceTypes()
.asScala
.map { item =>
zio.aws.nimble.model.StreamingInstanceType.wrap(item)
}
.toList
override val maxSessionLengthInMinutes
: Optional[StreamConfigurationMaxSessionLengthInMinutes] =
zio.aws.core.internal
.optionalFromNullable(impl.maxSessionLengthInMinutes())
.map(value =>
zio.aws.nimble.model.primitives
.StreamConfigurationMaxSessionLengthInMinutes(value)
)
override val maxStoppedSessionLengthInMinutes
: Optional[StreamConfigurationMaxStoppedSessionLengthInMinutes] =
zio.aws.core.internal
.optionalFromNullable(impl.maxStoppedSessionLengthInMinutes())
.map(value =>
zio.aws.nimble.model.primitives
.StreamConfigurationMaxStoppedSessionLengthInMinutes(value)
)
override val sessionBackup: Optional[
zio.aws.nimble.model.StreamConfigurationSessionBackup.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.sessionBackup())
.map(value =>
zio.aws.nimble.model.StreamConfigurationSessionBackup.wrap(value)
)
override val sessionPersistenceMode
: Optional[zio.aws.nimble.model.SessionPersistenceMode] =
zio.aws.core.internal
.optionalFromNullable(impl.sessionPersistenceMode())
.map(value => zio.aws.nimble.model.SessionPersistenceMode.wrap(value))
override val sessionStorage: Optional[
zio.aws.nimble.model.StreamConfigurationSessionStorage.ReadOnly
] = zio.aws.core.internal
.optionalFromNullable(impl.sessionStorage())
.map(value =>
zio.aws.nimble.model.StreamConfigurationSessionStorage.wrap(value)
)
override val streamingImageIds: List[StreamingImageId] = impl
.streamingImageIds()
.asScala
.map { item =>
zio.aws.nimble.model.primitives.StreamingImageId(item)
}
.toList
override val volumeConfiguration
: Optional[zio.aws.nimble.model.VolumeConfiguration.ReadOnly] =
zio.aws.core.internal
.optionalFromNullable(impl.volumeConfiguration())
.map(value => zio.aws.nimble.model.VolumeConfiguration.wrap(value))
}
def wrap(
impl: software.amazon.awssdk.services.nimble.model.StreamConfiguration
): zio.aws.nimble.model.StreamConfiguration.ReadOnly = new Wrapper(impl)
}