scala.googleapis.storage.Object.scala Maven / Gradle / Ivy
The newest version!
package googleapis.storage
import io.circe._
import io.circe.syntax._
final case class Object(
/** HTTP 1.1 Entity tag for the object.
*/
etag: Option[String] = None,
/** The name of the object. Required if not specified by URL parameter.
*/
name: Option[String] = None,
/** Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.
*/
cacheControl: Option[String] = None,
/** Content-Length of the data in bytes.
*/
size: Option[BigInt] = None,
/** This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.
*/
hardDeleteTime: Option[String] = None,
/** Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), 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 the 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.
*/
eventBasedHold: Option[Boolean] = None,
/** The content generation of this object. Used for object versioning.
*/
generation: Option[Long] = None,
/** CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
*/
crc32c: Option[String] = None,
/** MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see [Data Validation and Change Detection](https://cloud.google.com/storage/docs/data-validation).
*/
md5Hash: Option[String] = None,
/** Content-Language of the object data.
*/
contentLanguage: Option[String] = None,
/** The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.
*/
timeDeleted: Option[String] = None,
/** A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).
*/
retentionExpirationTime: Option[String] = None,
/** Restore token used to differentiate deleted objects with the same name and generation. This field is only returned for deleted objects in hierarchical namespace buckets.
*/
restoreToken: Option[String] = None,
/** The creation time of the object in RFC 3339 format.
*/
timeCreated: Option[String] = None,
/** The link to this object.
*/
selfLink: Option[String] = None,
/** The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.
*/
timeStorageClassUpdated: Option[String] = None,
/** Storage class of the object.
*/
storageClass: Option[String] = None,
/** Access controls on the object.
*/
acl: Option[List[ObjectAccessControl]] = None,
/** A collection of object level retention parameters.
*/
retention: Option[ObjectRetention] = None,
/** Number of underlying components that make up this object. Components are accumulated by compose operations.
*/
componentCount: Option[Int] = None,
/** The ID of the object, including the bucket name, object name, and generation number.
*/
id: Option[String] = None,
/** Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.
*/
contentType: Option[String] = None,
/** The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.
*/
updated: Option[String] = None,
/** Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.
*/
kmsKeyName: Option[String] = None,
/** Media download link.
*/
mediaLink: Option[String] = None,
/** The name of the bucket containing this object.
*/
bucket: Option[String] = None,
/** User-provided metadata, in key/value pairs.
*/
metadata: Option[Map[String, String]] = None,
/** Content-Encoding of the object data.
*/
contentEncoding: Option[String] = None,
/** Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.
*/
temporaryHold: Option[Boolean] = None,
/** The owner of the object. This will always be the uploader of the object.
*/
owner: Option[ObjectOwner] = None,
/** The kind of item this is. For objects, this is always storage#object.
*/
kind: Option[String] = None,
/** Content-Disposition of the object data.
*/
contentDisposition: Option[String] = None,
/** A timestamp in RFC 3339 format specified by the user for an object.
*/
customTime: Option[String] = None,
/** The time at which the object became soft-deleted in RFC 3339 format.
*/
softDeleteTime: Option[String] = None,
/** The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.
*/
metageneration: Option[Long] = None,
/** Metadata of customer-supplied encryption key, if the object is encrypted by such a key.
*/
customerEncryption: Option[ObjectCustomerEncryption] = None,
)
object Object {
implicit val encoder: Encoder[Object] = Encoder.instance { x =>
Json.obj(
"etag" := x.etag,
"name" := x.name,
"cacheControl" := x.cacheControl,
"size" := x.size,
"hardDeleteTime" := x.hardDeleteTime,
"eventBasedHold"
:= x.eventBasedHold,
"generation" := x.generation,
"crc32c" := x.crc32c,
"md5Hash" := x.md5Hash,
"contentLanguage" := x.contentLanguage,
"timeDeleted" := x.timeDeleted,
"retentionExpirationTime" := x.retentionExpirationTime,
"restoreToken" := x.restoreToken,
"timeCreated"
:= x.timeCreated,
"selfLink" := x.selfLink,
"timeStorageClassUpdated" := x.timeStorageClassUpdated,
"storageClass" := x.storageClass,
"acl" := x.acl,
"retention" := x.retention,
"componentCount" := x.componentCount,
"id" := x.id,
"contentType" := x.contentType,
"updated" := x.updated,
"kmsKeyName" := x.kmsKeyName,
"mediaLink" := x.mediaLink,
"bucket" := x.bucket,
"metadata" := x.metadata,
"contentEncoding" := x.contentEncoding,
"temporaryHold" := x.temporaryHold,
"owner" := x.owner,
"kind" := x.kind,
"contentDisposition" := x.contentDisposition,
"customTime" := x.customTime,
"softDeleteTime" := x.softDeleteTime,
"metageneration" := x.metageneration,
"customerEncryption" := x.customerEncryption,
)
}
implicit val decoder: Decoder[Object] = Decoder.instance { c =>
for {
v0 <- c.get[Option[String]]("etag")
v1 <- c.get[Option[String]]("name")
v2 <- c.get[Option[String]]("cacheControl")
v3 <- c.get[Option[BigInt]]("size")
v4 <- c.get[Option[String]]("hardDeleteTime")
v5 <- c.get[Option[Boolean]]("eventBasedHold")
v6 <- c.get[Option[Long]]("generation")
v7 <- c.get[Option[String]]("crc32c")
v8 <- c.get[Option[String]]("md5Hash")
v9 <- c.get[Option[String]]("contentLanguage")
v10 <- c.get[Option[String]]("timeDeleted")
v11 <- c.get[Option[String]]("retentionExpirationTime")
v12 <- c.get[Option[String]]("restoreToken")
v13 <- c.get[Option[String]]("timeCreated")
v14 <- c.get[Option[String]]("selfLink")
v15 <- c.get[Option[String]]("timeStorageClassUpdated")
v16 <- c.get[Option[String]]("storageClass")
v17 <- c.get[Option[List[ObjectAccessControl]]]("acl")
v18 <- c.get[Option[ObjectRetention]]("retention")
v19 <- c.get[Option[Int]]("componentCount")
v20 <- c.get[Option[String]]("id")
v21 <- c.get[Option[String]]("contentType")
v22 <- c.get[Option[String]]("updated")
v23 <- c.get[Option[String]]("kmsKeyName")
v24 <- c.get[Option[String]]("mediaLink")
v25 <- c.get[Option[String]]("bucket")
v26 <- c.get[Option[Map[String, String]]]("metadata")
v27 <- c.get[Option[String]]("contentEncoding")
v28 <- c.get[Option[Boolean]]("temporaryHold")
v29 <- c.get[Option[ObjectOwner]]("owner")
v30 <- c.get[Option[String]]("kind")
v31 <- c.get[Option[String]]("contentDisposition")
v32 <- c.get[Option[String]]("customTime")
v33 <- c.get[Option[String]]("softDeleteTime")
v34 <- c.get[Option[Long]]("metageneration")
v35 <- c.get[Option[ObjectCustomerEncryption]]("customerEncryption")
} yield Object(
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,
)
}
}