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

zio.aws.transcribe.model.VocabularyInfo.scala Maven / Gradle / Ivy

The newest version!
package zio.aws.transcribe.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.aws.transcribe.model.primitives.{DateTime, VocabularyName}
import zio.ZIO
import scala.jdk.CollectionConverters._
final case class VocabularyInfo(
    vocabularyName: Optional[VocabularyName] = Optional.Absent,
    languageCode: Optional[zio.aws.transcribe.model.LanguageCode] =
      Optional.Absent,
    lastModifiedTime: Optional[DateTime] = Optional.Absent,
    vocabularyState: Optional[zio.aws.transcribe.model.VocabularyState] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.transcribe.model.VocabularyInfo = {
    import VocabularyInfo.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.transcribe.model.VocabularyInfo
      .builder()
      .optionallyWith(
        vocabularyName.map(value =>
          VocabularyName.unwrap(value): java.lang.String
        )
      )(_.vocabularyName)
      .optionallyWith(languageCode.map(value => value.unwrap))(_.languageCode)
      .optionallyWith(
        lastModifiedTime.map(value => DateTime.unwrap(value): Instant)
      )(_.lastModifiedTime)
      .optionallyWith(vocabularyState.map(value => value.unwrap))(
        _.vocabularyState
      )
      .build()
  }
  def asReadOnly: zio.aws.transcribe.model.VocabularyInfo.ReadOnly =
    zio.aws.transcribe.model.VocabularyInfo.wrap(buildAwsValue())
}
object VocabularyInfo {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.transcribe.model.VocabularyInfo
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.transcribe.model.VocabularyInfo =
      zio.aws.transcribe.model.VocabularyInfo(
        vocabularyName.map(value => value),
        languageCode.map(value => value),
        lastModifiedTime.map(value => value),
        vocabularyState.map(value => value)
      )
    def vocabularyName: Optional[VocabularyName]
    def languageCode: Optional[zio.aws.transcribe.model.LanguageCode]
    def lastModifiedTime: Optional[DateTime]
    def vocabularyState: Optional[zio.aws.transcribe.model.VocabularyState]
    def getVocabularyName: ZIO[Any, AwsError, VocabularyName] =
      AwsError.unwrapOptionField("vocabularyName", vocabularyName)
    def getLanguageCode
        : ZIO[Any, AwsError, zio.aws.transcribe.model.LanguageCode] =
      AwsError.unwrapOptionField("languageCode", languageCode)
    def getLastModifiedTime: ZIO[Any, AwsError, DateTime] =
      AwsError.unwrapOptionField("lastModifiedTime", lastModifiedTime)
    def getVocabularyState
        : ZIO[Any, AwsError, zio.aws.transcribe.model.VocabularyState] =
      AwsError.unwrapOptionField("vocabularyState", vocabularyState)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.transcribe.model.VocabularyInfo
  ) extends zio.aws.transcribe.model.VocabularyInfo.ReadOnly {
    override val vocabularyName: Optional[VocabularyName] =
      zio.aws.core.internal
        .optionalFromNullable(impl.vocabularyName())
        .map(value => zio.aws.transcribe.model.primitives.VocabularyName(value))
    override val languageCode: Optional[zio.aws.transcribe.model.LanguageCode] =
      zio.aws.core.internal
        .optionalFromNullable(impl.languageCode())
        .map(value => zio.aws.transcribe.model.LanguageCode.wrap(value))
    override val lastModifiedTime: Optional[DateTime] = zio.aws.core.internal
      .optionalFromNullable(impl.lastModifiedTime())
      .map(value => zio.aws.transcribe.model.primitives.DateTime(value))
    override val vocabularyState
        : Optional[zio.aws.transcribe.model.VocabularyState] =
      zio.aws.core.internal
        .optionalFromNullable(impl.vocabularyState())
        .map(value => zio.aws.transcribe.model.VocabularyState.wrap(value))
  }
  def wrap(
      impl: software.amazon.awssdk.services.transcribe.model.VocabularyInfo
  ): zio.aws.transcribe.model.VocabularyInfo.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy