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

zio.aws.codecatalyst.model.GetSubscriptionResponse.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.codecatalyst.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.codecatalyst.model.primitives.{
  SyntheticTimestamp_date_time,
  NameString
}
import scala.jdk.CollectionConverters.*
final case class GetSubscriptionResponse(
    subscriptionType: Optional[String] = Optional.Absent,
    awsAccountName: Optional[NameString] = Optional.Absent,
    pendingSubscriptionType: Optional[String] = Optional.Absent,
    pendingSubscriptionStartTime: Optional[SyntheticTimestamp_date_time] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse = {
    import GetSubscriptionResponse.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse
      .builder()
      .optionallyWith(subscriptionType.map(value => value: java.lang.String))(
        _.subscriptionType
      )
      .optionallyWith(
        awsAccountName.map(value => NameString.unwrap(value): java.lang.String)
      )(_.awsAccountName)
      .optionallyWith(
        pendingSubscriptionType.map(value => value: java.lang.String)
      )(_.pendingSubscriptionType)
      .optionallyWith(
        pendingSubscriptionStartTime.map(value =>
          SyntheticTimestamp_date_time.unwrap(value): Instant
        )
      )(_.pendingSubscriptionStartTime)
      .build()
  }
  def asReadOnly: zio.aws.codecatalyst.model.GetSubscriptionResponse.ReadOnly =
    zio.aws.codecatalyst.model.GetSubscriptionResponse.wrap(buildAwsValue())
}
object GetSubscriptionResponse {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.codecatalyst.model.GetSubscriptionResponse =
      zio.aws.codecatalyst.model.GetSubscriptionResponse(
        subscriptionType.map(value => value),
        awsAccountName.map(value => value),
        pendingSubscriptionType.map(value => value),
        pendingSubscriptionStartTime.map(value => value)
      )
    def subscriptionType: Optional[String]
    def awsAccountName: Optional[NameString]
    def pendingSubscriptionType: Optional[String]
    def pendingSubscriptionStartTime: Optional[SyntheticTimestamp_date_time]
    def getSubscriptionType: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("subscriptionType", subscriptionType)
    def getAwsAccountName: ZIO[Any, AwsError, NameString] =
      AwsError.unwrapOptionField("awsAccountName", awsAccountName)
    def getPendingSubscriptionType: ZIO[Any, AwsError, String] = AwsError
      .unwrapOptionField("pendingSubscriptionType", pendingSubscriptionType)
    def getPendingSubscriptionStartTime
        : ZIO[Any, AwsError, SyntheticTimestamp_date_time] =
      AwsError.unwrapOptionField(
        "pendingSubscriptionStartTime",
        pendingSubscriptionStartTime
      )
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse
  ) extends zio.aws.codecatalyst.model.GetSubscriptionResponse.ReadOnly {
    override val subscriptionType: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.subscriptionType())
      .map(value => value: String)
    override val awsAccountName: Optional[NameString] = zio.aws.core.internal
      .optionalFromNullable(impl.awsAccountName())
      .map(value => zio.aws.codecatalyst.model.primitives.NameString(value))
    override val pendingSubscriptionType: Optional[String] =
      zio.aws.core.internal
        .optionalFromNullable(impl.pendingSubscriptionType())
        .map(value => value: String)
    override val pendingSubscriptionStartTime
        : Optional[SyntheticTimestamp_date_time] = zio.aws.core.internal
      .optionalFromNullable(impl.pendingSubscriptionStartTime())
      .map(value =>
        zio.aws.codecatalyst.model.primitives
          .SyntheticTimestamp_date_time(value)
      )
  }
  def wrap(
      impl: software.amazon.awssdk.services.codecatalyst.model.GetSubscriptionResponse
  ): zio.aws.codecatalyst.model.GetSubscriptionResponse.ReadOnly = new Wrapper(
    impl
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy