Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ install-generator: install ## Install dependencies for SDK code generator
generate: install-generator ## Generate the SDK from our public openapi spec
node_modules/.bin/openapi-generator-cli generate -i spec/public-api.yaml \
-g python \
-o ./generated
-o ./generated \
--additional-properties=packageName=groundlight_openapi_client
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change. Everything else is either auto-generated or CTRL-F changing references from openapi_client to groundlight_openapi_client

poetry run datamodel-codegen --input spec/public-api.yaml --output generated/model.py
poetry run black .

Expand Down
2 changes: 1 addition & 1 deletion generated/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ stages:
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=openapi_client
- pytest --cov=groundlight_openapi_client

test-3.6:
extends: .tests
Expand Down
70 changes: 35 additions & 35 deletions generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,41 @@ docs/RulesApi.md
docs/User.md
docs/UserApi.md
git_push.sh
openapi_client/__init__.py
openapi_client/api/__init__.py
openapi_client/api/detectors_api.py
openapi_client/api/image_queries_api.py
openapi_client/api/images_api.py
openapi_client/api/notes_api.py
openapi_client/api/rules_api.py
openapi_client/api/user_api.py
openapi_client/api_client.py
openapi_client/apis/__init__.py
openapi_client/configuration.py
openapi_client/exceptions.py
openapi_client/model/__init__.py
openapi_client/model/action.py
openapi_client/model/classification_result.py
openapi_client/model/condition.py
openapi_client/model/detector.py
openapi_client/model/detector_creation_input.py
openapi_client/model/detector_type_enum.py
openapi_client/model/image_query.py
openapi_client/model/image_query_type_enum.py
openapi_client/model/inline_response200.py
openapi_client/model/note.py
openapi_client/model/note_creation_input.py
openapi_client/model/paginated_detector_list.py
openapi_client/model/paginated_image_query_list.py
openapi_client/model/paginated_rule_list.py
openapi_client/model/result_type_enum.py
openapi_client/model/rule.py
openapi_client/model/rule_base.py
openapi_client/model/rule_creation_input.py
openapi_client/model/user.py
openapi_client/model_utils.py
openapi_client/models/__init__.py
openapi_client/rest.py
groundlight_openapi_client/__init__.py
groundlight_openapi_client/api/__init__.py
groundlight_openapi_client/api/detectors_api.py
groundlight_openapi_client/api/image_queries_api.py
groundlight_openapi_client/api/images_api.py
groundlight_openapi_client/api/notes_api.py
groundlight_openapi_client/api/rules_api.py
groundlight_openapi_client/api/user_api.py
groundlight_openapi_client/api_client.py
groundlight_openapi_client/apis/__init__.py
groundlight_openapi_client/configuration.py
groundlight_openapi_client/exceptions.py
groundlight_openapi_client/model/__init__.py
groundlight_openapi_client/model/action.py
groundlight_openapi_client/model/classification_result.py
groundlight_openapi_client/model/condition.py
groundlight_openapi_client/model/detector.py
groundlight_openapi_client/model/detector_creation_input.py
groundlight_openapi_client/model/detector_type_enum.py
groundlight_openapi_client/model/image_query.py
groundlight_openapi_client/model/image_query_type_enum.py
groundlight_openapi_client/model/inline_response200.py
groundlight_openapi_client/model/note.py
groundlight_openapi_client/model/note_creation_input.py
groundlight_openapi_client/model/paginated_detector_list.py
groundlight_openapi_client/model/paginated_image_query_list.py
groundlight_openapi_client/model/paginated_rule_list.py
groundlight_openapi_client/model/result_type_enum.py
groundlight_openapi_client/model/rule.py
groundlight_openapi_client/model/rule_base.py
groundlight_openapi_client/model/rule_creation_input.py
groundlight_openapi_client/model/user.py
groundlight_openapi_client/model_utils.py
groundlight_openapi_client/models/__init__.py
groundlight_openapi_client/rest.py
requirements.txt
setup.cfg
setup.py
Expand Down
2 changes: 1 addition & 1 deletion generated/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: pytest --cov=openapi_client
script: pytest --cov=groundlight_openapi_client
34 changes: 17 additions & 17 deletions generated/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openapi-client
# groundlight-openapi-client
Easy Computer Vision powered by Natural Language

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
Expand All @@ -23,7 +23,7 @@ pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Then import the package:
```python
import openapi_client
import groundlight_openapi_client
```

### Setuptools
Expand All @@ -37,7 +37,7 @@ python setup.py install --user

Then import the package:
```python
import openapi_client
import groundlight_openapi_client
```

## Getting Started
Expand All @@ -47,15 +47,15 @@ Please follow the [installation procedure](#installation--usage) and then run th
```python

import time
import openapi_client
import groundlight_openapi_client
from pprint import pprint
from openapi_client.api import detectors_api
from openapi_client.model.detector import Detector
from openapi_client.model.detector_creation_input import DetectorCreationInput
from openapi_client.model.paginated_detector_list import PaginatedDetectorList
from groundlight_openapi_client.api import detectors_api
from groundlight_openapi_client.model.detector import Detector
from groundlight_openapi_client.model.detector_creation_input import DetectorCreationInput
from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
configuration = groundlight_openapi_client.Configuration(
host = "https://api.groundlight.ai/device-api"
)

Expand All @@ -72,7 +72,7 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'


# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = detectors_api.DetectorsApi(api_client)
detector_creation_input = DetectorCreationInput(
Expand All @@ -87,7 +87,7 @@ with openapi_client.ApiClient(configuration) as api_client:
try:
api_response = api_instance.create_detector(detector_creation_input)
pprint(api_response)
except openapi_client.ApiException as e:
except groundlight_openapi_client.ApiException as e:
print("Exception when calling DetectorsApi->create_detector: %s\n" % e)
```

Expand Down Expand Up @@ -152,21 +152,21 @@ support@groundlight.ai


## Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in openapi_client.apis and openapi_client.models may fail with a
If the OpenAPI document is large, imports in groundlight_openapi_client.apis and groundlight_openapi_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 openapi_client.api.default_api import DefaultApi`
- `from openapi_client.model.pet import Pet`
- `from groundlight_openapi_client.api.default_api import DefaultApi`
- `from groundlight_openapi_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 openapi_client
from openapi_client.apis import *
from openapi_client.models import *
import groundlight_openapi_client
from groundlight_openapi_client.apis import *
from groundlight_openapi_client.models import *
```

40 changes: 20 additions & 20 deletions generated/docs/DetectorsApi.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openapi_client.DetectorsApi
# groundlight_openapi_client.DetectorsApi

All URIs are relative to *https://api.groundlight.ai/device-api*

Expand All @@ -22,14 +22,14 @@ Create a new detector.

```python
import time
import openapi_client
from openapi_client.api import detectors_api
from openapi_client.model.detector_creation_input import DetectorCreationInput
from openapi_client.model.detector import Detector
import groundlight_openapi_client
from groundlight_openapi_client.api import detectors_api
from groundlight_openapi_client.model.detector import Detector
from groundlight_openapi_client.model.detector_creation_input import DetectorCreationInput
from pprint import pprint
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
configuration = groundlight_openapi_client.Configuration(
host = "https://api.groundlight.ai/device-api"
)

Expand All @@ -45,7 +45,7 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# configuration.api_key_prefix['ApiToken'] = 'Bearer'

# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = detectors_api.DetectorsApi(api_client)
detector_creation_input = DetectorCreationInput(
Expand All @@ -61,7 +61,7 @@ with openapi_client.ApiClient(configuration) as api_client:
try:
api_response = api_instance.create_detector(detector_creation_input)
pprint(api_response)
except openapi_client.ApiException as e:
except groundlight_openapi_client.ApiException as e:
print("Exception when calling DetectorsApi->create_detector: %s\n" % e)
```

Expand Down Expand Up @@ -107,13 +107,13 @@ Retrieve a detector by its ID.

```python
import time
import openapi_client
from openapi_client.api import detectors_api
from openapi_client.model.detector import Detector
import groundlight_openapi_client
from groundlight_openapi_client.api import detectors_api
from groundlight_openapi_client.model.detector import Detector
from pprint import pprint
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
configuration = groundlight_openapi_client.Configuration(
host = "https://api.groundlight.ai/device-api"
)

Expand All @@ -129,7 +129,7 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# configuration.api_key_prefix['ApiToken'] = 'Bearer'

# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = detectors_api.DetectorsApi(api_client)
id = "id_example" # str | Choose a detector by its ID.
Expand All @@ -138,7 +138,7 @@ with openapi_client.ApiClient(configuration) as api_client:
try:
api_response = api_instance.get_detector(id)
pprint(api_response)
except openapi_client.ApiException as e:
except groundlight_openapi_client.ApiException as e:
print("Exception when calling DetectorsApi->get_detector: %s\n" % e)
```

Expand Down Expand Up @@ -184,13 +184,13 @@ Retrieve a list of detectors.

```python
import time
import openapi_client
from openapi_client.api import detectors_api
from openapi_client.model.paginated_detector_list import PaginatedDetectorList
import groundlight_openapi_client
from groundlight_openapi_client.api import detectors_api
from groundlight_openapi_client.model.paginated_detector_list import PaginatedDetectorList
from pprint import pprint
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
configuration = groundlight_openapi_client.Configuration(
host = "https://api.groundlight.ai/device-api"
)

Expand All @@ -206,7 +206,7 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
# configuration.api_key_prefix['ApiToken'] = 'Bearer'

# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = detectors_api.DetectorsApi(api_client)
page = 1 # int | A page number within the paginated result set. (optional)
Expand All @@ -217,7 +217,7 @@ with openapi_client.ApiClient(configuration) as api_client:
try:
api_response = api_instance.list_detectors(page=page, page_size=page_size)
pprint(api_response)
except openapi_client.ApiException as e:
except groundlight_openapi_client.ApiException as e:
print("Exception when calling DetectorsApi->list_detectors: %s\n" % e)
```

Expand Down
Loading