Skip to content

Commit e686a28

Browse files
committed
Initial commit: Python SDK for Agent Metrics API
0 parents  commit e686a28

40 files changed

Lines changed: 4331 additions & 0 deletions

.github/workflows/python.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
5+
6+
name: openapi_client Python package
7+
8+
on: [push, pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
- name: Install dependencies
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install -r requirements.txt
31+
pip install -r test-requirements.txt
32+
- name: Test with pytest
33+
run: |
34+
pytest --cov=openapi_client

.gitignore

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
*.egg-info/
24+
.installed.cfg
25+
*.egg
26+
27+
# PyInstaller
28+
# Usually these files are written by a python script from a template
29+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30+
*.manifest
31+
*.spec
32+
33+
# Installer logs
34+
pip-log.txt
35+
pip-delete-this-directory.txt
36+
37+
# Unit test / coverage reports
38+
htmlcov/
39+
.tox/
40+
.coverage
41+
.coverage.*
42+
.cache
43+
nosetests.xml
44+
coverage.xml
45+
*,cover
46+
.hypothesis/
47+
venv/
48+
.venv/
49+
.python-version
50+
.pytest_cache
51+
52+
# Translations
53+
*.mo
54+
*.pot
55+
56+
# Django stuff:
57+
*.log
58+
59+
# Sphinx documentation
60+
docs/_build/
61+
62+
# PyBuilder
63+
target/
64+
65+
#Ipython Notebook
66+
.ipynb_checkpoints

.gitlab-ci.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
4+
# ref: https://docs.gitlab.com/ee/ci/README.html
5+
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
6+
7+
stages:
8+
- test
9+
10+
.pytest:
11+
stage: test
12+
script:
13+
- pip install -r requirements.txt
14+
- pip install -r test-requirements.txt
15+
- pytest --cov=openapi_client
16+
17+
pytest-3.9:
18+
extends: .pytest
19+
image: python:3.9-alpine
20+
pytest-3.10:
21+
extends: .pytest
22+
image: python:3.10-alpine
23+
pytest-3.11:
24+
extends: .pytest
25+
image: python:3.11-alpine
26+
pytest-3.12:
27+
extends: .pytest
28+
image: python:3.12-alpine
29+
pytest-3.13:
30+
extends: .pytest
31+
image: python:3.13-alpine

.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

.openapi-generator/FILES

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.github/workflows/python.yml
2+
.gitignore
3+
.gitlab-ci.yml
4+
.openapi-generator-ignore
5+
.travis.yml
6+
README.md
7+
docs/CsatApi.md
8+
docs/MetricsApi.md
9+
docs/OnlineAgentsApi.md
10+
docs/SampleApi.md
11+
docs/ShiftAgent.md
12+
git_push.sh
13+
openapi_client/__init__.py
14+
openapi_client/api/__init__.py
15+
openapi_client/api/csat_api.py
16+
openapi_client/api/metrics_api.py
17+
openapi_client/api/online_agents_api.py
18+
openapi_client/api/sample_api.py
19+
openapi_client/api_client.py
20+
openapi_client/api_response.py
21+
openapi_client/configuration.py
22+
openapi_client/exceptions.py
23+
openapi_client/models/__init__.py
24+
openapi_client/models/shift_agent.py
25+
openapi_client/py.typed
26+
openapi_client/rest.py
27+
pyproject.toml
28+
requirements.txt
29+
setup.cfg
30+
setup.py
31+
test-requirements.txt
32+
test/__init__.py
33+
test/test_csat_api.py
34+
test/test_metrics_api.py
35+
test/test_online_agents_api.py
36+
test/test_sample_api.py
37+
test/test_shift_agent.py
38+
tox.ini

.openapi-generator/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7.14.0

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ref: https://docs.travis-ci.com/user/languages/python
2+
language: python
3+
python:
4+
- "3.9"
5+
- "3.10"
6+
- "3.11"
7+
- "3.12"
8+
- "3.13"
9+
# uncomment the following if needed
10+
#- "3.13-dev" # 3.13 development branch
11+
#- "nightly" # nightly build
12+
# command to install dependencies
13+
install:
14+
- "pip install -r requirements.txt"
15+
- "pip install -r test-requirements.txt"
16+
# command to run tests
17+
script: pytest --cov=openapi_client

README.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# openapi-client
2+
API for online agents
3+
4+
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5+
6+
- API version: v1
7+
- Package version: 1.0.0
8+
- Generator version: 7.14.0
9+
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
10+
11+
## Requirements.
12+
13+
Python 3.9+
14+
15+
## Installation & Usage
16+
### pip install
17+
18+
If the python package is hosted on a repository, you can install directly using:
19+
20+
```sh
21+
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
22+
```
23+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
24+
25+
Then import the package:
26+
```python
27+
import openapi_client
28+
```
29+
30+
### Setuptools
31+
32+
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
33+
34+
```sh
35+
python setup.py install --user
36+
```
37+
(or `sudo python setup.py install` to install the package for all users)
38+
39+
Then import the package:
40+
```python
41+
import openapi_client
42+
```
43+
44+
### Tests
45+
46+
Execute `pytest` to run the tests.
47+
48+
## Getting Started
49+
50+
Please follow the [installation procedure](#installation--usage) and then run the following:
51+
52+
```python
53+
54+
import openapi_client
55+
from openapi_client.rest import ApiException
56+
from pprint import pprint
57+
58+
# Defining the host is optional and defaults to http://localhost:8000
59+
# See configuration.py for a list of all supported configuration parameters.
60+
configuration = openapi_client.Configuration(
61+
host = "http://localhost:8000"
62+
)
63+
64+
# The client must configure the authentication and authorization parameters
65+
# in accordance with the API server security policy.
66+
# Examples for each auth method are provided below, use the example that
67+
# satisfies your auth use case.
68+
69+
# Configure HTTP basic authorization: Basic
70+
configuration = openapi_client.Configuration(
71+
username = os.environ["USERNAME"],
72+
password = os.environ["PASSWORD"]
73+
)
74+
75+
76+
# Enter a context with an instance of the API client
77+
with openapi_client.ApiClient(configuration) as api_client:
78+
# Create an instance of the API class
79+
api_instance = openapi_client.CsatApi(api_client)
80+
81+
try:
82+
api_instance.csat_save_create()
83+
except ApiException as e:
84+
print("Exception when calling CsatApi->csat_save_create: %s\n" % e)
85+
86+
```
87+
88+
## Documentation for API Endpoints
89+
90+
All URIs are relative to *http://localhost:8000*
91+
92+
Class | Method | HTTP request | Description
93+
------------ | ------------- | ------------- | -------------
94+
*CsatApi* | [**csat_save_create**](docs/CsatApi.md#csat_save_create) | **POST** /csat/save/ |
95+
*MetricsApi* | [**metrics_save_create**](docs/MetricsApi.md#metrics_save_create) | **POST** /metrics/save/ |
96+
*OnlineAgentsApi* | [**online_agents_list**](docs/OnlineAgentsApi.md#online_agents_list) | **GET** /online-agents/ |
97+
*SampleApi* | [**sample_save_create**](docs/SampleApi.md#sample_save_create) | **POST** /sample/save/ |
98+
99+
100+
## Documentation For Models
101+
102+
- [ShiftAgent](docs/ShiftAgent.md)
103+
104+
105+
<a id="documentation-for-authorization"></a>
106+
## Documentation For Authorization
107+
108+
109+
Authentication schemes defined for the API:
110+
<a id="Basic"></a>
111+
### Basic
112+
113+
- **Type**: HTTP basic authentication
114+
115+
116+
## Author
117+
118+
119+
120+

0 commit comments

Comments
 (0)