Skip to content

Commit bc7aa60

Browse files
authored
Merge pull request #95 from fireblocks/fireblocks-api-spec/generated/4262
Generated SDK #4262
2 parents 3008e17 + f811637 commit bc7aa60

30 files changed

+556
-110
lines changed

.openapi-generator/FILES

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ docs/NetworkRecord.md
284284
docs/NoneNetworkRoutingDest.md
285285
docs/NotFoundException.md
286286
docs/Notification.md
287+
docs/NotificationAttempt.md
287288
docs/NotificationPaginatedResponse.md
288289
docs/NotificationStatus.md
289290
docs/NotificationWithData.md
@@ -867,6 +868,7 @@ fireblocks/models/network_record.py
867868
fireblocks/models/none_network_routing_dest.py
868869
fireblocks/models/not_found_exception.py
869870
fireblocks/models/notification.py
871+
fireblocks/models/notification_attempt.py
870872
fireblocks/models/notification_paginated_response.py
871873
fireblocks/models/notification_status.py
872874
fireblocks/models/notification_with_data.py
@@ -1425,6 +1427,7 @@ test/test_nfts_api.py
14251427
test/test_none_network_routing_dest.py
14261428
test/test_not_found_exception.py
14271429
test/test_notification.py
1430+
test/test_notification_attempt.py
14281431
test/test_notification_paginated_response.py
14291432
test/test_notification_status.py
14301433
test/test_notification_with_data.py

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ Class | Method | HTTP request | Description
489489
*WebhooksV2BetaApi* | [**get_notifications**](docs/WebhooksV2BetaApi.md#get_notifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id
490490
*WebhooksV2BetaApi* | [**get_webhook**](docs/WebhooksV2BetaApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get webhook by id
491491
*WebhooksV2BetaApi* | [**get_webhooks**](docs/WebhooksV2BetaApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks
492+
*WebhooksV2BetaApi* | [**resend_notification_by_id**](docs/WebhooksV2BetaApi.md#resend_notification_by_id) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id
492493
*WebhooksV2BetaApi* | [**update_webhook**](docs/WebhooksV2BetaApi.md#update_webhook) | **PATCH** /webhooks/{webhookId} | Update webhook
493494
*WorkspaceStatusBetaApi* | [**get_workspace_status**](docs/WorkspaceStatusBetaApi.md#get_workspace_status) | **GET** /management/workspace_status | Returns current workspace status
494495
*WhitelistIpAddressesApi* | [**get_whitelist_ip_addresses**](docs/WhitelistIpAddressesApi.md#get_whitelist_ip_addresses) | **GET** /management/api_users/{userId}/whitelist_ip_addresses | Gets whitelisted ip addresses
@@ -754,6 +755,7 @@ Class | Method | HTTP request | Description
754755
- [NoneNetworkRoutingDest](docs/NoneNetworkRoutingDest.md)
755756
- [NotFoundException](docs/NotFoundException.md)
756757
- [Notification](docs/Notification.md)
758+
- [NotificationAttempt](docs/NotificationAttempt.md)
757759
- [NotificationPaginatedResponse](docs/NotificationPaginatedResponse.md)
758760
- [NotificationStatus](docs/NotificationStatus.md)
759761
- [NotificationWithData](docs/NotificationWithData.md)

docs/CreateWebhookRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**url** | **str** | The url of the webhook where notifications will be sent. URL must be valid, unique and https. |
9-
**description** | **str** | description of the webhook. should not contain special characters. |
9+
**description** | **str** | description of the webhook. should not contain special characters. | [optional]
1010
**events** | [**List[WebhookEvent]**](WebhookEvent.md) | event types the webhook will subscribe to |
1111
**enabled** | **bool** | The status of the webhook. If false, the webhook will not receive notifications. | [optional] [default to True]
1212

docs/NetworkConnectionsApi.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ No authorization required
757757
[[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)
758758

759759
# **search_network_ids**
760-
> SearchNetworkIdsResponse search_network_ids(search=search, exclude_self=exclude_self, exclude_connected=exclude_connected, page_cursor=page_cursor, page_size=page_size)
760+
> SearchNetworkIdsResponse search_network_ids(search=search, exclude_self=exclude_self, only_self=only_self, exclude_connected=exclude_connected, page_cursor=page_cursor, page_size=page_size)
761761
762762
Search network IDs, both local IDs and discoverable remote IDs
763763

@@ -790,13 +790,14 @@ configuration = ClientConfiguration(
790790
with Fireblocks(configuration) as fireblocks:
791791
search = 'search_example' # str | Search string - displayName networkId. Optional (optional)
792792
exclude_self = True # bool | Exclude your networkIds. Optional, default false (optional)
793+
only_self = True # bool | Include just your networkIds. Optional, default false (optional)
793794
exclude_connected = True # bool | Exclude connected networkIds. Optional, default false (optional)
794795
page_cursor = 'page_cursor_example' # str | ID of the record after which to fetch $limit records (optional)
795796
page_size = 50 # float | Number of records to fetch. By default, it is 50 (optional) (default to 50)
796797

797798
try:
798799
# Search network IDs, both local IDs and discoverable remote IDs
799-
api_response = fireblocks.network_connections.search_network_ids(search=search, exclude_self=exclude_self, exclude_connected=exclude_connected, page_cursor=page_cursor, page_size=page_size).result()
800+
api_response = fireblocks.network_connections.search_network_ids(search=search, exclude_self=exclude_self, only_self=only_self, exclude_connected=exclude_connected, page_cursor=page_cursor, page_size=page_size).result()
800801
print("The response of NetworkConnectionsApi->search_network_ids:\n")
801802
pprint(api_response)
802803
except Exception as e:
@@ -812,6 +813,7 @@ Name | Type | Description | Notes
812813
------------- | ------------- | ------------- | -------------
813814
**search** | **str**| Search string - displayName networkId. Optional | [optional]
814815
**exclude_self** | **bool**| Exclude your networkIds. Optional, default false | [optional]
816+
**only_self** | **bool**| Include just your networkIds. Optional, default false | [optional]
815817
**exclude_connected** | **bool**| Exclude connected networkIds. Optional, default false | [optional]
816818
**page_cursor** | **str**| ID of the record after which to fetch $limit records | [optional]
817819
**page_size** | **float**| Number of records to fetch. By default, it is 50 | [optional] [default to 50]

docs/Notification.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**id** | **str** | The id of the Notification |
9-
**created_at** | **datetime** | The creation date of the notification |
10-
**updated_at** | **datetime** | The date when the notification was updated |
9+
**created_at** | **int** | The creation date of the notification in milliseconds |
10+
**updated_at** | **int** | The date when the notification was updated in milliseconds |
1111
**status** | [**NotificationStatus**](NotificationStatus.md) | |
1212
**event_type** | [**WebhookEvent**](WebhookEvent.md) | |
13-
**event_version** | **float** | The event version of the Notification |
1413
**resource_id** | **str** | The resource id of the event which the Notification is listen to | [optional]
15-
**attempts** | **List[str]** | The attempts related to Notification | [optional] [default to []]
14+
**attempts** | [**List[NotificationAttempt]**](NotificationAttempt.md) | The attempts related to Notification | [default to []]
1615

1716
## Example
1817

docs/NotificationAttempt.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# NotificationAttempt
2+
3+
4+
## Properties
5+
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**sent_time** | **int** | The time when the attempt was sent in milliseconds. |
9+
**duration** | **int** | The duration of the attempt in milliseconds. |
10+
**response_code** | **int** | The response code of the attempt, when missing refer to failureReason. | [optional]
11+
**failure_reason** | **str** | The request failure reason in case responseCode is missing. | [optional]
12+
13+
## Example
14+
15+
```python
16+
from fireblocks.models.notification_attempt import NotificationAttempt
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of NotificationAttempt from a JSON string
21+
notification_attempt_instance = NotificationAttempt.from_json(json)
22+
# print the JSON string representation of the object
23+
print(NotificationAttempt.to_json())
24+
25+
# convert the object into a dict
26+
notification_attempt_dict = notification_attempt_instance.to_dict()
27+
# create an instance of NotificationAttempt from a dict
28+
notification_attempt_from_dict = NotificationAttempt.from_dict(notification_attempt_dict)
29+
```
30+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
31+
32+

docs/NotificationWithData.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**id** | **str** | |
9-
**created_at** | **datetime** | The creation date of the notification |
10-
**updated_at** | **datetime** | The date when the notification was updated |
9+
**created_at** | **int** | The creation date of the notification in milliseconds |
10+
**updated_at** | **int** | The date when the notification was updated in milliseconds |
1111
**status** | [**NotificationStatus**](NotificationStatus.md) | |
1212
**event_type** | [**WebhookEvent**](WebhookEvent.md) | |
13-
**event_version** | **float** | The event version which the Notification is listen to |
1413
**resource_id** | **str** | The resource id of the event which the Notification is listen to | [optional]
15-
**attempts** | **List[str]** | The attempts related to Notification | [default to []]
14+
**attempts** | [**List[NotificationAttempt]**](NotificationAttempt.md) | The attempts related to Notification | [default to []]
1615
**data** | **object** | notification data | [optional]
1716

1817
## Example

docs/Webhook.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**id** | **str** | The id of the webhook | [optional]
9-
**url** | **str** | The url of the webhook where notifications will be sent. Must be a valid URL and https. | [optional]
8+
**id** | **str** | The id of the webhook |
9+
**url** | **str** | The url of the webhook where notifications will be sent. Must be a valid URL and https. |
1010
**description** | **str** | description of the webhook of what it is used for | [optional]
11-
**events** | [**List[WebhookEvent]**](WebhookEvent.md) | The events that the webhook will be subscribed to | [optional]
12-
**status** | **str** | The status of the webhook | [optional]
13-
**created_at** | **datetime** | The date and time the webhook was created | [optional]
14-
**updated_at** | **datetime** | The date and time the webhook was last updated | [optional]
11+
**events** | [**List[WebhookEvent]**](WebhookEvent.md) | The events that the webhook will be subscribed to |
12+
**status** | **str** | The status of the webhook |
13+
**created_at** | **int** | The date and time the webhook was created in milliseconds |
14+
**updated_at** | **int** | The date and time the webhook was last updated in milliseconds |
1515

1616
## Example
1717

docs/WebhooksV2BetaApi.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Method | HTTP request | Description
1010
[**get_notifications**](WebhooksV2BetaApi.md#get_notifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id
1111
[**get_webhook**](WebhooksV2BetaApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get webhook by id
1212
[**get_webhooks**](WebhooksV2BetaApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks
13+
[**resend_notification_by_id**](WebhooksV2BetaApi.md#resend_notification_by_id) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id
1314
[**update_webhook**](WebhooksV2BetaApi.md#update_webhook) | **PATCH** /webhooks/{webhookId} | Update webhook
1415

1516

@@ -238,6 +239,7 @@ No authorization required
238239
| Status code | Description | Response headers |
239240
|-------------|-------------|------------------|
240241
**200** | OK | * X-Request-ID - <br> |
242+
**0** | Error Response | * X-Request-ID - <br> |
241243

242244
[[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)
243245

@@ -329,6 +331,7 @@ No authorization required
329331
| Status code | Description | Response headers |
330332
|-------------|-------------|------------------|
331333
**200** | A paginated response containing NotificationExternalDTO objects | * X-Request-ID - <br> |
334+
**0** | Error Response | * X-Request-ID - <br> |
332335

333336
[[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)
334337

@@ -484,6 +487,80 @@ No authorization required
484487

485488
[[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)
486489

490+
# **resend_notification_by_id**
491+
> resend_notification_by_id(webhook_id, notification_id, idempotency_key=idempotency_key)
492+
493+
Resend notification by id
494+
495+
Resend notification by ID **Note:** These endpoints are currently in beta and might be subject to changes.
496+
497+
### Example
498+
499+
500+
```python
501+
from fireblocks.client import Fireblocks
502+
from fireblocks.client_configuration import ClientConfiguration
503+
from fireblocks.exceptions import ApiException
504+
from fireblocks.base_path import BasePath
505+
506+
# load the secret key content from a file
507+
with open('your_secret_key_file_path', 'r') as file:
508+
secret_key_value = file.read()
509+
510+
# build the configuration
511+
configuration = ClientConfiguration(
512+
api_key="your_api_key",
513+
secret_key=secret_key_value,
514+
base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1"
515+
)
516+
517+
518+
# Enter a context with an instance of the API client
519+
with Fireblocks(configuration) as fireblocks:
520+
webhook_id = 'webhook_id_example' # str | The ID of the webhook
521+
notification_id = 'notification_id_example' # str | The ID of the notification
522+
idempotency_key = 'idempotency_key_example' # str | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional)
523+
524+
try:
525+
# Resend notification by id
526+
fireblocks.webhooks_v2_beta.resend_notification_by_id(webhook_id, notification_id, idempotency_key=idempotency_key).result()
527+
except Exception as e:
528+
print("Exception when calling WebhooksV2BetaApi->resend_notification_by_id: %s\n" % e)
529+
```
530+
531+
532+
533+
### Parameters
534+
535+
536+
Name | Type | Description | Notes
537+
------------- | ------------- | ------------- | -------------
538+
**webhook_id** | **str**| The ID of the webhook |
539+
**notification_id** | **str**| The ID of the notification |
540+
**idempotency_key** | **str**| A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. | [optional]
541+
542+
### Return type
543+
544+
void (empty response body)
545+
546+
### Authorization
547+
548+
No authorization required
549+
550+
### HTTP request headers
551+
552+
- **Content-Type**: Not defined
553+
- **Accept**: application/json
554+
555+
### HTTP response details
556+
557+
| Status code | Description | Response headers |
558+
|-------------|-------------|------------------|
559+
**202** | Resend notification request was accepted and is being processed | * X-Request-ID - <br> |
560+
**0** | Error Response | * X-Request-ID - <br> |
561+
562+
[[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)
563+
487564
# **update_webhook**
488565
> Webhook update_webhook(webhook_id, update_webhook_request)
489566

fireblocks/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
""" # noqa: E501
1616

1717

18-
__version__ = "7.0.0"
18+
__version__ = "0.0.0"
1919

2020
# import apis into sdk package
2121
from fireblocks.api.api_user_api import ApiUserApi
@@ -477,6 +477,7 @@
477477
from fireblocks.models.none_network_routing_dest import NoneNetworkRoutingDest
478478
from fireblocks.models.not_found_exception import NotFoundException
479479
from fireblocks.models.notification import Notification
480+
from fireblocks.models.notification_attempt import NotificationAttempt
480481
from fireblocks.models.notification_paginated_response import (
481482
NotificationPaginatedResponse,
482483
)

fireblocks/api/network_connections_api.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,7 @@ def search_network_ids(
13431343
self,
13441344
search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Search string - displayName networkId. Optional")] = None,
13451345
exclude_self: Annotated[Optional[StrictBool], Field(description="Exclude your networkIds. Optional, default false")] = None,
1346+
only_self: Annotated[Optional[StrictBool], Field(description="Include just your networkIds. Optional, default false")] = None,
13461347
exclude_connected: Annotated[Optional[StrictBool], Field(description="Exclude connected networkIds. Optional, default false")] = None,
13471348
page_cursor: Annotated[Optional[StrictStr], Field(description="ID of the record after which to fetch $limit records")] = None,
13481349
page_size: Annotated[Optional[Union[Annotated[float, Field(le=50, strict=True, ge=1)], Annotated[int, Field(le=50, strict=True, ge=1)]]], Field(description="Number of records to fetch. By default, it is 50")] = None,
@@ -1367,6 +1368,8 @@ def search_network_ids(
13671368
:type search: str
13681369
:param exclude_self: Exclude your networkIds. Optional, default false
13691370
:type exclude_self: bool
1371+
:param only_self: Include just your networkIds. Optional, default false
1372+
:type only_self: bool
13701373
:param exclude_connected: Exclude connected networkIds. Optional, default false
13711374
:type exclude_connected: bool
13721375
:param page_cursor: ID of the record after which to fetch $limit records
@@ -1399,6 +1402,7 @@ def search_network_ids(
13991402
_param = self._search_network_ids_serialize(
14001403
search=search,
14011404
exclude_self=exclude_self,
1405+
only_self=only_self,
14021406
exclude_connected=exclude_connected,
14031407
page_cursor=page_cursor,
14041408
page_size=page_size,
@@ -1423,6 +1427,7 @@ def _search_network_ids_serialize(
14231427
self,
14241428
search,
14251429
exclude_self,
1430+
only_self,
14261431
exclude_connected,
14271432
page_cursor,
14281433
page_size,
@@ -1454,6 +1459,10 @@ def _search_network_ids_serialize(
14541459

14551460
_query_params.append(('excludeSelf', exclude_self))
14561461

1462+
if only_self is not None:
1463+
1464+
_query_params.append(('onlySelf', only_self))
1465+
14571466
if exclude_connected is not None:
14581467

14591468
_query_params.append(('excludeConnected', exclude_connected))

0 commit comments

Comments
 (0)