scala.googleapis.storage.BucketLifecycleRuleCondition.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class BucketLifecycleRuleCondition(
/** A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the "Early Access" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released.
*/
matchesPattern: Option[String] = None,
/** A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.
*/
noncurrentTimeBefore: Option[String] = None,
/** Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.
*/
numNewerVersions: Option[Int] = None,
/** Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.
*/
daysSinceCustomTime: Option[Int] = None,
/** Age of an object (in days). This condition is satisfied when an object reaches the specified age.
*/
age: Option[Int] = None,
/** A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when an object is created before midnight of the specified date in UTC.
*/
createdBefore: Option[String] = None,
/** Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.
*/
matchesStorageClass: Option[List[String]] = None,
/** Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects.
*/
isLive: Option[Boolean] = None,
/** A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when the custom time on an object is before this date in UTC.
*/
customTimeBefore: Option[String] = None,
/** Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.
*/
daysSinceNoncurrentTime: Option[Int] = None,
/** List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.
*/
matchesSuffix: Option[List[String]] = None,
/** List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.
*/
matchesPrefix: Option[List[String]] = None,
)
object BucketLifecycleRuleCondition {
implicit val encoder: Encoder[
BucketLifecycleRuleCondition
] = Encoder.instance { x =>
Json.obj(
"matchesPattern" := x.matchesPattern,
"noncurrentTimeBefore" := x.noncurrentTimeBefore,
"numNewerVersions" := x.numNewerVersions,
"daysSinceCustomTime" := x.daysSinceCustomTime,
"age" := x.age,
"createdBefore" := x.createdBefore,
"matchesStorageClass" := x.matchesStorageClass,
"isLive" := x.isLive,
"customTimeBefore" := x.customTimeBefore,
"daysSinceNoncurrentTime" := x.daysSinceNoncurrentTime,
"matchesSuffix" := x.matchesSuffix,
"matchesPrefix" := x.matchesPrefix,
)
}
implicit val decoder: Decoder[
BucketLifecycleRuleCondition
] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("matchesPattern")
v1 <- c.get[Option[String]]("noncurrentTimeBefore")
v2 <- c.get[Option[Int]]("numNewerVersions")
v3 <- c.get[Option[Int]]("daysSinceCustomTime")
v4 <- c.get[Option[Int]]("age")
v5 <- c.get[Option[String]]("createdBefore")
v6 <- c.get[Option[List[String]]]("matchesStorageClass")
v7 <- c.get[Option[Boolean]]("isLive")
v8 <- c.get[Option[String]]("customTimeBefore")
v9 <- c.get[Option[Int]]("daysSinceNoncurrentTime")
v10 <- c.get[Option[List[String]]]("matchesSuffix")
v11 <- c.get[Option[List[String]]]("matchesPrefix")
} yield BucketLifecycleRuleCondition(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11)
}
}