zio.aws.gamelift.model.ListGameServersResponse.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-gamelift_3 Show documentation
Show all versions of zio-aws-gamelift_3 Show documentation
Low-level AWS wrapper for ZIO
The newest version!
package zio.aws.gamelift.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import zio.aws.gamelift.model.primitives.NonZeroAndMaxString
import scala.jdk.CollectionConverters.*
final case class ListGameServersResponse(
gameServers: Optional[Iterable[zio.aws.gamelift.model.GameServer]] =
Optional.Absent,
nextToken: Optional[NonZeroAndMaxString] = Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.gamelift.model.ListGameServersResponse = {
import ListGameServersResponse.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.gamelift.model.ListGameServersResponse
.builder()
.optionallyWith(
gameServers.map(value =>
value.map { item =>
item.buildAwsValue()
}.asJavaCollection
)
)(_.gameServers)
.optionallyWith(
nextToken.map(value =>
NonZeroAndMaxString.unwrap(value): java.lang.String
)
)(_.nextToken)
.build()
}
def asReadOnly: zio.aws.gamelift.model.ListGameServersResponse.ReadOnly =
zio.aws.gamelift.model.ListGameServersResponse.wrap(buildAwsValue())
}
object ListGameServersResponse {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.gamelift.model.ListGameServersResponse
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.gamelift.model.ListGameServersResponse =
zio.aws.gamelift.model.ListGameServersResponse(
gameServers.map(value =>
value.map { item =>
item.asEditable
}
),
nextToken.map(value => value)
)
def gameServers: Optional[List[zio.aws.gamelift.model.GameServer.ReadOnly]]
def nextToken: Optional[NonZeroAndMaxString]
def getGameServers
: ZIO[Any, AwsError, List[zio.aws.gamelift.model.GameServer.ReadOnly]] =
AwsError.unwrapOptionField("gameServers", gameServers)
def getNextToken: ZIO[Any, AwsError, NonZeroAndMaxString] =
AwsError.unwrapOptionField("nextToken", nextToken)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.gamelift.model.ListGameServersResponse
) extends zio.aws.gamelift.model.ListGameServersResponse.ReadOnly {
override val gameServers
: Optional[List[zio.aws.gamelift.model.GameServer.ReadOnly]] =
zio.aws.core.internal
.optionalFromNullable(impl.gameServers())
.map(value =>
value.asScala.map { item =>
zio.aws.gamelift.model.GameServer.wrap(item)
}.toList
)
override val nextToken: Optional[NonZeroAndMaxString] =
zio.aws.core.internal
.optionalFromNullable(impl.nextToken())
.map(value =>
zio.aws.gamelift.model.primitives.NonZeroAndMaxString(value)
)
}
def wrap(
impl: software.amazon.awssdk.services.gamelift.model.ListGameServersResponse
): zio.aws.gamelift.model.ListGameServersResponse.ReadOnly = new Wrapper(impl)
}