Google Sheets API . spreadsheets . developerMetadata

Instance Methods

get(spreadsheetId, metadataId, x__xgafv=None)

Returns the developer metadata with the specified ID.

search(spreadsheetId, body, x__xgafv=None)

Returns all developer metadata matching the specified DataFilter.

Method Details

get(spreadsheetId, metadataId, x__xgafv=None)
Returns the developer metadata with the specified ID.
The caller must specify the spreadsheet ID and the developer metadata's
unique metadataId.

Args:
  spreadsheetId: string, The ID of the spreadsheet to retrieve metadata from. (required)
  metadataId: integer, The ID of the developer metadata to retrieve. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Developer metadata associated with a location or object in a spreadsheet.
      # Developer metadata may be used to associate arbitrary data with various
      # parts of a spreadsheet and will remain associated at those locations as they
      # move around and the spreadsheet is edited.  For example, if developer
      # metadata is associated with row 5 and another row is then subsequently
      # inserted above row 5, that original metadata will still be associated with
      # the row it was first associated with (what is now row 6). If the associated
      # object is deleted its metadata is deleted too.
    "metadataId": 42, # The spreadsheet-scoped unique ID that identifies the metadata. IDs may be
        # specified when metadata is created, otherwise one will be randomly
        # generated and assigned. Must be positive.
    "metadataValue": "A String", # Data associated with the metadata's key.
    "location": { # A location where metadata may be associated in a spreadsheet. # The location where the metadata is associated.
      "locationType": "A String", # The type of location this object represents.  This field is read-only.
      "dimensionRange": { # A range along a single dimension on a sheet. # Represents the row or column when metadata is associated with
          # a dimension. The specified DimensionRange must represent a single row
          # or column; it cannot be unbounded or span multiple rows or columns.
          # All indexes are zero-based.
          # Indexes are half open: the start index is inclusive
          # and the end index is exclusive.
          # Missing indexes indicate the range is unbounded on that side.
        "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
        "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
        "sheetId": 42, # The sheet this span is on.
        "dimension": "A String", # The dimension of the span.
      },
      "spreadsheet": True or False, # True when metadata is associated with an entire spreadsheet.
      "sheetId": 42, # The ID of the sheet when metadata is associated with an entire sheet.
    },
    "visibility": "A String", # The metadata visibility.  Developer metadata must always have a visibility
        # specified.
    "metadataKey": "A String", # The metadata key. There may be multiple metadata in a spreadsheet with the
        # same key.  Developer metadata must always have a key specified.
  }
search(spreadsheetId, body, x__xgafv=None)
Returns all developer metadata matching the specified DataFilter.
If the provided DataFilter represents a DeveloperMetadataLookup object,
this will return all DeveloperMetadata entries selected by it. If the
DataFilter represents a location in a spreadsheet, this will return all
developer metadata associated with locations intersecting that region.

Args:
  spreadsheetId: string, The ID of the spreadsheet to retrieve metadata from. (required)
  body: object, The request body. (required)
    The object takes the form of:

{ # A request to retrieve all developer metadata matching the set of specified
      # criteria.
    "dataFilters": [ # The data filters describing the criteria used to determine which
        # DeveloperMetadata entries to return.  DeveloperMetadata matching any of the
        # specified filters will be included in the response.
      { # Filter that describes what data should be selected or returned from a
          # request.
        "developerMetadataLookup": { # Selects DeveloperMetadata that matches all of the specified fields.  For # Selects data associated with the developer metadata matching the criteria
            # described by this DeveloperMetadataLookup.
            # example, if only a metadata ID is specified this considers the
            # DeveloperMetadata with that particular unique ID. If a metadata key is
            # specified, this considers all developer metadata with that key.  If a
            # key, visibility, and location type are all specified, this considers all
            # developer metadata with that key and visibility that are associated with a
            # location of that type.  In general, this
            # selects all DeveloperMetadata that matches the intersection of all the
            # specified fields; any field or combination of fields may be specified.
          "metadataLocation": { # A location where metadata may be associated in a spreadsheet. # Limits the selected developer metadata to those entries associated with
              # the specified location.  This field either matches exact locations or all
              # intersecting locations according the specified
              # locationMatchingStrategy.
            "locationType": "A String", # The type of location this object represents.  This field is read-only.
            "dimensionRange": { # A range along a single dimension on a sheet. # Represents the row or column when metadata is associated with
                # a dimension. The specified DimensionRange must represent a single row
                # or column; it cannot be unbounded or span multiple rows or columns.
                # All indexes are zero-based.
                # Indexes are half open: the start index is inclusive
                # and the end index is exclusive.
                # Missing indexes indicate the range is unbounded on that side.
              "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
              "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
              "sheetId": 42, # The sheet this span is on.
              "dimension": "A String", # The dimension of the span.
            },
            "spreadsheet": True or False, # True when metadata is associated with an entire spreadsheet.
            "sheetId": 42, # The ID of the sheet when metadata is associated with an entire sheet.
          },
          "metadataValue": "A String", # Limits the selected developer metadata to that which has a matching
              # DeveloperMetadata.metadata_value.
          "locationMatchingStrategy": "A String", # Determines how this lookup matches the location.  If this field is
              # specified as EXACT, only developer metadata associated on the exact
              # location specified is matched.  If this field is specified to INTERSECTING,
              # developer metadata associated on intersecting locations is also
              # matched.  If left unspecified, this field assumes a default value of
              # INTERSECTING.
              # If this field is specified, a metadataLocation
              # must also be specified.
          "locationType": "A String", # Limits the selected developer metadata to those entries which are
              # associated with locations of the specified type.  For example, when this
              # field is specified as ROW this lookup
              # only considers developer metadata associated on rows.  If the field is left
              # unspecified, all location types are considered.  This field cannot be
              # specified as SPREADSHEET when
              # the locationMatchingStrategy
              # is specified as INTERSECTING or when the
              # metadataLocation is specified as a
              # non-spreadsheet location: spreadsheet metadata cannot intersect any other
              # developer metadata location.  This field also must be left unspecified when
              # the locationMatchingStrategy
              # is specified as EXACT.
          "metadataId": 42, # Limits the selected developer metadata to that which has a matching
              # DeveloperMetadata.metadata_id.
          "visibility": "A String", # Limits the selected developer metadata to that which has a matching
              # DeveloperMetadata.visibility.  If left unspecified, all developer
              # metadata visibile to the requesting project is considered.
          "metadataKey": "A String", # Limits the selected developer metadata to that which has a matching
              # DeveloperMetadata.metadata_key.
        },
        "a1Range": "A String", # Selects data that matches the specified A1 range.
        "gridRange": { # A range on a sheet. # Selects data that matches the range described by the GridRange.
            # All indexes are zero-based.
            # Indexes are half open, e.g the start index is inclusive
            # and the end index is exclusive -- [start_index, end_index).
            # Missing indexes indicate the range is unbounded on that side.
            #
            # For example, if `"Sheet1"` is sheet ID 0, then:
            #
            #   `Sheet1!A1:A1 == sheet_id: 0,
            #                   start_row_index: 0, end_row_index: 1,
            #                   start_column_index: 0, end_column_index: 1`
            #
            #   `Sheet1!A3:B4 == sheet_id: 0,
            #                   start_row_index: 2, end_row_index: 4,
            #                   start_column_index: 0, end_column_index: 2`
            #
            #   `Sheet1!A:B == sheet_id: 0,
            #                 start_column_index: 0, end_column_index: 2`
            #
            #   `Sheet1!A5:B == sheet_id: 0,
            #                  start_row_index: 4,
            #                  start_column_index: 0, end_column_index: 2`
            #
            #   `Sheet1 == sheet_id:0`
            #
            # The start index must always be less than or equal to the end index.
            # If the start index equals the end index, then the range is empty.
            # Empty ranges are typically not meaningful and are usually rendered in the
            # UI as `#REF!`.
          "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
          "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
          "sheetId": 42, # The sheet this range is on.
          "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
          "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
        },
      },
    ],
  }

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A reply to a developer metadata search request.
    "matchedDeveloperMetadata": [ # The metadata matching the criteria of the search request.
      { # A developer metadata entry and the data filters specified in the original
          # request that matched it.
        "dataFilters": [ # All filters matching the returned developer metadata.
          { # Filter that describes what data should be selected or returned from a
              # request.
            "developerMetadataLookup": { # Selects DeveloperMetadata that matches all of the specified fields.  For # Selects data associated with the developer metadata matching the criteria
                # described by this DeveloperMetadataLookup.
                # example, if only a metadata ID is specified this considers the
                # DeveloperMetadata with that particular unique ID. If a metadata key is
                # specified, this considers all developer metadata with that key.  If a
                # key, visibility, and location type are all specified, this considers all
                # developer metadata with that key and visibility that are associated with a
                # location of that type.  In general, this
                # selects all DeveloperMetadata that matches the intersection of all the
                # specified fields; any field or combination of fields may be specified.
              "metadataLocation": { # A location where metadata may be associated in a spreadsheet. # Limits the selected developer metadata to those entries associated with
                  # the specified location.  This field either matches exact locations or all
                  # intersecting locations according the specified
                  # locationMatchingStrategy.
                "locationType": "A String", # The type of location this object represents.  This field is read-only.
                "dimensionRange": { # A range along a single dimension on a sheet. # Represents the row or column when metadata is associated with
                    # a dimension. The specified DimensionRange must represent a single row
                    # or column; it cannot be unbounded or span multiple rows or columns.
                    # All indexes are zero-based.
                    # Indexes are half open: the start index is inclusive
                    # and the end index is exclusive.
                    # Missing indexes indicate the range is unbounded on that side.
                  "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
                  "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
                  "sheetId": 42, # The sheet this span is on.
                  "dimension": "A String", # The dimension of the span.
                },
                "spreadsheet": True or False, # True when metadata is associated with an entire spreadsheet.
                "sheetId": 42, # The ID of the sheet when metadata is associated with an entire sheet.
              },
              "metadataValue": "A String", # Limits the selected developer metadata to that which has a matching
                  # DeveloperMetadata.metadata_value.
              "locationMatchingStrategy": "A String", # Determines how this lookup matches the location.  If this field is
                  # specified as EXACT, only developer metadata associated on the exact
                  # location specified is matched.  If this field is specified to INTERSECTING,
                  # developer metadata associated on intersecting locations is also
                  # matched.  If left unspecified, this field assumes a default value of
                  # INTERSECTING.
                  # If this field is specified, a metadataLocation
                  # must also be specified.
              "locationType": "A String", # Limits the selected developer metadata to those entries which are
                  # associated with locations of the specified type.  For example, when this
                  # field is specified as ROW this lookup
                  # only considers developer metadata associated on rows.  If the field is left
                  # unspecified, all location types are considered.  This field cannot be
                  # specified as SPREADSHEET when
                  # the locationMatchingStrategy
                  # is specified as INTERSECTING or when the
                  # metadataLocation is specified as a
                  # non-spreadsheet location: spreadsheet metadata cannot intersect any other
                  # developer metadata location.  This field also must be left unspecified when
                  # the locationMatchingStrategy
                  # is specified as EXACT.
              "metadataId": 42, # Limits the selected developer metadata to that which has a matching
                  # DeveloperMetadata.metadata_id.
              "visibility": "A String", # Limits the selected developer metadata to that which has a matching
                  # DeveloperMetadata.visibility.  If left unspecified, all developer
                  # metadata visibile to the requesting project is considered.
              "metadataKey": "A String", # Limits the selected developer metadata to that which has a matching
                  # DeveloperMetadata.metadata_key.
            },
            "a1Range": "A String", # Selects data that matches the specified A1 range.
            "gridRange": { # A range on a sheet. # Selects data that matches the range described by the GridRange.
                # All indexes are zero-based.
                # Indexes are half open, e.g the start index is inclusive
                # and the end index is exclusive -- [start_index, end_index).
                # Missing indexes indicate the range is unbounded on that side.
                #
                # For example, if `"Sheet1"` is sheet ID 0, then:
                #
                #   `Sheet1!A1:A1 == sheet_id: 0,
                #                   start_row_index: 0, end_row_index: 1,
                #                   start_column_index: 0, end_column_index: 1`
                #
                #   `Sheet1!A3:B4 == sheet_id: 0,
                #                   start_row_index: 2, end_row_index: 4,
                #                   start_column_index: 0, end_column_index: 2`
                #
                #   `Sheet1!A:B == sheet_id: 0,
                #                 start_column_index: 0, end_column_index: 2`
                #
                #   `Sheet1!A5:B == sheet_id: 0,
                #                  start_row_index: 4,
                #                  start_column_index: 0, end_column_index: 2`
                #
                #   `Sheet1 == sheet_id:0`
                #
                # The start index must always be less than or equal to the end index.
                # If the start index equals the end index, then the range is empty.
                # Empty ranges are typically not meaningful and are usually rendered in the
                # UI as `#REF!`.
              "endRowIndex": 42, # The end row (exclusive) of the range, or not set if unbounded.
              "endColumnIndex": 42, # The end column (exclusive) of the range, or not set if unbounded.
              "sheetId": 42, # The sheet this range is on.
              "startColumnIndex": 42, # The start column (inclusive) of the range, or not set if unbounded.
              "startRowIndex": 42, # The start row (inclusive) of the range, or not set if unbounded.
            },
          },
        ],
        "developerMetadata": { # Developer metadata associated with a location or object in a spreadsheet. # The developer metadata matching the specified filters.
            # Developer metadata may be used to associate arbitrary data with various
            # parts of a spreadsheet and will remain associated at those locations as they
            # move around and the spreadsheet is edited.  For example, if developer
            # metadata is associated with row 5 and another row is then subsequently
            # inserted above row 5, that original metadata will still be associated with
            # the row it was first associated with (what is now row 6). If the associated
            # object is deleted its metadata is deleted too.
          "metadataId": 42, # The spreadsheet-scoped unique ID that identifies the metadata. IDs may be
              # specified when metadata is created, otherwise one will be randomly
              # generated and assigned. Must be positive.
          "metadataValue": "A String", # Data associated with the metadata's key.
          "location": { # A location where metadata may be associated in a spreadsheet. # The location where the metadata is associated.
            "locationType": "A String", # The type of location this object represents.  This field is read-only.
            "dimensionRange": { # A range along a single dimension on a sheet. # Represents the row or column when metadata is associated with
                # a dimension. The specified DimensionRange must represent a single row
                # or column; it cannot be unbounded or span multiple rows or columns.
                # All indexes are zero-based.
                # Indexes are half open: the start index is inclusive
                # and the end index is exclusive.
                # Missing indexes indicate the range is unbounded on that side.
              "endIndex": 42, # The end (exclusive) of the span, or not set if unbounded.
              "startIndex": 42, # The start (inclusive) of the span, or not set if unbounded.
              "sheetId": 42, # The sheet this span is on.
              "dimension": "A String", # The dimension of the span.
            },
            "spreadsheet": True or False, # True when metadata is associated with an entire spreadsheet.
            "sheetId": 42, # The ID of the sheet when metadata is associated with an entire sheet.
          },
          "visibility": "A String", # The metadata visibility.  Developer metadata must always have a visibility
              # specified.
          "metadataKey": "A String", # The metadata key. There may be multiple metadata in a spreadsheet with the
              # same key.  Developer metadata must always have a key specified.
        },
      },
    ],
  }