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

scala.googleapis.storage.ObjectsClient.scala Maven / Gradle / Ivy

The newest version!
package googleapis.storage

import cats.effect.Concurrent
import org.http4s._
import org.http4s.implicits._
import org.http4s.client.Client

class ObjectsClient[F[_]: Concurrent](client: Client[F]) extends AbstractClient[F](client) {
  val baseUri = uri"https://storage.googleapis.com/storage/v1"
  def bulkRestore(
      /** Name of the bucket in which the object resides.
        */
      bucket: String
  )(input: BulkRestoreObjectsRequest): F[GoogleLongrunningOperation] =
    expectJson[GoogleLongrunningOperation](
      requestWithBody(
        method = Method.POST,
        uri = baseUri / "b" / s"${bucket}" / "o" / "bulkRestore",
      )(input)
    )
  def testIamPermissions(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.TestIamPermissionsParams = ObjectsClient.TestIamPermissionsParams(),
  ): F[TestIamPermissionsResponse] = expectJson[TestIamPermissionsResponse](
    request(
      method = Method.GET,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}" / "iam" / "testPermissions")
        .copy(query =
          Query(
            "generation" -> query.generation,
            "permissions" -> query.permissions,
            "userProject" -> query.userProject,
          )
        ),
    )
  )
  def compose(
      /** Name of the bucket containing the source objects. The destination object is stored in this bucket.
        */
      destinationBucket: String,
      /** Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      destinationObject: String,
      query: ObjectsClient.ComposeParams = ObjectsClient.ComposeParams(),
  )(input: ComposeRequest): F[Object] = expectJson[Object](
    requestWithBody(
      method = Method.POST,
      uri = (baseUri / "b" / s"${destinationBucket}" / "o" / s"${destinationObject}" / "compose")
        .copy(query =
          Query(
            "destinationPredefinedAcl" -> query.destinationPredefinedAcl,
            "ifGenerationMatch" -> query.ifGenerationMatch,
            "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
            "kmsKeyName" -> query.kmsKeyName,
            "userProject" -> query.userProject,
          )
        ),
    )(input)
  )
  def insert(
      /** Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.
        */
      bucket: String,
      query: ObjectsClient.InsertParams = ObjectsClient.InsertParams(),
  )(input: Object): F[Object] = expectJson[Object](
    requestWithBody(
      method = Method.POST,
      uri = (baseUri / "b" / s"${bucket}" / "o").copy(query =
        Query(
          "contentEncoding" -> query.contentEncoding,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "kmsKeyName" -> query.kmsKeyName,
          "name" -> query.name,
          "predefinedAcl" -> query.predefinedAcl,
          "projection" -> query.projection,
          "userProject" -> query.userProject,
        )
      ),
    )(input)
  )
  def restore(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.RestoreParams = ObjectsClient.RestoreParams(),
  ): F[Object] = expectJson[Object](
    request(
      method = Method.POST,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}" / "restore").copy(query =
        Query(
          "copySourceAcl" -> query.copySourceAcl.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "generation" -> query.generation,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "projection" -> query.projection,
          "restoreToken" -> query.restoreToken,
          "userProject" -> query.userProject,
        )
      ),
    )
  )
  def watchAll(
      /** Name of the bucket in which to look for objects.
        */
      bucket: String,
      query: ObjectsClient.WatchAllParams = ObjectsClient.WatchAllParams(),
  )(input: Channel): F[Channel] = expectJson[Channel](
    requestWithBody(
      method = Method.POST,
      uri = (baseUri / "b" / s"${bucket}" / "o" / "watch").copy(query =
        Query(
          "delimiter" -> query.delimiter,
          "endOffset" -> query.endOffset,
          "includeTrailingDelimiter" -> query.includeTrailingDelimiter.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "maxResults" -> query.maxResults.map(s => QueryParamEncoder[Int].encode(s).value),
          "pageToken" -> query.pageToken,
          "prefix" -> query.prefix,
          "projection" -> query.projection,
          "startOffset" -> query.startOffset,
          "userProject" -> query.userProject,
          "versions" -> query.versions.map(s => QueryParamEncoder[Boolean].encode(s).value),
        )
      ),
    )(input)
  )
  def setIamPolicy(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.SetIamPolicyParams = ObjectsClient.SetIamPolicyParams(),
  )(input: Policy): F[Policy] = expectJson[Policy](
    requestWithBody(
      method = Method.PUT,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}" / "iam")
        .copy(query = Query("generation" -> query.generation, "userProject" -> query.userProject)),
    )(input)
  )
  def getIamPolicy(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.GetIamPolicyParams = ObjectsClient.GetIamPolicyParams(),
  ): F[Policy] = expectJson[Policy](
    request(
      method = Method.GET,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}" / "iam")
        .copy(query = Query("generation" -> query.generation, "userProject" -> query.userProject)),
    )
  )
  def delete(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.DeleteParams = ObjectsClient.DeleteParams(),
  ): F[Status] = client.status(
    request(
      method = Method.DELETE,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}").copy(query =
        Query(
          "generation" -> query.generation,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "userProject" -> query.userProject,
        )
      ),
    )
  )
  def rewrite(
      /** Name of the bucket in which to find the source object.
        */
      sourceBucket: String,
      /** Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      sourceObject: String,
      /** Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.
        */
      destinationBucket: String,
      /** Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      destinationObject: String,
      query: ObjectsClient.RewriteParams = ObjectsClient.RewriteParams(),
  )(input: Object): F[RewriteResponse] = expectJson[RewriteResponse](
    requestWithBody(
      method = Method.POST,
      uri =
        (baseUri / "b" / s"${sourceBucket}" / "o" / s"${sourceObject}" / "rewriteTo" / "b" / s"${destinationBucket}" / "o" / s"${destinationObject}")
          .copy(query =
            Query(
              "destinationKmsKeyName" -> query.destinationKmsKeyName,
              "destinationPredefinedAcl" -> query.destinationPredefinedAcl,
              "ifGenerationMatch" -> query.ifGenerationMatch,
              "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
              "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
              "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
              "ifSourceGenerationMatch" -> query.ifSourceGenerationMatch,
              "ifSourceGenerationNotMatch" -> query.ifSourceGenerationNotMatch,
              "ifSourceMetagenerationMatch" -> query.ifSourceMetagenerationMatch,
              "ifSourceMetagenerationNotMatch" -> query.ifSourceMetagenerationNotMatch,
              "maxBytesRewrittenPerCall" -> query.maxBytesRewrittenPerCall,
              "projection" -> query.projection,
              "rewriteToken" -> query.rewriteToken,
              "sourceGeneration" -> query.sourceGeneration,
              "userProject" -> query.userProject,
            )
          ),
    )(input)
  )
  def copy(
      /** Name of the bucket in which to find the source object.
        */
      sourceBucket: String,
      /** Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      sourceObject: String,
      /** Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      destinationBucket: String,
      /** Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.
        */
      destinationObject: String,
      query: ObjectsClient.CopyParams = ObjectsClient.CopyParams(),
  )(input: Object): F[Object] = expectJson[Object](
    requestWithBody(
      method = Method.POST,
      uri =
        (baseUri / "b" / s"${sourceBucket}" / "o" / s"${sourceObject}" / "copyTo" / "b" / s"${destinationBucket}" / "o" / s"${destinationObject}")
          .copy(query =
            Query(
              "destinationKmsKeyName" -> query.destinationKmsKeyName,
              "destinationPredefinedAcl" -> query.destinationPredefinedAcl,
              "ifGenerationMatch" -> query.ifGenerationMatch,
              "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
              "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
              "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
              "ifSourceGenerationMatch" -> query.ifSourceGenerationMatch,
              "ifSourceGenerationNotMatch" -> query.ifSourceGenerationNotMatch,
              "ifSourceMetagenerationMatch" -> query.ifSourceMetagenerationMatch,
              "ifSourceMetagenerationNotMatch" -> query.ifSourceMetagenerationNotMatch,
              "projection" -> query.projection,
              "sourceGeneration" -> query.sourceGeneration,
              "userProject" -> query.userProject,
            )
          ),
    )(input)
  )
  def get(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.GetParams = ObjectsClient.GetParams(),
  ): F[Object] = expectJson[Object](
    request(
      method = Method.GET,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}").copy(query =
        Query(
          "generation" -> query.generation,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "projection" -> query.projection,
          "restoreToken" -> query.restoreToken,
          "softDeleted" -> query.softDeleted.map(s => QueryParamEncoder[Boolean].encode(s).value),
          "userProject" -> query.userProject,
        )
      ),
    )
  )
  def update(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.UpdateParams = ObjectsClient.UpdateParams(),
  )(input: Object): F[Object] = expectJson[Object](
    requestWithBody(
      method = Method.PUT,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}").copy(query =
        Query(
          "generation" -> query.generation,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "overrideUnlockedRetention" -> query.overrideUnlockedRetention.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "predefinedAcl" -> query.predefinedAcl,
          "projection" -> query.projection,
          "userProject" -> query.userProject,
        )
      ),
    )(input)
  )
  def patch(
      /** Name of the bucket in which the object resides.
        */
      bucket: String,
      /** Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      `object`: String,
      query: ObjectsClient.PatchParams = ObjectsClient.PatchParams(),
  )(input: Object): F[Object] = expectJson[Object](
    requestWithBody(
      method = Method.PATCH,
      uri = (baseUri / "b" / s"${bucket}" / "o" / s"${`object`}").copy(query =
        Query(
          "generation" -> query.generation,
          "ifGenerationMatch" -> query.ifGenerationMatch,
          "ifGenerationNotMatch" -> query.ifGenerationNotMatch,
          "ifMetagenerationMatch" -> query.ifMetagenerationMatch,
          "ifMetagenerationNotMatch" -> query.ifMetagenerationNotMatch,
          "overrideUnlockedRetention" -> query.overrideUnlockedRetention.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "predefinedAcl" -> query.predefinedAcl,
          "projection" -> query.projection,
          "userProject" -> query.userProject,
        )
      ),
    )(input)
  )
  def list(
      /** Name of the bucket in which to look for objects.
        */
      bucket: String,
      query: ObjectsClient.ListParams = ObjectsClient.ListParams(),
  ): F[Objects] = expectJson[Objects](
    request(
      method = Method.GET,
      uri = (baseUri / "b" / s"${bucket}" / "o").copy(query =
        Query(
          "delimiter" -> query.delimiter,
          "endOffset" -> query.endOffset,
          "includeFoldersAsPrefixes" -> query.includeFoldersAsPrefixes.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "includeTrailingDelimiter" -> query.includeTrailingDelimiter.map(s =>
            QueryParamEncoder[Boolean].encode(s).value
          ),
          "matchGlob" -> query.matchGlob,
          "maxResults" -> query.maxResults.map(s => QueryParamEncoder[Int].encode(s).value),
          "pageToken" -> query.pageToken,
          "prefix" -> query.prefix,
          "projection" -> query.projection,
          "softDeleted" -> query.softDeleted.map(s => QueryParamEncoder[Boolean].encode(s).value),
          "startOffset" -> query.startOffset,
          "userProject" -> query.userProject,
          "versions" -> query.versions.map(s => QueryParamEncoder[Boolean].encode(s).value),
        )
      ),
    )
  )
}
object ObjectsClient {
  final case class TestIamPermissionsParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** Permissions to test.
        */
      permissions: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class ComposeParams(
      /** Apply a predefined set of access controls to the destination object.
        */
      destinationPredefinedAcl: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.
        */
      kmsKeyName: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class InsertParams(
      /** If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.
        */
      contentEncoding: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.
        */
      kmsKeyName: Option[String] = None,
      /** Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).
        */
      name: Option[String] = None,
      /** Apply a predefined set of access controls to this object.
        */
      predefinedAcl: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
        */
      projection: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class RestoreParams(
      /** If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.
        */
      copySourceAcl: Option[Boolean] = None,
      /** Selects a specific revision of this object.
        */
      generation: Option[String] = None,
      /** Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's one live metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether none of the object's live metagenerations match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Set of properties to return. Defaults to full.
        */
      projection: Option[String] = None,
      /** Restore token used to differentiate sof-deleted objects with the same name and generation. Only applicable for hierarchical namespace buckets. This parameter is optional, and is only required in the rare case when there are multiple soft-deleted objects with the same name and generation.
        */
      restoreToken: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class WatchAllParams(
      /** Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
        */
      delimiter: Option[String] = None,
      /** Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
        */
      endOffset: Option[String] = None,
      /** If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.
        */
      includeTrailingDelimiter: Option[Boolean] = None,
      /** Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.
        */
      maxResults: Option[Int] = None,
      /** A previously-returned page token representing part of the larger set of results to view.
        */
      pageToken: Option[String] = None,
      /** Filter results to objects whose names begin with this prefix.
        */
      prefix: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl.
        */
      projection: Option[String] = None,
      /** Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
        */
      startOffset: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
      /** If true, lists all versions of an object as distinct results. The default is false. For more information, see [Object Versioning](https://cloud.google.com/storage/docs/object-versioning).
        */
      versions: Option[Boolean] = None,
  )
  final case class SetIamPolicyParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class GetIamPolicyParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class DeleteParams(
      /** If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class RewriteParams(
      /** Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.
        */
      destinationKmsKeyName: Option[String] = None,
      /** Apply a predefined set of access controls to the destination object.
        */
      destinationPredefinedAcl: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current generation matches the given value.
        */
      ifSourceGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current generation does not match the given value.
        */
      ifSourceGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current metageneration matches the given value.
        */
      ifSourceMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current metageneration does not match the given value.
        */
      ifSourceMetagenerationNotMatch: Option[String] = None,
      /** The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.
        */
      maxBytesRewrittenPerCall: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
        */
      projection: Option[String] = None,
      /** Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.
        */
      rewriteToken: Option[String] = None,
      /** If present, selects a specific revision of the source object (as opposed to the latest version, the default).
        */
      sourceGeneration: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class CopyParams(
      /** Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.
        */
      destinationKmsKeyName: Option[String] = None,
      /** Apply a predefined set of access controls to the destination object.
        */
      destinationPredefinedAcl: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the destination object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current generation matches the given value.
        */
      ifSourceGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current generation does not match the given value.
        */
      ifSourceGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current metageneration matches the given value.
        */
      ifSourceMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the source object's current metageneration does not match the given value.
        */
      ifSourceMetagenerationNotMatch: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.
        */
      projection: Option[String] = None,
      /** If present, selects a specific revision of the source object (as opposed to the latest version, the default).
        */
      sourceGeneration: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class GetParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl.
        */
      projection: Option[String] = None,
      /** Restore token used to differentiate soft-deleted objects with the same name and generation. Only applicable for hierarchical namespace buckets and if softDeleted is set to true. This parameter is optional, and is only required in the rare case when there are multiple soft-deleted objects with the same name and generation.
        */
      restoreToken: Option[String] = None,
      /** If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
        */
      softDeleted: Option[Boolean] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class UpdateParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.
        */
      overrideUnlockedRetention: Option[Boolean] = None,
      /** Apply a predefined set of access controls to this object.
        */
      predefinedAcl: Option[String] = None,
      /** Set of properties to return. Defaults to full.
        */
      projection: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class PatchParams(
      /** If present, selects a specific revision of this object (as opposed to the latest version, the default).
        */
      generation: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.
        */
      ifGenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.
        */
      ifGenerationNotMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration matches the given value.
        */
      ifMetagenerationMatch: Option[String] = None,
      /** Makes the operation conditional on whether the object's current metageneration does not match the given value.
        */
      ifMetagenerationNotMatch: Option[String] = None,
      /** Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.
        */
      overrideUnlockedRetention: Option[Boolean] = None,
      /** Apply a predefined set of access controls to this object.
        */
      predefinedAcl: Option[String] = None,
      /** Set of properties to return. Defaults to full.
        */
      projection: Option[String] = None,
      /** The project to be billed for this request, for Requester Pays buckets.
        */
      userProject: Option[String] = None,
  )
  final case class ListParams(
      /** Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.
        */
      delimiter: Option[String] = None,
      /** Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
        */
      endOffset: Option[String] = None,
      /** Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.
        */
      includeFoldersAsPrefixes: Option[Boolean] = None,
      /** If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.
        */
      includeTrailingDelimiter: Option[Boolean] = None,
      /** Filter results to objects and prefixes that match this glob pattern.
        */
      matchGlob: Option[String] = None,
      /** Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.
        */
      maxResults: Option[Int] = None,
      /** A previously-returned page token representing part of the larger set of results to view.
        */
      pageToken: Option[String] = None,
      /** Filter results to objects whose names begin with this prefix.
        */
      prefix: Option[String] = None,
      /** Set of properties to return. Defaults to noAcl.
        */
      projection: Option[String] = None,
      /** If true, only soft-deleted object versions will be listed. The default is false. For more information, see [Soft Delete](https://cloud.google.com/storage/docs/soft-delete).
        */
      softDeleted: Option[Boolean] = None,
      /** Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).
        */
      startOffset: Option[String] = None,
      /** The project to be billed for this request. Required for Requester Pays buckets.
        */
      userProject: Option[String] = None,
      /** If true, lists all versions of an object as distinct results. The default is false. For more information, see [Object Versioning](https://cloud.google.com/storage/docs/object-versioning).
        */
      versions: Option[Boolean] = None,
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy