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

zio.aws.ssm.model.ResourceDataSyncItem.scala Maven / Gradle / Ivy

There is a newer version: 7.28.26.1
Show newest version
package zio.aws.ssm.model
import java.time.Instant
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.ZIO
import zio.aws.ssm.model.primitives.{
  LastResourceDataSyncTime,
  ResourceDataSyncCreatedTime,
  ResourceDataSyncLastModifiedTime,
  LastResourceDataSyncMessage,
  ResourceDataSyncType,
  ResourceDataSyncName,
  LastSuccessfulResourceDataSyncTime
}
import scala.jdk.CollectionConverters.*
final case class ResourceDataSyncItem(
    syncName: Optional[ResourceDataSyncName] = Optional.Absent,
    syncType: Optional[ResourceDataSyncType] = Optional.Absent,
    syncSource: Optional[zio.aws.ssm.model.ResourceDataSyncSourceWithState] =
      Optional.Absent,
    s3Destination: Optional[zio.aws.ssm.model.ResourceDataSyncS3Destination] =
      Optional.Absent,
    lastSyncTime: Optional[LastResourceDataSyncTime] = Optional.Absent,
    lastSuccessfulSyncTime: Optional[LastSuccessfulResourceDataSyncTime] =
      Optional.Absent,
    syncLastModifiedTime: Optional[ResourceDataSyncLastModifiedTime] =
      Optional.Absent,
    lastStatus: Optional[zio.aws.ssm.model.LastResourceDataSyncStatus] =
      Optional.Absent,
    syncCreatedTime: Optional[ResourceDataSyncCreatedTime] = Optional.Absent,
    lastSyncStatusMessage: Optional[LastResourceDataSyncMessage] =
      Optional.Absent
) {
  def buildAwsValue()
      : software.amazon.awssdk.services.ssm.model.ResourceDataSyncItem = {
    import ResourceDataSyncItem.zioAwsBuilderHelper.BuilderOps
    software.amazon.awssdk.services.ssm.model.ResourceDataSyncItem
      .builder()
      .optionallyWith(
        syncName.map(value =>
          ResourceDataSyncName.unwrap(value): java.lang.String
        )
      )(_.syncName)
      .optionallyWith(
        syncType.map(value =>
          ResourceDataSyncType.unwrap(value): java.lang.String
        )
      )(_.syncType)
      .optionallyWith(syncSource.map(value => value.buildAwsValue()))(
        _.syncSource
      )
      .optionallyWith(s3Destination.map(value => value.buildAwsValue()))(
        _.s3Destination
      )
      .optionallyWith(
        lastSyncTime.map(value =>
          LastResourceDataSyncTime.unwrap(value): Instant
        )
      )(_.lastSyncTime)
      .optionallyWith(
        lastSuccessfulSyncTime.map(value =>
          LastSuccessfulResourceDataSyncTime.unwrap(value): Instant
        )
      )(_.lastSuccessfulSyncTime)
      .optionallyWith(
        syncLastModifiedTime.map(value =>
          ResourceDataSyncLastModifiedTime.unwrap(value): Instant
        )
      )(_.syncLastModifiedTime)
      .optionallyWith(lastStatus.map(value => value.unwrap))(_.lastStatus)
      .optionallyWith(
        syncCreatedTime.map(value =>
          ResourceDataSyncCreatedTime.unwrap(value): Instant
        )
      )(_.syncCreatedTime)
      .optionallyWith(
        lastSyncStatusMessage.map(value =>
          LastResourceDataSyncMessage.unwrap(value): java.lang.String
        )
      )(_.lastSyncStatusMessage)
      .build()
  }
  def asReadOnly: zio.aws.ssm.model.ResourceDataSyncItem.ReadOnly =
    zio.aws.ssm.model.ResourceDataSyncItem.wrap(buildAwsValue())
}
object ResourceDataSyncItem {
  private lazy val zioAwsBuilderHelper: BuilderHelper[
    software.amazon.awssdk.services.ssm.model.ResourceDataSyncItem
  ] = BuilderHelper.apply
  trait ReadOnly {
    def asEditable: zio.aws.ssm.model.ResourceDataSyncItem =
      zio.aws.ssm.model.ResourceDataSyncItem(
        syncName.map(value => value),
        syncType.map(value => value),
        syncSource.map(value => value.asEditable),
        s3Destination.map(value => value.asEditable),
        lastSyncTime.map(value => value),
        lastSuccessfulSyncTime.map(value => value),
        syncLastModifiedTime.map(value => value),
        lastStatus.map(value => value),
        syncCreatedTime.map(value => value),
        lastSyncStatusMessage.map(value => value)
      )
    def syncName: Optional[ResourceDataSyncName]
    def syncType: Optional[ResourceDataSyncType]
    def syncSource
        : Optional[zio.aws.ssm.model.ResourceDataSyncSourceWithState.ReadOnly]
    def s3Destination
        : Optional[zio.aws.ssm.model.ResourceDataSyncS3Destination.ReadOnly]
    def lastSyncTime: Optional[LastResourceDataSyncTime]
    def lastSuccessfulSyncTime: Optional[LastSuccessfulResourceDataSyncTime]
    def syncLastModifiedTime: Optional[ResourceDataSyncLastModifiedTime]
    def lastStatus: Optional[zio.aws.ssm.model.LastResourceDataSyncStatus]
    def syncCreatedTime: Optional[ResourceDataSyncCreatedTime]
    def lastSyncStatusMessage: Optional[LastResourceDataSyncMessage]
    def getSyncName: ZIO[Any, AwsError, ResourceDataSyncName] =
      AwsError.unwrapOptionField("syncName", syncName)
    def getSyncType: ZIO[Any, AwsError, ResourceDataSyncType] =
      AwsError.unwrapOptionField("syncType", syncType)
    def getSyncSource: ZIO[
      Any,
      AwsError,
      zio.aws.ssm.model.ResourceDataSyncSourceWithState.ReadOnly
    ] = AwsError.unwrapOptionField("syncSource", syncSource)
    def getS3Destination: ZIO[
      Any,
      AwsError,
      zio.aws.ssm.model.ResourceDataSyncS3Destination.ReadOnly
    ] = AwsError.unwrapOptionField("s3Destination", s3Destination)
    def getLastSyncTime: ZIO[Any, AwsError, LastResourceDataSyncTime] =
      AwsError.unwrapOptionField("lastSyncTime", lastSyncTime)
    def getLastSuccessfulSyncTime
        : ZIO[Any, AwsError, LastSuccessfulResourceDataSyncTime] = AwsError
      .unwrapOptionField("lastSuccessfulSyncTime", lastSuccessfulSyncTime)
    def getSyncLastModifiedTime
        : ZIO[Any, AwsError, ResourceDataSyncLastModifiedTime] =
      AwsError.unwrapOptionField("syncLastModifiedTime", syncLastModifiedTime)
    def getLastStatus
        : ZIO[Any, AwsError, zio.aws.ssm.model.LastResourceDataSyncStatus] =
      AwsError.unwrapOptionField("lastStatus", lastStatus)
    def getSyncCreatedTime: ZIO[Any, AwsError, ResourceDataSyncCreatedTime] =
      AwsError.unwrapOptionField("syncCreatedTime", syncCreatedTime)
    def getLastSyncStatusMessage
        : ZIO[Any, AwsError, LastResourceDataSyncMessage] =
      AwsError.unwrapOptionField("lastSyncStatusMessage", lastSyncStatusMessage)
  }
  private final class Wrapper(
      impl: software.amazon.awssdk.services.ssm.model.ResourceDataSyncItem
  ) extends zio.aws.ssm.model.ResourceDataSyncItem.ReadOnly {
    override val syncName: Optional[ResourceDataSyncName] =
      zio.aws.core.internal
        .optionalFromNullable(impl.syncName())
        .map(value => zio.aws.ssm.model.primitives.ResourceDataSyncName(value))
    override val syncType: Optional[ResourceDataSyncType] =
      zio.aws.core.internal
        .optionalFromNullable(impl.syncType())
        .map(value => zio.aws.ssm.model.primitives.ResourceDataSyncType(value))
    override val syncSource
        : Optional[zio.aws.ssm.model.ResourceDataSyncSourceWithState.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.syncSource())
        .map(value =>
          zio.aws.ssm.model.ResourceDataSyncSourceWithState.wrap(value)
        )
    override val s3Destination
        : Optional[zio.aws.ssm.model.ResourceDataSyncS3Destination.ReadOnly] =
      zio.aws.core.internal
        .optionalFromNullable(impl.s3Destination())
        .map(value =>
          zio.aws.ssm.model.ResourceDataSyncS3Destination.wrap(value)
        )
    override val lastSyncTime: Optional[LastResourceDataSyncTime] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lastSyncTime())
        .map(value =>
          zio.aws.ssm.model.primitives.LastResourceDataSyncTime(value)
        )
    override val lastSuccessfulSyncTime
        : Optional[LastSuccessfulResourceDataSyncTime] = zio.aws.core.internal
      .optionalFromNullable(impl.lastSuccessfulSyncTime())
      .map(value =>
        zio.aws.ssm.model.primitives.LastSuccessfulResourceDataSyncTime(value)
      )
    override val syncLastModifiedTime
        : Optional[ResourceDataSyncLastModifiedTime] = zio.aws.core.internal
      .optionalFromNullable(impl.syncLastModifiedTime())
      .map(value =>
        zio.aws.ssm.model.primitives.ResourceDataSyncLastModifiedTime(value)
      )
    override val lastStatus
        : Optional[zio.aws.ssm.model.LastResourceDataSyncStatus] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lastStatus())
        .map(value => zio.aws.ssm.model.LastResourceDataSyncStatus.wrap(value))
    override val syncCreatedTime: Optional[ResourceDataSyncCreatedTime] =
      zio.aws.core.internal
        .optionalFromNullable(impl.syncCreatedTime())
        .map(value =>
          zio.aws.ssm.model.primitives.ResourceDataSyncCreatedTime(value)
        )
    override val lastSyncStatusMessage: Optional[LastResourceDataSyncMessage] =
      zio.aws.core.internal
        .optionalFromNullable(impl.lastSyncStatusMessage())
        .map(value =>
          zio.aws.ssm.model.primitives.LastResourceDataSyncMessage(value)
        )
  }
  def wrap(
      impl: software.amazon.awssdk.services.ssm.model.ResourceDataSyncItem
  ): zio.aws.ssm.model.ResourceDataSyncItem.ReadOnly = new Wrapper(impl)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy