Skip to content

Webhooks for alerts #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jan 27, 2025
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
9 changes: 9 additions & 0 deletions generated/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ docs/RuleRequest.md
docs/SnoozeTimeUnitEnum.md
docs/SourceEnum.md
docs/StatusEnum.md
docs/TextRecognitionResult.md
docs/UserApi.md
docs/VerbEnum.md
docs/WebhookAction.md
docs/WebhookActionRequest.md
git_push.sh
groundlight_openapi_client/__init__.py
groundlight_openapi_client/api/__init__.py
Expand Down Expand Up @@ -107,7 +110,10 @@ groundlight_openapi_client/model/rule_request.py
groundlight_openapi_client/model/snooze_time_unit_enum.py
groundlight_openapi_client/model/source_enum.py
groundlight_openapi_client/model/status_enum.py
groundlight_openapi_client/model/text_recognition_result.py
groundlight_openapi_client/model/verb_enum.py
groundlight_openapi_client/model/webhook_action.py
groundlight_openapi_client/model/webhook_action_request.py
groundlight_openapi_client/model_utils.py
groundlight_openapi_client/models/__init__.py
groundlight_openapi_client/rest.py
Expand All @@ -116,4 +122,7 @@ setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_text_recognition_result.py
test/test_webhook_action.py
test/test_webhook_action_request.py
tox.ini
9 changes: 9 additions & 0 deletions generated/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ rule_request = RuleRequest(
},
),
action=None,
webhook_action=[
WebhookActionRequest(
url="url_example",
include_image=True,
),
],
) # RuleRequest |

try:
Expand Down Expand Up @@ -171,7 +177,10 @@ Class | Method | HTTP request | Description
- [SnoozeTimeUnitEnum](docs/SnoozeTimeUnitEnum.md)
- [SourceEnum](docs/SourceEnum.md)
- [StatusEnum](docs/StatusEnum.md)
- [TextRecognitionResult](docs/TextRecognitionResult.md)
- [VerbEnum](docs/VerbEnum.md)
- [WebhookAction](docs/WebhookAction.md)
- [WebhookActionRequest](docs/WebhookActionRequest.md)


## Documentation For Authorization
Expand Down
18 changes: 18 additions & 0 deletions generated/docs/ActionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
},
),
action=None,
webhook_action=[
WebhookActionRequest(
url="url_example",
include_image=True,
),
],
) # RuleRequest |

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

# example passing only required values which don't have defaults set
try:
api_response = api_instance.list_detector_rules(detector_id)
pprint(api_response)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
api_response = api_instance.list_detector_rules(detector_id, page=page, page_size=page_size)
pprint(api_response)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling ActionsApi->list_detector_rules: %s\n" % e)
```


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

### Return type

Expand Down
2 changes: 1 addition & 1 deletion generated/docs/BinaryClassificationResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **str** | |
**confidence** | **float** | | [optional]
**confidence** | **float, none_type** | | [optional]
**source** | **str** | | [optional]
**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]

Expand Down
2 changes: 1 addition & 1 deletion generated/docs/CountingResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**count** | **int, none_type** | |
**confidence** | **float** | | [optional]
**confidence** | **float, none_type** | | [optional]
**source** | **str** | | [optional]
**greater_than_max** | **bool** | | [optional]
**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]
Expand Down
2 changes: 1 addition & 1 deletion generated/docs/DetectorCreationInputRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Name | Type | Description | Notes
**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
**pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional]
**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]
**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 | [optional]
**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]
**mode_configuration** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**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]

Expand Down
6 changes: 3 additions & 3 deletions generated/docs/ImageQueriesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
with groundlight_openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = image_queries_api.ImageQueriesApi(api_client)
detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional)
page = 1 # int | A page number within the paginated result set. (optional)
page_size = 1 # int | Number of items to return per page. (optional)
detector_id = "detector_id_example" # str | Optionally filter image queries by detector ID. (optional)

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

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

### Return type

Expand Down
2 changes: 1 addition & 1 deletion generated/docs/ModeEnum.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", ]
**value** | **str** | | must be one of ["BINARY", "COUNT", "MULTI_CLASS", "TEXT", ]

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

Expand Down
2 changes: 1 addition & 1 deletion generated/docs/MultiClassificationResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | **str** | |
**confidence** | **float** | | [optional]
**confidence** | **float, none_type** | | [optional]
**source** | **str** | | [optional]
**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]

Expand Down
3 changes: 2 additions & 1 deletion generated/docs/Note.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**detector_id** | **str** | | [readonly]
**content** | **str** | Text content of the note. |
**content** | **str, none_type** | Text content of the note. | [optional]
**is_pinned** | **bool, none_type** | | [optional]
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
3 changes: 2 additions & 1 deletion generated/docs/NoteRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**content** | **str** | Text content of the note. |
**content** | **str, none_type** | Text content of the note. | [optional]
**is_pinned** | **bool, none_type** | | [optional]
**image** | **file_type, none_type** | | [optional]
**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]

Expand Down
20 changes: 14 additions & 6 deletions generated/docs/NotesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Method | HTTP request | Description


# **create_note**
> create_note(detector_id, note_request)
> create_note(detector_id)



Create a new note
Creates a new note.

### Example

Expand Down Expand Up @@ -49,12 +49,20 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
detector_id = "detector_id_example" # str | the detector to associate the new note with
note_request = NoteRequest(
content="content_example",
is_pinned=True,
image=open('/path/to/file', 'rb'),
) # NoteRequest |
) # NoteRequest | (optional)

# example passing only required values which don't have defaults set
try:
api_instance.create_note(detector_id, note_request)
api_instance.create_note(detector_id)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling NotesApi->create_note: %s\n" % e)

# example passing only required values which don't have defaults set
# and optional values
try:
api_instance.create_note(detector_id, note_request=note_request)
except groundlight_openapi_client.ApiException as e:
print("Exception when calling NotesApi->create_note: %s\n" % e)
```
Expand All @@ -65,7 +73,7 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**detector_id** | **str**| the detector to associate the new note with |
**note_request** | [**NoteRequest**](NoteRequest.md)| |
**note_request** | [**NoteRequest**](NoteRequest.md)| | [optional]

### Return type

Expand Down Expand Up @@ -94,7 +102,7 @@ void (empty response body)



Get all the notes from a given detector and return the answer in lists, one for each note_category
Retrieves all notes from a given detector and returns them in lists, one for each note_category.

### Example

Expand Down
2 changes: 1 addition & 1 deletion generated/docs/ResultTypeEnum.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", ]
**value** | **str** | | must be one of ["binary_classification", "counting", "multi_classification", "text_recognition", ]

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

Expand Down
3 changes: 2 additions & 1 deletion generated/docs/Rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ Name | Type | Description | Notes
**detector_name** | **str** | | [readonly]
**name** | **str** | |
**condition** | [**Condition**](Condition.md) | |
**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**enabled** | **bool** | | [optional] if omitted the server will use the default value of True
**snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False
**snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0
**snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False
**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**webhook_action** | [**[WebhookAction]**](WebhookAction.md) | | [optional]
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
3 changes: 2 additions & 1 deletion generated/docs/RuleRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **str** | |
**condition** | [**ConditionRequest**](ConditionRequest.md) | |
**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | |
**enabled** | **bool** | | [optional] if omitted the server will use the default value of True
**snooze_time_enabled** | **bool** | | [optional] if omitted the server will use the default value of False
**snooze_time_value** | **int** | | [optional] if omitted the server will use the default value of 0
**snooze_time_unit** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**human_review_required** | **bool** | | [optional] if omitted the server will use the default value of False
**action** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
**webhook_action** | [**[WebhookActionRequest]**](WebhookActionRequest.md) | | [optional]
**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]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Expand Down
15 changes: 15 additions & 0 deletions generated/docs/TextRecognitionResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# TextRecognitionResult


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**text** | **str** | |
**truncated** | **bool** | |
**confidence** | **float, none_type** | | [optional]
**source** | **str** | | [optional]
**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]

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


13 changes: 13 additions & 0 deletions generated/docs/WebhookAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# WebhookAction


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **str** | |
**include_image** | **bool** | | [optional]
**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]

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


13 changes: 13 additions & 0 deletions generated/docs/WebhookActionRequest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# WebhookActionRequest


## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **str** | |
**include_image** | **bool** | | [optional]
**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]

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


10 changes: 10 additions & 0 deletions generated/groundlight_openapi_client/api/actions_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ def __init__(self, api_client=None):
params_map={
"all": [
"detector_id",
"page",
"page_size",
],
"required": [
"detector_id",
Expand All @@ -186,12 +188,18 @@ def __init__(self, api_client=None):
"allowed_values": {},
"openapi_types": {
"detector_id": (str,),
"page": (int,),
"page_size": (int,),
},
"attribute_map": {
"detector_id": "detector_id",
"page": "page",
"page_size": "page_size",
},
"location_map": {
"detector_id": "path",
"page": "query",
"page_size": "query",
},
"collection_format_map": {},
},
Expand Down Expand Up @@ -434,6 +442,8 @@ def list_detector_rules(self, detector_id, **kwargs):
detector_id (str):

Keyword Args:
page (int): A page number within the paginated result set.. [optional]
page_size (int): Number of results to return per page.. [optional]
_return_http_data_only (bool): response data without head status
code and headers. Default is True.
_preload_content (bool): if False, the urllib3.HTTPResponse object
Expand Down
Loading
Loading