zio.aws.dlm.model.CrossRegionCopyRetainRule.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zio-aws-dlm_2.13 Show documentation
Show all versions of zio-aws-dlm_2.13 Show documentation
Low-level AWS wrapper for ZIO
package zio.aws.dlm.model
import zio.prelude.data.Optional
import zio.aws.core.{AwsError, BuilderHelper}
import zio.aws.dlm.model.primitives.Interval
import zio.ZIO
import java.lang.Integer
import scala.jdk.CollectionConverters._
final case class CrossRegionCopyRetainRule(
interval: Optional[Interval] = Optional.Absent,
intervalUnit: Optional[zio.aws.dlm.model.RetentionIntervalUnitValues] =
Optional.Absent
) {
def buildAwsValue()
: software.amazon.awssdk.services.dlm.model.CrossRegionCopyRetainRule = {
import CrossRegionCopyRetainRule.zioAwsBuilderHelper.BuilderOps
software.amazon.awssdk.services.dlm.model.CrossRegionCopyRetainRule
.builder()
.optionallyWith(interval.map(value => Interval.unwrap(value): Integer))(
_.interval
)
.optionallyWith(intervalUnit.map(value => value.unwrap))(_.intervalUnit)
.build()
}
def asReadOnly: zio.aws.dlm.model.CrossRegionCopyRetainRule.ReadOnly =
zio.aws.dlm.model.CrossRegionCopyRetainRule.wrap(buildAwsValue())
}
object CrossRegionCopyRetainRule {
private lazy val zioAwsBuilderHelper: BuilderHelper[
software.amazon.awssdk.services.dlm.model.CrossRegionCopyRetainRule
] = BuilderHelper.apply
trait ReadOnly {
def asEditable: zio.aws.dlm.model.CrossRegionCopyRetainRule =
zio.aws.dlm.model.CrossRegionCopyRetainRule(
interval.map(value => value),
intervalUnit.map(value => value)
)
def interval: Optional[Interval]
def intervalUnit: Optional[zio.aws.dlm.model.RetentionIntervalUnitValues]
def getInterval: ZIO[Any, AwsError, Interval] =
AwsError.unwrapOptionField("interval", interval)
def getIntervalUnit
: ZIO[Any, AwsError, zio.aws.dlm.model.RetentionIntervalUnitValues] =
AwsError.unwrapOptionField("intervalUnit", intervalUnit)
}
private final class Wrapper(
impl: software.amazon.awssdk.services.dlm.model.CrossRegionCopyRetainRule
) extends zio.aws.dlm.model.CrossRegionCopyRetainRule.ReadOnly {
override val interval: Optional[Interval] = zio.aws.core.internal
.optionalFromNullable(impl.interval())
.map(value => zio.aws.dlm.model.primitives.Interval(value))
override val intervalUnit
: Optional[zio.aws.dlm.model.RetentionIntervalUnitValues] =
zio.aws.core.internal
.optionalFromNullable(impl.intervalUnit())
.map(value => zio.aws.dlm.model.RetentionIntervalUnitValues.wrap(value))
}
def wrap(
impl: software.amazon.awssdk.services.dlm.model.CrossRegionCopyRetainRule
): zio.aws.dlm.model.CrossRegionCopyRetainRule.ReadOnly = new Wrapper(impl)
}