diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 57ecc85..6525239 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -290,6 +290,7 @@ docs/NftsApi.md docs/NoneNetworkRoutingDest.md docs/NotFoundException.md docs/Notification.md +docs/NotificationAttempt.md docs/NotificationPaginatedResponse.md docs/NotificationStatus.md docs/NotificationWithData.md @@ -888,6 +889,7 @@ src/main/java/com/fireblocks/sdk/model/NetworkRecord.java src/main/java/com/fireblocks/sdk/model/NoneNetworkRoutingDest.java src/main/java/com/fireblocks/sdk/model/NotFoundException.java src/main/java/com/fireblocks/sdk/model/Notification.java +src/main/java/com/fireblocks/sdk/model/NotificationAttempt.java src/main/java/com/fireblocks/sdk/model/NotificationPaginatedResponse.java src/main/java/com/fireblocks/sdk/model/NotificationStatus.java src/main/java/com/fireblocks/sdk/model/NotificationWithData.java @@ -1447,6 +1449,7 @@ src/test/java/com/fireblocks/sdk/model/NetworkIdTest.java src/test/java/com/fireblocks/sdk/model/NetworkRecordTest.java src/test/java/com/fireblocks/sdk/model/NoneNetworkRoutingDestTest.java src/test/java/com/fireblocks/sdk/model/NotFoundExceptionTest.java +src/test/java/com/fireblocks/sdk/model/NotificationAttemptTest.java src/test/java/com/fireblocks/sdk/model/NotificationPaginatedResponseTest.java src/test/java/com/fireblocks/sdk/model/NotificationStatusTest.java src/test/java/com/fireblocks/sdk/model/NotificationTest.java diff --git a/README.md b/README.md index eb1a6b5..226c108 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Add this dependency to your project's POM: com.fireblocks.sdk fireblocks-sdk - 8.0.0 + 0.0.0 compile ``` @@ -42,7 +42,7 @@ Add this dependency to your project's POM: Add this dependency to your project's build file: ```groovy -compile "com.fireblocks.sdk:fireblocks-sdk:8.0.0" +compile "com.fireblocks.sdk:fireblocks-sdk:0.0.0" ``` ### Others @@ -55,7 +55,7 @@ mvn clean package Then manually install the following JARs: -- `target/fireblocks-sdk-8.0.0.jar` +- `target/fireblocks-sdk-0.0.0.jar` - `target/lib/*.jar` @@ -397,6 +397,7 @@ Class | Method | HTTP request | Description *WebhooksV2BetaApi* | [**getNotifications**](docs/WebhooksV2BetaApi.md#getNotifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id *WebhooksV2BetaApi* | [**getWebhook**](docs/WebhooksV2BetaApi.md#getWebhook) | **GET** /webhooks/{webhookId} | Get webhook by id *WebhooksV2BetaApi* | [**getWebhooks**](docs/WebhooksV2BetaApi.md#getWebhooks) | **GET** /webhooks | Get all webhooks +*WebhooksV2BetaApi* | [**resendNotificationById**](docs/WebhooksV2BetaApi.md#resendNotificationById) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id *WebhooksV2BetaApi* | [**updateWebhook**](docs/WebhooksV2BetaApi.md#updateWebhook) | **PATCH** /webhooks/{webhookId} | Update webhook *WhitelistIpAddressesApi* | [**getWhitelistIpAddresses**](docs/WhitelistIpAddressesApi.md#getWhitelistIpAddresses) | **GET** /management/api_users/{userId}/whitelist_ip_addresses | Gets whitelisted ip addresses *WorkspaceStatusBetaApi* | [**getWorkspaceStatus**](docs/WorkspaceStatusBetaApi.md#getWorkspaceStatus) | **GET** /management/workspace_status | Returns current workspace status @@ -662,6 +663,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) diff --git a/api/openapi.yaml b/api/openapi.yaml index 81ee453..5f59e3f 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -4197,6 +4197,14 @@ paths: schema: type: boolean style: form + - description: "Include just your networkIds. Optional, default false" + explode: true + in: query + name: onlySelf + required: false + schema: + type: boolean + style: form - description: "Exclude connected networkIds. Optional, default false" explode: true in: query @@ -4255,11 +4263,11 @@ paths: - language: java code: "CompletableFuture> response\ \ = fireblocks.networkConnections().searchNetworkIds(search, excludeSelf,\ - \ excludeConnected, pageCursor, pageSize);" + \ onlySelf, excludeConnected, pageCursor, pageSize);" name: Fireblocks SDK Java example - language: python code: "response = fireblocks.network_connections.search_network_ids(search,\ - \ exclude_self, exclude_connected, page_cursor, page_size);" + \ exclude_self, only_self, exclude_connected, page_cursor, page_size);" name: Fireblocks SDK Python example x-codeSamples: - lang: TypeScript @@ -4268,10 +4276,10 @@ paths: - lang: Java source: "CompletableFuture> response\ \ = fireblocks.networkConnections().searchNetworkIds(search, excludeSelf,\ - \ excludeConnected, pageCursor, pageSize);" + \ onlySelf, excludeConnected, pageCursor, pageSize);" - lang: Python source: "response = fireblocks.network_connections.search_network_ids(search,\ - \ exclude_self, exclude_connected, page_cursor, page_size);" + \ exclude_self, only_self, exclude_connected, page_cursor, page_size);" x-accepts: application/json /network_ids/{networkId}: delete: @@ -11273,6 +11281,15 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' summary: Get all notifications by webhook id tags: - Webhooks V2 (Beta) @@ -11346,6 +11363,15 @@ paths: headers: X-Request-ID: $ref: '#/components/headers/X-Request-ID' + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' summary: Get notification by id tags: - Webhooks V2 (Beta) @@ -11374,6 +11400,81 @@ paths: source: "response = fireblocks.webhooks_v2_beta.get_notification(webhook_id,\ \ notification_id, include_data);" x-accepts: application/json + /webhooks/{webhookId}/notifications/{notificationId}/resend: + post: + description: | + Resend notification by ID + **Note:** These endpoints are currently in beta and might be subject to changes. + operationId: resendNotificationById + parameters: + - description: The ID of the webhook + explode: false + in: path + name: webhookId + required: true + schema: + type: string + style: simple + - description: The ID of the notification + explode: false + in: path + name: notificationId + required: true + schema: + type: string + style: simple + - description: "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." + explode: false + in: header + name: Idempotency-Key + required: false + schema: + type: string + style: simple + responses: + "202": + description: Resend notification request was accepted and is being processed + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + default: + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorSchema' + description: Error Response + headers: + X-Request-ID: + $ref: '#/components/headers/X-Request-ID' + summary: Resend notification by id + tags: + - Webhooks V2 (Beta) + x-readme: + code-samples: + - language: typescript + code: "const response: Promise> = fireblocks.webhooksV2Beta.resendNotificationById(webhooksV2BetaApiResendNotificationByIdRequest);" + name: Fireblocks SDK TypeScript example + - language: java + code: "CompletableFuture> response = fireblocks.webhooksV2Beta().resendNotificationById(webhookId,\ + \ notificationId, idempotencyKey);" + name: Fireblocks SDK Java example + - language: python + code: "response = fireblocks.webhooks_v2_beta.resend_notification_by_id(webhook_id,\ + \ notification_id, idempotency_key);" + name: Fireblocks SDK Python example + x-codeSamples: + - lang: TypeScript + source: "const response: Promise> = fireblocks.webhooksV2Beta.resendNotificationById(webhooksV2BetaApiResendNotificationByIdRequest);" + - lang: Java + source: "CompletableFuture> response = fireblocks.webhooksV2Beta().resendNotificationById(webhookId,\ + \ notificationId, idempotencyKey);" + - lang: Python + source: "response = fireblocks.webhooks_v2_beta.resend_notification_by_id(webhook_id,\ + \ notification_id, idempotency_key);" + x-accepts: application/json /tokenization/templates: get: description: Return minimal representation of all the contract templates available @@ -27166,40 +27267,16 @@ components: - vault_account.created - vault_account.asset.listed - vault_account.asset.balance_updated - - vault_account.nft.balance_updated + - embedded_wallet.status.updated - embedded_wallet.created - embedded_wallet.asset.balance_updated - embedded_wallet.asset.listed - embedded_wallet.account.created - embedded_wallet.device.added - - embedded_wallet.transaction.updated - - exchange_account.connected - - fiat_account.connected - - ticket.created - - ticket.submitted - - ticket.expired - - ticket.canceled - - ticket.fulfilled - - ticket.counterparty.added - - ticket.counterparty_external_id.set - - ticket.note.added - - ticket.expired_in.set - - ticket.expired_at.set - - ticket.term.added - - ticket.term.updated - - ticket.term.deleted - - ticket.term.funded - - ticket.term.manually_funded - - ticket.term.funding_canceled - - ticket.term.funding_failed - - ticket.term.funding_completed - - ticket.term.transaction_status_changed - - settlement.created - - collateral.status.updated type: string Webhook: example: - createdAt: 2021-09-01T12:00:00Z + createdAt: 1625126400000 description: This webhook is used for transactions notifications id: 123e4567-e89b-12d3-a456-426614174000 url: https://example.com/webhook @@ -27207,7 +27284,7 @@ components: - transaction.created - transaction.status.updated status: ENABLED - updatedAt: 2021-09-05T15:00:00Z + updatedAt: 1625126400000 properties: id: description: The id of the webhook @@ -27238,24 +27315,32 @@ components: enum: - DISABLED - ENABLED + - SUSPENDED example: ENABLED type: string createdAt: - description: The date and time the webhook was created - example: 2021-09-01T12:00:00Z - format: date-time - type: string + description: The date and time the webhook was created in milliseconds + example: 1625126400000 + format: int64 + type: integer updatedAt: - description: The date and time the webhook was last updated - example: 2021-09-05T15:00:00Z - format: date-time - type: string + description: The date and time the webhook was last updated in milliseconds + example: 1625126400000 + format: int64 + type: integer + required: + - createdAt + - events + - id + - status + - updatedAt + - url type: object WebhookPaginatedResponse: example: next: eJ0eXAiOiJKV1QiLCJhbGcOiJIUzI1NiJ9 data: - - createdAt: 2021-09-01T12:00:00Z + - createdAt: 1625126400000 description: This webhook is used for transactions notifications id: 123e4567-e89b-12d3-a456-426614174000 url: https://example.com/webhook @@ -27263,8 +27348,8 @@ components: - transaction.created - transaction.status.updated status: ENABLED - updatedAt: 2021-09-05T15:00:00Z - - createdAt: 2021-09-01T12:00:00Z + updatedAt: 1625126400000 + - createdAt: 1625126400000 description: This webhook is used for transactions notifications id: 123e4567-e89b-12d3-a456-426614174000 url: https://example.com/webhook @@ -27272,7 +27357,7 @@ components: - transaction.created - transaction.status.updated status: ENABLED - updatedAt: 2021-09-05T15:00:00Z + updatedAt: 1625126400000 properties: data: description: The data of the current page @@ -27322,7 +27407,6 @@ components: example: false type: boolean required: - - description - events - url type: object @@ -27368,18 +27452,54 @@ components: - IN_PROGRESS example: COMPLETED type: string + NotificationAttempt: + example: + duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + properties: + sentTime: + description: The time when the attempt was sent in milliseconds. + example: 1625126400000 + format: int64 + type: integer + duration: + description: The duration of the attempt in milliseconds. + example: 130 + type: integer + responseCode: + description: "The response code of the attempt, when missing refer to failureReason." + example: 200 + type: integer + failureReason: + description: The request failure reason in case responseCode is missing. + enum: + - TIMED_OUT + - NO_RESPONSE + example: TIMED_OUT + type: string + required: + - duration + - sentTime + type: object Notification: example: - createdAt: 2021-07-01T00:00:00Z + createdAt: 1625126400000 resourceId: 44fcead0-7053-4831-a53a-df7fb90d440f - eventVersion: 1 id: 44fcead0-7053-4831-a53a-df7fb90d440f eventType: null - updatedAt: 2021-07-01T00:00:00Z + updatedAt: 1625126400000 status: COMPLETED attempts: - - attempts - - attempts + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 properties: id: description: The id of the Notification @@ -27387,23 +27507,19 @@ components: format: uuid type: string createdAt: - description: The creation date of the notification - example: 2021-07-01T00:00:00Z - format: date-time - type: string + description: The creation date of the notification in milliseconds + example: 1625126400000 + format: int64 + type: integer updatedAt: - description: The date when the notification was updated - example: 2021-07-01T00:00:00Z - format: date-time - type: string + description: The date when the notification was updated in milliseconds + example: 1625126400000 + format: int64 + type: integer status: $ref: '#/components/schemas/NotificationStatus' eventType: $ref: '#/components/schemas/WebhookEvent' - eventVersion: - description: The event version of the Notification - example: 1 - type: number resourceId: description: The resource id of the event which the Notification is listen to @@ -27415,12 +27531,12 @@ components: default: [] description: The attempts related to Notification items: - type: string + $ref: '#/components/schemas/NotificationAttempt' type: array required: + - attempts - createdAt - eventType - - eventVersion - id - status - updatedAt @@ -27429,26 +27545,36 @@ components: example: next: eJ0eXAiOiJKV1QiLCJhbGcOiJIUzI1NiJ9 data: - - createdAt: 2021-07-01T00:00:00Z + - createdAt: 1625126400000 resourceId: 44fcead0-7053-4831-a53a-df7fb90d440f - eventVersion: 1 id: 44fcead0-7053-4831-a53a-df7fb90d440f eventType: null - updatedAt: 2021-07-01T00:00:00Z + updatedAt: 1625126400000 status: COMPLETED attempts: - - attempts - - attempts - - createdAt: 2021-07-01T00:00:00Z + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + - createdAt: 1625126400000 resourceId: 44fcead0-7053-4831-a53a-df7fb90d440f - eventVersion: 1 id: 44fcead0-7053-4831-a53a-df7fb90d440f eventType: null - updatedAt: 2021-07-01T00:00:00Z + updatedAt: 1625126400000 status: COMPLETED attempts: - - attempts - - attempts + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 properties: data: description: The data of the current page @@ -27465,40 +27591,41 @@ components: type: object NotificationWithData: example: - createdAt: 2021-07-01T00:00:00Z + createdAt: 1625126400000 resourceId: 44fcead0-7053-4831-a53a-df7fb90d440f data: "{}" - eventVersion: 1 id: 44fcead0-7053-4831-a53a-df7fb90d440f eventType: null - updatedAt: 2021-07-01T00:00:00Z + updatedAt: 1625126400000 status: COMPLETED attempts: - - attempts - - attempts + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 + - duration: 130 + failureReason: TIMED_OUT + sentTime: 1625126400000 + responseCode: 200 properties: id: example: 44fcead0-7053-4831-a53a-df7fb90d440f format: uuid type: string createdAt: - description: The creation date of the notification - example: 2021-07-01T00:00:00Z - format: date-time - type: string + description: The creation date of the notification in milliseconds + example: 1625126400000 + format: int64 + type: integer updatedAt: - description: The date when the notification was updated - example: 2021-07-01T00:00:00Z - format: date-time - type: string + description: The date when the notification was updated in milliseconds + example: 1625126400000 + format: int64 + type: integer status: $ref: '#/components/schemas/NotificationStatus' eventType: $ref: '#/components/schemas/WebhookEvent' - eventVersion: - description: The event version which the Notification is listen to - example: 1 - type: number resourceId: description: The resource id of the event which the Notification is listen to @@ -27510,7 +27637,7 @@ components: default: [] description: The attempts related to Notification items: - type: string + $ref: '#/components/schemas/NotificationAttempt' type: array data: description: notification data @@ -27519,7 +27646,6 @@ components: - attempts - createdAt - eventType - - eventVersion - id - status - updatedAt diff --git a/build.gradle b/build.gradle index 67b9e80..358eefb 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'eclipse' apply plugin: 'com.diffplug.spotless' group = 'com.fireblocks.sdk' -version = '8.0.0' +version = '0.0.0' buildscript { repositories { diff --git a/docs/CreateWebhookRequest.md b/docs/CreateWebhookRequest.md index cd9f04a..41a52a9 100644 --- a/docs/CreateWebhookRequest.md +++ b/docs/CreateWebhookRequest.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**url** | **String** | The url of the webhook where notifications will be sent. URL must be valid, unique and https. | | -|**description** | **String** | description of the webhook. should not contain special characters. | | +|**description** | **String** | description of the webhook. should not contain special characters. | [optional] | |**events** | **List<WebhookEvent>** | event types the webhook will subscribe to | | |**enabled** | **Boolean** | The status of the webhook. If false, the webhook will not receive notifications. | [optional] | diff --git a/docs/NetworkConnectionsApi.md b/docs/NetworkConnectionsApi.md index d3639c8..577edf0 100644 --- a/docs/NetworkConnectionsApi.md +++ b/docs/NetworkConnectionsApi.md @@ -848,7 +848,7 @@ No authorization required ## searchNetworkIds -> CompletableFuture> searchNetworkIds searchNetworkIds(search, excludeSelf, excludeConnected, pageCursor, pageSize) +> CompletableFuture> searchNetworkIds searchNetworkIds(search, excludeSelf, onlySelf, excludeConnected, pageCursor, pageSize) Search network IDs, both local IDs and discoverable remote IDs @@ -879,11 +879,12 @@ public class Example { String search = "search_example"; // String | Search string - displayName networkId. Optional Boolean excludeSelf = true; // Boolean | Exclude your networkIds. Optional, default false + Boolean onlySelf = true; // Boolean | Include just your networkIds. Optional, default false Boolean excludeConnected = true; // Boolean | Exclude connected networkIds. Optional, default false String pageCursor = "pageCursor_example"; // String | ID of the record after which to fetch $limit records BigDecimal pageSize = new BigDecimal("50"); // BigDecimal | Number of records to fetch. By default, it is 50 try { - CompletableFuture> response = fireblocks.networkConnections().searchNetworkIds(search, excludeSelf, excludeConnected, pageCursor, pageSize); + CompletableFuture> response = fireblocks.networkConnections().searchNetworkIds(search, excludeSelf, onlySelf, excludeConnected, pageCursor, pageSize); System.out.println("Status code: " + response.get().getStatusCode()); System.out.println("Response headers: " + response.get().getHeaders()); System.out.println("Response body: " + response.get().getData()); @@ -912,6 +913,7 @@ public class Example { |------------- | ------------- | ------------- | -------------| | **search** | **String**| Search string - displayName networkId. Optional | [optional] | | **excludeSelf** | **Boolean**| Exclude your networkIds. Optional, default false | [optional] | +| **onlySelf** | **Boolean**| Include just your networkIds. Optional, default false | [optional] | | **excludeConnected** | **Boolean**| Exclude connected networkIds. Optional, default false | [optional] | | **pageCursor** | **String**| ID of the record after which to fetch $limit records | [optional] | | **pageSize** | **BigDecimal**| Number of records to fetch. By default, it is 50 | [optional] [default to 50] | diff --git a/docs/Notification.md b/docs/Notification.md index f43d5c1..5ecd1c5 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -8,13 +8,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **UUID** | The id of the Notification | | -|**createdAt** | **OffsetDateTime** | The creation date of the notification | | -|**updatedAt** | **OffsetDateTime** | The date when the notification was updated | | +|**createdAt** | **Long** | The creation date of the notification in milliseconds | | +|**updatedAt** | **Long** | The date when the notification was updated in milliseconds | | |**status** | **NotificationStatus** | | | |**eventType** | **WebhookEvent** | | | -|**eventVersion** | **BigDecimal** | The event version of the Notification | | |**resourceId** | **UUID** | The resource id of the event which the Notification is listen to | [optional] | -|**attempts** | **List<String>** | The attempts related to Notification | [optional] | +|**attempts** | [**List<NotificationAttempt>**](NotificationAttempt.md) | The attempts related to Notification | | diff --git a/docs/NotificationAttempt.md b/docs/NotificationAttempt.md new file mode 100644 index 0000000..4ea6079 --- /dev/null +++ b/docs/NotificationAttempt.md @@ -0,0 +1,25 @@ + + +# NotificationAttempt + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**sentTime** | **Long** | The time when the attempt was sent in milliseconds. | | +|**duration** | **Integer** | The duration of the attempt in milliseconds. | | +|**responseCode** | **Integer** | The response code of the attempt, when missing refer to failureReason. | [optional] | +|**failureReason** | [**FailureReasonEnum**](#FailureReasonEnum) | The request failure reason in case responseCode is missing. | [optional] | + + + +## Enum: FailureReasonEnum + +| Name | Value | +|---- | -----| +| TIMED_OUT | "TIMED_OUT" | +| NO_RESPONSE | "NO_RESPONSE" | + + + diff --git a/docs/NotificationWithData.md b/docs/NotificationWithData.md index 95f6a1a..f1cbbf4 100644 --- a/docs/NotificationWithData.md +++ b/docs/NotificationWithData.md @@ -8,13 +8,12 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**id** | **UUID** | | | -|**createdAt** | **OffsetDateTime** | The creation date of the notification | | -|**updatedAt** | **OffsetDateTime** | The date when the notification was updated | | +|**createdAt** | **Long** | The creation date of the notification in milliseconds | | +|**updatedAt** | **Long** | The date when the notification was updated in milliseconds | | |**status** | **NotificationStatus** | | | |**eventType** | **WebhookEvent** | | | -|**eventVersion** | **BigDecimal** | The event version which the Notification is listen to | | |**resourceId** | **UUID** | The resource id of the event which the Notification is listen to | [optional] | -|**attempts** | **List<String>** | The attempts related to Notification | | +|**attempts** | [**List<NotificationAttempt>**](NotificationAttempt.md) | The attempts related to Notification | | |**data** | **Object** | notification data | [optional] | diff --git a/docs/Webhook.md b/docs/Webhook.md index fcbdab0..f938aca 100644 --- a/docs/Webhook.md +++ b/docs/Webhook.md @@ -7,13 +7,13 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| -|**id** | **UUID** | The id of the webhook | [optional] | -|**url** | **String** | The url of the webhook where notifications will be sent. Must be a valid URL and https. | [optional] | +|**id** | **UUID** | The id of the webhook | | +|**url** | **String** | The url of the webhook where notifications will be sent. Must be a valid URL and https. | | |**description** | **String** | description of the webhook of what it is used for | [optional] | -|**events** | **List<WebhookEvent>** | The events that the webhook will be subscribed to | [optional] | -|**status** | [**StatusEnum**](#StatusEnum) | The status of the webhook | [optional] | -|**createdAt** | **OffsetDateTime** | The date and time the webhook was created | [optional] | -|**updatedAt** | **OffsetDateTime** | The date and time the webhook was last updated | [optional] | +|**events** | **List<WebhookEvent>** | The events that the webhook will be subscribed to | | +|**status** | [**StatusEnum**](#StatusEnum) | The status of the webhook | | +|**createdAt** | **Long** | The date and time the webhook was created in milliseconds | | +|**updatedAt** | **Long** | The date and time the webhook was last updated in milliseconds | | @@ -23,6 +23,7 @@ |---- | -----| | DISABLED | "DISABLED" | | ENABLED | "ENABLED" | +| SUSPENDED | "SUSPENDED" | diff --git a/docs/WebhookEvent.md b/docs/WebhookEvent.md index a3d5141..545f2dd 100644 --- a/docs/WebhookEvent.md +++ b/docs/WebhookEvent.md @@ -29,7 +29,7 @@ * `VAULT_ACCOUNT_ASSET_BALANCE_UPDATED` (value: `"vault_account.asset.balance_updated"`) -* `VAULT_ACCOUNT_NFT_BALANCE_UPDATED` (value: `"vault_account.nft.balance_updated"`) +* `EMBEDDED_WALLET_STATUS_UPDATED` (value: `"embedded_wallet.status.updated"`) * `EMBEDDED_WALLET_CREATED` (value: `"embedded_wallet.created"`) @@ -41,53 +41,5 @@ * `EMBEDDED_WALLET_DEVICE_ADDED` (value: `"embedded_wallet.device.added"`) -* `EMBEDDED_WALLET_TRANSACTION_UPDATED` (value: `"embedded_wallet.transaction.updated"`) - -* `EXCHANGE_ACCOUNT_CONNECTED` (value: `"exchange_account.connected"`) - -* `FIAT_ACCOUNT_CONNECTED` (value: `"fiat_account.connected"`) - -* `TICKET_CREATED` (value: `"ticket.created"`) - -* `TICKET_SUBMITTED` (value: `"ticket.submitted"`) - -* `TICKET_EXPIRED` (value: `"ticket.expired"`) - -* `TICKET_CANCELED` (value: `"ticket.canceled"`) - -* `TICKET_FULFILLED` (value: `"ticket.fulfilled"`) - -* `TICKET_COUNTERPARTY_ADDED` (value: `"ticket.counterparty.added"`) - -* `TICKET_COUNTERPARTY_EXTERNAL_ID_SET` (value: `"ticket.counterparty_external_id.set"`) - -* `TICKET_NOTE_ADDED` (value: `"ticket.note.added"`) - -* `TICKET_EXPIRED_IN_SET` (value: `"ticket.expired_in.set"`) - -* `TICKET_EXPIRED_AT_SET` (value: `"ticket.expired_at.set"`) - -* `TICKET_TERM_ADDED` (value: `"ticket.term.added"`) - -* `TICKET_TERM_UPDATED` (value: `"ticket.term.updated"`) - -* `TICKET_TERM_DELETED` (value: `"ticket.term.deleted"`) - -* `TICKET_TERM_FUNDED` (value: `"ticket.term.funded"`) - -* `TICKET_TERM_MANUALLY_FUNDED` (value: `"ticket.term.manually_funded"`) - -* `TICKET_TERM_FUNDING_CANCELED` (value: `"ticket.term.funding_canceled"`) - -* `TICKET_TERM_FUNDING_FAILED` (value: `"ticket.term.funding_failed"`) - -* `TICKET_TERM_FUNDING_COMPLETED` (value: `"ticket.term.funding_completed"`) - -* `TICKET_TERM_TRANSACTION_STATUS_CHANGED` (value: `"ticket.term.transaction_status_changed"`) - -* `SETTLEMENT_CREATED` (value: `"settlement.created"`) - -* `COLLATERAL_STATUS_UPDATED` (value: `"collateral.status.updated"`) - diff --git a/docs/WebhooksV2BetaApi.md b/docs/WebhooksV2BetaApi.md index 938200c..9bc5a91 100644 --- a/docs/WebhooksV2BetaApi.md +++ b/docs/WebhooksV2BetaApi.md @@ -10,6 +10,7 @@ All URIs are relative to https://developers.fireblocks.com/reference/ | [**getNotifications**](WebhooksV2BetaApi.md#getNotifications) | **GET** /webhooks/{webhookId}/notifications | Get all notifications by webhook id | | [**getWebhook**](WebhooksV2BetaApi.md#getWebhook) | **GET** /webhooks/{webhookId} | Get webhook by id | | [**getWebhooks**](WebhooksV2BetaApi.md#getWebhooks) | **GET** /webhooks | Get all webhooks | +| [**resendNotificationById**](WebhooksV2BetaApi.md#resendNotificationById) | **POST** /webhooks/{webhookId}/notifications/{notificationId}/resend | Resend notification by id | | [**updateWebhook**](WebhooksV2BetaApi.md#updateWebhook) | **PATCH** /webhooks/{webhookId} | Update webhook | @@ -266,6 +267,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | OK | * X-Request-ID -
| +| **0** | Error Response | * X-Request-ID -
| ## getNotifications @@ -364,6 +366,7 @@ No authorization required | Status code | Description | Response headers | |-------------|-------------|------------------| | **200** | A paginated response containing NotificationExternalDTO objects | * X-Request-ID -
| +| **0** | Error Response | * X-Request-ID -
| ## getWebhook @@ -536,6 +539,92 @@ No authorization required | **0** | Error Response | * X-Request-ID -
| +## resendNotificationById + +> CompletableFuture> resendNotificationById resendNotificationById(webhookId, notificationId, idempotencyKey) + +Resend notification by id + +Resend notification by ID **Note:** These endpoints are currently in beta and might be subject to changes. + +### Example + +```java +// Import classes: +import com.fireblocks.sdk.ApiClient; +import com.fireblocks.sdk.ApiException; +import com.fireblocks.sdk.ApiResponse; +import com.fireblocks.sdk.BasePath; +import com.fireblocks.sdk.Fireblocks; +import com.fireblocks.sdk.ConfigurationOptions; +import com.fireblocks.sdk.model.*; +import com.fireblocks.sdk.api.WebhooksV2BetaApi; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; + +public class Example { + public static void main(String[] args) { + ConfigurationOptions configurationOptions = new ConfigurationOptions() + .basePath(BasePath.Sandbox) + .apiKey("my-api-key") + .secretKey("my-secret-key"); + Fireblocks fireblocks = new Fireblocks(configurationOptions); + + String webhookId = "webhookId_example"; // String | The ID of the webhook + String notificationId = "notificationId_example"; // String | The ID of the notification + String idempotencyKey = "idempotencyKey_example"; // String | 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. + try { + CompletableFuture> response = fireblocks.webhooksV2Beta().resendNotificationById(webhookId, notificationId, idempotencyKey); + System.out.println("Status code: " + response.get().getStatusCode()); + System.out.println("Response headers: " + response.get().getHeaders()); + } catch (InterruptedException | ExecutionException e) { + ApiException apiException = (ApiException)e.getCause(); + System.err.println("Exception when calling WebhooksV2BetaApi#resendNotificationById"); + System.err.println("Status code: " + apiException.getCode()); + System.err.println("Response headers: " + apiException.getResponseHeaders()); + System.err.println("Reason: " + apiException.getResponseBody()); + e.printStackTrace(); + } catch (ApiException e) { + System.err.println("Exception when calling WebhooksV2BetaApi#resendNotificationById"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Response headers: " + e.getResponseHeaders()); + System.err.println("Reason: " + e.getResponseBody()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **webhookId** | **String**| The ID of the webhook | | +| **notificationId** | **String**| The ID of the notification | | +| **idempotencyKey** | **String**| 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 + + +CompletableFuture> + +### 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 -
| +| **0** | Error Response | * X-Request-ID -
| + + ## updateWebhook > CompletableFuture> updateWebhook updateWebhook(updateWebhookRequest, webhookId) diff --git a/pom.xml b/pom.xml index 9951dfb..94938f5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ fireblocks-sdk jar fireblocks-sdk - 8.0.0 + 0.0.0 https://github.com/fireblocks/java-sdk The Fireblocks Official SDK is a comprehensive software development kit that enables seamless integration and interaction with the Fireblocks platform. Fireblocks is a cutting-edge blockchain infrastructure platform that provides secure and scalable solutions for managing digital assets and transactions. This SDK empowers developers to build robust applications that can interact with the Fireblocks platform's features, including creating and managing vault accounts, initiating secure transactions, managing assets, and more. It abstracts complex interactions with the Fireblocks API, making it easier for developers to leverage the platform's capabilities while adhering to best practices in security and efficiency. diff --git a/src/main/java/com/fireblocks/sdk/Configuration.java b/src/main/java/com/fireblocks/sdk/Configuration.java index 7b3b4c2..9ec56d0 100644 --- a/src/main/java/com/fireblocks/sdk/Configuration.java +++ b/src/main/java/com/fireblocks/sdk/Configuration.java @@ -14,7 +14,7 @@ @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Configuration { - public static final String VERSION = "8.0.0"; + public static final String VERSION = "0.0.0"; private static ApiClient defaultApiClient = new ApiClient(); diff --git a/src/main/java/com/fireblocks/sdk/api/NetworkConnectionsApi.java b/src/main/java/com/fireblocks/sdk/api/NetworkConnectionsApi.java index 56de9c1..51b67a2 100644 --- a/src/main/java/com/fireblocks/sdk/api/NetworkConnectionsApi.java +++ b/src/main/java/com/fireblocks/sdk/api/NetworkConnectionsApi.java @@ -890,6 +890,7 @@ private HttpRequest.Builder getRoutingPolicyAssetGroupsRequestBuilder() throws A * * @param search Search string - displayName networkId. Optional (optional) * @param excludeSelf Exclude your networkIds. Optional, default false (optional) + * @param onlySelf Include just your networkIds. Optional, default false (optional) * @param excludeConnected Exclude connected networkIds. Optional, default false (optional) * @param pageCursor ID of the record after which to fetch $limit records (optional) * @param pageSize Number of records to fetch. By default, it is 50 (optional, default to 50) @@ -899,6 +900,7 @@ private HttpRequest.Builder getRoutingPolicyAssetGroupsRequestBuilder() throws A public CompletableFuture> searchNetworkIds( String search, Boolean excludeSelf, + Boolean onlySelf, Boolean excludeConnected, String pageCursor, BigDecimal pageSize) @@ -906,7 +908,7 @@ public CompletableFuture> searchNetworkIds try { HttpRequest.Builder localVarRequestBuilder = searchNetworkIdsRequestBuilder( - search, excludeSelf, excludeConnected, pageCursor, pageSize); + search, excludeSelf, onlySelf, excludeConnected, pageCursor, pageSize); return memberVarHttpClient .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) .thenComposeAsync( @@ -942,6 +944,7 @@ public CompletableFuture> searchNetworkIds private HttpRequest.Builder searchNetworkIdsRequestBuilder( String search, Boolean excludeSelf, + Boolean onlySelf, Boolean excludeConnected, String pageCursor, BigDecimal pageSize) @@ -958,6 +961,8 @@ private HttpRequest.Builder searchNetworkIdsRequestBuilder( localVarQueryParams.addAll(ApiClient.parameterToPairs("search", search)); localVarQueryParameterBaseName = "excludeSelf"; localVarQueryParams.addAll(ApiClient.parameterToPairs("excludeSelf", excludeSelf)); + localVarQueryParameterBaseName = "onlySelf"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("onlySelf", onlySelf)); localVarQueryParameterBaseName = "excludeConnected"; localVarQueryParams.addAll( ApiClient.parameterToPairs("excludeConnected", excludeConnected)); diff --git a/src/main/java/com/fireblocks/sdk/api/WebhooksV2BetaApi.java b/src/main/java/com/fireblocks/sdk/api/WebhooksV2BetaApi.java index a1aea36..4e4d1fc 100644 --- a/src/main/java/com/fireblocks/sdk/api/WebhooksV2BetaApi.java +++ b/src/main/java/com/fireblocks/sdk/api/WebhooksV2BetaApi.java @@ -606,6 +606,77 @@ private HttpRequest.Builder getWebhooksRequestBuilder( } return localVarRequestBuilder; } + /** + * Resend notification by id Resend notification by ID **Note:** These endpoints are currently + * in beta and might be subject to changes. + * + * @param webhookId The ID of the webhook (required) + * @param notificationId The ID of the notification (required) + * @param idempotencyKey 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 CompletableFuture<ApiResponse<Void>> + * @throws ApiException if fails to make API call + */ + public CompletableFuture> resendNotificationById( + String webhookId, String notificationId, String idempotencyKey) throws ApiException { + try { + HttpRequest.Builder localVarRequestBuilder = + resendNotificationByIdRequestBuilder(webhookId, notificationId, idempotencyKey); + return memberVarHttpClient + .sendAsync(localVarRequestBuilder.build(), HttpResponse.BodyHandlers.ofString()) + .thenComposeAsync( + localVarResponse -> { + if (memberVarAsyncResponseInterceptor != null) { + memberVarAsyncResponseInterceptor.accept(localVarResponse); + } + if (localVarResponse.statusCode() / 100 != 2) { + return CompletableFuture.failedFuture( + getApiException( + "resendNotificationById", localVarResponse)); + } + return CompletableFuture.completedFuture( + new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + null)); + }); + } catch (ApiException e) { + return CompletableFuture.failedFuture(e); + } + } + + private HttpRequest.Builder resendNotificationByIdRequestBuilder( + String webhookId, String notificationId, String idempotencyKey) throws ApiException { + ValidationUtils.assertParamExistsAndNotEmpty( + "resendNotificationById", "webhookId", webhookId); + ValidationUtils.assertParamExistsAndNotEmpty( + "resendNotificationById", "notificationId", notificationId); + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/webhooks/{webhookId}/notifications/{notificationId}/resend" + .replace("{webhookId}", ApiClient.urlEncode(webhookId.toString())) + .replace( + "{notificationId}", ApiClient.urlEncode(notificationId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (idempotencyKey != null) { + localVarRequestBuilder.header("Idempotency-Key", idempotencyKey.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } /** * Update webhook Update a webhook by its id **Note:** These endpoints are currently in beta and * might be subject to changes. diff --git a/src/main/java/com/fireblocks/sdk/model/CreateWebhookRequest.java b/src/main/java/com/fireblocks/sdk/model/CreateWebhookRequest.java index 7334d1b..df392d8 100644 --- a/src/main/java/com/fireblocks/sdk/model/CreateWebhookRequest.java +++ b/src/main/java/com/fireblocks/sdk/model/CreateWebhookRequest.java @@ -79,15 +79,15 @@ public CreateWebhookRequest description(String description) { * * @return description */ - @jakarta.annotation.Nonnull + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public String getDescription() { return description; } @JsonProperty(JSON_PROPERTY_DESCRIPTION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; } diff --git a/src/main/java/com/fireblocks/sdk/model/Notification.java b/src/main/java/com/fireblocks/sdk/model/Notification.java index 6e68014..b7a9def 100644 --- a/src/main/java/com/fireblocks/sdk/model/Notification.java +++ b/src/main/java/com/fireblocks/sdk/model/Notification.java @@ -16,10 +16,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.math.BigDecimal; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -33,7 +31,6 @@ Notification.JSON_PROPERTY_UPDATED_AT, Notification.JSON_PROPERTY_STATUS, Notification.JSON_PROPERTY_EVENT_TYPE, - Notification.JSON_PROPERTY_EVENT_VERSION, Notification.JSON_PROPERTY_RESOURCE_ID, Notification.JSON_PROPERTY_ATTEMPTS }) @@ -43,10 +40,10 @@ public class Notification { private UUID id; public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; - private OffsetDateTime createdAt; + private Long createdAt; public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; - private OffsetDateTime updatedAt; + private Long updatedAt; public static final String JSON_PROPERTY_STATUS = "status"; private NotificationStatus status; @@ -54,14 +51,11 @@ public class Notification { public static final String JSON_PROPERTY_EVENT_TYPE = "eventType"; private WebhookEvent eventType; - public static final String JSON_PROPERTY_EVENT_VERSION = "eventVersion"; - private BigDecimal eventVersion; - public static final String JSON_PROPERTY_RESOURCE_ID = "resourceId"; private UUID resourceId; public static final String JSON_PROPERTY_ATTEMPTS = "attempts"; - private List attempts = new ArrayList<>(); + private List attempts = new ArrayList<>(); public Notification() {} @@ -88,49 +82,49 @@ public void setId(UUID id) { this.id = id; } - public Notification createdAt(OffsetDateTime createdAt) { + public Notification createdAt(Long createdAt) { this.createdAt = createdAt; return this; } /** - * The creation date of the notification + * The creation date of the notification in milliseconds * * @return createdAt */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getCreatedAt() { + public Long getCreatedAt() { return createdAt; } @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCreatedAt(OffsetDateTime createdAt) { + public void setCreatedAt(Long createdAt) { this.createdAt = createdAt; } - public Notification updatedAt(OffsetDateTime updatedAt) { + public Notification updatedAt(Long updatedAt) { this.updatedAt = updatedAt; return this; } /** - * The date when the notification was updated + * The date when the notification was updated in milliseconds * * @return updatedAt */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getUpdatedAt() { + public Long getUpdatedAt() { return updatedAt; } @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUpdatedAt(OffsetDateTime updatedAt) { + public void setUpdatedAt(Long updatedAt) { this.updatedAt = updatedAt; } @@ -180,29 +174,6 @@ public void setEventType(WebhookEvent eventType) { this.eventType = eventType; } - public Notification eventVersion(BigDecimal eventVersion) { - this.eventVersion = eventVersion; - return this; - } - - /** - * The event version of the Notification - * - * @return eventVersion - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getEventVersion() { - return eventVersion; - } - - @JsonProperty(JSON_PROPERTY_EVENT_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventVersion(BigDecimal eventVersion) { - this.eventVersion = eventVersion; - } - public Notification resourceId(UUID resourceId) { this.resourceId = resourceId; return this; @@ -226,12 +197,12 @@ public void setResourceId(UUID resourceId) { this.resourceId = resourceId; } - public Notification attempts(List attempts) { + public Notification attempts(List attempts) { this.attempts = attempts; return this; } - public Notification addAttemptsItem(String attemptsItem) { + public Notification addAttemptsItem(NotificationAttempt attemptsItem) { if (this.attempts == null) { this.attempts = new ArrayList<>(); } @@ -244,16 +215,16 @@ public Notification addAttemptsItem(String attemptsItem) { * * @return attempts */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ATTEMPTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAttempts() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAttempts() { return attempts; } @JsonProperty(JSON_PROPERTY_ATTEMPTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttempts(List attempts) { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setAttempts(List attempts) { this.attempts = attempts; } @@ -272,15 +243,13 @@ public boolean equals(Object o) { && Objects.equals(this.updatedAt, notification.updatedAt) && Objects.equals(this.status, notification.status) && Objects.equals(this.eventType, notification.eventType) - && Objects.equals(this.eventVersion, notification.eventVersion) && Objects.equals(this.resourceId, notification.resourceId) && Objects.equals(this.attempts, notification.attempts); } @Override public int hashCode() { - return Objects.hash( - id, createdAt, updatedAt, status, eventType, eventVersion, resourceId, attempts); + return Objects.hash(id, createdAt, updatedAt, status, eventType, resourceId, attempts); } @Override @@ -292,7 +261,6 @@ public String toString() { sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" eventVersion: ").append(toIndentedString(eventVersion)).append("\n"); sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); sb.append(" attempts: ").append(toIndentedString(attempts)).append("\n"); sb.append("}"); @@ -400,19 +368,6 @@ public String toUrlQueryString(String prefix) { .replaceAll("\\+", "%20"))); } - // add `eventVersion` to the URL query string - if (getEventVersion() != null) { - joiner.add( - String.format( - "%seventVersion%s=%s", - prefix, - suffix, - URLEncoder.encode( - String.valueOf(getEventVersion()), - StandardCharsets.UTF_8) - .replaceAll("\\+", "%20"))); - } - // add `resourceId` to the URL query string if (getResourceId() != null) { joiner.add( @@ -428,19 +383,23 @@ public String toUrlQueryString(String prefix) { // add `attempts` to the URL query string if (getAttempts() != null) { for (int i = 0; i < getAttempts().size(); i++) { - joiner.add( - String.format( - "%sattempts%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format( - "%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode( - String.valueOf(getAttempts().get(i)), - StandardCharsets.UTF_8) - .replaceAll("\\+", "%20"))); + if (getAttempts().get(i) != null) { + joiner.add( + getAttempts() + .get(i) + .toUrlQueryString( + String.format( + "%sattempts%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } } } diff --git a/src/main/java/com/fireblocks/sdk/model/NotificationAttempt.java b/src/main/java/com/fireblocks/sdk/model/NotificationAttempt.java new file mode 100644 index 0000000..7cd737e --- /dev/null +++ b/src/main/java/com/fireblocks/sdk/model/NotificationAttempt.java @@ -0,0 +1,300 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.fireblocks.sdk.model; + + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; + +/** NotificationAttempt */ +@JsonPropertyOrder({ + NotificationAttempt.JSON_PROPERTY_SENT_TIME, + NotificationAttempt.JSON_PROPERTY_DURATION, + NotificationAttempt.JSON_PROPERTY_RESPONSE_CODE, + NotificationAttempt.JSON_PROPERTY_FAILURE_REASON +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class NotificationAttempt { + public static final String JSON_PROPERTY_SENT_TIME = "sentTime"; + private Long sentTime; + + public static final String JSON_PROPERTY_DURATION = "duration"; + private Integer duration; + + public static final String JSON_PROPERTY_RESPONSE_CODE = "responseCode"; + private Integer responseCode; + + /** The request failure reason in case responseCode is missing. */ + public enum FailureReasonEnum { + TIMED_OUT("TIMED_OUT"), + + NO_RESPONSE("NO_RESPONSE"); + + private String value; + + FailureReasonEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static FailureReasonEnum fromValue(String value) { + for (FailureReasonEnum b : FailureReasonEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_FAILURE_REASON = "failureReason"; + private FailureReasonEnum failureReason; + + public NotificationAttempt() {} + + public NotificationAttempt sentTime(Long sentTime) { + this.sentTime = sentTime; + return this; + } + + /** + * The time when the attempt was sent in milliseconds. + * + * @return sentTime + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getSentTime() { + return sentTime; + } + + @JsonProperty(JSON_PROPERTY_SENT_TIME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setSentTime(Long sentTime) { + this.sentTime = sentTime; + } + + public NotificationAttempt duration(Integer duration) { + this.duration = duration; + return this; + } + + /** + * The duration of the attempt in milliseconds. + * + * @return duration + */ + @jakarta.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getDuration() { + return duration; + } + + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDuration(Integer duration) { + this.duration = duration; + } + + public NotificationAttempt responseCode(Integer responseCode) { + this.responseCode = responseCode; + return this; + } + + /** + * The response code of the attempt, when missing refer to failureReason. + * + * @return responseCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESPONSE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getResponseCode() { + return responseCode; + } + + @JsonProperty(JSON_PROPERTY_RESPONSE_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponseCode(Integer responseCode) { + this.responseCode = responseCode; + } + + public NotificationAttempt failureReason(FailureReasonEnum failureReason) { + this.failureReason = failureReason; + return this; + } + + /** + * The request failure reason in case responseCode is missing. + * + * @return failureReason + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAILURE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FailureReasonEnum getFailureReason() { + return failureReason; + } + + @JsonProperty(JSON_PROPERTY_FAILURE_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFailureReason(FailureReasonEnum failureReason) { + this.failureReason = failureReason; + } + + /** Return true if this NotificationAttempt object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NotificationAttempt notificationAttempt = (NotificationAttempt) o; + return Objects.equals(this.sentTime, notificationAttempt.sentTime) + && Objects.equals(this.duration, notificationAttempt.duration) + && Objects.equals(this.responseCode, notificationAttempt.responseCode) + && Objects.equals(this.failureReason, notificationAttempt.failureReason); + } + + @Override + public int hashCode() { + return Objects.hash(sentTime, duration, responseCode, failureReason); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NotificationAttempt {\n"); + sb.append(" sentTime: ").append(toIndentedString(sentTime)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\n"); + sb.append(" responseCode: ").append(toIndentedString(responseCode)).append("\n"); + sb.append(" failureReason: ").append(toIndentedString(failureReason)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sentTime` to the URL query string + if (getSentTime() != null) { + joiner.add( + String.format( + "%ssentTime%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getSentTime()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `duration` to the URL query string + if (getDuration() != null) { + joiner.add( + String.format( + "%sduration%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDuration()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `responseCode` to the URL query string + if (getResponseCode() != null) { + joiner.add( + String.format( + "%sresponseCode%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getResponseCode()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `failureReason` to the URL query string + if (getFailureReason() != null) { + joiner.add( + String.format( + "%sfailureReason%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getFailureReason()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } +} diff --git a/src/main/java/com/fireblocks/sdk/model/NotificationWithData.java b/src/main/java/com/fireblocks/sdk/model/NotificationWithData.java index fa020e5..3d0644f 100644 --- a/src/main/java/com/fireblocks/sdk/model/NotificationWithData.java +++ b/src/main/java/com/fireblocks/sdk/model/NotificationWithData.java @@ -16,10 +16,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.math.BigDecimal; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -33,7 +31,6 @@ NotificationWithData.JSON_PROPERTY_UPDATED_AT, NotificationWithData.JSON_PROPERTY_STATUS, NotificationWithData.JSON_PROPERTY_EVENT_TYPE, - NotificationWithData.JSON_PROPERTY_EVENT_VERSION, NotificationWithData.JSON_PROPERTY_RESOURCE_ID, NotificationWithData.JSON_PROPERTY_ATTEMPTS, NotificationWithData.JSON_PROPERTY_DATA @@ -44,10 +41,10 @@ public class NotificationWithData { private UUID id; public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; - private OffsetDateTime createdAt; + private Long createdAt; public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; - private OffsetDateTime updatedAt; + private Long updatedAt; public static final String JSON_PROPERTY_STATUS = "status"; private NotificationStatus status; @@ -55,14 +52,11 @@ public class NotificationWithData { public static final String JSON_PROPERTY_EVENT_TYPE = "eventType"; private WebhookEvent eventType; - public static final String JSON_PROPERTY_EVENT_VERSION = "eventVersion"; - private BigDecimal eventVersion; - public static final String JSON_PROPERTY_RESOURCE_ID = "resourceId"; private UUID resourceId; public static final String JSON_PROPERTY_ATTEMPTS = "attempts"; - private List attempts = new ArrayList<>(); + private List attempts = new ArrayList<>(); public static final String JSON_PROPERTY_DATA = "data"; private Object data; @@ -92,49 +86,49 @@ public void setId(UUID id) { this.id = id; } - public NotificationWithData createdAt(OffsetDateTime createdAt) { + public NotificationWithData createdAt(Long createdAt) { this.createdAt = createdAt; return this; } /** - * The creation date of the notification + * The creation date of the notification in milliseconds * * @return createdAt */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getCreatedAt() { + public Long getCreatedAt() { return createdAt; } @JsonProperty(JSON_PROPERTY_CREATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCreatedAt(OffsetDateTime createdAt) { + public void setCreatedAt(Long createdAt) { this.createdAt = createdAt; } - public NotificationWithData updatedAt(OffsetDateTime updatedAt) { + public NotificationWithData updatedAt(Long updatedAt) { this.updatedAt = updatedAt; return this; } /** - * The date when the notification was updated + * The date when the notification was updated in milliseconds * * @return updatedAt */ @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public OffsetDateTime getUpdatedAt() { + public Long getUpdatedAt() { return updatedAt; } @JsonProperty(JSON_PROPERTY_UPDATED_AT) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setUpdatedAt(OffsetDateTime updatedAt) { + public void setUpdatedAt(Long updatedAt) { this.updatedAt = updatedAt; } @@ -184,29 +178,6 @@ public void setEventType(WebhookEvent eventType) { this.eventType = eventType; } - public NotificationWithData eventVersion(BigDecimal eventVersion) { - this.eventVersion = eventVersion; - return this; - } - - /** - * The event version which the Notification is listen to - * - * @return eventVersion - */ - @jakarta.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_EVENT_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public BigDecimal getEventVersion() { - return eventVersion; - } - - @JsonProperty(JSON_PROPERTY_EVENT_VERSION) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEventVersion(BigDecimal eventVersion) { - this.eventVersion = eventVersion; - } - public NotificationWithData resourceId(UUID resourceId) { this.resourceId = resourceId; return this; @@ -230,12 +201,12 @@ public void setResourceId(UUID resourceId) { this.resourceId = resourceId; } - public NotificationWithData attempts(List attempts) { + public NotificationWithData attempts(List attempts) { this.attempts = attempts; return this; } - public NotificationWithData addAttemptsItem(String attemptsItem) { + public NotificationWithData addAttemptsItem(NotificationAttempt attemptsItem) { if (this.attempts == null) { this.attempts = new ArrayList<>(); } @@ -251,13 +222,13 @@ public NotificationWithData addAttemptsItem(String attemptsItem) { @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ATTEMPTS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getAttempts() { + public List getAttempts() { return attempts; } @JsonProperty(JSON_PROPERTY_ATTEMPTS) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setAttempts(List attempts) { + public void setAttempts(List attempts) { this.attempts = attempts; } @@ -299,7 +270,6 @@ public boolean equals(Object o) { && Objects.equals(this.updatedAt, notificationWithData.updatedAt) && Objects.equals(this.status, notificationWithData.status) && Objects.equals(this.eventType, notificationWithData.eventType) - && Objects.equals(this.eventVersion, notificationWithData.eventVersion) && Objects.equals(this.resourceId, notificationWithData.resourceId) && Objects.equals(this.attempts, notificationWithData.attempts) && Objects.equals(this.data, notificationWithData.data); @@ -308,15 +278,7 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - id, - createdAt, - updatedAt, - status, - eventType, - eventVersion, - resourceId, - attempts, - data); + id, createdAt, updatedAt, status, eventType, resourceId, attempts, data); } @Override @@ -328,7 +290,6 @@ public String toString() { sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).append("\n"); sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" eventType: ").append(toIndentedString(eventType)).append("\n"); - sb.append(" eventVersion: ").append(toIndentedString(eventVersion)).append("\n"); sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); sb.append(" attempts: ").append(toIndentedString(attempts)).append("\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); @@ -437,19 +398,6 @@ public String toUrlQueryString(String prefix) { .replaceAll("\\+", "%20"))); } - // add `eventVersion` to the URL query string - if (getEventVersion() != null) { - joiner.add( - String.format( - "%seventVersion%s=%s", - prefix, - suffix, - URLEncoder.encode( - String.valueOf(getEventVersion()), - StandardCharsets.UTF_8) - .replaceAll("\\+", "%20"))); - } - // add `resourceId` to the URL query string if (getResourceId() != null) { joiner.add( @@ -465,19 +413,23 @@ public String toUrlQueryString(String prefix) { // add `attempts` to the URL query string if (getAttempts() != null) { for (int i = 0; i < getAttempts().size(); i++) { - joiner.add( - String.format( - "%sattempts%s%s=%s", - prefix, - suffix, - "".equals(suffix) - ? "" - : String.format( - "%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode( - String.valueOf(getAttempts().get(i)), - StandardCharsets.UTF_8) - .replaceAll("\\+", "%20"))); + if (getAttempts().get(i) != null) { + joiner.add( + getAttempts() + .get(i) + .toUrlQueryString( + String.format( + "%sattempts%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } } } diff --git a/src/main/java/com/fireblocks/sdk/model/Webhook.java b/src/main/java/com/fireblocks/sdk/model/Webhook.java index 7fb80b0..b4b8e9e 100644 --- a/src/main/java/com/fireblocks/sdk/model/Webhook.java +++ b/src/main/java/com/fireblocks/sdk/model/Webhook.java @@ -20,7 +20,6 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -49,13 +48,15 @@ public class Webhook { private String description; public static final String JSON_PROPERTY_EVENTS = "events"; - private List events; + private List events = new ArrayList<>(); /** The status of the webhook */ public enum StatusEnum { DISABLED("DISABLED"), - ENABLED("ENABLED"); + ENABLED("ENABLED"), + + SUSPENDED("SUSPENDED"); private String value; @@ -88,10 +89,10 @@ public static StatusEnum fromValue(String value) { private StatusEnum status; public static final String JSON_PROPERTY_CREATED_AT = "createdAt"; - private OffsetDateTime createdAt; + private Long createdAt; public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; - private OffsetDateTime updatedAt; + private Long updatedAt; public Webhook() {} @@ -105,15 +106,15 @@ public Webhook id(UUID id) { * * @return id */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public UUID getId() { return id; } @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setId(UUID id) { this.id = id; } @@ -128,15 +129,15 @@ public Webhook url(String url) { * * @return url */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getUrl() { return url; } @JsonProperty(JSON_PROPERTY_URL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setUrl(String url) { this.url = url; } @@ -182,15 +183,15 @@ public Webhook addEventsItem(WebhookEvent eventsItem) { * * @return events */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_EVENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public List getEvents() { return events; } @JsonProperty(JSON_PROPERTY_EVENTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEvents(List events) { this.events = events; } @@ -205,62 +206,62 @@ public Webhook status(StatusEnum status) { * * @return status */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public StatusEnum getStatus() { return status; } @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setStatus(StatusEnum status) { this.status = status; } - public Webhook createdAt(OffsetDateTime createdAt) { + public Webhook createdAt(Long createdAt) { this.createdAt = createdAt; return this; } /** - * The date and time the webhook was created + * The date and time the webhook was created in milliseconds * * @return createdAt */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getCreatedAt() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCreatedAt() { return createdAt; } @JsonProperty(JSON_PROPERTY_CREATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCreatedAt(OffsetDateTime createdAt) { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCreatedAt(Long createdAt) { this.createdAt = createdAt; } - public Webhook updatedAt(OffsetDateTime updatedAt) { + public Webhook updatedAt(Long updatedAt) { this.updatedAt = updatedAt; return this; } /** - * The date and time the webhook was last updated + * The date and time the webhook was last updated in milliseconds * * @return updatedAt */ - @jakarta.annotation.Nullable + @jakarta.annotation.Nonnull @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public OffsetDateTime getUpdatedAt() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getUpdatedAt() { return updatedAt; } @JsonProperty(JSON_PROPERTY_UPDATED_AT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUpdatedAt(OffsetDateTime updatedAt) { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setUpdatedAt(Long updatedAt) { this.updatedAt = updatedAt; } diff --git a/src/main/java/com/fireblocks/sdk/model/WebhookEvent.java b/src/main/java/com/fireblocks/sdk/model/WebhookEvent.java index c29dd19..309578b 100644 --- a/src/main/java/com/fireblocks/sdk/model/WebhookEvent.java +++ b/src/main/java/com/fireblocks/sdk/model/WebhookEvent.java @@ -42,7 +42,7 @@ public enum WebhookEvent { VAULT_ACCOUNT_ASSET_BALANCE_UPDATED("vault_account.asset.balance_updated"), - VAULT_ACCOUNT_NFT_BALANCE_UPDATED("vault_account.nft.balance_updated"), + EMBEDDED_WALLET_STATUS_UPDATED("embedded_wallet.status.updated"), EMBEDDED_WALLET_CREATED("embedded_wallet.created"), @@ -52,55 +52,7 @@ public enum WebhookEvent { EMBEDDED_WALLET_ACCOUNT_CREATED("embedded_wallet.account.created"), - EMBEDDED_WALLET_DEVICE_ADDED("embedded_wallet.device.added"), - - EMBEDDED_WALLET_TRANSACTION_UPDATED("embedded_wallet.transaction.updated"), - - EXCHANGE_ACCOUNT_CONNECTED("exchange_account.connected"), - - FIAT_ACCOUNT_CONNECTED("fiat_account.connected"), - - TICKET_CREATED("ticket.created"), - - TICKET_SUBMITTED("ticket.submitted"), - - TICKET_EXPIRED("ticket.expired"), - - TICKET_CANCELED("ticket.canceled"), - - TICKET_FULFILLED("ticket.fulfilled"), - - TICKET_COUNTERPARTY_ADDED("ticket.counterparty.added"), - - TICKET_COUNTERPARTY_EXTERNAL_ID_SET("ticket.counterparty_external_id.set"), - - TICKET_NOTE_ADDED("ticket.note.added"), - - TICKET_EXPIRED_IN_SET("ticket.expired_in.set"), - - TICKET_EXPIRED_AT_SET("ticket.expired_at.set"), - - TICKET_TERM_ADDED("ticket.term.added"), - - TICKET_TERM_UPDATED("ticket.term.updated"), - - TICKET_TERM_DELETED("ticket.term.deleted"), - - TICKET_TERM_FUNDED("ticket.term.funded"), - - TICKET_TERM_MANUALLY_FUNDED("ticket.term.manually_funded"), - - TICKET_TERM_FUNDING_CANCELED("ticket.term.funding_canceled"), - - TICKET_TERM_FUNDING_FAILED("ticket.term.funding_failed"), - - TICKET_TERM_FUNDING_COMPLETED("ticket.term.funding_completed"), - - TICKET_TERM_TRANSACTION_STATUS_CHANGED("ticket.term.transaction_status_changed"), - - SETTLEMENT_CREATED("settlement.created"), - - COLLATERAL_STATUS_UPDATED("collateral.status.updated"); + EMBEDDED_WALLET_DEVICE_ADDED("embedded_wallet.device.added"); private String value; diff --git a/src/test/java/com/fireblocks/sdk/api/NetworkConnectionsApiTest.java b/src/test/java/com/fireblocks/sdk/api/NetworkConnectionsApiTest.java index 4917823..ca9adcd 100644 --- a/src/test/java/com/fireblocks/sdk/api/NetworkConnectionsApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/NetworkConnectionsApiTest.java @@ -294,11 +294,13 @@ public void getRoutingPolicyAssetGroupsTest() throws ApiException { public void searchNetworkIdsTest() throws ApiException { String search = null; Boolean excludeSelf = null; + Boolean onlySelf = null; Boolean excludeConnected = null; String pageCursor = null; BigDecimal pageSize = null; CompletableFuture> response = - api.searchNetworkIds(search, excludeSelf, excludeConnected, pageCursor, pageSize); + api.searchNetworkIds( + search, excludeSelf, onlySelf, excludeConnected, pageCursor, pageSize); } /** diff --git a/src/test/java/com/fireblocks/sdk/api/WebhooksV2BetaApiTest.java b/src/test/java/com/fireblocks/sdk/api/WebhooksV2BetaApiTest.java index b08550f..fbebede 100644 --- a/src/test/java/com/fireblocks/sdk/api/WebhooksV2BetaApiTest.java +++ b/src/test/java/com/fireblocks/sdk/api/WebhooksV2BetaApiTest.java @@ -146,6 +146,24 @@ public void getWebhooksTest() throws ApiException { api.getWebhooks(order, pageCursor, pageSize); } + /** + * Resend notification by id + * + *

Resend notification by ID **Note:** These endpoints are currently in beta and might be + * subject to changes. + * + * @throws ApiException if the Api call fails + */ + @Test + public void resendNotificationByIdTest() throws ApiException { + String webhookId = null; + String notificationId = null; + String idempotencyKey = null; + + CompletableFuture> response = + api.resendNotificationById(webhookId, notificationId, idempotencyKey); + } + /** * Update webhook * diff --git a/src/test/java/com/fireblocks/sdk/model/NotificationAttemptTest.java b/src/test/java/com/fireblocks/sdk/model/NotificationAttemptTest.java new file mode 100644 index 0000000..fda70df --- /dev/null +++ b/src/test/java/com/fireblocks/sdk/model/NotificationAttemptTest.java @@ -0,0 +1,51 @@ +/* + * Fireblocks API + * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * + * The version of the OpenAPI document: 1.6.2 + * Contact: support@fireblocks.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.fireblocks.sdk.model; + + +import org.junit.Test; + +/** Model tests for NotificationAttempt */ +public class NotificationAttemptTest { + private final NotificationAttempt model = new NotificationAttempt(); + + /** Model tests for NotificationAttempt */ + @Test + public void testNotificationAttempt() { + // TODO: test NotificationAttempt + } + + /** Test the property 'sentTime' */ + @Test + public void sentTimeTest() { + // TODO: test sentTime + } + + /** Test the property 'duration' */ + @Test + public void durationTest() { + // TODO: test duration + } + + /** Test the property 'responseCode' */ + @Test + public void responseCodeTest() { + // TODO: test responseCode + } + + /** Test the property 'failureReason' */ + @Test + public void failureReasonTest() { + // TODO: test failureReason + } +} diff --git a/src/test/java/com/fireblocks/sdk/model/NotificationTest.java b/src/test/java/com/fireblocks/sdk/model/NotificationTest.java index 31044a5..0480535 100644 --- a/src/test/java/com/fireblocks/sdk/model/NotificationTest.java +++ b/src/test/java/com/fireblocks/sdk/model/NotificationTest.java @@ -55,12 +55,6 @@ public void eventTypeTest() { // TODO: test eventType } - /** Test the property 'eventVersion' */ - @Test - public void eventVersionTest() { - // TODO: test eventVersion - } - /** Test the property 'resourceId' */ @Test public void resourceIdTest() { diff --git a/src/test/java/com/fireblocks/sdk/model/NotificationWithDataTest.java b/src/test/java/com/fireblocks/sdk/model/NotificationWithDataTest.java index 42240b2..b1b77f6 100644 --- a/src/test/java/com/fireblocks/sdk/model/NotificationWithDataTest.java +++ b/src/test/java/com/fireblocks/sdk/model/NotificationWithDataTest.java @@ -55,12 +55,6 @@ public void eventTypeTest() { // TODO: test eventType } - /** Test the property 'eventVersion' */ - @Test - public void eventVersionTest() { - // TODO: test eventVersion - } - /** Test the property 'resourceId' */ @Test public void resourceIdTest() {