class_docstr: Represent a single revision of a GCS Object.
class_docstr_tok: ["Represent","a","single","revision","of","a","GCS","Object","."]
docstr: Initialize a new object revision.
  
  :param gcs_url:str the base URL for the GCS service.
  :param bucket_name:str the name of the bucket that contains the object.
  :param name:str the name of the object.
  :param generation:int the generation number for this object.
  :param request:flask.Request the contents of the HTTP request.
  :param media:str the contents of the object.
docstr_tok: ["Initialize","a","new","object","revision",".",":","param","gcs_url",":","str","the","base","URL","for","the","GCS","service",".",":","param","bucket_name",":","str","the","name","of","the","bucket","that","contains","the","object",".",":","param","name",":","str","the","name","of","the","object",".",":","param","generation",":","int","the","generation","number","for","this","object",".",":","param","request",":","flask.Request","the","contents","of","the","HTTP","request",".",":","param","media",":","str","the","contents","of","the","object","."]
code: def __init__(
      self, gcs_url, bucket_name, name, generation, request, media
  ):
      """Initialize a new object revision.
  
      :param gcs_url:str the base URL for the GCS service.
      :param bucket_name:str the name of the bucket that contains the object.
      :param name:str the name of the object.
      :param generation:int the generation number for this object.
      :param request:flask.Request the contents of the HTTP request.
      :param media:str the contents of the object.
      """
      self.gcs_url = gcs_url
      self.bucket_name = bucket_name
      self.name = name
      self.generation = str(generation)
      self.object_id = (
          bucket_name + "/o/" + name + "/" + str(generation)
      )
      now = time.gmtime(time.time())
      timestamp = time.strftime("%Y-%m-%dT%H:%M:%SZ", now)
      self.media = media
      instructions = request.headers.get(
          "x-goog-testbench-instructions"
      )
      if instructions == "inject-upload-data-error":
          self.media = testbench_utils.corrupt_media(media)
  
      self.metadata = {
          "timeCreated": timestamp,
          "updated": timestamp,
          "metageneration": "0",
          "generation": str(generation),
          "location": "US",
          "storageClass": "STANDARD",
          "size": str(len(self.media)),
          "etag": "XYZ=",
          "owner": {
              "entity": "project-owners-123456789",
              "entityId": "",
          },
          "md5Hash": base64.b64encode(
              hashlib.md5(self.media).digest()
          ).decode("utf-8"),
          "crc32c": base64.b64encode(
              struct.pack(">I", crc32c.crc32(self.media))
          ).decode("utf-8"),
      }
      if request.headers.get("content-type") is not None:
          self.metadata["contentType"] = request.headers.get(
              "content-type"
          )
  
imports: import base64
  import crc32c
  import error_response
  import hashlib
  import json
  import struct
  import testbench_utils
  import time
label_desc: Use image node_id 1 to create a new GcsObjectVersion object  with example: obj = GcsObjectVersion(gcs_url, bucket_name, name, generation, request, media)