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

zio.aws.tnb.model.ProblemDetails.scala Maven / Gradle / Ivy

There is a newer version: 7.28.29.10
Show newest version
package zio.aws.tnb.model
import zio.ZIO
import zio.aws.core.{AwsError, BuilderHelper}
import zio.prelude.data.Optional
import scala.jdk.CollectionConverters.*
final case class ProblemDetails(
    detail: String,
    title: Optional[String] = Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.tnb.model.ProblemDetails = {
    import ProblemDetails.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.tnb.model.ProblemDetails
      .builder()
      .detail(detail: java.lang.String)
      .optionallyWith(title.map(value => value: java.lang.String))(_.title)
      .build()
  }
  def asReadOnly: zio.aws.tnb.model.ProblemDetails.ReadOnly =
    zio.aws.tnb.model.ProblemDetails.wrap(buildAwsValue())
}
object ProblemDetails {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.tnb.model.ProblemDetails
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.tnb.model.ProblemDetails =
      zio.aws.tnb.model.ProblemDetails(detail, title.map(value => value))
    def detail: String
    def title: Optional[String]
    def getDetail: ZIO[Any, Nothing, String] = ZIO.succeed(detail)
    def getTitle: ZIO[Any, AwsError, String] =
      AwsError.unwrapOptionField("title", title)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.tnb.model.ProblemDetails
  ) extends zio.aws.tnb.model.ProblemDetails.ReadOnly {
    override val detail: String = impl.detail(): String
    override val title: Optional[String] = zio.aws.core.internal
      .optionalFromNullable(impl.title())
      .map(value => value: String)
  }
  def wrap(
      impl: software.amazon.awssdk.services.tnb.model.ProblemDetails
  ): zio.aws.tnb.model.ProblemDetails.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy