All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zio.aws.gamelift.model.StopFleetActionsRequest.scala Maven / Gradle / Ivy

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.{LocationStringModel, FleetIdOrArn}
import scala.jdk.CollectionConverters.*
final case class StopFleetActionsRequest(
    fleetId: FleetIdOrArn,
    actions: Iterable[zio.aws.gamelift.model.FleetAction],
    location: Optional[LocationStringModel] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.gamelift.model.StopFleetActionsRequest = {
    import StopFleetActionsRequest.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.gamelift.model.StopFleetActionsRequest
      .builder()
      .fleetId(FleetIdOrArn.unwrap(fleetId): java.lang.String)
      .actionsWithStrings(actions.map { item =>
        item.unwrap.toString
      }.asJavaCollection)
      .optionallyWith(
        location.map(value =>
          LocationStringModel.unwrap(value): java.lang.String
        )
      )(_.location)
      .build()
  }
  def asReadOnly: zio.aws.gamelift.model.StopFleetActionsRequest.ReadOnly =
    zio.aws.gamelift.model.StopFleetActionsRequest.wrap(buildAwsValue())
}
object StopFleetActionsRequest {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.gamelift.model.StopFleetActionsRequest
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.gamelift.model.StopFleetActionsRequest =
      zio.aws.gamelift.model
        .StopFleetActionsRequest(fleetId, actions, location.map(value => value))
    def fleetId: FleetIdOrArn
    def actions: List[zio.aws.gamelift.model.FleetAction]
    def location: Optional[LocationStringModel]
    def getFleetId: ZIO[Any, Nothing, FleetIdOrArn] = ZIO.succeed(fleetId)
    def getActions
        : ZIO[Any, Nothing, List[zio.aws.gamelift.model.FleetAction]] =
      ZIO.succeed(actions)
    def getLocation: ZIO[Any, AwsError, LocationStringModel] =
      AwsError.unwrapOptionField("location", location)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.gamelift.model.StopFleetActionsRequest
  ) extends zio.aws.gamelift.model.StopFleetActionsRequest.ReadOnly {
    override val fleetId: FleetIdOrArn =
      zio.aws.gamelift.model.primitives.FleetIdOrArn(impl.fleetId())
    override val actions: List[zio.aws.gamelift.model.FleetAction] = impl
      .actions()
      .asScala
      .map { item =>
        zio.aws.gamelift.model.FleetAction.wrap(item)
      }
      .toList
    override val location: Optional[LocationStringModel] = zio.aws.core.internal
      .optionalFromNullable(impl.location())
      .map(value =>
        zio.aws.gamelift.model.primitives.LocationStringModel(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.gamelift.model.StopFleetActionsRequest
  ): zio.aws.gamelift.model.StopFleetActionsRequest.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy