Skip to content

Commit 32c8e52

Browse files
authored
Bump version to 0.22.4 and generate client code from updated spec (#337)
Bump version to 0.22.4. This updates the spec to the point of #4798, to avoid removing the `Label` enum (which may cause issues, I'm not sure). Spec changes include (as far as I can tell): - additional fields related to Webhook models - addition of bounding box mode components - edge `report-metrics` endpoint - `from_edge` field on results
1 parent b5a54b7 commit 32c8e52

34 files changed

+1083
-21
lines changed

generated/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ docs/BBoxGeometry.md
99
docs/BBoxGeometryRequest.md
1010
docs/BinaryClassificationResult.md
1111
docs/BlankEnum.md
12+
docs/BoundingBoxModeConfiguration.md
13+
docs/BoundingBoxResult.md
1214
docs/ChannelEnum.md
1315
docs/Condition.md
1416
docs/ConditionRequest.md
@@ -88,6 +90,8 @@ groundlight_openapi_client/model/b_box_geometry.py
8890
groundlight_openapi_client/model/b_box_geometry_request.py
8991
groundlight_openapi_client/model/binary_classification_result.py
9092
groundlight_openapi_client/model/blank_enum.py
93+
groundlight_openapi_client/model/bounding_box_mode_configuration.py
94+
groundlight_openapi_client/model/bounding_box_result.py
9195
groundlight_openapi_client/model/channel_enum.py
9296
groundlight_openapi_client/model/condition.py
9397
groundlight_openapi_client/model/condition_request.py

generated/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ rule_request = RuleRequest(
9595
url="url_example",
9696
include_image=True,
9797
payload_template=None,
98+
last_message_failed=True,
99+
last_failure_error="last_failure_error_example",
100+
last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'),
98101
),
99102
],
100103
) # RuleRequest |
@@ -127,6 +130,7 @@ Class | Method | HTTP request | Description
127130
*DetectorsApi* | [**get_detector_metrics**](docs/DetectorsApi.md#get_detector_metrics) | **GET** /v1/detectors/{detector_id}/metrics |
128131
*DetectorsApi* | [**list_detectors**](docs/DetectorsApi.md#list_detectors) | **GET** /v1/detectors |
129132
*DetectorsApi* | [**update_detector**](docs/DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} |
133+
*EdgeApi* | [**edge_report_metrics_create**](docs/EdgeApi.md#edge_report_metrics_create) | **POST** /v1/edge/report-metrics |
130134
*EdgeApi* | [**get_model_urls**](docs/EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ |
131135
*ImageQueriesApi* | [**get_image**](docs/ImageQueriesApi.md#get_image) | **GET** /v1/image-queries/{id}/image |
132136
*ImageQueriesApi* | [**get_image_query**](docs/ImageQueriesApi.md#get_image_query) | **GET** /v1/image-queries/{id} |
@@ -148,6 +152,8 @@ Class | Method | HTTP request | Description
148152
- [BBoxGeometryRequest](docs/BBoxGeometryRequest.md)
149153
- [BinaryClassificationResult](docs/BinaryClassificationResult.md)
150154
- [BlankEnum](docs/BlankEnum.md)
155+
- [BoundingBoxModeConfiguration](docs/BoundingBoxModeConfiguration.md)
156+
- [BoundingBoxResult](docs/BoundingBoxResult.md)
151157
- [ChannelEnum](docs/ChannelEnum.md)
152158
- [Condition](docs/Condition.md)
153159
- [ConditionRequest](docs/ConditionRequest.md)

generated/docs/ActionsApi.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
7070
url="url_example",
7171
include_image=True,
7272
payload_template=None,
73+
last_message_failed=True,
74+
last_failure_error="last_failure_error_example",
75+
last_failed_at=dateutil_parser('1970-01-01T00:00:00.00Z'),
7376
),
7477
],
7578
) # RuleRequest |

generated/docs/BinaryClassificationResult.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**result_type** | **str** | | [optional] if omitted the server will use the default value of "binary_classification"
11+
**from_edge** | **bool** | | [optional]
1112
**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]
1213

1314
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# BoundingBoxModeConfiguration
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**class_name** | **str** | |
8+
**max_num_bboxes** | **int** | | [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+

generated/docs/BoundingBoxResult.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# BoundingBoxResult
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**label** | **str** | |
8+
**confidence** | **float, none_type** | | [optional]
9+
**source** | **str** | | [optional]
10+
**result_type** | **str** | | [optional] if omitted the server will use the default value of "bounding_box"
11+
**from_edge** | **bool** | | [optional]
12+
**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]
13+
14+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
15+
16+

generated/docs/CountingResult.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**result_type** | **str** | | [optional] if omitted the server will use the default value of "counting"
11+
**from_edge** | **bool** | | [optional]
1112
**greater_than_max** | **bool** | | [optional]
1213
**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]
1314

generated/docs/DetectorCreationInputRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Name | Type | Description | Notes
1212
**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0
1313
**pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional]
1414
**metadata** | **str** | Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding. | [optional]
15-
**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT | [optional]
15+
**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX | [optional]
1616
**mode_configuration** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
1717
**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]
1818

generated/docs/EdgeApi.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,81 @@ All URIs are relative to *https://api.groundlight.ai/device-api*
44

55
Method | HTTP request | Description
66
------------- | ------------- | -------------
7+
[**edge_report_metrics_create**](EdgeApi.md#edge_report_metrics_create) | **POST** /v1/edge/report-metrics |
78
[**get_model_urls**](EdgeApi.md#get_model_urls) | **GET** /v1/edge/fetch-model-urls/{detector_id}/ |
89

910

11+
# **edge_report_metrics_create**
12+
> edge_report_metrics_create()
13+
14+
15+
16+
Edge server periodically calls this to report metrics. POST body will have JSON data that we log.
17+
18+
### Example
19+
20+
* Api Key Authentication (ApiToken):
21+
22+
```python
23+
import time
24+
import groundlight_openapi_client
25+
from groundlight_openapi_client.api import edge_api
26+
from pprint import pprint
27+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
28+
# See configuration.py for a list of all supported configuration parameters.
29+
configuration = groundlight_openapi_client.Configuration(
30+
host = "https://api.groundlight.ai/device-api"
31+
)
32+
33+
# The client must configure the authentication and authorization parameters
34+
# in accordance with the API server security policy.
35+
# Examples for each auth method are provided below, use the example that
36+
# satisfies your auth use case.
37+
38+
# Configure API key authorization: ApiToken
39+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
40+
41+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
42+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
43+
44+
# Enter a context with an instance of the API client
45+
with groundlight_openapi_client.ApiClient(configuration) as api_client:
46+
# Create an instance of the API class
47+
api_instance = edge_api.EdgeApi(api_client)
48+
49+
# example, this endpoint has no required or optional parameters
50+
try:
51+
api_instance.edge_report_metrics_create()
52+
except groundlight_openapi_client.ApiException as e:
53+
print("Exception when calling EdgeApi->edge_report_metrics_create: %s\n" % e)
54+
```
55+
56+
57+
### Parameters
58+
This endpoint does not need any parameter.
59+
60+
### Return type
61+
62+
void (empty response body)
63+
64+
### Authorization
65+
66+
[ApiToken](../README.md#ApiToken)
67+
68+
### HTTP request headers
69+
70+
- **Content-Type**: Not defined
71+
- **Accept**: Not defined
72+
73+
74+
### HTTP response details
75+
76+
| Status code | Description | Response headers |
77+
|-------------|-------------|------------------|
78+
**200** | No response body | - |
79+
80+
[[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)
81+
1082
# **get_model_urls**
1183
> EdgeModelInfo get_model_urls(detector_id)
1284

generated/docs/ModeEnum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ]
7+
**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", "BOUNDING_BOX", ]
88

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

generated/docs/MultiClassificationResult.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
88
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**result_type** | **str** | | [optional] if omitted the server will use the default value of "multi_classification"
11+
**from_edge** | **bool** | | [optional]
1112
**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]
1213

1314
[[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/ResultTypeEnum.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ]
7+
**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", "bounding_box", ]
88

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

generated/docs/TextRecognitionResult.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
99
**confidence** | **float, none_type** | | [optional]
1010
**source** | **str** | | [optional]
1111
**result_type** | **str** | | [optional] if omitted the server will use the default value of "text_recognition"
12+
**from_edge** | **bool** | | [optional]
1213
**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]
1314

1415
[[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/WebhookAction.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Name | Type | Description | Notes
77
**url** | **str** | |
88
**include_image** | **bool** | | [optional]
99
**payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
10+
**last_message_failed** | **bool** | | [optional]
11+
**last_failure_error** | **str, none_type** | | [optional]
12+
**last_failed_at** | **datetime, none_type** | | [optional]
1013
**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]
1114

1215
[[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/WebhookActionRequest.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Name | Type | Description | Notes
77
**url** | **str** | |
88
**include_image** | **bool** | | [optional]
99
**payload_template** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
10+
**last_message_failed** | **bool** | | [optional]
11+
**last_failure_error** | **str, none_type** | | [optional]
12+
**last_failed_at** | **datetime, none_type** | | [optional]
1013
**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]
1114

1215
[[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/groundlight_openapi_client/api/edge_api.py

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,30 @@ def __init__(self, api_client=None):
3535
if api_client is None:
3636
api_client = ApiClient()
3737
self.api_client = api_client
38+
self.edge_report_metrics_create_endpoint = _Endpoint(
39+
settings={
40+
"response_type": None,
41+
"auth": ["ApiToken"],
42+
"endpoint_path": "/v1/edge/report-metrics",
43+
"operation_id": "edge_report_metrics_create",
44+
"http_method": "POST",
45+
"servers": None,
46+
},
47+
params_map={"all": [], "required": [], "nullable": [], "enum": [], "validation": []},
48+
root_map={
49+
"validations": {},
50+
"allowed_values": {},
51+
"openapi_types": {},
52+
"attribute_map": {},
53+
"location_map": {},
54+
"collection_format_map": {},
55+
},
56+
headers_map={
57+
"accept": [],
58+
"content_type": [],
59+
},
60+
api_client=api_client,
61+
)
3862
self.get_model_urls_endpoint = _Endpoint(
3963
settings={
4064
"response_type": (EdgeModelInfo,),
@@ -76,6 +100,61 @@ def __init__(self, api_client=None):
76100
api_client=api_client,
77101
)
78102

103+
def edge_report_metrics_create(self, **kwargs):
104+
"""edge_report_metrics_create # noqa: E501
105+
106+
Edge server periodically calls this to report metrics. POST body will have JSON data that we log. # noqa: E501
107+
This method makes a synchronous HTTP request by default. To make an
108+
asynchronous HTTP request, please pass async_req=True
109+
110+
>>> thread = api.edge_report_metrics_create(async_req=True)
111+
>>> result = thread.get()
112+
113+
114+
Keyword Args:
115+
_return_http_data_only (bool): response data without head status
116+
code and headers. Default is True.
117+
_preload_content (bool): if False, the urllib3.HTTPResponse object
118+
will be returned without reading/decoding response data.
119+
Default is True.
120+
_request_timeout (int/float/tuple): timeout setting for this request. If
121+
one number provided, it will be total request timeout. It can also
122+
be a pair (tuple) of (connection, read) timeouts.
123+
Default is None.
124+
_check_input_type (bool): specifies if type checking
125+
should be done one the data sent to the server.
126+
Default is True.
127+
_check_return_type (bool): specifies if type checking
128+
should be done one the data received from the server.
129+
Default is True.
130+
_spec_property_naming (bool): True if the variable names in the input data
131+
are serialized names, as specified in the OpenAPI document.
132+
False if the variable names in the input data
133+
are pythonic names, e.g. snake case (default)
134+
_content_type (str/None): force body content-type.
135+
Default is None and content-type will be predicted by allowed
136+
content-types and body.
137+
_host_index (int/None): specifies the index of the server
138+
that we want to use.
139+
Default is read from the configuration.
140+
async_req (bool): execute request asynchronously
141+
142+
Returns:
143+
None
144+
If the method is called asynchronously, returns the request
145+
thread.
146+
"""
147+
kwargs["async_req"] = kwargs.get("async_req", False)
148+
kwargs["_return_http_data_only"] = kwargs.get("_return_http_data_only", True)
149+
kwargs["_preload_content"] = kwargs.get("_preload_content", True)
150+
kwargs["_request_timeout"] = kwargs.get("_request_timeout", None)
151+
kwargs["_check_input_type"] = kwargs.get("_check_input_type", True)
152+
kwargs["_check_return_type"] = kwargs.get("_check_return_type", True)
153+
kwargs["_spec_property_naming"] = kwargs.get("_spec_property_naming", False)
154+
kwargs["_content_type"] = kwargs.get("_content_type")
155+
kwargs["_host_index"] = kwargs.get("_host_index")
156+
return self.edge_report_metrics_create_endpoint.call_with_http_info(**kwargs)
157+
79158
def get_model_urls(self, detector_id, **kwargs):
80159
"""get_model_urls # noqa: E501
81160

generated/groundlight_openapi_client/model/binary_classification_result.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def openapi_types():
117117
), # noqa: E501
118118
"source": (str,), # noqa: E501
119119
"result_type": (str,), # noqa: E501
120+
"from_edge": (bool,), # noqa: E501
120121
}
121122

122123
@cached_property
@@ -128,6 +129,7 @@ def discriminator():
128129
"confidence": "confidence", # noqa: E501
129130
"source": "source", # noqa: E501
130131
"result_type": "result_type", # noqa: E501
132+
"from_edge": "from_edge", # noqa: E501
131133
}
132134

133135
read_only_vars = {}
@@ -176,6 +178,7 @@ def _from_openapi_data(cls, label, *args, **kwargs): # noqa: E501
176178
confidence (float, none_type): [optional] # noqa: E501
177179
source (str): [optional] # noqa: E501
178180
result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501
181+
from_edge (bool): [optional] # noqa: E501
179182
"""
180183

181184
_check_type = kwargs.pop("_check_type", True)
@@ -267,6 +270,7 @@ def __init__(self, label, *args, **kwargs): # noqa: E501
267270
confidence (float, none_type): [optional] # noqa: E501
268271
source (str): [optional] # noqa: E501
269272
result_type (str): [optional] if omitted the server will use the default value of "binary_classification" # noqa: E501
273+
from_edge (bool): [optional] # noqa: E501
270274
"""
271275

272276
_check_type = kwargs.pop("_check_type", True)

0 commit comments

Comments
 (0)