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

zio.aws.amplifybackend.model.GetBackendResponse.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.10
Show newest version
package zio.aws.amplifybackend.model
import zio.aws.amplifybackend.model.primitives.__string
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class GetBackendResponse(
    amplifyFeatureFlags: Optional[__string] = Optional.Absent,
    amplifyMetaConfig: Optional[__string] = Optional.Absent,
    appId: Optional[__string] = Optional.Absent,
    appName: Optional[__string] = Optional.Absent,
    backendEnvironmentList: Optional[Iterable[__string]] = Optional.Absent,
    backendEnvironmentName: Optional[__string] = Optional.Absent,
    error: Optional[__string] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.amplifybackend.model.GetBackendResponse = {
    import GetBackendResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.amplifybackend.model.GetBackendResponse
      .builder()
      .optionallyWith(
        amplifyFeatureFlags.map(value => value: java.lang.String)
      )(_.amplifyFeatureFlags)
      .optionallyWith(amplifyMetaConfig.map(value => value: java.lang.String))(
        _.amplifyMetaConfig
      )
      .optionallyWith(appId.map(value => value: java.lang.String))(_.appId)
      .optionallyWith(appName.map(value => value: java.lang.String))(_.appName)
      .optionallyWith(
        backendEnvironmentList.map(value =>
          value.map { item =>
            item: java.lang.String
          }.asJavaCollection
        )
      )(_.backendEnvironmentList)
      .optionallyWith(
        backendEnvironmentName.map(value => value: java.lang.String)
      )(_.backendEnvironmentName)
      .optionallyWith(error.map(value => value: java.lang.String))(_.error)
      .build()
  }
  def asReadOnly: zio.aws.amplifybackend.model.GetBackendResponse.ReadOnly =
    zio.aws.amplifybackend.model.GetBackendResponse.wrap(buildAwsValue())
}
object GetBackendResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.amplifybackend.model.GetBackendResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.amplifybackend.model.GetBackendResponse =
      zio.aws.amplifybackend.model.GetBackendResponse(
        amplifyFeatureFlags.map(value => value),
        amplifyMetaConfig.map(value => value),
        appId.map(value => value),
        appName.map(value => value),
        backendEnvironmentList.map(value => value),
        backendEnvironmentName.map(value => value),
        error.map(value => value)
      )
    def amplifyFeatureFlags: Optional[__string]
    def amplifyMetaConfig: Optional[__string]
    def appId: Optional[__string]
    def appName: Optional[__string]
    def backendEnvironmentList: Optional[List[__string]]
    def backendEnvironmentName: Optional[__string]
    def error: Optional[__string]
    def getAmplifyFeatureFlags: ZIO[Any, AwsError, __string] =
      AwsError.unwrapOptionField("amplifyFeatureFlags", amplifyFeatureFlags)
    def getAmplifyMetaConfig: ZIO[Any, AwsError, __string] =
      AwsError.unwrapOptionField("amplifyMetaConfig", amplifyMetaConfig)
    def getAppId: ZIO[Any, AwsError, __string] =
      AwsError.unwrapOptionField("appId", appId)
    def getAppName: ZIO[Any, AwsError, __string] =
      AwsError.unwrapOptionField("appName", appName)
    def getBackendEnvironmentList: ZIO[Any, AwsError, List[__string]] = AwsError
      .unwrapOptionField("backendEnvironmentList", backendEnvironmentList)
    def getBackendEnvironmentName: ZIO[Any, AwsError, __string] = AwsError
      .unwrapOptionField("backendEnvironmentName", backendEnvironmentName)
    def getError: ZIO[Any, AwsError, __string] =
      AwsError.unwrapOptionField("error", error)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.amplifybackend.model.GetBackendResponse
  ) extends zio.aws.amplifybackend.model.GetBackendResponse.ReadOnly {
    override val amplifyFeatureFlags: Optional[__string] = zio.aws.core.internal
      .optionalFromNullable(impl.amplifyFeatureFlags())
      .map(value => value: __string)
    override val amplifyMetaConfig: Optional[__string] = zio.aws.core.internal
      .optionalFromNullable(impl.amplifyMetaConfig())
      .map(value => value: __string)
    override val appId: Optional[__string] = zio.aws.core.internal
      .optionalFromNullable(impl.appId())
      .map(value => value: __string)
    override val appName: Optional[__string] = zio.aws.core.internal
      .optionalFromNullable(impl.appName())
      .map(value => value: __string)
    override val backendEnvironmentList: Optional[List[__string]] =
      zio.aws.core.internal
        .optionalFromNullable(impl.backendEnvironmentList())
        .map(value =>
          value.asScala.map { item =>
            item: __string
          }.toList
        )
    override val backendEnvironmentName: Optional[__string] =
      zio.aws.core.internal
        .optionalFromNullable(impl.backendEnvironmentName())
        .map(value => value: __string)
    override val error: Optional[__string] = zio.aws.core.internal
      .optionalFromNullable(impl.error())
      .map(value => value: __string)
  }
  def wrap(
      impl: software.amazon.awssdk.services.amplifybackend.model.GetBackendResponse
  ): zio.aws.amplifybackend.model.GetBackendResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy