upstream-api-client 0.1.9
Upstream Sensor Storage
Requires Python: >=3.9
Keywords: OpenAPI, OpenAPI-Generator, Upstream Sensor Storage

# upstream-api-client

Sensor Storage for Upstream data

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

- API version: 0.0.1
- Package version: 0.1.9
- Generator version: 7.14.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Updating the Generated Client

This repository is automatically generated from the OpenAPI specification. To update the client when the API changes:

1. Download the latest `openapi.json` from the API server and save it in the root directory
2. Run the generator using Docker (requires Docker to be installed):
   ```bash
   make openapi
   ```
3. Build the package:
   ```bash
   python -m build
   ```
4. Upload to PyPI:
   ```bash
   twine upload dist/* --config-file ~/.pypirc
   ```

### Setting up PyPI credentials

Create a `~/.pypirc` file with your PyPI credentials:

```ini
[distutils]
index-servers =
    pypi

[pypi]
username = __token__
password = pypi-your-api-token-here
```

Replace `pypi-your-api-token-here` with your actual PyPI API token. You can generate tokens at https://pypi.org/manage/account/token/.

## Requirements.

Python 3.9+

## Installation & Usage

### pip install

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

```sh
pip install upstream-api-client
```

(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/In-For-Disaster-Analytics/upstream-python-api-client.git`)

Then import the package:

```python
import upstream_api_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 upstream_api_client
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

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

```python

import upstream_api_client
from upstream_api_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = upstream_api_client.Configuration(
    host = "http://localhost"
)



# Enter a context with an instance of the API client
with upstream_api_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = upstream_api_client.AuthApi(api_client)
    username = 'username_example' # str |
    password = 'password_example' # str |
    grant_type = 'grant_type_example' # str |  (optional)
    scope = '' # str |  (optional) (default to '')
    client_id = 'client_id_example' # str |  (optional)
    client_secret = 'client_secret_example' # str |  (optional)

    try:
        # Login
        api_response = api_instance.login_api_v1_token_post(username, password, grant_type=grant_type, scope=scope, client_id=client_id, client_secret=client_secret)
        print("The response of AuthApi->login_api_v1_token_post:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AuthApi->login_api_v1_token_post: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to _http://localhost_

| Class                | Method                                                                                                                                                                                                                                                                                                                                 | HTTP request                                                                                                        | Description                                |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| _AuthApi_            | [**login_api_v1_token_post**](docs/AuthApi.md#login_api_v1_token_post)                                                                                                                                                                                                                                                                 | **POST** /api/v1/token                                                                                              | Login                                      |
| _CampaignsApi_       | [**create_campaign_api_v1_campaigns_post**](docs/CampaignsApi.md#create_campaign_api_v1_campaigns_post)                                                                                                                                                                                                                                | **POST** /api/v1/campaigns                                                                                          | Create Campaign                            |
| _CampaignsApi_       | [**delete_sensor_api_v1_campaigns_campaign_id_delete**](docs/CampaignsApi.md#delete_sensor_api_v1_campaigns_campaign_id_delete)                                                                                                                                                                                                        | **DELETE** /api/v1/campaigns/{campaign_id}                                                                          | Delete Sensor                              |
| _CampaignsApi_       | [**get_campaign_api_v1_campaigns_campaign_id_get**](docs/CampaignsApi.md#get_campaign_api_v1_campaigns_campaign_id_get)                                                                                                                                                                                                                | **GET** /api/v1/campaigns/{campaign_id}                                                                             | Get Campaign                               |
| _CampaignsApi_       | [**list_campaigns_api_v1_campaigns_get**](docs/CampaignsApi.md#list_campaigns_api_v1_campaigns_get)                                                                                                                                                                                                                                    | **GET** /api/v1/campaigns                                                                                           | List Campaigns                             |
| _CampaignsApi_       | [**partial_update_campaign_api_v1_campaigns_campaign_id_patch**](docs/CampaignsApi.md#partial_update_campaign_api_v1_campaigns_campaign_id_patch)                                                                                                                                                                                      | **PATCH** /api/v1/campaigns/{campaign_id}                                                                           | Partial Update Campaign                    |
| _CampaignsApi_       | [**update_campaign_api_v1_campaigns_campaign_id_put**](docs/CampaignsApi.md#update_campaign_api_v1_campaigns_campaign_id_put)                                                                                                                                                                                                          | **PUT** /api/v1/campaigns/{campaign_id}                                                                             | Update Campaign                            |
| _MeasurementsApi_    | [**create_measurement_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_post**](docs/MeasurementsApi.md#create_measurement_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_post)                                                                                         | **POST** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements                     | Create Measurement                         |
| _MeasurementsApi_    | [**delete_sensor_measurements_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_delete**](docs/MeasurementsApi.md#delete_sensor_measurements_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_delete)                                                                     | **DELETE** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements                   | Delete Sensor Measurements                 |
| _MeasurementsApi_    | [**get_measurements_with_confidence_intervals_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_confidence_intervals_get**](docs/MeasurementsApi.md#get_measurements_with_confidence_intervals_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_confidence_intervals_get) | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements/confidence-intervals | Get Measurements With Confidence Intervals |
| _MeasurementsApi_    | [**get_sensor_measurements_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_get**](docs/MeasurementsApi.md#get_sensor_measurements_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_get)                                                                                 | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements                      | Get Sensor Measurements                    |
| _MeasurementsApi_    | [**partial_update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_measurement_id_patch**](docs/MeasurementsApi.md#partial_update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_measurement_id_patch)                                                   | **PATCH** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements/{measurement_id}   | Partial Update Sensor                      |
| _MeasurementsApi_    | [**update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_measurement_id_put**](docs/MeasurementsApi.md#update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_measurements_measurement_id_put)                                                                       | **PUT** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/measurements/{measurement_id}     | Update Sensor                              |
| _ProjectsApi_        | [**get_project_members_for_user_api_v1_projects_project_id_members_get**](docs/ProjectsApi.md#get_project_members_for_user_api_v1_projects_project_id_members_get)                                                                                                                                                                     | **GET** /api/v1/projects/{project_id}/members                                                                       | Get Project Members For User               |
| _ProjectsApi_        | [**get_projects_api_v1_projects_get**](docs/ProjectsApi.md#get_projects_api_v1_projects_get)                                                                                                                                                                                                                                           | **GET** /api/v1/projects                                                                                            | Get Projects                               |
| _SensorVariablesApi_ | [**list_sensor_variables_api_v1_sensor_variables_get**](docs/SensorVariablesApi.md#list_sensor_variables_api_v1_sensor_variables_get)                                                                                                                                                                                                  | **GET** /api/v1/sensor_variables                                                                                    | List Sensor Variables                      |
| _SensorsApi_         | [**delete_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_delete**](docs/SensorsApi.md#delete_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_delete)                                                                                                                                                  | **DELETE** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors                                            | Delete Sensor                              |
| _SensorsApi_         | [**force_update_sensor_statistics_api_v1_campaigns_campaign_id_stations_station_id_sensors_statistics_post**](docs/SensorsApi.md#force_update_sensor_statistics_api_v1_campaigns_campaign_id_stations_station_id_sensors_statistics_post)                                                                                              | **POST** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/statistics                                   | Force Update Sensor Statistics             |
| _SensorsApi_         | [**force_update_single_sensor_statistics_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_statistics_post**](docs/SensorsApi.md#force_update_single_sensor_statistics_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_statistics_post)                                                            | **POST** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}/statistics                       | Force Update Single Sensor Statistics      |
| _SensorsApi_         | [**get_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_get**](docs/SensorsApi.md#get_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_get)                                                                                                                                          | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}                                   | Get Sensor                                 |
| _SensorsApi_         | [**list_sensors_api_v1_campaigns_campaign_id_stations_station_id_sensors_get**](docs/SensorsApi.md#list_sensors_api_v1_campaigns_campaign_id_stations_station_id_sensors_get)                                                                                                                                                          | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors                                               | List Sensors                               |
| _SensorsApi_         | [**partial_update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_patch**](docs/SensorsApi.md#partial_update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_patch)                                                                                                                | **PATCH** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}                                 | Partial Update Sensor                      |
| _SensorsApi_         | [**update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_put**](docs/SensorsApi.md#update_sensor_api_v1_campaigns_campaign_id_stations_station_id_sensors_sensor_id_put)                                                                                                                                    | **PUT** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/{sensor_id}                                   | Update Sensor                              |
| _StationsApi_        | [**create_station_api_v1_campaigns_campaign_id_stations_post**](docs/StationsApi.md#create_station_api_v1_campaigns_campaign_id_stations_post)                                                                                                                                                                                         | **POST** /api/v1/campaigns/{campaign_id}/stations                                                                   | Create Station                             |
| _StationsApi_        | [**delete_sensor_api_v1_campaigns_campaign_id_stations_delete**](docs/StationsApi.md#delete_sensor_api_v1_campaigns_campaign_id_stations_delete)                                                                                                                                                                                       | **DELETE** /api/v1/campaigns/{campaign_id}/stations                                                                 | Delete Sensor                              |
| _StationsApi_        | [**export_measurements_csv_api_v1_campaigns_campaign_id_stations_station_id_measurements_export_get**](docs/StationsApi.md#export_measurements_csv_api_v1_campaigns_campaign_id_stations_station_id_measurements_export_get)                                                                                                           | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/measurements/export                                   | Export Measurements Csv                    |
| _StationsApi_        | [**export_sensors_csv_api_v1_campaigns_campaign_id_stations_station_id_sensors_export_get**](docs/StationsApi.md#export_sensors_csv_api_v1_campaigns_campaign_id_stations_station_id_sensors_export_get)                                                                                                                               | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}/sensors/export                                        | Export Sensors Csv                         |
| _StationsApi_        | [**get_station_api_v1_campaigns_campaign_id_stations_station_id_get**](docs/StationsApi.md#get_station_api_v1_campaigns_campaign_id_stations_station_id_get)                                                                                                                                                                           | **GET** /api/v1/campaigns/{campaign_id}/stations/{station_id}                                                       | Get Station                                |
| _StationsApi_        | [**list_stations_api_v1_campaigns_campaign_id_stations_get**](docs/StationsApi.md#list_stations_api_v1_campaigns_campaign_id_stations_get)                                                                                                                                                                                             | **GET** /api/v1/campaigns/{campaign_id}/stations                                                                    | List Stations                              |
| _StationsApi_        | [**partial_update_station_api_v1_campaigns_campaign_id_stations_station_id_patch**](docs/StationsApi.md#partial_update_station_api_v1_campaigns_campaign_id_stations_station_id_patch)                                                                                                                                                 | **PATCH** /api/v1/campaigns/{campaign_id}/stations/{station_id}                                                     | Partial Update Station                     |
| _StationsApi_        | [**update_station_api_v1_campaigns_campaign_id_stations_station_id_put**](docs/StationsApi.md#update_station_api_v1_campaigns_campaign_id_stations_station_id_put)                                                                                                                                                                     | **PUT** /api/v1/campaigns/{campaign_id}/stations/{station_id}                                                       | Update Station                             |
| _UploadfileCsvApi_   | [**post_sensor_and_measurement_api_v1_uploadfile_csv_campaign_campaign_id_station_station_id_sensor_post**](docs/UploadfileCsvApi.md#post_sensor_and_measurement_api_v1_uploadfile_csv_campaign_campaign_id_station_station_id_sensor_post)                                                                                            | **POST** /api/v1/uploadfile_csv/campaign/{campaign_id}/station/{station_id}/sensor                                  | Post Sensor And Measurement                |

## Documentation For Models

- [AggregatedMeasurement](docs/AggregatedMeasurement.md)
- [Bbox](docs/Bbox.md)
- [CampaignCreateResponse](docs/CampaignCreateResponse.md)
- [CampaignUpdate](docs/CampaignUpdate.md)
- [CampaignsIn](docs/CampaignsIn.md)
- [Coordinates](docs/Coordinates.md)
- [ForceUpdateSensorStatisticsResponse](docs/ForceUpdateSensorStatisticsResponse.md)
- [GetCampaignResponse](docs/GetCampaignResponse.md)
- [GetSensorResponse](docs/GetSensorResponse.md)
- [GetStationResponse](docs/GetStationResponse.md)
- [HTTPValidationError](docs/HTTPValidationError.md)
- [ListCampaignsResponseItem](docs/ListCampaignsResponseItem.md)
- [ListCampaignsResponsePagination](docs/ListCampaignsResponsePagination.md)
- [ListMeasurementsResponsePagination](docs/ListMeasurementsResponsePagination.md)
- [ListSensorsResponsePagination](docs/ListSensorsResponsePagination.md)
- [ListStationsResponsePagination](docs/ListStationsResponsePagination.md)
- [Location](docs/Location.md)
- [LoginResponse](docs/LoginResponse.md)
- [MeasurementCreateResponse](docs/MeasurementCreateResponse.md)
- [MeasurementIn](docs/MeasurementIn.md)
- [MeasurementItem](docs/MeasurementItem.md)
- [MeasurementUpdate](docs/MeasurementUpdate.md)
- [Point](docs/Point.md)
- [PyTASAllocation](docs/PyTASAllocation.md)
- [PyTASPi](docs/PyTASPi.md)
- [PyTASProject](docs/PyTASProject.md)
- [PyTASUser](docs/PyTASUser.md)
- [SensorCreateResponse](docs/SensorCreateResponse.md)
- [SensorItem](docs/SensorItem.md)
- [SensorStatistics](docs/SensorStatistics.md)
- [SensorSummaryForStations](docs/SensorSummaryForStations.md)
- [SensorUpdate](docs/SensorUpdate.md)
- [SortField](docs/SortField.md)
- [StationCreate](docs/StationCreate.md)
- [StationCreateResponse](docs/StationCreateResponse.md)
- [StationItemWithSummary](docs/StationItemWithSummary.md)
- [StationType](docs/StationType.md)
- [StationUpdate](docs/StationUpdate.md)
- [StationsListResponseItem](docs/StationsListResponseItem.md)
- [SummaryGetCampaign](docs/SummaryGetCampaign.md)
- [SummaryListCampaigns](docs/SummaryListCampaigns.md)
- [UpdateSensorStatisticsResponse](docs/UpdateSensorStatisticsResponse.md)
- [ValidationError](docs/ValidationError.md)
- [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)

<a id="documentation-for-authorization"></a>

## Documentation For Authorization

Authentication schemes defined for the API:
<a id="OAuth2PasswordBearer"></a>

### OAuth2PasswordBearer

- **Type**: OAuth
- **Flow**: password
- **Authorization URL**:
- **Scopes**: N/A

## Author

wmobley@tacc.utexas.edu