# here-data-query-v1-client
The `query` service provides a way to get information (metadata) about layers and partitions stored in a catalog. This service exposes the metadata for single partitions that users can query one by one or by specifying a parent tile.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.3
- Package version: 1.2.105
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python >= 3.6

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import here_data_query_v1_client
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import here_data_query_v1_client
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import time
import here_data_query_v1_client
from pprint import pprint
from here_data_query_v1_client.api import query_api
from here_data_query_v1_client.model.index import Index
from here_data_query_v1_client.model.partitions import Partitions
# Defining the host is optional and defaults to http://Use API Lookup for a base URL
# See configuration.py for a list of all supported configuration parameters.
configuration = here_data_query_v1_client.Configuration(
    host = "http://Use API Lookup for a base URL"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Bearer
configuration = here_data_query_v1_client.Configuration(
    access_token = 'YOUR_BEARER_TOKEN'
)


# Enter a context with an instance of the API client
with here_data_query_v1_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = query_api.QueryApi(api_client)
    layer_id = "layerId_example" # str | The ID of the layer specified in the request. The value of this parameter must refer to a valid layer already configured in the catalog configuration. You can specify multiple layers as additional parameters.
partition = [
        "partition_example",
    ] # [str] | The partitions you want to include in the response. This allows you to limit the response to specific partitions. You can specify multiple partitions by using this parameter multiple times. The maximum number of partitions per call is 100.
start_version = "startVersion_example" # str | Start version for the catalog (exclusive). By convention -1 indicates the virtual initial version before the first publication which will have version 0. (optional)
end_version = "endVersion_example" # str | End version (inclusive). This has to be a valid catalog version greater than the startVersion. (optional)
since_time = 1 # int | Will return partitions whose data has been modified since this time, in milliseconds since epoch, inclusive. (optional)
additional_fields = [
        "dataSize",
    ] # [str] | Additional fields - `dataSize`, `checksum`, `compressedDataSize`, `crc`. (optional)
billing_tag = "billingTag_example" # str | Billing Tag is an optional free-form tag which is used for grouping billing records together. If supplied, it must be between 4 - 16 characters, contain only alpha/numeric ASCII characters  [A-Za-z0-9]. Grouping billing records by billing tag will be available in future releases. (optional)

    try:
        # Gets changes for the version or time range for the specific partition(s).
        api_response = api_instance.get_changes_by_id(layer_id, partition, start_version=start_version, end_version=end_version, since_time=since_time, additional_fields=additional_fields, billing_tag=billing_tag)
        pprint(api_response)
    except here_data_query_v1_client.ApiException as e:
        print("Exception when calling QueryApi->get_changes_by_id: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to *http://Use API Lookup for a base URL*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*QueryApi* | [**get_changes_by_id**](docs/QueryApi.md#get_changes_by_id) | **GET** /layers/{layerId}/changes | Gets changes for the version or time range for the specific partition(s).
*QueryApi* | [**get_partitions_by_id**](docs/QueryApi.md#get_partitions_by_id) | **GET** /layers/{layerId}/partitions | Gets metadata for the requested partitions
*QueryApi* | [**quad_tree_index**](docs/QueryApi.md#quad_tree_index) | **GET** /layers/{layerId}/versions/{version}/quadkeys/{quadKey}/depths/{depth} | Gets index metadata of versioned
*QueryApi* | [**quad_tree_index_volatile**](docs/QueryApi.md#quad_tree_index_volatile) | **GET** /layers/{layerId}/quadkeys/{quadKey}/depths/{depth} | Gets index metadata for volatile layers


## Documentation For Models

 - [Index](docs/Index.md)
 - [ParentQuad](docs/ParentQuad.md)
 - [Partition](docs/Partition.md)
 - [Partitions](docs/Partitions.md)
 - [SubQuad](docs/SubQuad.md)


## Documentation For Authorization


## Bearer

- **Type**: Bearer authentication (JWT)


## Author




## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in here_data_query_v1_client.apis and here_data_query_v1_client.models may fail with a
RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:

Solution 1:
Use specific imports for apis and models like:
- `from here_data_query_v1_client.api.default_api import DefaultApi`
- `from here_data_query_v1_client.model.pet import Pet`

Solution 2:
Before importing the package, adjust the maximum recursion limit as shown below:
```
import sys
sys.setrecursionlimit(1500)
import here_data_query_v1_client
from here_data_query_v1_client.apis import *
from here_data_query_v1_client.models import *
```

