{
  "swagger": "2.0",
  "info": {
    "title": "Series metadata service",
    "version": "0.1507.0",
    "description": "Send your API key as a bearer token: `Authorization: Bearer <api key>`."
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Your API key as a bearer token: `Authorization: Bearer <api key>`."
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/timeseries/archetype/v1/series-archetype/batch-get": {
      "post": {
        "operationId": "SeriesMetadataService_batchGet",
        "summary": "Batch get",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Batch get series metadata by DataSourceRid.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/BatchGetSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "datasources": [
                "<data source rid>"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BatchGetSeriesMetadataResponse"
            },
            "x-example": {
              "responses": {
                "<key>": [
                  {
                    "rid": "<series metadata rid>",
                    "channel": "<channel>",
                    "dataSourceRid": "<data source rid>",
                    "locator": {
                      "type": "timescaleDb",
                      "timescaleDb": {
                        "table": "<table name>",
                        "schema": "<schema name>",
                        "column": "<column name>",
                        "timeColumn": "<column name>",
                        "type": "BOOLEAN"
                      }
                    },
                    "unit": "<unit>",
                    "description": "<description>",
                    "tags": {
                      "<key>": "<tag value>"
                    },
                    "seriesDataType": "DOUBLE",
                    "channelKind": "STANDARD"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype": {
      "post": {
        "operationId": "SeriesMetadataService_create",
        "summary": "Create",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Create new series metadata.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CreateSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "channel": "<channel>",
              "dataSourceRid": "<data source rid>",
              "locator": {
                "type": "timescaleDb",
                "timescaleDb": {
                  "table": "<table name>",
                  "schema": "<schema name>",
                  "column": "<column name>",
                  "timeColumn": "<column name>",
                  "type": "BOOLEAN"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/batch-create": {
      "post": {
        "operationId": "SeriesMetadataService_batchCreate",
        "summary": "Batch create",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Idempotently creates series metadata.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/BatchCreateSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "requests": [
                {
                  "channel": "<channel>",
                  "dataSourceRid": "<data source rid>",
                  "locator": {
                    "type": "timescaleDb",
                    "timescaleDb": {
                      "table": "<table name>",
                      "schema": "<schema name>",
                      "column": "<column name>",
                      "timeColumn": "<column name>",
                      "type": "BOOLEAN"
                    }
                  }
                }
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/create-or-update": {
      "post": {
        "operationId": "SeriesMetadataService_createOrUpdate",
        "summary": "Create or update",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Upserts series metadata. Creates new series metadata if it does not exist for the given channel and data source. If it already exists, updates the locator and any provided unit and description fields while preserving existing values for fields not supplied.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CreateSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "channel": "<channel>",
              "dataSourceRid": "<data source rid>",
              "locator": {
                "type": "timescaleDb",
                "timescaleDb": {
                  "table": "<table name>",
                  "schema": "<schema name>",
                  "column": "<column name>",
                  "timeColumn": "<column name>",
                  "type": "BOOLEAN"
                }
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/batch-create-or-update": {
      "post": {
        "operationId": "SeriesMetadataService_batchCreateOrUpdate",
        "summary": "Batch create or update",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Batch version of createOrUpdate.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/BatchCreateSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "requests": [
                {
                  "channel": "<channel>",
                  "dataSourceRid": "<data source rid>",
                  "locator": {
                    "type": "timescaleDb",
                    "timescaleDb": {
                      "table": "<table name>",
                      "schema": "<schema name>",
                      "column": "<column name>",
                      "timeColumn": "<column name>",
                      "type": "BOOLEAN"
                    }
                  }
                }
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/{rid}": {
      "get": {
        "operationId": "SeriesMetadataService_get",
        "summary": "Get",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Get series metadata from its series metadata rid.",
        "parameters": [
          {
            "name": "rid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "SeriesMetadataRid",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/SeriesMetadata"
            },
            "x-example": {
              "rid": "<series metadata rid>",
              "channel": "<channel>",
              "dataSourceRid": "<data source rid>",
              "locator": {
                "type": "timescaleDb",
                "timescaleDb": {
                  "table": "<table name>",
                  "schema": "<schema name>",
                  "column": "<column name>",
                  "timeColumn": "<column name>",
                  "type": "BOOLEAN"
                }
              },
              "unit": "<unit>",
              "description": "<description>",
              "tags": {
                "<key>": "<tag value>"
              },
              "seriesDataType": "DOUBLE",
              "channelKind": "STANDARD"
            }
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/{rid}/metadata": {
      "post": {
        "operationId": "SeriesMetadataService_updateMetadata",
        "summary": "Update metadata",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Update existing series metadata. Throws SeriesMetadataNotFound if the series metadata does not exist.",
        "parameters": [
          {
            "name": "rid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "SeriesMetadataRid",
            "required": true
          },
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/UpdateSeriesMetadataRequest"
            },
            "required": true,
            "x-example": {
              "unit": "<unit>",
              "unitUpdate": {
                "type": "unit",
                "unit": "<unit>"
              },
              "description": "<description>",
              "channelKind": "STANDARD"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/SeriesMetadata"
            },
            "x-example": {
              "rid": "<series metadata rid>",
              "channel": "<channel>",
              "dataSourceRid": "<data source rid>",
              "locator": {
                "type": "timescaleDb",
                "timescaleDb": {
                  "table": "<table name>",
                  "schema": "<schema name>",
                  "column": "<column name>",
                  "timeColumn": "<column name>",
                  "type": "BOOLEAN"
                }
              },
              "unit": "<unit>",
              "description": "<description>",
              "tags": {
                "<key>": "<tag value>"
              },
              "seriesDataType": "DOUBLE",
              "channelKind": "STANDARD"
            }
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/change-data-type": {
      "post": {
        "operationId": "SeriesMetadataService_changeDataType",
        "summary": "Change data type",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "This endpoint lets an authorized workspace caller change how one nominal dataset channel is interpreted. This updates metadata and future series resolution. It does not rewrite historical point rows.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/ChangeDataTypeRequest"
            },
            "required": true,
            "x-example": {
              "dataSourceRid": "<data source rid>",
              "channel": "<channel>",
              "expectedCurrentType": "DOUBLE",
              "newType": "DOUBLE"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ChangeDataTypeResponse"
            },
            "x-example": {
              "seriesMetadataRid": "<series metadata rid>",
              "oldType": "DOUBLE",
              "newType": "DOUBLE"
            }
          }
        }
      }
    },
    "/timeseries/archetype/v1/series-archetype/video-channel": {
      "post": {
        "operationId": "SeriesMetadataService_batchCreateVideoSeries",
        "summary": "Batch create video series",
        "tags": [
          "Series Metadata Service"
        ],
        "description": "Batch creates series metadata for video channels if they don't exist. Idempotent - returns existing SeriesMetadataRid if already exists.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/BatchCreateVideoSeriesRequest"
            },
            "required": true,
            "x-example": {
              "requests": [
                {
                  "datasetRid": "<dataset rid>",
                  "channel": "<channel>",
                  "timeBounds": {
                    "start": {
                      "seconds": 1,
                      "nanos": 1
                    },
                    "end": {
                      "seconds": 1,
                      "nanos": 1
                    }
                  }
                }
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/BatchCreateVideoSeriesResponse"
            },
            "x-example": {
              "responses": [
                {
                  "seriesMetadataRid": "<series metadata rid>",
                  "seriesUuid": "<series uuid>"
                }
              ]
            }
          }
        }
      }
    }
  },
  "definitions": {
    "ChannelKind": {
      "description": "Classifies how a channel is used. COMMAND channels accept commands through the Command Service.",
      "type": "string",
      "enum": [
        "STANDARD",
        "COMMAND"
      ]
    },
    "Empty": {
      "type": "object",
      "properties": {}
    },
    "SeriesDataType": {
      "description": "The data types that are available for querying.",
      "type": "string",
      "enum": [
        "DOUBLE",
        "STRING",
        "LOG",
        "INT",
        "UINT",
        "DOUBLE_ARRAY",
        "STRING_ARRAY",
        "STRUCT",
        "VIDEO",
        "SPATIAL"
      ]
    },
    "Timestamp": {
      "description": "Deprecated for new APIs. Use google.protobuf.Timestamp for absolute instants in proto APIs.\n\nThis legacy nanosecond precision timestamp type is represented by an epoch time in seconds and a nanosecond offset. The nanosecond offset is from the start of the epoch second, so must be less than 1 billion.",
      "type": "object",
      "properties": {
        "seconds": {
          "type": "integer",
          "format": "int64"
        },
        "nanos": {
          "type": "integer",
          "format": "int64"
        }
      },
      "required": [
        "seconds",
        "nanos"
      ]
    },
    "NominalDataType": {
      "description": "The data types supported by Nominal's database.",
      "type": "string",
      "enum": [
        "DOUBLE",
        "STRING",
        "LOG",
        "INT64",
        "UINT64",
        "DOUBLE_ARRAY",
        "STRING_ARRAY",
        "STRUCT",
        "VIDEO",
        "SPATIAL"
      ]
    },
    "BigQueryType": {
      "type": "string",
      "enum": [
        "DOUBLE",
        "STRING"
      ]
    },
    "InfluxType": {
      "type": "string",
      "enum": [
        "BOOLEAN",
        "NUMERIC",
        "STRING"
      ]
    },
    "TimescaleType": {
      "type": "string",
      "enum": [
        "BOOLEAN",
        "DOUBLE",
        "STRING"
      ]
    },
    "TimestreamType": {
      "type": "string",
      "enum": [
        "DOUBLE",
        "STRING"
      ]
    },
    "UnitUpdate": {
      "description": "UnitUpdate is used to either set a unit, or to clear an existing unit.\n\nSet `type` to the name of one of the other fields, and set only that field.",
      "type": "object",
      "x-union": true,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "unit",
            "clearUnit"
          ]
        },
        "unit": {
          "type": "string",
          "x-alias": "Unit"
        },
        "clearUnit": {
          "$ref": "#/definitions/Empty"
        }
      },
      "required": [
        "type"
      ],
      "example": {
        "type": "unit",
        "unit": "string"
      }
    },
    "VisualCrossingEndpointUri": {
      "type": "string",
      "enum": [
        "HISTORY",
        "TIMELINE"
      ]
    },
    "VisualCrossingType": {
      "type": "string",
      "enum": [
        "DOUBLE",
        "STRING"
      ]
    },
    "BatchCreateSeriesMetadataRequest": {
      "type": "object",
      "properties": {
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CreateSeriesMetadataRequest"
          }
        }
      },
      "example": {
        "requests": [
          {
            "channel": "<channel>",
            "dataSourceRid": "<data source rid>",
            "locator": {
              "type": "timescaleDb",
              "timescaleDb": {
                "table": "<table name>",
                "schema": "<schema name>",
                "column": "<column name>",
                "timeColumn": "<column name>",
                "type": "BOOLEAN"
              }
            }
          }
        ]
      }
    },
    "BatchCreateVideoSeriesRequest": {
      "type": "object",
      "properties": {
        "requests": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CreateVideoSeriesRequest"
          }
        }
      },
      "example": {
        "requests": [
          {
            "datasetRid": "<dataset rid>",
            "channel": "<channel>",
            "timeBounds": {
              "start": {
                "seconds": 1,
                "nanos": 1
              },
              "end": {
                "seconds": 1,
                "nanos": 1
              }
            }
          }
        ]
      }
    },
    "BatchCreateVideoSeriesResponse": {
      "type": "object",
      "properties": {
        "responses": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CreateVideoSeriesResponse"
          }
        }
      }
    },
    "BatchGetSeriesMetadataRequest": {
      "type": "object",
      "properties": {
        "datasources": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "rid",
            "x-alias": "DataSourceRid"
          },
          "uniqueItems": true
        }
      },
      "example": {
        "datasources": [
          "<data source rid>"
        ]
      }
    },
    "BatchGetSeriesMetadataResponse": {
      "type": "object",
      "properties": {
        "responses": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/SeriesMetadata"
            },
            "uniqueItems": true
          },
          "x-map-key": "DataSourceRid"
        }
      }
    },
    "BigQueryLocatorTemplate": {
      "type": "object",
      "properties": {
        "valueColumn": {
          "type": "string",
          "x-alias": "ColumnName"
        },
        "timeColumn": {
          "type": "string",
          "x-alias": "ColumnName"
        },
        "type": {
          "$ref": "#/definitions/BigQueryType"
        }
      },
      "required": [
        "valueColumn",
        "timeColumn",
        "type"
      ]
    },
    "ChangeDataTypeRequest": {
      "description": "This request changes the nominal data type used for one channel in one data source. The operator is expected to be a workspace admin for the workspace containing the data source. The request includes the expected current type so retries and stale caller intent fail visibly.",
      "type": "object",
      "properties": {
        "dataSourceRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "DataSourceRid",
          "description": "Identifies the data source whose channel metadata should be changed."
        },
        "channel": {
          "type": "string",
          "x-alias": "Channel",
          "description": "Identifies the channel name within the data source."
        },
        "expectedCurrentType": {
          "allOf": [
            {
              "$ref": "#/definitions/NominalDataType"
            }
          ],
          "description": "Provides the exact nominal type the caller expects to be stored in the locator before the change."
        },
        "newType": {
          "allOf": [
            {
              "$ref": "#/definitions/NominalDataType"
            }
          ],
          "description": "Provides the exact nominal type future series resolution should use."
        }
      },
      "required": [
        "dataSourceRid",
        "channel",
        "expectedCurrentType",
        "newType"
      ],
      "example": {
        "dataSourceRid": "<data source rid>",
        "channel": "<channel>",
        "expectedCurrentType": "DOUBLE",
        "newType": "DOUBLE"
      }
    },
    "ChangeDataTypeResponse": {
      "description": "This response identifies the series metadata row and nominal types from the applied change.",
      "type": "object",
      "properties": {
        "seriesMetadataRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "SeriesMetadataRid",
          "description": "Identifies the series metadata row being changed."
        },
        "oldType": {
          "allOf": [
            {
              "$ref": "#/definitions/NominalDataType"
            }
          ],
          "description": "Reports the exact nominal type read from the existing locator."
        },
        "newType": {
          "allOf": [
            {
              "$ref": "#/definitions/NominalDataType"
            }
          ],
          "description": "Reports the exact nominal type requested by the caller."
        }
      },
      "required": [
        "seriesMetadataRid",
        "oldType",
        "newType"
      ]
    },
    "CreateSeriesMetadataRequest": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "x-alias": "Channel",
          "description": "This name should be unique amongst SeriesMetadata within the data source. All series created from this metadata will share this name."
        },
        "dataSourceRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "DataSourceRid"
        },
        "locator": {
          "$ref": "#/definitions/LocatorTemplate"
        },
        "unit": {
          "type": "string",
          "x-alias": "Unit"
        },
        "description": {
          "type": "string"
        },
        "channelKind": {
          "allOf": [
            {
              "$ref": "#/definitions/ChannelKind"
            }
          ],
          "description": "Classifies how the channel is used. Omitted values default to STANDARD."
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "x-alias": "TagValue"
          },
          "x-map-key": "TagName",
          "description": "Tags specified here will take precedence over tags specified in the RunDatasource, in the case that both specify the same TagName.",
          "x-deprecated": "Deprecated. Should not be used."
        }
      },
      "required": [
        "channel",
        "dataSourceRid",
        "locator"
      ],
      "example": {
        "channel": "<channel>",
        "dataSourceRid": "<data source rid>",
        "locator": {
          "type": "timescaleDb",
          "timescaleDb": {
            "table": "<table name>",
            "schema": "<schema name>",
            "column": "<column name>",
            "timeColumn": "<column name>",
            "type": "BOOLEAN"
          }
        }
      }
    },
    "CreateVideoSeriesRequest": {
      "description": "Creates series and metadata for a video channel if it doesn't exist. Returns the SeriesMetadataRid of the created or existing series metadata.",
      "type": "object",
      "properties": {
        "datasetRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "DatasetRid"
        },
        "channel": {
          "type": "string",
          "x-alias": "Channel"
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "x-alias": "TagValue"
          },
          "x-map-key": "TagName"
        },
        "timeBounds": {
          "$ref": "#/definitions/TimeBounds"
        }
      },
      "required": [
        "datasetRid",
        "channel",
        "timeBounds"
      ]
    },
    "CreateVideoSeriesResponse": {
      "type": "object",
      "properties": {
        "seriesMetadataRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "SeriesMetadataRid"
        },
        "seriesUuid": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "seriesMetadataRid",
        "seriesUuid"
      ]
    },
    "Influx1LocatorTemplate": {
      "type": "object",
      "properties": {
        "database": {
          "type": "string",
          "x-alias": "DatabaseName"
        },
        "measurement": {
          "type": "string",
          "x-alias": "MeasurementName"
        },
        "field": {
          "type": "string",
          "x-alias": "FieldName"
        },
        "type": {
          "$ref": "#/definitions/InfluxType"
        }
      },
      "required": [
        "database",
        "measurement",
        "field",
        "type"
      ]
    },
    "Influx2LocatorTemplate": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "x-alias": "BucketName"
        },
        "measurement": {
          "type": "string",
          "x-alias": "MeasurementName"
        },
        "valueColumn": {
          "type": "string",
          "description": "If omitted, defaults to `_value`. Can be used to extract tag values."
        },
        "field": {
          "type": "string",
          "x-alias": "FieldName"
        },
        "type": {
          "$ref": "#/definitions/InfluxType"
        }
      },
      "required": [
        "bucket",
        "measurement",
        "field",
        "type"
      ]
    },
    "LocatorTemplate": {
      "type": "object",
      "x-union": true,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "timescaleDb",
            "influx",
            "influx1",
            "nominal",
            "timestream",
            "visualCrossing",
            "bigQuery",
            "video",
            "spatial"
          ]
        },
        "timescaleDb": {
          "$ref": "#/definitions/TimescaleDbLocatorTemplate"
        },
        "influx": {
          "$ref": "#/definitions/Influx2LocatorTemplate"
        },
        "influx1": {
          "$ref": "#/definitions/Influx1LocatorTemplate"
        },
        "nominal": {
          "$ref": "#/definitions/NominalLocatorTemplate"
        },
        "timestream": {
          "$ref": "#/definitions/TimestreamLocatorTemplate"
        },
        "visualCrossing": {
          "$ref": "#/definitions/VisualCrossingLocatorTemplate"
        },
        "bigQuery": {
          "$ref": "#/definitions/BigQueryLocatorTemplate"
        },
        "video": {
          "$ref": "#/definitions/VideoLocatorTemplate"
        },
        "spatial": {
          "$ref": "#/definitions/SpatialLocatorTemplate"
        }
      },
      "required": [
        "type"
      ],
      "description": "Set `type` to the name of one of the other fields, and set only that field.",
      "example": {
        "type": "timescaleDb",
        "timescaleDb": {
          "table": "string",
          "schema": "string",
          "column": "string",
          "timeColumn": "string",
          "type": "BOOLEAN"
        }
      }
    },
    "NominalLocatorTemplate": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "x-alias": "Channel"
        },
        "type": {
          "$ref": "#/definitions/NominalDataType"
        }
      },
      "required": [
        "channel",
        "type"
      ]
    },
    "SeriesMetadata": {
      "type": "object",
      "properties": {
        "rid": {
          "type": "string",
          "format": "rid",
          "x-alias": "SeriesMetadataRid"
        },
        "channel": {
          "type": "string",
          "x-alias": "Channel"
        },
        "dataSourceRid": {
          "type": "string",
          "format": "rid",
          "x-alias": "DataSourceRid"
        },
        "locator": {
          "$ref": "#/definitions/LocatorTemplate"
        },
        "unit": {
          "type": "string",
          "x-alias": "Unit"
        },
        "description": {
          "type": "string"
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "x-alias": "TagValue"
          },
          "x-map-key": "TagName",
          "description": "Tags specified here will take precedence over tags specified in the RunDatasource, in the case that both specify the same TagName.",
          "x-deprecated": "Deprecated. Should not be used."
        },
        "seriesDataType": {
          "$ref": "#/definitions/SeriesDataType"
        },
        "channelKind": {
          "allOf": [
            {
              "$ref": "#/definitions/ChannelKind"
            }
          ],
          "description": "Classifies how the channel is used. Omitted values should be treated as STANDARD."
        }
      },
      "required": [
        "rid",
        "channel",
        "dataSourceRid",
        "locator"
      ]
    },
    "SpatialLocatorTemplate": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "x-alias": "Channel"
        }
      },
      "required": [
        "channel"
      ]
    },
    "TimeBounds": {
      "description": "Time bounds for the video file. Used to update the series time bounds",
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/definitions/Timestamp"
        },
        "end": {
          "$ref": "#/definitions/Timestamp"
        }
      },
      "required": [
        "start",
        "end"
      ]
    },
    "TimescaleDbLocatorTemplate": {
      "type": "object",
      "properties": {
        "table": {
          "type": "string",
          "x-alias": "TableName"
        },
        "schema": {
          "type": "string",
          "x-alias": "SchemaName"
        },
        "column": {
          "type": "string",
          "x-alias": "ColumnName"
        },
        "timeColumn": {
          "type": "string",
          "x-alias": "ColumnName"
        },
        "type": {
          "$ref": "#/definitions/TimescaleType"
        }
      },
      "required": [
        "table",
        "schema",
        "column",
        "timeColumn",
        "type"
      ]
    },
    "TimestreamLocatorTemplate": {
      "type": "object",
      "properties": {
        "table": {
          "type": "string",
          "x-alias": "TableName"
        },
        "measure": {
          "type": "string",
          "x-alias": "MeasureName"
        },
        "attribute": {
          "type": "string",
          "x-alias": "AttributeName"
        },
        "type": {
          "$ref": "#/definitions/TimestreamType"
        }
      },
      "required": [
        "table",
        "measure",
        "type"
      ]
    },
    "UpdateSeriesMetadataRequest": {
      "description": "If fields are present, will override existing values.",
      "type": "object",
      "properties": {
        "unit": {
          "type": "string",
          "x-alias": "Unit",
          "x-deprecated": "Deprecated. Use unitUpdate instead."
        },
        "unitUpdate": {
          "$ref": "#/definitions/UnitUpdate"
        },
        "description": {
          "type": "string"
        },
        "channelKind": {
          "allOf": [
            {
              "$ref": "#/definitions/ChannelKind"
            }
          ],
          "description": "Updates the channel kind. Omitted values preserve the current setting."
        }
      },
      "example": {
        "unit": "<unit>",
        "unitUpdate": {
          "type": "unit",
          "unit": "<unit>"
        },
        "description": "<description>",
        "channelKind": "STANDARD"
      }
    },
    "VideoLocatorTemplate": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "x-alias": "Channel"
        }
      },
      "required": [
        "channel"
      ]
    },
    "VisualCrossingLocatorTemplate": {
      "type": "object",
      "properties": {
        "field": {
          "type": "string",
          "x-alias": "FieldName"
        },
        "endpoint": {
          "allOf": [
            {
              "$ref": "#/definitions/VisualCrossingEndpointUri"
            }
          ],
          "description": "Defaults to HISTORY."
        },
        "type": {
          "$ref": "#/definitions/VisualCrossingType"
        }
      },
      "required": [
        "field",
        "type"
      ]
    }
  },
  "tags": [
    {
      "name": "Series Metadata Service",
      "x-displayName": "Series metadata service",
      "description": "[INTERNAL] Series metadata represents the constant information about data in a series - specifically, the name, units, a description, and the tags. Series metadata can be used to query points from specific series depending on the tag value selections.",
      "x-errors": [
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "SeriesMetadata:SeriesMetadataNotFound",
          "description": "The error supports both series metadata lookup shapes. RID-based lookups populate `rid`; channel lookups populate `dataSourceRid` and `channel`."
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "SeriesMetadata:DataSourcesNotFound"
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "SeriesMetadata:InvalidDataSource"
        },
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "SeriesMetadata:IncompatibleSeriesMetadataUpdate"
        }
      ]
    }
  ]
}
