Skip to content

Commit

Permalink
Merge pull request #95 from fireblocks/fireblocks-api-spec/generated/…
Browse files Browse the repository at this point in the history
…4262

Generated SDK #4262
  • Loading branch information
asafs932 authored Feb 12, 2025
2 parents 3008e17 + f811637 commit bc7aa60
Show file tree
Hide file tree
Showing 30 changed files with 556 additions and 110 deletions.
3 changes: 3 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ docs/NetworkRecord.md
docs/NoneNetworkRoutingDest.md
docs/NotFoundException.md
docs/Notification.md
docs/NotificationAttempt.md
docs/NotificationPaginatedResponse.md
docs/NotificationStatus.md
docs/NotificationWithData.md
Expand Down Expand Up @@ -867,6 +868,7 @@ fireblocks/models/network_record.py
fireblocks/models/none_network_routing_dest.py
fireblocks/models/not_found_exception.py
fireblocks/models/notification.py
fireblocks/models/notification_attempt.py
fireblocks/models/notification_paginated_response.py
fireblocks/models/notification_status.py
fireblocks/models/notification_with_data.py
Expand Down Expand Up @@ -1425,6 +1427,7 @@ test/test_nfts_api.py
test/test_none_network_routing_dest.py
test/test_not_found_exception.py
test/test_notification.py
test/test_notification_attempt.py
test/test_notification_paginated_response.py
test/test_notification_status.py
test/test_notification_with_data.py
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ Class | Method | HTTP request | Description
*WebhooksV2BetaApi* | [**get_notifications**](docs/WebhooksV2BetaApi.md#get_notifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id
*WebhooksV2BetaApi* | [**get_webhook**](docs/WebhooksV2BetaApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get webhook by id
*WebhooksV2BetaApi* | [**get_webhooks**](docs/WebhooksV2BetaApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks
*WebhooksV2BetaApi* | [**resend_notification_by_id**](docs/WebhooksV2BetaApi.md#resend_notification_by_id) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id
*WebhooksV2BetaApi* | [**update_webhook**](docs/WebhooksV2BetaApi.md#update_webhook) | **PATCH** /webhooks/{webhookId} | Update webhook
*WorkspaceStatusBetaApi* | [**get_workspace_status**](docs/WorkspaceStatusBetaApi.md#get_workspace_status) | **GET** /management/workspace_status | Returns current workspace status
*WhitelistIpAddressesApi* | [**get_whitelist_ip_addresses**](docs/WhitelistIpAddressesApi.md#get_whitelist_ip_addresses) | **GET** /management/api_users/{userId}/whitelist_ip_addresses | Gets whitelisted ip addresses
Expand Down Expand Up @@ -754,6 +755,7 @@ Class | Method | HTTP request | Description
- [NoneNetworkRoutingDest](docs/NoneNetworkRoutingDest.md)
- [NotFoundException](docs/NotFoundException.md)
- [Notification](docs/Notification.md)
- [NotificationAttempt](docs/NotificationAttempt.md)
- [NotificationPaginatedResponse](docs/NotificationPaginatedResponse.md)
- [NotificationStatus](docs/NotificationStatus.md)
- [NotificationWithData](docs/NotificationWithData.md)
Expand Down
2 changes: 1 addition & 1 deletion docs/CreateWebhookRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | **str** | The url of the webhook where notifications will be sent. URL must be valid, unique and https. |
**description** | **str** | description of the webhook. should not contain special characters. |
**description** | **str** | description of the webhook. should not contain special characters. | [optional]
**events** | [**List[WebhookEvent]**](WebhookEvent.md) | event types the webhook will subscribe to |
**enabled** | **bool** | The status of the webhook. If false, the webhook will not receive notifications. | [optional] [default to True]

Expand Down
6 changes: 4 additions & 2 deletions docs/NetworkConnectionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ No authorization required
[[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)

# **search_network_ids**
> SearchNetworkIdsResponse search_network_ids(search=search, exclude_self=exclude_self, exclude_connected=exclude_connected, page_cursor=page_cursor, page_size=page_size)
> 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)
Search network IDs, both local IDs and discoverable remote IDs

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

try:
# Search network IDs, both local IDs and discoverable remote IDs
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()
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()
print("The response of NetworkConnectionsApi->search_network_ids:\n")
pprint(api_response)
except Exception as e:
Expand All @@ -812,6 +813,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**search** | **str**| Search string - displayName networkId. Optional | [optional]
**exclude_self** | **bool**| Exclude your networkIds. Optional, default false | [optional]
**only_self** | **bool**| Include just your networkIds. Optional, default false | [optional]
**exclude_connected** | **bool**| Exclude connected networkIds. Optional, default false | [optional]
**page_cursor** | **str**| ID of the record after which to fetch $limit records | [optional]
**page_size** | **float**| Number of records to fetch. By default, it is 50 | [optional] [default to 50]
Expand Down
7 changes: 3 additions & 4 deletions docs/Notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | The id of the Notification |
**created_at** | **datetime** | The creation date of the notification |
**updated_at** | **datetime** | The date when the notification was updated |
**created_at** | **int** | The creation date of the notification in milliseconds |
**updated_at** | **int** | The date when the notification was updated in milliseconds |
**status** | [**NotificationStatus**](NotificationStatus.md) | |
**event_type** | [**WebhookEvent**](WebhookEvent.md) | |
**event_version** | **float** | The event version of the Notification |
**resource_id** | **str** | The resource id of the event which the Notification is listen to | [optional]
**attempts** | **List[str]** | The attempts related to Notification | [optional] [default to []]
**attempts** | [**List[NotificationAttempt]**](NotificationAttempt.md) | The attempts related to Notification | [default to []]

## Example

Expand Down
32 changes: 32 additions & 0 deletions docs/NotificationAttempt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# NotificationAttempt


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**sent_time** | **int** | The time when the attempt was sent in milliseconds. |
**duration** | **int** | The duration of the attempt in milliseconds. |
**response_code** | **int** | The response code of the attempt, when missing refer to failureReason. | [optional]
**failure_reason** | **str** | The request failure reason in case responseCode is missing. | [optional]

## Example

```python
from fireblocks.models.notification_attempt import NotificationAttempt

# TODO update the JSON string below
json = "{}"
# create an instance of NotificationAttempt from a JSON string
notification_attempt_instance = NotificationAttempt.from_json(json)
# print the JSON string representation of the object
print(NotificationAttempt.to_json())

# convert the object into a dict
notification_attempt_dict = notification_attempt_instance.to_dict()
# create an instance of NotificationAttempt from a dict
notification_attempt_from_dict = NotificationAttempt.from_dict(notification_attempt_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


7 changes: 3 additions & 4 deletions docs/NotificationWithData.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**created_at** | **datetime** | The creation date of the notification |
**updated_at** | **datetime** | The date when the notification was updated |
**created_at** | **int** | The creation date of the notification in milliseconds |
**updated_at** | **int** | The date when the notification was updated in milliseconds |
**status** | [**NotificationStatus**](NotificationStatus.md) | |
**event_type** | [**WebhookEvent**](WebhookEvent.md) | |
**event_version** | **float** | The event version which the Notification is listen to |
**resource_id** | **str** | The resource id of the event which the Notification is listen to | [optional]
**attempts** | **List[str]** | The attempts related to Notification | [default to []]
**attempts** | [**List[NotificationAttempt]**](NotificationAttempt.md) | The attempts related to Notification | [default to []]
**data** | **object** | notification data | [optional]

## Example
Expand Down
12 changes: 6 additions & 6 deletions docs/Webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

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

## Example

Expand Down
77 changes: 77 additions & 0 deletions docs/WebhooksV2BetaApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Method | HTTP request | Description
[**get_notifications**](WebhooksV2BetaApi.md#get_notifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id
[**get_webhook**](WebhooksV2BetaApi.md#get_webhook) | **GET** /webhooks/{webhookId} | Get webhook by id
[**get_webhooks**](WebhooksV2BetaApi.md#get_webhooks) | **GET** /webhooks | Get all webhooks
[**resend_notification_by_id**](WebhooksV2BetaApi.md#resend_notification_by_id) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id
[**update_webhook**](WebhooksV2BetaApi.md#update_webhook) | **PATCH** /webhooks/{webhookId} | Update webhook


Expand Down Expand Up @@ -238,6 +239,7 @@ No authorization required
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | OK | * X-Request-ID - <br> |
**0** | Error Response | * X-Request-ID - <br> |

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

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

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

Expand Down Expand Up @@ -484,6 +487,80 @@ No authorization required

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

# **resend_notification_by_id**
> resend_notification_by_id(webhook_id, notification_id, idempotency_key=idempotency_key)
Resend notification by id

Resend notification by ID **Note:** These endpoints are currently in beta and might be subject to changes.

### Example


```python
from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.exceptions import ApiException
from fireblocks.base_path import BasePath

# load the secret key content from a file
with open('your_secret_key_file_path', 'r') as file:
secret_key_value = file.read()

# build the configuration
configuration = ClientConfiguration(
api_key="your_api_key",
secret_key=secret_key_value,
base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1"
)


# Enter a context with an instance of the API client
with Fireblocks(configuration) as fireblocks:
webhook_id = 'webhook_id_example' # str | The ID of the webhook
notification_id = 'notification_id_example' # str | The ID of the notification
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)

try:
# Resend notification by id
fireblocks.webhooks_v2_beta.resend_notification_by_id(webhook_id, notification_id, idempotency_key=idempotency_key).result()
except Exception as e:
print("Exception when calling WebhooksV2BetaApi->resend_notification_by_id: %s\n" % e)
```



### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**webhook_id** | **str**| The ID of the webhook |
**notification_id** | **str**| The ID of the notification |
**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]

### Return type

void (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**202** | Resend notification request was accepted and is being processed | * X-Request-ID - <br> |
**0** | Error Response | * X-Request-ID - <br> |

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

# **update_webhook**
> Webhook update_webhook(webhook_id, update_webhook_request)
Expand Down
3 changes: 2 additions & 1 deletion fireblocks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
""" # noqa: E501


__version__ = "7.0.0"
__version__ = "0.0.0"

# import apis into sdk package
from fireblocks.api.api_user_api import ApiUserApi
Expand Down Expand Up @@ -477,6 +477,7 @@
from fireblocks.models.none_network_routing_dest import NoneNetworkRoutingDest
from fireblocks.models.not_found_exception import NotFoundException
from fireblocks.models.notification import Notification
from fireblocks.models.notification_attempt import NotificationAttempt
from fireblocks.models.notification_paginated_response import (
NotificationPaginatedResponse,
)
Expand Down
9 changes: 9 additions & 0 deletions fireblocks/api/network_connections_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1343,6 +1343,7 @@ def search_network_ids(
self,
search: Annotated[Optional[Annotated[str, Field(min_length=1, strict=True)]], Field(description="Search string - displayName networkId. Optional")] = None,
exclude_self: Annotated[Optional[StrictBool], Field(description="Exclude your networkIds. Optional, default false")] = None,
only_self: Annotated[Optional[StrictBool], Field(description="Include just your networkIds. Optional, default false")] = None,
exclude_connected: Annotated[Optional[StrictBool], Field(description="Exclude connected networkIds. Optional, default false")] = None,
page_cursor: Annotated[Optional[StrictStr], Field(description="ID of the record after which to fetch $limit records")] = None,
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,
Expand All @@ -1367,6 +1368,8 @@ def search_network_ids(
:type search: str
:param exclude_self: Exclude your networkIds. Optional, default false
:type exclude_self: bool
:param only_self: Include just your networkIds. Optional, default false
:type only_self: bool
:param exclude_connected: Exclude connected networkIds. Optional, default false
:type exclude_connected: bool
:param page_cursor: ID of the record after which to fetch $limit records
Expand Down Expand Up @@ -1399,6 +1402,7 @@ def search_network_ids(
_param = self._search_network_ids_serialize(
search=search,
exclude_self=exclude_self,
only_self=only_self,
exclude_connected=exclude_connected,
page_cursor=page_cursor,
page_size=page_size,
Expand All @@ -1423,6 +1427,7 @@ def _search_network_ids_serialize(
self,
search,
exclude_self,
only_self,
exclude_connected,
page_cursor,
page_size,
Expand Down Expand Up @@ -1454,6 +1459,10 @@ def _search_network_ids_serialize(

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

if only_self is not None:

_query_params.append(('onlySelf', only_self))

if exclude_connected is not None:

_query_params.append(('excludeConnected', exclude_connected))
Expand Down
Loading

0 comments on commit bc7aa60

Please sign in to comment.