class_docstr: Represent a GCS Object, including all its revisions.
class_docstr_tok: ["Represent","a","GCS","Object",",","including","all","its","revisions","."]
docstr: Verify that the given precondition values are met.
docstr_tok: ["Verify","that","the","given","precondition","values","are","met","."]
code: def check_preconditions_by_value(
      self,
      generation_match,
      generation_not_match,
      metageneration_match,
      metageneration_not_match,
  ):
      """Verify that the given precondition values are met."""
      current_generation = self.current_generation or "0"
      if (
          generation_match is not None
          and generation_match != current_generation
      ):
          raise error_response.ErrorResponse(
              "Precondition Failed", status_code=412
          )
      # This object does not exist (yet), testing in this case is special.
      if (
          generation_not_match is not None
          and generation_not_match == current_generation
      ):
          raise error_response.ErrorResponse(
              "Precondition Failed", status_code=412
          )
  
      if self.current_generation is None:
          if (
              metageneration_match is not None
              or metageneration_not_match is not None
          ):
              raise error_response.ErrorResponse(
                  "Precondition Failed", status_code=412
              )
          return
  
      current = self.revisions.get(current_generation)
      if current is None:
          raise error_response.ErrorResponse(
              "Object not found", status_code=404
          )
      metageneration = current.metadata.get("metageneration")
      if (
          metageneration_not_match is not None
          and metageneration_not_match == metageneration
      ):
          raise error_response.ErrorResponse(
              "Precondition Failed", status_code=412
          )
      if (
          metageneration_match is not None
          and metageneration_match != metageneration
      ):
          raise error_response.ErrorResponse(
              "Precondition Failed", status_code=412
          )
  
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 7 for calling the GcsObject obj's underlying member method code with example usage: obj.check_preconditions_by_value(generation_match, generation_not_match, metageneration_match, metageneration_not_match) without return types