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

zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse.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.NextToken
import scala.jdk.CollectionConverters._
final case class ListDeviceResourcesResponse(
    nextToken: Optional[NextToken] = Optional.Absent,
    resources: Optional[
      Iterable[zio.aws.snowdevicemanagement.model.ResourceSummary]
    ] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.snowdevicemanagement.model.ListDeviceResourcesResponse = {
    import ListDeviceResourcesResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.snowdevicemanagement.model.ListDeviceResourcesResponse
      .builder()
      .optionallyWith(
        nextToken.map(value => NextToken.unwrap(value): java.lang.String)
      )(_.nextToken)
      .optionallyWith(
        resources.map(value =>
          value.map { item =>
            item.buildAwsValue()
          }.asJavaCollection
        )
      )(_.resources)
      .build()
  }
  def asReadOnly
      : zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse.ReadOnly =
    zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse
      .wrap(buildAwsValue())
}
object ListDeviceResourcesResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.snowdevicemanagement.model.ListDeviceResourcesResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable
        : zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse =
      zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse(
        nextToken.map(value => value),
        resources.map(value =>
          value.map { item =>
            item.asEditable
          }
        )
      )
    def nextToken: Optional[NextToken]
    def resources: Optional[
      List[zio.aws.snowdevicemanagement.model.ResourceSummary.ReadOnly]
    ]
    def getNextToken: ZIO[Any, AwsError, NextToken] =
      AwsError.unwrapOptionField("nextToken", nextToken)
    def getResources: ZIO[Any, AwsError, List[
      zio.aws.snowdevicemanagement.model.ResourceSummary.ReadOnly
    ]] = AwsError.unwrapOptionField("resources", resources)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListDeviceResourcesResponse
  ) extends zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse.ReadOnly {
    override val nextToken: Optional[NextToken] = zio.aws.core.internal
      .optionalFromNullable(impl.nextToken())
      .map(value =>
        zio.aws.snowdevicemanagement.model.primitives.NextToken(value)
      )
    override val resources: Optional[
      List[zio.aws.snowdevicemanagement.model.ResourceSummary.ReadOnly]
    ] = zio.aws.core.internal
      .optionalFromNullable(impl.resources())
      .map(value =>
        value.asScala.map { item =>
          zio.aws.snowdevicemanagement.model.ResourceSummary.wrap(item)
        }.toList
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.snowdevicemanagement.model.ListDeviceResourcesResponse
  ): zio.aws.snowdevicemanagement.model.ListDeviceResourcesResponse.ReadOnly =
    new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy