Skip to content

Commit 233f837

Browse files
brandon-wadaAuto-format Bot
andauthored
V0.15.0 (#185)
* wip. mix of whoami improvments and change to the public-api to support notifications * Experimenting with autogenerating the request function * Some debugging, but it seems like a valid request is sent. TODO, test with dev environment and make the sdk code cleaner and nicer * Automatically reformatting code * Seems to work. The parameters for each type of notification aren't documented yet as they may be unstable * Making very clear that this isn't in the final release of the SDK * Automatically reformatting code * make the UnstableApi class accessible like the Groundlight class * this is pretty much the spec, need to switch gears rn tho * rename to experimentalApi * adds get and delete methods * add get rule list and delete all rules. And added tests * Automatically reformatting code * regenerating code to remove old files and correct a type * linting mostly * Automatically reformatting code * addressing comments before next big PR * typo * removing old file * lint * esoteric linter stuff * pylint is acting weird still * Ok, there was one legit linter error among several that I'm not too interested in * aaa * Automatically reformatting code * wrap comments * regenerating files * changing spec, get requests should have no body * regenerating files * Working test that gets an image off my dev environment * Automatically reformatting code * once the endpoint is exposed, tests will work on prod * init commit * first pass at get notes * appease the linting gods * Unified branch for the various new features being added on top v0.14.0 at the same time Also gonna boldly declaire the set of features I've added as worthy of a version bump * actions tests are working again * got image tests working again * outline of note code * notes tests are working * Automatically reformatting code * test against prod * appease the (merciful) linting deities * Updates the endpoint for images * Automatically reformatting code * fix how client handles rules * Automatically reformatting code * change testing endpoint * Incorporated suggestions, regenerated files. Ran into one last bug with zuuul endpoint * regenerate api code * upgrading the datetime calls was supposed to be innocuous * Automatically reformatting code * Trigger CI * Correcting note type available in the sdk * customer types in test * Automatically reformatting code * more fixes * case issue * good suggestions --------- Co-authored-by: Auto-format Bot <[email protected]>
1 parent f5da2a6 commit 233f837

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3041
-351
lines changed

generated/.openapi-generator/FILES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ docs/DetectorsApi.md
1212
docs/ImageQueriesApi.md
1313
docs/ImageQuery.md
1414
docs/ImageQueryTypeEnum.md
15+
docs/ImagesApi.md
16+
docs/InlineResponse200.md
17+
docs/Note.md
18+
docs/NoteCreationInput.md
19+
docs/NotesApi.md
1520
docs/PaginatedDetectorList.md
1621
docs/PaginatedImageQueryList.md
22+
docs/PaginatedRuleList.md
1723
docs/ResultTypeEnum.md
1824
docs/Rule.md
1925
docs/RuleBase.md
@@ -26,6 +32,8 @@ openapi_client/__init__.py
2632
openapi_client/api/__init__.py
2733
openapi_client/api/detectors_api.py
2834
openapi_client/api/image_queries_api.py
35+
openapi_client/api/images_api.py
36+
openapi_client/api/notes_api.py
2937
openapi_client/api/rules_api.py
3038
openapi_client/api/user_api.py
3139
openapi_client/api_client.py
@@ -41,8 +49,12 @@ openapi_client/model/detector_creation_input.py
4149
openapi_client/model/detector_type_enum.py
4250
openapi_client/model/image_query.py
4351
openapi_client/model/image_query_type_enum.py
52+
openapi_client/model/inline_response200.py
53+
openapi_client/model/note.py
54+
openapi_client/model/note_creation_input.py
4455
openapi_client/model/paginated_detector_list.py
4556
openapi_client/model/paginated_image_query_list.py
57+
openapi_client/model/paginated_rule_list.py
4658
openapi_client/model/result_type_enum.py
4759
openapi_client/model/rule.py
4860
openapi_client/model/rule_base.py

generated/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ Class | Method | HTTP request | Description
103103
*ImageQueriesApi* | [**get_image_query**](docs/ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} |
104104
*ImageQueriesApi* | [**list_image_queries**](docs/ImageQueriesApi.md#list_image_queries) | **GET** /v1/image-queries |
105105
*ImageQueriesApi* | [**submit_image_query**](docs/ImageQueriesApi.md#submit_image_query) | **POST** /v1/image-queries |
106-
*RulesApi* | [**create_rule**](docs/RulesApi.md#create_rule) | **POST** /v1/actions/detector/{id}/rules |
106+
*ImagesApi* | [**get_image**](docs/ImagesApi.md#get_image) | **GET** /v1/image-queries/{id}/image |
107+
*NotesApi* | [**create_note**](docs/NotesApi.md#create_note) | **POST** /v1/notes |
108+
*NotesApi* | [**get_notes**](docs/NotesApi.md#get_notes) | **GET** /v1/notes |
109+
*RulesApi* | [**create_rule**](docs/RulesApi.md#create_rule) | **POST** /v1/actions/detector/{detector_id}/rules |
110+
*RulesApi* | [**delete_rule**](docs/RulesApi.md#delete_rule) | **DELETE** /v1/actions/rules/{id} |
111+
*RulesApi* | [**get_rule**](docs/RulesApi.md#get_rule) | **GET** /v1/actions/rules/{id} |
112+
*RulesApi* | [**list_rules**](docs/RulesApi.md#list_rules) | **GET** /v1/actions/rules |
107113
*UserApi* | [**who_am_i**](docs/UserApi.md#who_am_i) | **GET** /me |
108114

109115

@@ -117,8 +123,12 @@ Class | Method | HTTP request | Description
117123
- [DetectorTypeEnum](docs/DetectorTypeEnum.md)
118124
- [ImageQuery](docs/ImageQuery.md)
119125
- [ImageQueryTypeEnum](docs/ImageQueryTypeEnum.md)
126+
- [InlineResponse200](docs/InlineResponse200.md)
127+
- [Note](docs/Note.md)
128+
- [NoteCreationInput](docs/NoteCreationInput.md)
120129
- [PaginatedDetectorList](docs/PaginatedDetectorList.md)
121130
- [PaginatedImageQueryList](docs/PaginatedImageQueryList.md)
131+
- [PaginatedRuleList](docs/PaginatedRuleList.md)
122132
- [ResultTypeEnum](docs/ResultTypeEnum.md)
123133
- [Rule](docs/Rule.md)
124134
- [RuleBase](docs/RuleBase.md)

generated/docs/DetectorsApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Name | Type | Description | Notes
8282

8383
### HTTP request headers
8484

85-
- **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data
85+
- **Content-Type**: application/json
8686
- **Accept**: application/json
8787

8888

generated/docs/ImagesApi.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# openapi_client.ImagesApi
2+
3+
All URIs are relative to *https://api.groundlight.ai/device-api*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**get_image**](ImagesApi.md#get_image) | **GET** /v1/image-queries/{id}/image |
8+
9+
10+
# **get_image**
11+
> file_type get_image(id)
12+
13+
14+
15+
Retrieve an image by its image query id.
16+
17+
### Example
18+
19+
* Api Key Authentication (ApiToken):
20+
21+
```python
22+
import time
23+
import openapi_client
24+
from openapi_client.api import images_api
25+
from pprint import pprint
26+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
27+
# See configuration.py for a list of all supported configuration parameters.
28+
configuration = openapi_client.Configuration(
29+
host = "https://api.groundlight.ai/device-api"
30+
)
31+
32+
# The client must configure the authentication and authorization parameters
33+
# in accordance with the API server security policy.
34+
# Examples for each auth method are provided below, use the example that
35+
# satisfies your auth use case.
36+
37+
# Configure API key authorization: ApiToken
38+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
39+
40+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
41+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
42+
43+
# Enter a context with an instance of the API client
44+
with openapi_client.ApiClient(configuration) as api_client:
45+
# Create an instance of the API class
46+
api_instance = images_api.ImagesApi(api_client)
47+
id = "id_example" # str | Choose an image by its image query id.
48+
49+
# example passing only required values which don't have defaults set
50+
try:
51+
api_response = api_instance.get_image(id)
52+
pprint(api_response)
53+
except openapi_client.ApiException as e:
54+
print("Exception when calling ImagesApi->get_image: %s\n" % e)
55+
```
56+
57+
58+
### Parameters
59+
60+
Name | Type | Description | Notes
61+
------------- | ------------- | ------------- | -------------
62+
**id** | **str**| Choose an image by its image query id. |
63+
64+
### Return type
65+
66+
**file_type**
67+
68+
### Authorization
69+
70+
[ApiToken](../README.md#ApiToken)
71+
72+
### HTTP request headers
73+
74+
- **Content-Type**: Not defined
75+
- **Accept**: image/jpeg
76+
77+
78+
### HTTP response details
79+
80+
| Status code | Description | Response headers |
81+
|-------------|-------------|------------------|
82+
**200** | | - |
83+
84+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
85+

generated/docs/Error.md renamed to generated/docs/InlineResponse200.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
# Error
1+
# InlineResponse200
22

33

44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. |
7+
**customer** | [**[Note]**](Note.md) | |
8+
**gl** | [**[Note]**](Note.md) | |
89
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
910

1011
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/docs/Note.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Note
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**content** | **str** | The text inside the note | [optional]
8+
**note_type** | **str** | The type of note | [optional]
9+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
10+
11+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
12+
13+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# NoteCreationInput
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**content** | **str** | The text inside the note |
8+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+

generated/docs/NotesApi.md

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
# openapi_client.NotesApi
2+
3+
All URIs are relative to *https://api.groundlight.ai/device-api*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**create_note**](NotesApi.md#create_note) | **POST** /v1/notes |
8+
[**get_notes**](NotesApi.md#get_notes) | **GET** /v1/notes |
9+
10+
11+
# **create_note**
12+
> [Note] create_note(detector_id, note_creation_input)
13+
14+
15+
16+
Create a new note.
17+
18+
### Example
19+
20+
* Api Key Authentication (ApiToken):
21+
22+
```python
23+
import time
24+
import openapi_client
25+
from openapi_client.api import notes_api
26+
from openapi_client.model.note import Note
27+
from openapi_client.model.note_creation_input import NoteCreationInput
28+
from pprint import pprint
29+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
30+
# See configuration.py for a list of all supported configuration parameters.
31+
configuration = openapi_client.Configuration(
32+
host = "https://api.groundlight.ai/device-api"
33+
)
34+
35+
# The client must configure the authentication and authorization parameters
36+
# in accordance with the API server security policy.
37+
# Examples for each auth method are provided below, use the example that
38+
# satisfies your auth use case.
39+
40+
# Configure API key authorization: ApiToken
41+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
42+
43+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
44+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
45+
46+
# Enter a context with an instance of the API client
47+
with openapi_client.ApiClient(configuration) as api_client:
48+
# Create an instance of the API class
49+
api_instance = notes_api.NotesApi(api_client)
50+
detector_id = "detector_id_example" # str | the detector to associate the note with
51+
note_creation_input = NoteCreationInput(
52+
content="content_example",
53+
) # NoteCreationInput |
54+
55+
# example passing only required values which don't have defaults set
56+
try:
57+
api_response = api_instance.create_note(detector_id, note_creation_input)
58+
pprint(api_response)
59+
except openapi_client.ApiException as e:
60+
print("Exception when calling NotesApi->create_note: %s\n" % e)
61+
```
62+
63+
64+
### Parameters
65+
66+
Name | Type | Description | Notes
67+
------------- | ------------- | ------------- | -------------
68+
**detector_id** | **str**| the detector to associate the note with |
69+
**note_creation_input** | [**NoteCreationInput**](NoteCreationInput.md)| |
70+
71+
### Return type
72+
73+
[**[Note]**](Note.md)
74+
75+
### Authorization
76+
77+
[ApiToken](../README.md#ApiToken)
78+
79+
### HTTP request headers
80+
81+
- **Content-Type**: application/json
82+
- **Accept**: application/json
83+
84+
85+
### HTTP response details
86+
87+
| Status code | Description | Response headers |
88+
|-------------|-------------|------------------|
89+
**201** | | - |
90+
91+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
92+
93+
# **get_notes**
94+
> InlineResponse200 get_notes(detector_id)
95+
96+
97+
98+
Retrieve notes for a detector
99+
100+
### Example
101+
102+
* Api Key Authentication (ApiToken):
103+
104+
```python
105+
import time
106+
import openapi_client
107+
from openapi_client.api import notes_api
108+
from openapi_client.model.inline_response200 import InlineResponse200
109+
from pprint import pprint
110+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
111+
# See configuration.py for a list of all supported configuration parameters.
112+
configuration = openapi_client.Configuration(
113+
host = "https://api.groundlight.ai/device-api"
114+
)
115+
116+
# The client must configure the authentication and authorization parameters
117+
# in accordance with the API server security policy.
118+
# Examples for each auth method are provided below, use the example that
119+
# satisfies your auth use case.
120+
121+
# Configure API key authorization: ApiToken
122+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
123+
124+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
125+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
126+
127+
# Enter a context with an instance of the API client
128+
with openapi_client.ApiClient(configuration) as api_client:
129+
# Create an instance of the API class
130+
api_instance = notes_api.NotesApi(api_client)
131+
detector_id = "detector_id_example" # str | the detector whose notes to retrieve
132+
133+
# example passing only required values which don't have defaults set
134+
try:
135+
api_response = api_instance.get_notes(detector_id)
136+
pprint(api_response)
137+
except openapi_client.ApiException as e:
138+
print("Exception when calling NotesApi->get_notes: %s\n" % e)
139+
```
140+
141+
142+
### Parameters
143+
144+
Name | Type | Description | Notes
145+
------------- | ------------- | ------------- | -------------
146+
**detector_id** | **str**| the detector whose notes to retrieve |
147+
148+
### Return type
149+
150+
[**InlineResponse200**](InlineResponse200.md)
151+
152+
### Authorization
153+
154+
[ApiToken](../README.md#ApiToken)
155+
156+
### HTTP request headers
157+
158+
- **Content-Type**: Not defined
159+
- **Accept**: application/json
160+
161+
162+
### HTTP response details
163+
164+
| Status code | Description | Response headers |
165+
|-------------|-------------|------------------|
166+
**200** | | - |
167+
168+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
169+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PaginatedRuleList
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**count** | **int** | | [optional]
8+
**next** | **str, none_type** | | [optional]
9+
**previous** | **str, none_type** | | [optional]
10+
**results** | [**[Rule]**](Rule.md) | | [optional]
11+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+

generated/docs/Rule.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Spec for serializing a rule object in the public API.
55
## Properties
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8+
**id** | **int** | A unique ID for this object. | [optional] [readonly]
89
**detector_name** | **str** | The name of the detector this rule is associated with. | [optional] [readonly]
910
**detector_id** | **str** | Which detector should this rule be associated with? | [optional]
1011
**name** | **str** | A short, descriptive name for the rule. | [optional]

0 commit comments

Comments
 (0)