scala.googleapis.storage.Bucket.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class Bucket(
/** HTTP 1.1 Entity tag for the bucket.
*/
etag: Option[String] = None,
/** The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the [Static Website Examples](https://cloud.google.com/storage/docs/static-website) for more information.
*/
website: Option[BucketWebsite] = None,
/** The name of the bucket.
*/
name: Option[String] = None,
/** The bucket's Autoclass configuration.
*/
autoclass: Option[BucketAutoclass] = None,
/** Reserved for future use.
*/
satisfiesPZS: Option[Boolean] = None,
/** The bucket's versioning configuration.
*/
versioning: Option[BucketVersioning] = None,
/** The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.
*/
logging: Option[BucketLogging] = None,
/** The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the [Developer's Guide](https://cloud.google.com/storage/docs/locations) for the authoritative list.
*/
location: Option[String] = None,
/** The hard delete time of the bucket in RFC 3339 format.
*/
hardDeleteTime: Option[String] = None,
/** The bucket's lifecycle configuration. See [Lifecycle Management](https://cloud.google.com/storage/docs/lifecycle) for more information.
*/
lifecycle: Option[BucketLifecycle] = None,
/** The generation of this bucket.
*/
generation: Option[Long] = None,
/** The bucket's hierarchical namespace configuration.
*/
hierarchicalNamespace: Option[BucketHierarchicalNamespace] = None,
/** The creation time of the bucket in RFC 3339 format.
*/
timeCreated: Option[String] = None,
/** The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.
*/
defaultEventBasedHold: Option[Boolean] = None,
/** The URI of this bucket.
*/
selfLink: Option[String] = None,
/** The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see [Storage Classes](https://cloud.google.com/storage/docs/storage-classes).
*/
storageClass: Option[String] = None,
/** Access controls on the bucket.
*/
acl: Option[List[BucketAccessControl]] = None,
/** The bucket's Cross-Origin Resource Sharing (CORS) configuration.
*/
cors: Option[List[BucketCor]] = None,
/** Default access controls to apply to new objects when no ACL is provided.
*/
defaultObjectAcl: Option[List[ObjectAccessControl]] = None,
/** The ID of the bucket. For buckets, the id and name properties are the same.
*/
id: Option[String] = None,
/** Encryption configuration for a bucket.
*/
encryption: Option[BucketEncryption] = None,
/** The modification time of the bucket in RFC 3339 format.
*/
updated: Option[String] = None,
/** User-provided labels, in key/value pairs.
*/
labels: Option[Map[String, String]] = None,
/** The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.
*/
retentionPolicy: Option[BucketRetentionPolicy] = None,
/** The project number of the project the bucket belongs to.
*/
projectNumber: Option[BigInt] = None,
/** The bucket's object retention config.
*/
objectRetention: Option[BucketObjectRetention] = None,
/** The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket.
*/
rpo: Option[String] = None,
/** The bucket's IAM configuration.
*/
iamConfiguration: Option[BucketIamConfiguration] = None,
/** The owner of the bucket. This is always the project team's owner group.
*/
owner: Option[BucketOwner] = None,
/** The bucket's IP filter configuration. Specifies the network sources that are allowed to access the operations on the bucket, as well as its underlying objects. Only enforced when the mode is set to 'Enabled'.
*/
ipFilter: Option[BucketIpFilter] = None,
/** The kind of item this is. For buckets, this is always storage#bucket.
*/
kind: Option[String] = None,
/** The type of the bucket location.
*/
locationType: Option[String] = None,
/** The bucket's custom placement configuration for Custom Dual Regions.
*/
customPlacementConfig: Option[BucketCustomPlacementConfig] = None,
/** The bucket's billing configuration.
*/
billing: Option[BucketBilling] = None,
/** The soft delete time of the bucket in RFC 3339 format.
*/
softDeleteTime: Option[String] = None,
/** The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.
*/
softDeletePolicy: Option[BucketSoftDeletePolicy] = None,
/** The metadata generation of this bucket.
*/
metageneration: Option[Long] = None,
/** Reserved for future use.
*/
satisfiesPZI: Option[Boolean] = None,
)
object Bucket {
implicit val encoder: Encoder[Bucket] = Encoder.instance { x =>
Json.obj(
"etag" := x.etag,
"website" := x.website,
"name" := x.name,
"autoclass" :=
x.autoclass,
"satisfiesPZS" := x.satisfiesPZS,
"versioning" := x.versioning,
"logging" := x.logging,
"location" := x.location,
"hardDeleteTime" := x.hardDeleteTime,
"lifecycle" := x.lifecycle,
"generation" := x.generation,
"hierarchicalNamespace" := x.hierarchicalNamespace,
"timeCreated" := x.timeCreated,
"defaultEventBasedHold" := x.defaultEventBasedHold,
"selfLink" := x.selfLink,
"storageClass" := x.storageClass,
"acl" := x.acl,
"cors" := x.cors,
"defaultObjectAcl" := x.defaultObjectAcl,
"id" := x.id,
"encryption"
:= x.encryption,
"updated" := x.updated,
"labels" := x.labels,
"retentionPolicy" := x.retentionPolicy,
"projectNumber" := x.projectNumber,
"objectRetention" := x.objectRetention,
"rpo" := x.rpo,
"iamConfiguration" := x.iamConfiguration,
"owner" := x.owner,
"ipFilter"
:= x.ipFilter,
"kind" := x.kind,
"locationType" := x.locationType,
"customPlacementConfig" := x.customPlacementConfig,
"billing" := x.billing,
"softDeleteTime" := x.softDeleteTime,
"softDeletePolicy" := x.softDeletePolicy,
"metageneration" := x.metageneration,
"satisfiesPZI" :=
x.satisfiesPZI,
)
}
implicit val decoder: Decoder[Bucket] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("etag")
v1 <- c.get[Option[BucketWebsite]]("website")
v2 <- c.get[Option[String]]("name")
v3 <- c.get[Option[BucketAutoclass]]("autoclass")
v4 <- c.get[Option[Boolean]]("satisfiesPZS")
v5 <- c.get[Option[BucketVersioning]]("versioning")
v6 <- c.get[Option[BucketLogging]]("logging")
v7 <- c.get[Option[String]]("location")
v8 <- c.get[Option[String]]("hardDeleteTime")
v9 <- c.get[Option[BucketLifecycle]]("lifecycle")
v10 <- c.get[Option[Long]]("generation")
v11 <- c.get[Option[BucketHierarchicalNamespace]]("hierarchicalNamespace")
v12 <- c.get[Option[String]]("timeCreated")
v13 <- c.get[Option[Boolean]]("defaultEventBasedHold")
v14 <- c.get[Option[String]]("selfLink")
v15 <- c.get[Option[String]]("storageClass")
v16 <- c.get[Option[List[BucketAccessControl]]]("acl")
v17 <- c.get[Option[List[BucketCor]]]("cors")
v18 <- c.get[Option[List[ObjectAccessControl]]]("defaultObjectAcl")
v19 <- c.get[Option[String]]("id")
v20 <- c.get[Option[BucketEncryption]]("encryption")
v21 <- c.get[Option[String]]("updated")
v22 <- c.get[Option[Map[String, String]]]("labels")
v23 <- c.get[Option[BucketRetentionPolicy]]("retentionPolicy")
v24 <- c.get[Option[BigInt]]("projectNumber")
v25 <- c.get[Option[BucketObjectRetention]]("objectRetention")
v26 <- c.get[Option[String]]("rpo")
v27 <- c.get[Option[BucketIamConfiguration]]("iamConfiguration")
v28 <- c.get[Option[BucketOwner]]("owner")
v29 <- c.get[Option[BucketIpFilter]]("ipFilter")
v30 <- c.get[Option[String]]("kind")
v31 <- c.get[Option[String]]("locationType")
v32 <- c.get[Option[BucketCustomPlacementConfig]]("customPlacementConfig")
v33 <- c.get[Option[BucketBilling]]("billing")
v34 <- c.get[Option[String]]("softDeleteTime")
v35 <- c.get[Option[BucketSoftDeletePolicy]]("softDeletePolicy")
v36 <- c.get[Option[Long]]("metageneration")
v37 <- c.get[Option[Boolean]]("satisfiesPZI")
} yield Bucket(
v0,
v1,
v2,
v3,
v4,
v5,
v6,
v7,
v8,
v9,
v10,
v11,
v12,
v13,
v14,
v15,
v16,
v17,
v18,
v19,
v20,
v21,
v22,
v23,
v24,
v25,
v26,
v27,
v28,
v29,
v30,
v31,
v32,
v33,
v34,
v35,
v36,
v37,
)
}
}