Skip to content

Commit 2eceb62

Browse files
f-wrightAuto-format Bot
andauthored
Webhooks for alerts (#309)
Webhooks have been recently added as an action option for Groundlight, this PR makes them accessible through the SDK. --------- Co-authored-by: Auto-format Bot <autoformatbot@groundlight.ai>
1 parent 61c0141 commit 2eceb62

Some content is hidden

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

44 files changed

+1431
-134
lines changed

generated/.openapi-generator/FILES

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ docs/RuleRequest.md
4848
docs/SnoozeTimeUnitEnum.md
4949
docs/SourceEnum.md
5050
docs/StatusEnum.md
51+
docs/TextRecognitionResult.md
5152
docs/UserApi.md
5253
docs/VerbEnum.md
54+
docs/WebhookAction.md
55+
docs/WebhookActionRequest.md
5356
git_push.sh
5457
groundlight_openapi_client/__init__.py
5558
groundlight_openapi_client/api/__init__.py
@@ -107,7 +110,10 @@ groundlight_openapi_client/model/rule_request.py
107110
groundlight_openapi_client/model/snooze_time_unit_enum.py
108111
groundlight_openapi_client/model/source_enum.py
109112
groundlight_openapi_client/model/status_enum.py
113+
groundlight_openapi_client/model/text_recognition_result.py
110114
groundlight_openapi_client/model/verb_enum.py
115+
groundlight_openapi_client/model/webhook_action.py
116+
groundlight_openapi_client/model/webhook_action_request.py
111117
groundlight_openapi_client/model_utils.py
112118
groundlight_openapi_client/models/__init__.py
113119
groundlight_openapi_client/rest.py
@@ -116,4 +122,7 @@ setup.cfg
116122
setup.py
117123
test-requirements.txt
118124
test/__init__.py
125+
test/test_text_recognition_result.py
126+
test/test_webhook_action.py
127+
test/test_webhook_action_request.py
119128
tox.ini

generated/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ rule_request = RuleRequest(
9090
},
9191
),
9292
action=None,
93+
webhook_action=[
94+
WebhookActionRequest(
95+
url="url_example",
96+
include_image=True,
97+
),
98+
],
9399
) # RuleRequest |
94100

95101
try:
@@ -171,7 +177,10 @@ Class | Method | HTTP request | Description
171177
- [SnoozeTimeUnitEnum](docs/SnoozeTimeUnitEnum.md)
172178
- [SourceEnum](docs/SourceEnum.md)
173179
- [StatusEnum](docs/StatusEnum.md)
180+
- [TextRecognitionResult](docs/TextRecognitionResult.md)
174181
- [VerbEnum](docs/VerbEnum.md)
182+
- [WebhookAction](docs/WebhookAction.md)
183+
- [WebhookActionRequest](docs/WebhookActionRequest.md)
175184

176185

177186
## Documentation For Authorization

generated/docs/ActionsApi.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
6565
},
6666
),
6767
action=None,
68+
webhook_action=[
69+
WebhookActionRequest(
70+
url="url_example",
71+
include_image=True,
72+
),
73+
],
6874
) # RuleRequest |
6975

7076
# example passing only required values which don't have defaults set
@@ -296,13 +302,23 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
296302
# Create an instance of the API class
297303
api_instance = actions_api.ActionsApi(api_client)
298304
detector_id = "detector_id_example" # str |
305+
page = 1 # int | A page number within the paginated result set. (optional)
306+
page_size = 1 # int | Number of results to return per page. (optional)
299307

300308
# example passing only required values which don't have defaults set
301309
try:
302310
api_response = api_instance.list_detector_rules(detector_id)
303311
pprint(api_response)
304312
except groundlight_openapi_client.ApiException as e:
305313
print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)
314+
315+
# example passing only required values which don't have defaults set
316+
# and optional values
317+
try:
318+
api_response = api_instance.list_detector_rules(detector_id, page=page, page_size=page_size)
319+
pprint(api_response)
320+
except groundlight_openapi_client.ApiException as e:
321+
print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)
306322
```
307323

308324

@@ -311,6 +327,8 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
311327
Name | Type | Description | Notes
312328
------------- | ------------- | ------------- | -------------
313329
**detector_id** | **str**| |
330+
**page** | **int**| A page number within the paginated result set. | [optional]
331+
**page_size** | **int**| Number of results to return per page. | [optional]
314332

315333
### Return type
316334

generated/docs/BinaryClassificationResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**label** | **str** | |
8-
**confidence** | **float** | | [optional]
8+
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**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]
1111

generated/docs/CountingResult.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**count** | **int, none_type** | |
8-
**confidence** | **float** | | [optional]
8+
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**greater_than_max** | **bool** | | [optional]
1111
**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]

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. * &#x60;BINARY&#x60; - BINARY * &#x60;COUNT&#x60; - COUNT * &#x60;MULTI_CLASS&#x60; - MULTI_CLASS | [optional]
15+
**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * &#x60;BINARY&#x60; - BINARY * &#x60;COUNT&#x60; - COUNT * &#x60;MULTI_CLASS&#x60; - MULTI_CLASS * &#x60;TEXT&#x60; - TEXT | [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/ImageQueriesApi.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,14 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
201201
with groundlight_openapi_client.ApiClient(configuration) as api_client:
202202
# Create an instance of the API class
203203
api_instance = image_queries_api.ImageQueriesApi(api_client)
204+
detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional)
204205
page = 1 # int | A page number within the paginated result set. (optional)
205206
page_size = 1 # int | Number of items to return per page. (optional)
206-
detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional)
207207

208208
# example passing only required values which don't have defaults set
209209
# and optional values
210210
try:
211-
api_response = api_instance.list_image_queries(page=page, page_size=page_size, detector_id=detector_id)
211+
api_response = api_instance.list_image_queries(detector_id=detector_id, page=page, page_size=page_size)
212212
pprint(api_response)
213213
except groundlight_openapi_client.ApiException as e:
214214
print("Exception when calling ImageQueriesApi->list_image_queries: %s\n" % e)
@@ -219,9 +219,9 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
219219

220220
Name | Type | Description | Notes
221221
------------- | ------------- | ------------- | -------------
222+
**detector_id** | **str**| Optionally filter image queries by detector ID. | [optional]
222223
**page** | **int**| A page number within the paginated result set. | [optional]
223224
**page_size** | **int**| Number of items to return per page. | [optional]
224-
**detector_id** | **str**| Optionally filter image queries by detector ID. | [optional]
225225

226226
### Return type
227227

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", ]
7+
**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ]
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**label** | **str** | |
8-
**confidence** | **float** | | [optional]
8+
**confidence** | **float, none_type** | | [optional]
99
**source** | **str** | | [optional]
1010
**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]
1111

generated/docs/Note.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**detector_id** | **str** | | [readonly]
8-
**content** | **str** | Text content of the note. |
8+
**content** | **str, none_type** | Text content of the note. | [optional]
9+
**is_pinned** | **bool, none_type** | | [optional]
910
**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]
1011

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

0 commit comments

Comments
 (0)