diff --git a/README.md b/README.md index c4bfc95..b07ff7b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # hoprd-sdk -This Rest API enables developers to interact with a hoprd node programatically. +API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 3.0.0 -- Package version: 2.0.5 +- API version: 0.1.0 +- Package version: 2.0.0-rc.1 - Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen ## Requirements. @@ -51,204 +51,146 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.account_get_address() - pprint(api_response) -except ApiException as e: - print("Exception when calling AccountApi->account_get_address: %s\n" % e) - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.account_get_addresses() + # Get node's HOPR and native addresses. + api_response = api_instance.addresses() pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_get_addresses: %s\n" % e) + print("Exception when calling AccountApi->addresses: %s\n" % e) -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.account_get_balances() + # Get node's and associated Safe's HOPR and native balances as the allowance for HOPR + api_response = api_instance.balances() pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_get_balances: %s\n" % e) + print("Exception when calling AccountApi->balances: %s\n" % e) -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.AccountWithdrawBody() # AccountWithdrawBody | (optional) +body = hoprd_sdk.WithdrawRequest() # WithdrawRequest | try: - api_response = api_instance.account_withdraw(body=body) + # Withdraw funds from this node to the ethereum wallet address. + api_response = api_instance.withdraw(body) pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_withdraw: %s\n" % e) + print("Exception when calling AccountApi->withdraw: %s\n" % e) ``` ## Documentation for API Endpoints -All URIs are relative to */api/v3* +All URIs are relative to */* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*AccountApi* | [**account_get_address**](docs/AccountApi.md#account_get_address) | **GET** /account/address | -*AccountApi* | [**account_get_addresses**](docs/AccountApi.md#account_get_addresses) | **GET** /account/addresses | -*AccountApi* | [**account_get_balances**](docs/AccountApi.md#account_get_balances) | **GET** /account/balances | -*AccountApi* | [**account_withdraw**](docs/AccountApi.md#account_withdraw) | **POST** /account/withdraw | -*AliasesApi* | [**aliases_get_alias**](docs/AliasesApi.md#aliases_get_alias) | **GET** /aliases/{alias} | -*AliasesApi* | [**aliases_get_aliases**](docs/AliasesApi.md#aliases_get_aliases) | **GET** /aliases/ | -*AliasesApi* | [**aliases_remove_alias**](docs/AliasesApi.md#aliases_remove_alias) | **DELETE** /aliases/{alias} | -*AliasesApi* | [**aliases_set_alias**](docs/AliasesApi.md#aliases_set_alias) | **POST** /aliases/ | -*ChannelsApi* | [**channels_aggregate_tickets**](docs/ChannelsApi.md#channels_aggregate_tickets) | **POST** /channels/{channelid}/tickets/aggregate | -*ChannelsApi* | [**channels_close_channel**](docs/ChannelsApi.md#channels_close_channel) | **DELETE** /channels/{channelid}/ | -*ChannelsApi* | [**channels_fund_channel**](docs/ChannelsApi.md#channels_fund_channel) | **POST** /channels/{channelid}/fund | -*ChannelsApi* | [**channels_get_channel**](docs/ChannelsApi.md#channels_get_channel) | **GET** /channels/{channelid}/ | -*ChannelsApi* | [**channels_get_channels**](docs/ChannelsApi.md#channels_get_channels) | **GET** /channels/ | -*ChannelsApi* | [**channels_get_tickets**](docs/ChannelsApi.md#channels_get_tickets) | **GET** /channels/{channelid}/tickets | -*ChannelsApi* | [**channels_open_channel**](docs/ChannelsApi.md#channels_open_channel) | **POST** /channels/ | -*ChannelsApi* | [**channels_redeem_tickets**](docs/ChannelsApi.md#channels_redeem_tickets) | **POST** /channels/{channelid}/tickets/redeem | -*CheckHealthinessApi* | [**check_node_healthy**](docs/CheckHealthinessApi.md#check_node_healthy) | **GET** /healthyz/ | -*CheckReadyApi* | [**check_node_ready**](docs/CheckReadyApi.md#check_node_ready) | **GET** /readyz/ | -*CheckStartedApi* | [**check_node_started**](docs/CheckStartedApi.md#check_node_started) | **GET** /startedz/ | -*MessagesApi* | [**messages_delete_messages**](docs/MessagesApi.md#messages_delete_messages) | **DELETE** /messages/ | -*MessagesApi* | [**messages_get_size**](docs/MessagesApi.md#messages_get_size) | **GET** /messages/size | -*MessagesApi* | [**messages_peek_all_message**](docs/MessagesApi.md#messages_peek_all_message) | **POST** /messages/peek-all | -*MessagesApi* | [**messages_peek_message**](docs/MessagesApi.md#messages_peek_message) | **POST** /messages/peek | -*MessagesApi* | [**messages_pop_all_message**](docs/MessagesApi.md#messages_pop_all_message) | **POST** /messages/pop-all | -*MessagesApi* | [**messages_pop_message**](docs/MessagesApi.md#messages_pop_message) | **POST** /messages/pop | -*MessagesApi* | [**messages_send_message**](docs/MessagesApi.md#messages_send_message) | **POST** /messages/ | -*MessagesApi* | [**messages_websocket**](docs/MessagesApi.md#messages_websocket) | **GET** /messages/websocket | -*NodeApi* | [**node_get_entry_nodes**](docs/NodeApi.md#node_get_entry_nodes) | **GET** /node/entryNodes | -*NodeApi* | [**node_get_info**](docs/NodeApi.md#node_get_info) | **GET** /node/info | -*NodeApi* | [**node_get_metrics**](docs/NodeApi.md#node_get_metrics) | **GET** /node/metrics | -*NodeApi* | [**node_get_peers**](docs/NodeApi.md#node_get_peers) | **GET** /node/peers | -*NodeApi* | [**node_get_version**](docs/NodeApi.md#node_get_version) | **GET** /node/version | -*PeerInfoApi* | [**peer_info_get_peer_info**](docs/PeerInfoApi.md#peer_info_get_peer_info) | **GET** /peers/{peerid}/ | -*PeersApi* | [**peers_ping_peer**](docs/PeersApi.md#peers_ping_peer) | **POST** /peers/{peerid}/ping | -*SettingsApi* | [**settings_get_settings**](docs/SettingsApi.md#settings_get_settings) | **GET** /settings/ | -*SettingsApi* | [**settings_set_setting**](docs/SettingsApi.md#settings_set_setting) | **PUT** /settings/{setting} | -*TicketsApi* | [**tickets_get_statistics**](docs/TicketsApi.md#tickets_get_statistics) | **GET** /tickets/statistics | -*TicketsApi* | [**tickets_get_ticket_price**](docs/TicketsApi.md#tickets_get_ticket_price) | **GET** /tickets/price | -*TicketsApi* | [**tickets_get_tickets**](docs/TicketsApi.md#tickets_get_tickets) | **GET** /tickets/ | -*TicketsApi* | [**tickets_redeem_tickets**](docs/TicketsApi.md#tickets_redeem_tickets) | **POST** /tickets/redeem | -*TokensApi* | [**tokens_create**](docs/TokensApi.md#tokens_create) | **POST** /tokens/ | -*TokensApi* | [**tokens_delete**](docs/TokensApi.md#tokens_delete) | **DELETE** /tokens/{id} | -*TokensApi* | [**tokens_get_token**](docs/TokensApi.md#tokens_get_token) | **GET** /token | +*AccountApi* | [**addresses**](docs/AccountApi.md#addresses) | **GET** /api/v3/account/addresses | Get node's HOPR and native addresses. +*AccountApi* | [**balances**](docs/AccountApi.md#balances) | **GET** /api/v3/account/balances | Get node's and associated Safe's HOPR and native balances as the allowance for HOPR +*AccountApi* | [**withdraw**](docs/AccountApi.md#withdraw) | **POST** /api/v3/account/withdraw | Withdraw funds from this node to the ethereum wallet address. +*AliasApi* | [**aliases**](docs/AliasApi.md#aliases) | **GET** /api/v3/aliases | Get each previously set alias and its corresponding PeerId +*AliasApi* | [**delete_alias**](docs/AliasApi.md#delete_alias) | **DELETE** /api/v3/aliases/{alias} | Delete an alias. +*AliasApi* | [**get_alias**](docs/AliasApi.md#get_alias) | **GET** /api/v3/aliases/{alias} | Get alias for the PeerId (Hopr address) that have this alias assigned to it. +*AliasApi* | [**set_alias**](docs/AliasApi.md#set_alias) | **POST** /api/v3/aliases | Set alias for a peer with a specific PeerId. +*ChannelsApi* | [**aggregate_tickets_in_channel**](docs/ChannelsApi.md#aggregate_tickets_in_channel) | **POST** /api/v3/channels/{channelId}/tickets/aggregate | +*ChannelsApi* | [**close_channel**](docs/ChannelsApi.md#close_channel) | **DELETE** /api/v3/channels/{channelId} | +*ChannelsApi* | [**fund_channel**](docs/ChannelsApi.md#fund_channel) | **POST** /api/v3/channels/{channelId}/fund | +*ChannelsApi* | [**list_channels**](docs/ChannelsApi.md#list_channels) | **GET** /api/v3/channels | +*ChannelsApi* | [**open_channel**](docs/ChannelsApi.md#open_channel) | **POST** /api/v3/channels | +*ChannelsApi* | [**redeem_tickets_in_channel**](docs/ChannelsApi.md#redeem_tickets_in_channel) | **POST** /api/v3/channels/{channelId}/tickets/redeem | +*ChannelsApi* | [**show_channel**](docs/ChannelsApi.md#show_channel) | **GET** /api/v3/channels/{channelId} | +*ChannelsApi* | [**show_channel_tickets**](docs/ChannelsApi.md#show_channel_tickets) | **GET** /api/v3/channels/{channelId}/tickets | +*ChecksApi* | [**healthyz**](docs/ChecksApi.md#healthyz) | **GET** /healthyz | Check whether the node is healthy +*ChecksApi* | [**readyz**](docs/ChecksApi.md#readyz) | **GET** /readyz | Check whether the node is ready to accept connections. +*ChecksApi* | [**startedz**](docs/ChecksApi.md#startedz) | **GET** /startedz | Check whether the node is started. +*MessagesApi* | [**delete_messages**](docs/MessagesApi.md#delete_messages) | **DELETE** /api/v3/messages | Delete messages from nodes message inbox. +*MessagesApi* | [**peek**](docs/MessagesApi.md#peek) | **POST** /api/v3/messages/peek | Peek the oldest message currently present in the nodes message inbox. +*MessagesApi* | [**peek_all**](docs/MessagesApi.md#peek_all) | **POST** /api/v3/messages/peek-all | Peek the list of messages currently present in the nodes message inbox, filtered by tag, +*MessagesApi* | [**pop**](docs/MessagesApi.md#pop) | **POST** /api/v3/messages/pop | Get the oldest message currently present in the nodes message inbox. +*MessagesApi* | [**pop_all**](docs/MessagesApi.md#pop_all) | **POST** /api/v3/messages/pop-all | Get the list of messages currently present in the nodes message inbox. +*MessagesApi* | [**send_message**](docs/MessagesApi.md#send_message) | **POST** /api/v3/messages | Send a message to another peer using a given path. +*MessagesApi* | [**size**](docs/MessagesApi.md#size) | **GET** /api/v3/messages/size | Get size of filtered message inbox for a specific tag +*NetworkApi* | [**price**](docs/NetworkApi.md#price) | **GET** /api/v3/network/price | +*NodeApi* | [**entry_nodes**](docs/NodeApi.md#entry_nodes) | **GET** /api/v3/node/entryNodes | List all known entry nodes with multiaddrs and eligibility. +*NodeApi* | [**info**](docs/NodeApi.md#info) | **GET** /api/v3/node/info | Get information about this HOPR Node. +*NodeApi* | [**metrics**](docs/NodeApi.md#metrics) | **GET** /api/v3/node/metrics | Retrieve Prometheus metrics from the running node. +*NodeApi* | [**peers**](docs/NodeApi.md#peers) | **GET** /api/v3/node/peers | Lists information for `connected peers` and `announced peers`. +*NodeApi* | [**version**](docs/NodeApi.md#version) | **GET** /api/v3/node/version | Get release version of the running node. +*PeersApi* | [**ping_peer**](docs/PeersApi.md#ping_peer) | **POST** /api/v3/peers/{peerId}/ping | +*PeersApi* | [**show_peer_info**](docs/PeersApi.md#show_peer_info) | **GET** /api/v3/peers/{peerId} | +*TicketsApi* | [**redeem_all_tickets**](docs/TicketsApi.md#redeem_all_tickets) | **POST** /api/v3/tickets/redeem | +*TicketsApi* | [**show_all_tickets**](docs/TicketsApi.md#show_all_tickets) | **GET** /api/v3/tickets | +*TicketsApi* | [**show_ticket_statistics**](docs/TicketsApi.md#show_ticket_statistics) | **GET** /api/v3/tickets/statistics | ## Documentation For Models - - [AccountWithdrawBody](docs/AccountWithdrawBody.md) - - [AliasesBody](docs/AliasesBody.md) - - [Channel](docs/Channel.md) - - [ChannelId](docs/ChannelId.md) - - [ChannelStatus](docs/ChannelStatus.md) - - [ChannelTopology](docs/ChannelTopology.md) - - [ChannelidFundBody](docs/ChannelidFundBody.md) - - [ChannelsBody](docs/ChannelsBody.md) - - [Currency](docs/Currency.md) - - [Error](docs/Error.md) - - [HoprAddress](docs/HoprAddress.md) - - [HoprBalance](docs/HoprBalance.md) - - [InlineResponse200](docs/InlineResponse200.md) - - [InlineResponse2001](docs/InlineResponse2001.md) - - [InlineResponse20010](docs/InlineResponse20010.md) - - [InlineResponse20011](docs/InlineResponse20011.md) - - [InlineResponse20012](docs/InlineResponse20012.md) - - [InlineResponse20013](docs/InlineResponse20013.md) - - [InlineResponse20014](docs/InlineResponse20014.md) - - [InlineResponse20015](docs/InlineResponse20015.md) - - [InlineResponse2002](docs/InlineResponse2002.md) - - [InlineResponse2002Connected](docs/InlineResponse2002Connected.md) - - [InlineResponse2002Heartbeats](docs/InlineResponse2002Heartbeats.md) - - [InlineResponse2003](docs/InlineResponse2003.md) - - [InlineResponse2004](docs/InlineResponse2004.md) - - [InlineResponse2005](docs/InlineResponse2005.md) - - [InlineResponse2006](docs/InlineResponse2006.md) - - [InlineResponse2007](docs/InlineResponse2007.md) - - [InlineResponse2008](docs/InlineResponse2008.md) - - [InlineResponse2009](docs/InlineResponse2009.md) - - [InlineResponse201](docs/InlineResponse201.md) - - [InlineResponse2011](docs/InlineResponse2011.md) - - [InlineResponse403](docs/InlineResponse403.md) - - [InlineResponse409](docs/InlineResponse409.md) - - [InlineResponse422](docs/InlineResponse422.md) - - [InlineResponse4221](docs/InlineResponse4221.md) - - [InlineResponseMap200](docs/InlineResponseMap200.md) - - [MessageBody](docs/MessageBody.md) - - [MessageTag](docs/MessageTag.md) - - [MessagesBody](docs/MessagesBody.md) - - [MessagesPeekBody](docs/MessagesPeekBody.md) - - [MessagesPeekallBody](docs/MessagesPeekallBody.md) - - [MessagesPopBody](docs/MessagesPopBody.md) - - [MessagesPopallBody](docs/MessagesPopallBody.md) - - [MultiAddress](docs/MultiAddress.md) - - [NativeAddress](docs/NativeAddress.md) - - [NativeBalance](docs/NativeBalance.md) - - [ReceivedMessage](docs/ReceivedMessage.md) - - [RequestStatus](docs/RequestStatus.md) - - [Settings](docs/Settings.md) - - [SettingsSettingBody](docs/SettingsSettingBody.md) - - [Signature](docs/Signature.md) - - [Ticket](docs/Ticket.md) - - [Token](docs/Token.md) - - [TokenCapability](docs/TokenCapability.md) - - [TokenCapabilityLimit](docs/TokenCapabilityLimit.md) - - [TokenCapabilityLimitConditions](docs/TokenCapabilityLimitConditions.md) - - [TokensBody](docs/TokensBody.md) - - [TransactionReceipt](docs/TransactionReceipt.md) + - [AccountAddresses](docs/AccountAddresses.md) + - [AccountBalances](docs/AccountBalances.md) + - [AliasPeerId](docs/AliasPeerId.md) + - [ApiError](docs/ApiError.md) + - [ChannelTicket](docs/ChannelTicket.md) + - [ChannelsQuery](docs/ChannelsQuery.md) + - [CloseChannelReceipt](docs/CloseChannelReceipt.md) + - [EntryNode](docs/EntryNode.md) + - [FundRequest](docs/FundRequest.md) + - [GetMessageReq](docs/GetMessageReq.md) + - [HeartbeatInfo](docs/HeartbeatInfo.md) + - [InboxMessagesRes](docs/InboxMessagesRes.md) + - [MessagePopRes](docs/MessagePopRes.md) + - [NodeChannel](docs/NodeChannel.md) + - [NodeChannels](docs/NodeChannels.md) + - [NodeInfoRes](docs/NodeInfoRes.md) + - [NodePeerInfo](docs/NodePeerInfo.md) + - [NodePeersReqQuery](docs/NodePeersReqQuery.md) + - [NodePeersRes](docs/NodePeersRes.md) + - [NodeTicketStatistics](docs/NodeTicketStatistics.md) + - [NodeTopologyChannel](docs/NodeTopologyChannel.md) + - [NodeVersion](docs/NodeVersion.md) + - [OpenChannelReceipt](docs/OpenChannelReceipt.md) + - [OpenChannelRequest](docs/OpenChannelRequest.md) + - [PeerIdArg](docs/PeerIdArg.md) + - [PeerInfo](docs/PeerInfo.md) + - [PingInfo](docs/PingInfo.md) + - [SendMessageReq](docs/SendMessageReq.md) + - [SendMessageRes](docs/SendMessageRes.md) + - [Size](docs/Size.md) + - [TagQuery](docs/TagQuery.md) + - [TicketPriceResponse](docs/TicketPriceResponse.md) + - [WithdrawRequest](docs/WithdrawRequest.md) ## Documentation For Authorization -## keyScheme +## api_token - **Type**: API key -- **API key parameter name**: x-auth-token +- **API key parameter name**: X-Auth-Token - **Location**: HTTP header -## passwordScheme +## bearer_token -- **Type**: HTTP basic authentication ## Author diff --git a/docs/AccountAddresses.md b/docs/AccountAddresses.md new file mode 100644 index 0000000..9913529 --- /dev/null +++ b/docs/AccountAddresses.md @@ -0,0 +1,10 @@ +# AccountAddresses + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**hopr** | **str** | | +**native** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AccountApi.md b/docs/AccountApi.md index 83f997b..c11b7c8 100644 --- a/docs/AccountApi.md +++ b/docs/AccountApi.md @@ -1,72 +1,19 @@ # hoprd_sdk.AccountApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**account_get_address**](AccountApi.md#account_get_address) | **GET** /account/address | -[**account_get_addresses**](AccountApi.md#account_get_addresses) | **GET** /account/addresses | -[**account_get_balances**](AccountApi.md#account_get_balances) | **GET** /account/balances | -[**account_withdraw**](AccountApi.md#account_withdraw) | **POST** /account/withdraw | +[**addresses**](AccountApi.md#addresses) | **GET** /api/v3/account/addresses | Get node's HOPR and native addresses. +[**balances**](AccountApi.md#balances) | **GET** /api/v3/account/balances | Get node's and associated Safe's HOPR and native balances as the allowance for HOPR +[**withdraw**](AccountApi.md#withdraw) | **POST** /api/v3/account/withdraw | Withdraw funds from this node to the ethereum wallet address. -# **account_get_address** -> InlineResponse20010 account_get_address() +# **addresses** +> AccountAddresses addresses() +Get node's HOPR and native addresses. - -Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.account_get_address() - pprint(api_response) -except ApiException as e: - print("Exception when calling AccountApi->account_get_address: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponse20010**](InlineResponse20010.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **account_get_addresses** -> InlineResponse20010 account_get_addresses() - - - -Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. +Get node's HOPR and native addresses. HOPR address is represented by the P2P PeerId and can be used by other node owner to interact with this node. ### Example ```python @@ -76,23 +23,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.account_get_addresses() + # Get node's HOPR and native addresses. + api_response = api_instance.addresses() pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_get_addresses: %s\n" % e) + print("Exception when calling AccountApi->addresses: %s\n" % e) ``` ### Parameters @@ -100,11 +45,11 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse20010**](InlineResponse20010.md) +[**AccountAddresses**](AccountAddresses.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -113,12 +58,12 @@ This endpoint does not need any parameter. [[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) -# **account_get_balances** -> InlineResponse2009 account_get_balances() - +# **balances** +> AccountBalances balances() +Get node's and associated Safe's HOPR and native balances as the allowance for HOPR -Get node's and associated Safe's HOPR and native balances as well as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance is used to fund payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. +Get node's and associated Safe's HOPR and native balances as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance are used to fund the payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. ### Example ```python @@ -128,23 +73,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.account_get_balances() + # Get node's and associated Safe's HOPR and native balances as the allowance for HOPR + api_response = api_instance.balances() pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_get_balances: %s\n" % e) + print("Exception when calling AccountApi->balances: %s\n" % e) ``` ### Parameters @@ -152,11 +95,11 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse2009**](InlineResponse2009.md) +[**AccountBalances**](AccountBalances.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -165,12 +108,12 @@ This endpoint does not need any parameter. [[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) -# **account_withdraw** -> InlineResponse2008 account_withdraw(body=body) +# **withdraw** +> AccountBalances withdraw(body) +Withdraw funds from this node to the ethereum wallet address. - -Withdraw funds from this node to your ethereum wallet address. You can choose whitch currency you want to withdraw, NATIVE or HOPR. +Withdraw funds from this node to the ethereum wallet address. Both NATIVE or HOPR can be withdrawn using this method. ### Example ```python @@ -180,39 +123,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.AccountApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.AccountWithdrawBody() # AccountWithdrawBody | (optional) +body = hoprd_sdk.WithdrawRequest() # WithdrawRequest | try: - api_response = api_instance.account_withdraw(body=body) + # Withdraw funds from this node to the ethereum wallet address. + api_response = api_instance.withdraw(body) pprint(api_response) except ApiException as e: - print("Exception when calling AccountApi->account_withdraw: %s\n" % e) + print("Exception when calling AccountApi->withdraw: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**AccountWithdrawBody**](AccountWithdrawBody.md)| | [optional] + **body** | [**WithdrawRequest**](WithdrawRequest.md)| | ### Return type -[**InlineResponse2008**](InlineResponse2008.md) +[**AccountBalances**](AccountBalances.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers diff --git a/docs/ChannelidFundBody.md b/docs/AccountBalances.md similarity index 61% rename from docs/ChannelidFundBody.md rename to docs/AccountBalances.md index a01185b..01ac690 100644 --- a/docs/ChannelidFundBody.md +++ b/docs/AccountBalances.md @@ -1,9 +1,13 @@ -# ChannelidFundBody +# AccountBalances ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**amount** | **str** | Amount of weiHOPR tokens to fund the channel. It will be used to pay for sending messages through channel | +**hopr** | **str** | | +**native** | **str** | | +**safe_hopr** | **str** | | +**safe_hopr_allowance** | **str** | | +**safe_native** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AliasApi.md b/docs/AliasApi.md new file mode 100644 index 0000000..a793f43 --- /dev/null +++ b/docs/AliasApi.md @@ -0,0 +1,222 @@ +# hoprd_sdk.AliasApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**aliases**](AliasApi.md#aliases) | **GET** /api/v3/aliases | Get each previously set alias and its corresponding PeerId +[**delete_alias**](AliasApi.md#delete_alias) | **DELETE** /api/v3/aliases/{alias} | Delete an alias. +[**get_alias**](AliasApi.md#get_alias) | **GET** /api/v3/aliases/{alias} | Get alias for the PeerId (Hopr address) that have this alias assigned to it. +[**set_alias**](AliasApi.md#set_alias) | **POST** /api/v3/aliases | Set alias for a peer with a specific PeerId. + +# **aliases** +> dict(str, str) aliases() + +Get each previously set alias and its corresponding PeerId + +Get each previously set alias and its corresponding PeerId + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token +configuration = hoprd_sdk.Configuration() +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.AliasApi(hoprd_sdk.ApiClient(configuration)) + +try: + # Get each previously set alias and its corresponding PeerId + api_response = api_instance.aliases() + pprint(api_response) +except ApiException as e: + print("Exception when calling AliasApi->aliases: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**dict(str, str)** + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **delete_alias** +> delete_alias(alias) + +Delete an alias. + +Delete an alias. + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token +configuration = hoprd_sdk.Configuration() +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.AliasApi(hoprd_sdk.ApiClient(configuration)) +alias = 'alias_example' # str | Alias to be shown + +try: + # Delete an alias. + api_instance.delete_alias(alias) +except ApiException as e: + print("Exception when calling AliasApi->delete_alias: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alias** | **str**| Alias to be shown | + +### Return type + +void (empty response body) + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **get_alias** +> PeerIdArg get_alias(alias) + +Get alias for the PeerId (Hopr address) that have this alias assigned to it. + +Get alias for the PeerId (Hopr address) that have this alias assigned to it. + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token +configuration = hoprd_sdk.Configuration() +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.AliasApi(hoprd_sdk.ApiClient(configuration)) +alias = 'alias_example' # str | Alias to be shown + +try: + # Get alias for the PeerId (Hopr address) that have this alias assigned to it. + api_response = api_instance.get_alias(alias) + pprint(api_response) +except ApiException as e: + print("Exception when calling AliasApi->get_alias: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **alias** | **str**| Alias to be shown | + +### Return type + +[**PeerIdArg**](PeerIdArg.md) + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **set_alias** +> PeerIdArg set_alias(body) + +Set alias for a peer with a specific PeerId. + +Set alias for a peer with a specific PeerId. + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token +configuration = hoprd_sdk.Configuration() +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.AliasApi(hoprd_sdk.ApiClient(configuration)) +body = hoprd_sdk.AliasPeerId() # AliasPeerId | Alias name along with the PeerId to be aliased + +try: + # Set alias for a peer with a specific PeerId. + api_response = api_instance.set_alias(body) + pprint(api_response) +except ApiException as e: + print("Exception when calling AliasApi->set_alias: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AliasPeerId**](AliasPeerId.md)| Alias name along with the PeerId to be aliased | + +### Return type + +[**PeerIdArg**](PeerIdArg.md) + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[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) + diff --git a/docs/AliasPeerId.md b/docs/AliasPeerId.md new file mode 100644 index 0000000..42518a2 --- /dev/null +++ b/docs/AliasPeerId.md @@ -0,0 +1,10 @@ +# AliasPeerId + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**alias** | **str** | | +**peer_id** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/AliasesApi.md b/docs/AliasesApi.md deleted file mode 100644 index 77e7837..0000000 --- a/docs/AliasesApi.md +++ /dev/null @@ -1,229 +0,0 @@ -# hoprd_sdk.AliasesApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**aliases_get_alias**](AliasesApi.md#aliases_get_alias) | **GET** /aliases/{alias} | -[**aliases_get_aliases**](AliasesApi.md#aliases_get_aliases) | **GET** /aliases/ | -[**aliases_remove_alias**](AliasesApi.md#aliases_remove_alias) | **DELETE** /aliases/{alias} | -[**aliases_set_alias**](AliasesApi.md#aliases_set_alias) | **POST** /aliases/ | - -# **aliases_get_alias** -> InlineResponse20015 aliases_get_alias(alias) - - - -Get the PeerId (Hopr address) that have this alias assigned to it. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AliasesApi(hoprd_sdk.ApiClient(configuration)) -alias = 'alias_example' # str | Alias that we previously assigned to some PeerId. - -try: - api_response = api_instance.aliases_get_alias(alias) - pprint(api_response) -except ApiException as e: - print("Exception when calling AliasesApi->aliases_get_alias: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **alias** | **str**| Alias that we previously assigned to some PeerId. | - -### Return type - -[**InlineResponse20015**](InlineResponse20015.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **aliases_get_aliases** -> InlineResponse2007 aliases_get_aliases() - - - -Get all aliases you set previously and thier corresponding peer IDs. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AliasesApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.aliases_get_aliases() - pprint(api_response) -except ApiException as e: - print("Exception when calling AliasesApi->aliases_get_aliases: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponse2007**](InlineResponse2007.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **aliases_remove_alias** -> aliases_remove_alias(alias) - - - -Unassign an alias from a PeerId. You can always assign back alias to that PeerId using /aliases endpoint. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AliasesApi(hoprd_sdk.ApiClient(configuration)) -alias = 'alias_example' # str | Alias that we want to remove. - -try: - api_instance.aliases_remove_alias(alias) -except ApiException as e: - print("Exception when calling AliasesApi->aliases_remove_alias: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **alias** | **str**| Alias that we want to remove. | - -### Return type - -void (empty response body) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **aliases_set_alias** -> aliases_set_alias(body=body) - - - -Instead of using HOPR address, we can assign HOPR address to a specific name called alias. Give an address a more memorable alias and use it instead of Hopr address. Aliases are kept locally and are not saved or shared on the network. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.AliasesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.AliasesBody() # AliasesBody | (optional) - -try: - api_instance.aliases_set_alias(body=body) -except ApiException as e: - print("Exception when calling AliasesApi->aliases_set_alias: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**AliasesBody**](AliasesBody.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[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) - diff --git a/docs/Error.md b/docs/ApiError.md similarity index 86% rename from docs/Error.md rename to docs/ApiError.md index da4186a..4156442 100644 --- a/docs/Error.md +++ b/docs/ApiError.md @@ -1,10 +1,10 @@ -# Error +# ApiError ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] **status** | **str** | | -**error** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Channel.md b/docs/Channel.md deleted file mode 100644 index 3d42a82..0000000 --- a/docs/Channel.md +++ /dev/null @@ -1,13 +0,0 @@ -# Channel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | Channel can be either incomming or outgoing. Incomming means that other node can send messages using this node as relay. Outgoing means that this node can use other node to send message as realy. | [optional] -**id** | [**ChannelId**](ChannelId.md) | | [optional] -**peer_id** | [**HoprAddress**](HoprAddress.md) | | [optional] -**status** | [**ChannelStatus**](ChannelStatus.md) | | [optional] -**balance** | [**HoprBalance**](HoprBalance.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AccountWithdrawBody.md b/docs/ChannelTicket.md similarity index 54% rename from docs/AccountWithdrawBody.md rename to docs/ChannelTicket.md index 5e50a66..2157750 100644 --- a/docs/AccountWithdrawBody.md +++ b/docs/ChannelTicket.md @@ -1,11 +1,15 @@ -# AccountWithdrawBody +# ChannelTicket ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**currency** | [**Currency**](Currency.md) | | -**amount** | **str** | Amount to withdraw in the currency's smallest unit. | -**ethereum_address** | [**NativeAddress**](NativeAddress.md) | | +**amount** | **str** | | +**channel_epoch** | **int** | | +**channel_id** | **str** | | +**index** | **int** | | +**index_offset** | **int** | | +**signature** | **str** | | +**win_prob** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ChannelTopology.md b/docs/ChannelTopology.md deleted file mode 100644 index 8e6dcd8..0000000 --- a/docs/ChannelTopology.md +++ /dev/null @@ -1,18 +0,0 @@ -# ChannelTopology - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channel_id** | [**ChannelId**](ChannelId.md) | | [optional] -**source_peer_id** | [**HoprAddress**](HoprAddress.md) | | [optional] -**destination_peer_id** | [**HoprAddress**](HoprAddress.md) | | [optional] -**source_address** | [**NativeAddress**](NativeAddress.md) | | [optional] -**destination_address** | [**NativeAddress**](NativeAddress.md) | | [optional] -**balance** | [**HoprBalance**](HoprBalance.md) | | [optional] -**status** | [**ChannelStatus**](ChannelStatus.md) | | [optional] -**ticket_index** | **str** | Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. | [optional] -**channel_epoch** | **str** | Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. | [optional] -**closure_time** | **str** | Time when the channel can be closed | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ChannelsApi.md b/docs/ChannelsApi.md index 10b0320..89a18af 100644 --- a/docs/ChannelsApi.md +++ b/docs/ChannelsApi.md @@ -1,25 +1,23 @@ # hoprd_sdk.ChannelsApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**channels_aggregate_tickets**](ChannelsApi.md#channels_aggregate_tickets) | **POST** /channels/{channelid}/tickets/aggregate | -[**channels_close_channel**](ChannelsApi.md#channels_close_channel) | **DELETE** /channels/{channelid}/ | -[**channels_fund_channel**](ChannelsApi.md#channels_fund_channel) | **POST** /channels/{channelid}/fund | -[**channels_get_channel**](ChannelsApi.md#channels_get_channel) | **GET** /channels/{channelid}/ | -[**channels_get_channels**](ChannelsApi.md#channels_get_channels) | **GET** /channels/ | -[**channels_get_tickets**](ChannelsApi.md#channels_get_tickets) | **GET** /channels/{channelid}/tickets | -[**channels_open_channel**](ChannelsApi.md#channels_open_channel) | **POST** /channels/ | -[**channels_redeem_tickets**](ChannelsApi.md#channels_redeem_tickets) | **POST** /channels/{channelid}/tickets/redeem | +[**aggregate_tickets_in_channel**](ChannelsApi.md#aggregate_tickets_in_channel) | **POST** /api/v3/channels/{channelId}/tickets/aggregate | +[**close_channel**](ChannelsApi.md#close_channel) | **DELETE** /api/v3/channels/{channelId} | +[**fund_channel**](ChannelsApi.md#fund_channel) | **POST** /api/v3/channels/{channelId}/fund | +[**list_channels**](ChannelsApi.md#list_channels) | **GET** /api/v3/channels | +[**open_channel**](ChannelsApi.md#open_channel) | **POST** /api/v3/channels | +[**redeem_tickets_in_channel**](ChannelsApi.md#redeem_tickets_in_channel) | **POST** /api/v3/channels/{channelId}/tickets/redeem | +[**show_channel**](ChannelsApi.md#show_channel) | **GET** /api/v3/channels/{channelId} | +[**show_channel_tickets**](ChannelsApi.md#show_channel_tickets) | **GET** /api/v3/channels/{channelId}/tickets | -# **channels_aggregate_tickets** -> channels_aggregate_tickets(channelid) +# **aggregate_tickets_in_channel** +> aggregate_tickets_in_channel(channel_id) -Takes all acknowledged and winning tickets (if any) from the given channel and aggregates them into a single ticket. Requires cooperation of the ticket issuer. - ### Example ```python from __future__ import print_function @@ -28,30 +26,27 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = 'channelid_example' # str | +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_instance.channels_aggregate_tickets(channelid) + api_instance.aggregate_tickets_in_channel(channel_id) except ApiException as e: - print("Exception when calling ChannelsApi->channels_aggregate_tickets: %s\n" % e) + print("Exception when calling ChannelsApi->aggregate_tickets_in_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | **str**| | + **channel_id** | **str**| ID of the channel. | ### Return type @@ -59,7 +54,7 @@ void (empty response body) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -68,13 +63,11 @@ void (empty response body) [[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) -# **channels_close_channel** -> InlineResponse20014 channels_close_channel(channelid) +# **close_channel** +> CloseChannelReceipt close_channel(channel_id) -Close a opened channel between this node and other node. Once you've initiated channel closure, you have to wait for a specified closure time, it will show you a closure initiation message with cool-off time you need to wait. Then you will need to send the same command again to finalize closure. This is a cool down period to give the other party in the channel sufficient time to redeem their tickets. - ### Example ```python from __future__ import print_function @@ -83,39 +76,36 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = 'channelid_example' # str | +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_response = api_instance.channels_close_channel(channelid) + api_response = api_instance.close_channel(channel_id) pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_close_channel: %s\n" % e) + print("Exception when calling ChannelsApi->close_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | **str**| | + **channel_id** | **str**| ID of the channel. | ### Return type -[**InlineResponse20014**](InlineResponse20014.md) +[**CloseChannelReceipt**](CloseChannelReceipt.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -124,13 +114,11 @@ Name | Type | Description | Notes [[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) -# **channels_fund_channel** -> InlineResponse20013 channels_fund_channel(channelid, body=body) +# **fund_channel** +> str fund_channel(body, channel_id) -Funds an existing channel with the given amount. The channel must be in state OPEN - ### Example ```python from __future__ import print_function @@ -139,56 +127,51 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = 'channelid_example' # str | -body = hoprd_sdk.ChannelidFundBody() # ChannelidFundBody | (optional) +body = hoprd_sdk.FundRequest() # FundRequest | Amount of HOPR to fund the channel +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_response = api_instance.channels_fund_channel(channelid, body=body) + api_response = api_instance.fund_channel(body, channel_id) pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_fund_channel: %s\n" % e) + print("Exception when calling ChannelsApi->fund_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | **str**| | - **body** | [**ChannelidFundBody**](ChannelidFundBody.md)| | [optional] + **body** | [**FundRequest**](FundRequest.md)| Amount of HOPR to fund the channel | + **channel_id** | **str**| ID of the channel. | ### Return type -[**InlineResponse20013**](InlineResponse20013.md) +**str** ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - **Content-Type**: application/json - - **Accept**: application/json + - **Accept**: text/plain, application/json [[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) -# **channels_get_channel** -> ChannelTopology channels_get_channel(channelid) +# **list_channels** +> NodeChannels list_channels(including_closed=including_closed, full_topology=full_topology) -Returns information about the channel. - ### Example ```python from __future__ import print_function @@ -197,39 +180,38 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = hoprd_sdk.ChannelId() # ChannelId | +including_closed = true # bool | (optional) +full_topology = true # bool | (optional) try: - api_response = api_instance.channels_get_channel(channelid) + api_response = api_instance.list_channels(including_closed=including_closed, full_topology=full_topology) pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_get_channel: %s\n" % e) + print("Exception when calling ChannelsApi->list_channels: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | [**ChannelId**](.md)| | + **including_closed** | **bool**| | [optional] + **full_topology** | **bool**| | [optional] ### Return type -[**ChannelTopology**](ChannelTopology.md) +[**NodeChannels**](NodeChannels.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -238,12 +220,10 @@ Name | Type | Description | Notes [[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) -# **channels_get_channels** -> InlineResponse2006 channels_get_channels(including_closed=including_closed, full_topology=full_topology) - +# **open_channel** +> OpenChannelReceipt open_channel(body) -Lists all active channels between this node and other nodes on the Hopr network. By default response will contain all incomming and outgoing channels that are either open, waiting to be opened, or waiting to be closed. If you also want to receive past channels that were closed, you can pass `includingClosed` in the request url query. ### Example ```python @@ -253,56 +233,49 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -including_closed = 'including_closed_example' # str | When includingClosed is passed the response will include closed channels which are ommited by default. (optional) -full_topology = 'full_topology_example' # str | Get the full payment channel graph indexed by the node. (optional) +body = hoprd_sdk.OpenChannelRequest() # OpenChannelRequest | Open channel request specification try: - api_response = api_instance.channels_get_channels(including_closed=including_closed, full_topology=full_topology) + api_response = api_instance.open_channel(body) pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_get_channels: %s\n" % e) + print("Exception when calling ChannelsApi->open_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **including_closed** | **str**| When includingClosed is passed the response will include closed channels which are ommited by default. | [optional] - **full_topology** | **str**| Get the full payment channel graph indexed by the node. | [optional] + **body** | [**OpenChannelRequest**](OpenChannelRequest.md)| Open channel request specification | ### Return type -[**InlineResponse2006**](InlineResponse2006.md) +[**OpenChannelReceipt**](OpenChannelReceipt.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[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) -# **channels_get_tickets** -> list[Ticket] channels_get_tickets(channelid) +# **redeem_tickets_in_channel** +> redeem_tickets_in_channel(channel_id) -Get tickets earned by relaying data packets by your node for the particular channel. - ### Example ```python from __future__ import print_function @@ -311,39 +284,35 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = 'channelid_example' # str | +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_response = api_instance.channels_get_tickets(channelid) - pprint(api_response) + api_instance.redeem_tickets_in_channel(channel_id) except ApiException as e: - print("Exception when calling ChannelsApi->channels_get_tickets: %s\n" % e) + print("Exception when calling ChannelsApi->redeem_tickets_in_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | **str**| | + **channel_id** | **str**| ID of the channel. | ### Return type -[**list[Ticket]**](Ticket.md) +void (empty response body) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -352,12 +321,10 @@ Name | Type | Description | Notes [[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) -# **channels_open_channel** -> InlineResponse2011 channels_open_channel(body=body) - +# **show_channel** +> NodeTopologyChannel show_channel(channel_id) -Opens a payment channel between this node and the counter party provided. This channel can be used to send messages between two nodes using other nodes on the network to relay the messages. Each message will deduce its cost from the funded amount to pay other nodes for relaying your messages. Opening a channel can take a little bit of time, because it requires some block confirmations on the blockchain. ### Example ```python @@ -367,53 +334,48 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.ChannelsBody() # ChannelsBody | (optional) +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_response = api_instance.channels_open_channel(body=body) + api_response = api_instance.show_channel(channel_id) pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_open_channel: %s\n" % e) + print("Exception when calling ChannelsApi->show_channel: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**ChannelsBody**](ChannelsBody.md)| | [optional] + **channel_id** | **str**| ID of the channel. | ### Return type -[**InlineResponse2011**](InlineResponse2011.md) +[**NodeTopologyChannel**](NodeTopologyChannel.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - - **Content-Type**: application/json + - **Content-Type**: Not defined - **Accept**: application/json [[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) -# **channels_redeem_tickets** -> channels_redeem_tickets(channelid) - +# **show_channel_tickets** +> list[ChannelTicket] show_channel_tickets(channel_id) -Redeems your tickets for this channel. Redeeming will change your tickets into Hopr tokens if they are winning ones. You can check how much tickets given channel has by calling /channels/{channelid}/tickets endpoint. Do this before channel is closed as neglected tickets are no longer valid for redeeming. ### Example ```python @@ -423,38 +385,36 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.ChannelsApi(hoprd_sdk.ApiClient(configuration)) -channelid = 'channelid_example' # str | +channel_id = 'channel_id_example' # str | ID of the channel. try: - api_instance.channels_redeem_tickets(channelid) + api_response = api_instance.show_channel_tickets(channel_id) + pprint(api_response) except ApiException as e: - print("Exception when calling ChannelsApi->channels_redeem_tickets: %s\n" % e) + print("Exception when calling ChannelsApi->show_channel_tickets: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **channelid** | **str**| | + **channel_id** | **str**| ID of the channel. | ### Return type -void (empty response body) +[**list[ChannelTicket]**](ChannelTicket.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers diff --git a/docs/ChannelsBody.md b/docs/ChannelsBody.md deleted file mode 100644 index 10ac74f..0000000 --- a/docs/ChannelsBody.md +++ /dev/null @@ -1,10 +0,0 @@ -# ChannelsBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**peer_address** | **str** | Peer address that we want to transact with using this channel. | -**amount** | **str** | Amount of HOPR tokens to fund the channel. It will be used to pay for sending messages through channel | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/AliasesBody.md b/docs/ChannelsQuery.md similarity index 65% rename from docs/AliasesBody.md rename to docs/ChannelsQuery.md index cf0b4da..64ecb48 100644 --- a/docs/AliasesBody.md +++ b/docs/ChannelsQuery.md @@ -1,10 +1,10 @@ -# AliasesBody +# ChannelsQuery ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**peer_id** | **str** | PeerId that we want to set alias to. | -**alias** | **str** | Alias that we want to attach to peerId. | +**full_topology** | **bool** | | [optional] [default to False] +**including_closed** | **bool** | | [optional] [default to False] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CheckHealthinessApi.md b/docs/CheckHealthinessApi.md deleted file mode 100644 index a9fe0ee..0000000 --- a/docs/CheckHealthinessApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# hoprd_sdk.CheckHealthinessApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**check_node_healthy**](CheckHealthinessApi.md#check_node_healthy) | **GET** /healthyz/ | - -# **check_node_healthy** -> object check_node_healthy() - - - -Check whether the node is healthy - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.CheckHealthinessApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.check_node_healthy() - pprint(api_response) -except ApiException as e: - print("Exception when calling CheckHealthinessApi->check_node_healthy: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**object** - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - diff --git a/docs/CheckReadyApi.md b/docs/CheckReadyApi.md deleted file mode 100644 index 3f96022..0000000 --- a/docs/CheckReadyApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# hoprd_sdk.CheckReadyApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**check_node_ready**](CheckReadyApi.md#check_node_ready) | **GET** /readyz/ | - -# **check_node_ready** -> object check_node_ready() - - - -Check whether the node is ready - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.CheckReadyApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.check_node_ready() - pprint(api_response) -except ApiException as e: - print("Exception when calling CheckReadyApi->check_node_ready: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**object** - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - diff --git a/docs/CheckStartedApi.md b/docs/CheckStartedApi.md deleted file mode 100644 index c476c00..0000000 --- a/docs/CheckStartedApi.md +++ /dev/null @@ -1,60 +0,0 @@ -# hoprd_sdk.CheckStartedApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**check_node_started**](CheckStartedApi.md#check_node_started) | **GET** /startedz/ | - -# **check_node_started** -> object check_node_started() - - - -Check whether the node is started - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.CheckStartedApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.check_node_started() - pprint(api_response) -except ApiException as e: - print("Exception when calling CheckStartedApi->check_node_started: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**object** - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - diff --git a/docs/ChecksApi.md b/docs/ChecksApi.md new file mode 100644 index 0000000..57e57e5 --- /dev/null +++ b/docs/ChecksApi.md @@ -0,0 +1,139 @@ +# hoprd_sdk.ChecksApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**healthyz**](ChecksApi.md#healthyz) | **GET** /healthyz | Check whether the node is healthy +[**readyz**](ChecksApi.md#readyz) | **GET** /readyz | Check whether the node is ready to accept connections. +[**startedz**](ChecksApi.md#startedz) | **GET** /startedz | Check whether the node is started. + +# **healthyz** +> healthyz() + +Check whether the node is healthy + +Check whether the node is healthy + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = hoprd_sdk.ChecksApi() + +try: + # Check whether the node is healthy + api_instance.healthyz() +except ApiException as e: + print("Exception when calling ChecksApi->healthyz: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **readyz** +> readyz() + +Check whether the node is ready to accept connections. + +Check whether the node is ready to accept connections. + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = hoprd_sdk.ChecksApi() + +try: + # Check whether the node is ready to accept connections. + api_instance.readyz() +except ApiException as e: + print("Exception when calling ChecksApi->readyz: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + +# **startedz** +> startedz() + +Check whether the node is started. + +Check whether the node is started. + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = hoprd_sdk.ChecksApi() + +try: + # Check whether the node is started. + api_instance.startedz() +except ApiException as e: + print("Exception when calling ChecksApi->startedz: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[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) + diff --git a/docs/CloseChannelReceipt.md b/docs/CloseChannelReceipt.md new file mode 100644 index 0000000..34154a2 --- /dev/null +++ b/docs/CloseChannelReceipt.md @@ -0,0 +1,10 @@ +# CloseChannelReceipt + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_status** | **str** | | +**receipt** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/EntryNode.md b/docs/EntryNode.md new file mode 100644 index 0000000..7123983 --- /dev/null +++ b/docs/EntryNode.md @@ -0,0 +1,10 @@ +# EntryNode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_elligible** | **bool** | | +**multiaddrs** | **list[str]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/HoprAddress.md b/docs/FundRequest.md similarity index 86% rename from docs/HoprAddress.md rename to docs/FundRequest.md index 288cabf..069e632 100644 --- a/docs/HoprAddress.md +++ b/docs/FundRequest.md @@ -1,8 +1,9 @@ -# HoprAddress +# FundRequest ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**amount** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GetMessageReq.md b/docs/GetMessageReq.md new file mode 100644 index 0000000..04b0c3b --- /dev/null +++ b/docs/GetMessageReq.md @@ -0,0 +1,10 @@ +# GetMessageReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag** | **int** | The message tag used to filter messages based on application | [optional] +**timestamp** | **int** | Timestamp to filter messages received after this timestamp | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/HeartbeatInfo.md b/docs/HeartbeatInfo.md new file mode 100644 index 0000000..1862562 --- /dev/null +++ b/docs/HeartbeatInfo.md @@ -0,0 +1,10 @@ +# HeartbeatInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sent** | **int** | | +**success** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/HoprBalance.md b/docs/HoprBalance.md deleted file mode 100644 index aaf6ad6..0000000 --- a/docs/HoprBalance.md +++ /dev/null @@ -1,8 +0,0 @@ -# HoprBalance - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InboxMessagesRes.md b/docs/InboxMessagesRes.md new file mode 100644 index 0000000..86f7832 --- /dev/null +++ b/docs/InboxMessagesRes.md @@ -0,0 +1,9 @@ +# InboxMessagesRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**messages** | [**list[MessagePopRes]**](MessagePopRes.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md deleted file mode 100644 index 1856f95..0000000 --- a/docs/InlineResponse200.md +++ /dev/null @@ -1,18 +0,0 @@ -# InlineResponse200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**unredeemed** | **float** | Number of tickets that wait to be redeemed as for Hopr tokens. | [optional] -**unredeemed_value** | **str** | Total value of all unredeemed tickets in Hopr tokens. | [optional] -**redeemed** | **float** | Number of tickets already redeemed on this node. | [optional] -**redeemed_value** | **str** | Total value of all redeemed tickets in Hopr tokens. | [optional] -**losing_tickets** | **float** | Number of tickets that didn't win any Hopr tokens. To better understand how tickets work read about probabilistic payments (https://docs.hoprnet.org/core/probabilistic-payments) | [optional] -**win_proportion** | **float** | Proportion of number of winning tickets vs loosing tickets, 1 means 100% of tickets won and 0 means that all tickets were losing ones. | [optional] -**neglected** | **float** | Number of tickets that were not redeemed in time before channel was closed. Those cannot be redeemed anymore. | [optional] -**neglected_value** | **str** | Total value of all neglected tickets in Hopr tokens. | [optional] -**rejected** | **float** | Number of tickets that were rejected by the network by not passing validation. In other words tickets that look suspicious and are not eligible for redeeming. | [optional] -**rejected_value** | **str** | Total value of rejected tickets in Hopr tokens | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2001.md b/docs/InlineResponse2001.md deleted file mode 100644 index a7d01bf..0000000 --- a/docs/InlineResponse2001.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse2001 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**price** | **float** | Latest ticket price update. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20010.md b/docs/InlineResponse20010.md deleted file mode 100644 index 2571294..0000000 --- a/docs/InlineResponse20010.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse20010 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**native** | [**NativeAddress**](NativeAddress.md) | | [optional] -**hopr** | [**HoprAddress**](HoprAddress.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20011.md b/docs/InlineResponse20011.md deleted file mode 100644 index 155becf..0000000 --- a/docs/InlineResponse20011.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse20011 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**latency** | **float** | Number of milliseconds it took to get the response from the pinged node. | [optional] -**reported_version** | **str** | HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20012.md b/docs/InlineResponse20012.md deleted file mode 100644 index a5b082c..0000000 --- a/docs/InlineResponse20012.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse20012 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**announced** | [**list[MultiAddress]**](MultiAddress.md) | | [optional] -**observed** | [**list[MultiAddress]**](MultiAddress.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20013.md b/docs/InlineResponse20013.md deleted file mode 100644 index 12bf464..0000000 --- a/docs/InlineResponse20013.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse20013 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**receipt** | **str** | Receipt of the funding transaction | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20014.md b/docs/InlineResponse20014.md deleted file mode 100644 index 16497f1..0000000 --- a/docs/InlineResponse20014.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse20014 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**receipt** | **str** | Receipt of the closing transaction | [optional] -**channel_status** | **str** | Current status of the channel | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse20015.md b/docs/InlineResponse20015.md deleted file mode 100644 index 1dc3a77..0000000 --- a/docs/InlineResponse20015.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse20015 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**peer_id** | [**HoprAddress**](HoprAddress.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2002.md b/docs/InlineResponse2002.md deleted file mode 100644 index b02e047..0000000 --- a/docs/InlineResponse2002.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2002 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**connected** | [**list[InlineResponse2002Connected]**](InlineResponse2002Connected.md) | | [optional] -**announced** | [**list[InlineResponse2002Connected]**](InlineResponse2002Connected.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2002Connected.md b/docs/InlineResponse2002Connected.md deleted file mode 100644 index 26f9060..0000000 --- a/docs/InlineResponse2002Connected.md +++ /dev/null @@ -1,18 +0,0 @@ -# InlineResponse2002Connected - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**peer_id** | [**HoprAddress**](HoprAddress.md) | | [optional] -**peer_address** | [**NativeAddress**](NativeAddress.md) | | [optional] -**multi_addr** | [**MultiAddress**](MultiAddress.md) | | [optional] -**heartbeats** | [**InlineResponse2002Heartbeats**](InlineResponse2002Heartbeats.md) | | [optional] -**last_seen** | **float** | Timestamp on when the node was last seen (in milliseconds) | [optional] -**last_seen_latency** | **float** | Latency recorded the last time a node was measured when seen (in milliseconds) | [optional] -**quality** | **float** | A float between 0 (completely unreliable) and 1 (completely reliable) estimating the quality of service of a peer's network connection | [optional] -**backoff** | **float** | | [optional] -**is_new** | **bool** | True if the node is new (no heartbeats sent yet). | [optional] -**reported_version** | **str** | HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2002Heartbeats.md b/docs/InlineResponse2002Heartbeats.md deleted file mode 100644 index f411746..0000000 --- a/docs/InlineResponse2002Heartbeats.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2002Heartbeats - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sent** | **float** | Heartbeats sent to the node | [optional] -**success** | **float** | Successful heartbeats sent to the node | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md deleted file mode 100644 index fa92221..0000000 --- a/docs/InlineResponse2003.md +++ /dev/null @@ -1,21 +0,0 @@ -# InlineResponse2003 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**network** | **str** | Name of the network the node is running on. | [optional] -**announced_address** | **list[str]** | | [optional] -**listening_address** | **list[str]** | | [optional] -**chain** | **str** | Name of the Hopr network this node connects to. | [optional] -**hopr_token** | **str** | Contract address of the Hopr token on the ethereum chain. | [optional] -**hopr_channels** | **str** | Contract address of the HoprChannels smart contract on ethereum chain. This smart contract is used to open payment channels between nodes on blockchain. | [optional] -**hopr_network_registry_address** | **str** | Contract address of the contract that allows to control the number of nodes in the network | [optional] -**hopr_node_safe_registry_address** | **str** | Contract address of the contract that register node and safe pairs | [optional] -**node_management_module** | **str** | Contract address of the Safe module for managing the current hopr node | [optional] -**node_safe** | **str** | Contract address of the safe that holds asset for the current node | [optional] -**connectivity_status** | **str** | Indicates how good is the connectivity of this node to the HOPR network: either RED, ORANGE, YELLOW or GREEN | [optional] -**is_eligible** | **bool** | Determines whether the staking account associated with this node is eligible for accessing the HOPR network. Always true if network registry is disabled. | [optional] -**channel_closure_period** | **float** | Time (in minutes) that this node needs in order to clean up before closing the channel. When requesting to close the channel each node needs some time to make sure that channel can be closed securely and cleanly. After this channelClosurePeriod passes the second request for closing channel will close the channel. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2004.md b/docs/InlineResponse2004.md deleted file mode 100644 index c891050..0000000 --- a/docs/InlineResponse2004.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse2004 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**size** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2005.md b/docs/InlineResponse2005.md deleted file mode 100644 index dd02bcb..0000000 --- a/docs/InlineResponse2005.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse2005 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**messages** | [**list[ReceivedMessage]**](ReceivedMessage.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2006.md b/docs/InlineResponse2006.md deleted file mode 100644 index 14d163a..0000000 --- a/docs/InlineResponse2006.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineResponse2006 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**incoming** | [**list[Channel]**](Channel.md) | Incomming channels are the ones that were opened by a different node and this node acts as relay. | [optional] -**outgoing** | [**list[Channel]**](Channel.md) | Outgoing channels are the ones that were opened by this node and is using other node as relay. | [optional] -**all** | [**list[ChannelTopology]**](ChannelTopology.md) | All the channels indexed by the node in the current network. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2007.md b/docs/InlineResponse2007.md deleted file mode 100644 index 0e8f518..0000000 --- a/docs/InlineResponse2007.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2007 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**alice** | [**HoprAddress**](HoprAddress.md) | | [optional] -**bob** | [**HoprAddress**](HoprAddress.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2008.md b/docs/InlineResponse2008.md deleted file mode 100644 index fd198e2..0000000 --- a/docs/InlineResponse2008.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse2008 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**receipt** | **str** | Withdraw txn hash that can be used to check details of the transaction on ethereum chain. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2009.md b/docs/InlineResponse2009.md deleted file mode 100644 index cfa65b9..0000000 --- a/docs/InlineResponse2009.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineResponse2009 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**native** | [**NativeBalance**](NativeBalance.md) | | [optional] -**hopr** | [**HoprBalance**](HoprBalance.md) | | [optional] -**safe_native** | [**NativeBalance**](NativeBalance.md) | | [optional] -**safe_hopr** | [**HoprBalance**](HoprBalance.md) | | [optional] -**safe_hopr_allowance** | [**HoprBalance**](HoprBalance.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md deleted file mode 100644 index 00b6990..0000000 --- a/docs/InlineResponse201.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse201 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**token** | **str** | The generated token which must be used when authenticating for API calls. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse2011.md b/docs/InlineResponse2011.md deleted file mode 100644 index 798a90b..0000000 --- a/docs/InlineResponse2011.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse2011 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channel_id** | [**ChannelId**](ChannelId.md) | | [optional] -**transaction_receipt** | [**TransactionReceipt**](TransactionReceipt.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse403.md b/docs/InlineResponse403.md deleted file mode 100644 index 6be1360..0000000 --- a/docs/InlineResponse403.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse403 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | Insufficient balance to open channel. Amount passed in request body exeeds current balance. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse409.md b/docs/InlineResponse409.md deleted file mode 100644 index fbbd313..0000000 --- a/docs/InlineResponse409.md +++ /dev/null @@ -1,9 +0,0 @@ -# InlineResponse409 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | Channel already open. Cannot open more than one channel between two nodes. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse422.md b/docs/InlineResponse422.md deleted file mode 100644 index af4958f..0000000 --- a/docs/InlineResponse422.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse422 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | [optional] -**error** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponse4221.md b/docs/InlineResponse4221.md deleted file mode 100644 index c1a2b4b..0000000 --- a/docs/InlineResponse4221.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponse4221 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | | [optional] -**error** | **str** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/InlineResponseMap200.md b/docs/InlineResponseMap200.md deleted file mode 100644 index 3284ad9..0000000 --- a/docs/InlineResponseMap200.md +++ /dev/null @@ -1,10 +0,0 @@ -# InlineResponseMap200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**multiaddrs** | **list[str]** | Known Multiaddrs of the node | [optional] -**is_eligible** | **bool** | true if peer is allowed to access network, otherwise false | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessageBody.md b/docs/MessageBody.md deleted file mode 100644 index fe46626..0000000 --- a/docs/MessageBody.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagePopRes.md b/docs/MessagePopRes.md new file mode 100644 index 0000000..7935aa3 --- /dev/null +++ b/docs/MessagePopRes.md @@ -0,0 +1,11 @@ +# MessagePopRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **str** | | +**received_at** | **int** | | +**tag** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/MessageTag.md b/docs/MessageTag.md deleted file mode 100644 index 36f1052..0000000 --- a/docs/MessageTag.md +++ /dev/null @@ -1,8 +0,0 @@ -# MessageTag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagesApi.md b/docs/MessagesApi.md index 21e124d..1443e9a 100644 --- a/docs/MessagesApi.md +++ b/docs/MessagesApi.md @@ -1,24 +1,23 @@ # hoprd_sdk.MessagesApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**messages_delete_messages**](MessagesApi.md#messages_delete_messages) | **DELETE** /messages/ | -[**messages_get_size**](MessagesApi.md#messages_get_size) | **GET** /messages/size | -[**messages_peek_all_message**](MessagesApi.md#messages_peek_all_message) | **POST** /messages/peek-all | -[**messages_peek_message**](MessagesApi.md#messages_peek_message) | **POST** /messages/peek | -[**messages_pop_all_message**](MessagesApi.md#messages_pop_all_message) | **POST** /messages/pop-all | -[**messages_pop_message**](MessagesApi.md#messages_pop_message) | **POST** /messages/pop | -[**messages_send_message**](MessagesApi.md#messages_send_message) | **POST** /messages/ | -[**messages_websocket**](MessagesApi.md#messages_websocket) | **GET** /messages/websocket | +[**delete_messages**](MessagesApi.md#delete_messages) | **DELETE** /api/v3/messages | Delete messages from nodes message inbox. +[**peek**](MessagesApi.md#peek) | **POST** /api/v3/messages/peek | Peek the oldest message currently present in the nodes message inbox. +[**peek_all**](MessagesApi.md#peek_all) | **POST** /api/v3/messages/peek-all | Peek the list of messages currently present in the nodes message inbox, filtered by tag, +[**pop**](MessagesApi.md#pop) | **POST** /api/v3/messages/pop | Get the oldest message currently present in the nodes message inbox. +[**pop_all**](MessagesApi.md#pop_all) | **POST** /api/v3/messages/pop-all | Get the list of messages currently present in the nodes message inbox. +[**send_message**](MessagesApi.md#send_message) | **POST** /api/v3/messages | Send a message to another peer using a given path. +[**size**](MessagesApi.md#size) | **GET** /api/v3/messages/size | Get size of filtered message inbox for a specific tag -# **messages_delete_messages** -> messages_delete_messages(tag) +# **delete_messages** +> delete_messages(tag=tag) +Delete messages from nodes message inbox. - -Delete messages from nodes message inbox. Does not return any data. +Delete messages from nodes message inbox. ### Example ```python @@ -28,30 +27,28 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -tag = hoprd_sdk.MessageTag() # MessageTag | Tag used to filter target messages. +tag = 56 # int | (optional) try: - api_instance.messages_delete_messages(tag) + # Delete messages from nodes message inbox. + api_instance.delete_messages(tag=tag) except ApiException as e: - print("Exception when calling MessagesApi->messages_delete_messages: %s\n" % e) + print("Exception when calling MessagesApi->delete_messages: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tag** | [**MessageTag**](.md)| Tag used to filter target messages. | + **tag** | **int**| | [optional] ### Return type @@ -59,7 +56,7 @@ void (empty response body) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -68,12 +65,12 @@ void (empty response body) [[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) -# **messages_get_size** -> InlineResponse2004 messages_get_size(tag) +# **peek** +> MessagePopRes peek(body) +Peek the oldest message currently present in the nodes message inbox. - -Get size of filtered message inbox. +Peek the oldest message currently present in the nodes message inbox. The message is not removed from the inbox. ### Example ```python @@ -83,53 +80,51 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -tag = hoprd_sdk.MessageTag() # MessageTag | Tag used to filter target messages. +body = hoprd_sdk.TagQuery() # TagQuery | Tag of message queue to peek from try: - api_response = api_instance.messages_get_size(tag) + # Peek the oldest message currently present in the nodes message inbox. + api_response = api_instance.peek(body) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_get_size: %s\n" % e) + print("Exception when calling MessagesApi->peek: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **tag** | [**MessageTag**](.md)| Tag used to filter target messages. | + **body** | [**TagQuery**](TagQuery.md)| Tag of message queue to peek from | ### Return type -[**InlineResponse2004**](InlineResponse2004.md) +[**MessagePopRes**](MessagePopRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/json - **Accept**: application/json [[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) -# **messages_peek_all_message** -> InlineResponse2005 messages_peek_all_message(body=body) - +# **peek_all** +> InboxMessagesRes peek_all(body) +Peek the list of messages currently present in the nodes message inbox, filtered by tag, -Get list of messages currently present in the nodes message inbox. +Peek the list of messages currently present in the nodes message inbox, filtered by tag, and optionally by timestamp (epoch in milliseconds). The messages are not removed from the inbox. ### Example ```python @@ -139,39 +134,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.MessagesPeekallBody() # MessagesPeekallBody | (optional) +body = hoprd_sdk.GetMessageReq() # GetMessageReq | Tag of message queue and optionally a timestamp since from to peek from try: - api_response = api_instance.messages_peek_all_message(body=body) + # Peek the list of messages currently present in the nodes message inbox, filtered by tag, + api_response = api_instance.peek_all(body) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_peek_all_message: %s\n" % e) + print("Exception when calling MessagesApi->peek_all: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**MessagesPeekallBody**](MessagesPeekallBody.md)| | [optional] + **body** | [**GetMessageReq**](GetMessageReq.md)| Tag of message queue and optionally a timestamp since from to peek from | ### Return type -[**InlineResponse2005**](InlineResponse2005.md) +[**InboxMessagesRes**](InboxMessagesRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -180,12 +173,12 @@ Name | Type | Description | Notes [[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) -# **messages_peek_message** -> ReceivedMessage messages_peek_message(body=body) - +# **pop** +> MessagePopRes pop(body) +Get the oldest message currently present in the nodes message inbox. -Get oldest message currently present in the nodes message inbox. +Get the oldest message currently present in the nodes message inbox. The message is removed from the inbox. ### Example ```python @@ -195,39 +188,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.MessagesPeekBody() # MessagesPeekBody | (optional) +body = hoprd_sdk.TagQuery() # TagQuery | Tag of message queue to pop from try: - api_response = api_instance.messages_peek_message(body=body) + # Get the oldest message currently present in the nodes message inbox. + api_response = api_instance.pop(body) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_peek_message: %s\n" % e) + print("Exception when calling MessagesApi->pop: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**MessagesPeekBody**](MessagesPeekBody.md)| | [optional] + **body** | [**TagQuery**](TagQuery.md)| Tag of message queue to pop from | ### Return type -[**ReceivedMessage**](ReceivedMessage.md) +[**MessagePopRes**](MessagePopRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -236,12 +227,12 @@ Name | Type | Description | Notes [[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) -# **messages_pop_all_message** -> InlineResponse2005 messages_pop_all_message(body=body) - +# **pop_all** +> InboxMessagesRes pop_all(body) +Get the list of messages currently present in the nodes message inbox. -Get list of messages currently present in the nodes message inbox. The messages are removed from the inbox. +Get the list of messages currently present in the nodes message inbox. The messages are removed from the inbox. ### Example ```python @@ -251,39 +242,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.MessagesPopallBody() # MessagesPopallBody | (optional) +body = hoprd_sdk.TagQuery() # TagQuery | Tag of message queue to pop from try: - api_response = api_instance.messages_pop_all_message(body=body) + # Get the list of messages currently present in the nodes message inbox. + api_response = api_instance.pop_all(body) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_pop_all_message: %s\n" % e) + print("Exception when calling MessagesApi->pop_all: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**MessagesPopallBody**](MessagesPopallBody.md)| | [optional] + **body** | [**TagQuery**](TagQuery.md)| Tag of message queue to pop from | ### Return type -[**InlineResponse2005**](InlineResponse2005.md) +[**InboxMessagesRes**](InboxMessagesRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -292,12 +281,12 @@ Name | Type | Description | Notes [[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) -# **messages_pop_message** -> ReceivedMessage messages_pop_message(body=body) - +# **send_message** +> SendMessageRes send_message(body) +Send a message to another peer using a given path. -Get oldest message currently present in the nodes message inbox. The message is removed from the inbox. +Send a message to another peer using a given path. The message can be sent either over a specified path or using a specified number of HOPS, if no path is given. ### Example ```python @@ -307,39 +296,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.MessagesPopBody() # MessagesPopBody | (optional) +body = hoprd_sdk.SendMessageReq() # SendMessageReq | Body of a message to send try: - api_response = api_instance.messages_pop_message(body=body) + # Send a message to another peer using a given path. + api_response = api_instance.send_message(body) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_pop_message: %s\n" % e) + print("Exception when calling MessagesApi->send_message: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**MessagesPopBody**](MessagesPopBody.md)| | [optional] + **body** | [**SendMessageReq**](SendMessageReq.md)| Body of a message to send | ### Return type -[**ReceivedMessage**](ReceivedMessage.md) +[**SendMessageRes**](SendMessageRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -348,12 +335,12 @@ Name | Type | Description | Notes [[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) -# **messages_send_message** -> str messages_send_message(body=body) +# **size** +> Size size(tag=tag) +Get size of filtered message inbox for a specific tag - -Send a message to another peer using a given path (list of node addresses that should relay our message through network). If no path is given, HOPR will attempt to find a path. +Get size of filtered message inbox for a specific tag ### Example ```python @@ -363,96 +350,42 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.MessagesBody() # MessagesBody | (optional) +tag = 56 # int | (optional) try: - api_response = api_instance.messages_send_message(body=body) + # Get size of filtered message inbox for a specific tag + api_response = api_instance.size(tag=tag) pprint(api_response) except ApiException as e: - print("Exception when calling MessagesApi->messages_send_message: %s\n" % e) + print("Exception when calling MessagesApi->size: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**MessagesBody**](MessagesBody.md)| | [optional] - -### Return type - -**str** - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[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) - -# **messages_websocket** -> str messages_websocket() - - - -This is a websocket endpoint which exposes a subset of message functions. Incoming messages from other nodes are sent to the websocket client. A client may also send message by sending the following data: { cmd: \"sendmsg\", args: { peerId: \"SOME_PEER_ID\", path: [], hops: 1} } The command arguments follow the same semantics as in the dedicated API endpoint for sending messages. The following messages may be sent by the server over the Websocket connection: { type: \"message\", tag: 12, body: \"my example message\" } { type: \"message-ack\", id: \"some challenge id\" } { type: \"message-ack-challenge\", id: \"some challenge id\" } Authentication (if enabled) is done via either passing an `apiToken` parameter in the url or cookie `X-Auth-Token`. Connect to the endpoint by using a WS client. No preview available. Example: `ws://127.0.0.1:3001/api/v2/messages/websocket/?apiToken=myApiToken` - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.messages_websocket() - pprint(api_response) -except ApiException as e: - print("Exception when calling MessagesApi->messages_websocket: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. + **tag** | **int**| | [optional] ### Return type -**str** +[**Size**](Size.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/text, application/json + - **Accept**: application/json [[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) diff --git a/docs/MessagesBody.md b/docs/MessagesBody.md deleted file mode 100644 index c51497b..0000000 --- a/docs/MessagesBody.md +++ /dev/null @@ -1,13 +0,0 @@ -# MessagesBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | -**body** | [**MessageBody**](MessageBody.md) | | -**peer_id** | **str** | The recipient HOPR peer id, to which the message is sent. | -**path** | **list[str]** | The path is ordered list of peer ids through which the message should be sent. If no path is provided, a path which covers the nodes minimum required hops will be determined automatically. | [optional] -**hops** | **int** | Number of required intermediate nodes. This parameter is ignored if path is set. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagesPeekBody.md b/docs/MessagesPeekBody.md deleted file mode 100644 index be3c029..0000000 --- a/docs/MessagesPeekBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# MessagesPeekBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagesPeekallBody.md b/docs/MessagesPeekallBody.md deleted file mode 100644 index 5975c6c..0000000 --- a/docs/MessagesPeekallBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# MessagesPeekallBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagesPopBody.md b/docs/MessagesPopBody.md deleted file mode 100644 index 601b836..0000000 --- a/docs/MessagesPopBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# MessagesPopBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MessagesPopallBody.md b/docs/MessagesPopallBody.md deleted file mode 100644 index 4ef4933..0000000 --- a/docs/MessagesPopallBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# MessagesPopallBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MultiAddress.md b/docs/MultiAddress.md deleted file mode 100644 index dacc534..0000000 --- a/docs/MultiAddress.md +++ /dev/null @@ -1,8 +0,0 @@ -# MultiAddress - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/NativeAddress.md b/docs/NativeAddress.md deleted file mode 100644 index 44db04a..0000000 --- a/docs/NativeAddress.md +++ /dev/null @@ -1,8 +0,0 @@ -# NativeAddress - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/NativeBalance.md b/docs/NativeBalance.md deleted file mode 100644 index ce0353f..0000000 --- a/docs/NativeBalance.md +++ /dev/null @@ -1,8 +0,0 @@ -# NativeBalance - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/NetworkApi.md b/docs/NetworkApi.md new file mode 100644 index 0000000..d794720 --- /dev/null +++ b/docs/NetworkApi.md @@ -0,0 +1,55 @@ +# hoprd_sdk.NetworkApi + +All URIs are relative to */* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**price**](NetworkApi.md#price) | **GET** /api/v3/network/price | + +# **price** +> TicketPriceResponse price() + + + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token +configuration = hoprd_sdk.Configuration() +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.NetworkApi(hoprd_sdk.ApiClient(configuration)) + +try: + api_response = api_instance.price() + pprint(api_response) +except ApiException as e: + print("Exception when calling NetworkApi->price: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**TicketPriceResponse**](TicketPriceResponse.md) + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + diff --git a/docs/NodeApi.md b/docs/NodeApi.md index 0974ad5..ae7a49f 100644 --- a/docs/NodeApi.md +++ b/docs/NodeApi.md @@ -1,21 +1,21 @@ # hoprd_sdk.NodeApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**node_get_entry_nodes**](NodeApi.md#node_get_entry_nodes) | **GET** /node/entryNodes | -[**node_get_info**](NodeApi.md#node_get_info) | **GET** /node/info | -[**node_get_metrics**](NodeApi.md#node_get_metrics) | **GET** /node/metrics | -[**node_get_peers**](NodeApi.md#node_get_peers) | **GET** /node/peers | -[**node_get_version**](NodeApi.md#node_get_version) | **GET** /node/version | +[**entry_nodes**](NodeApi.md#entry_nodes) | **GET** /api/v3/node/entryNodes | List all known entry nodes with multiaddrs and eligibility. +[**info**](NodeApi.md#info) | **GET** /api/v3/node/info | Get information about this HOPR Node. +[**metrics**](NodeApi.md#metrics) | **GET** /api/v3/node/metrics | Retrieve Prometheus metrics from the running node. +[**peers**](NodeApi.md#peers) | **GET** /api/v3/node/peers | Lists information for `connected peers` and `announced peers`. +[**version**](NodeApi.md#version) | **GET** /api/v3/node/version | Get release version of the running node. -# **node_get_entry_nodes** -> dict(str, InlineResponseMap200) node_get_entry_nodes() +# **entry_nodes** +> dict(str, EntryNode) entry_nodes() +List all known entry nodes with multiaddrs and eligibility. - -List all known entry nodes and their multiaddrs and their eligibility state +List all known entry nodes with multiaddrs and eligibility. ### Example ```python @@ -25,23 +25,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.node_get_entry_nodes() + # List all known entry nodes with multiaddrs and eligibility. + api_response = api_instance.entry_nodes() pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->node_get_entry_nodes: %s\n" % e) + print("Exception when calling NodeApi->entry_nodes: %s\n" % e) ``` ### Parameters @@ -49,11 +47,11 @@ This endpoint does not need any parameter. ### Return type -[**dict(str, InlineResponseMap200)**](InlineResponseMap200.md) +[**dict(str, EntryNode)**](EntryNode.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -62,12 +60,12 @@ This endpoint does not need any parameter. [[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) -# **node_get_info** -> InlineResponse2003 node_get_info() +# **info** +> NodeInfoRes info() +Get information about this HOPR Node. - -Information about the HOPR Node, including any options it started with. See the schema of the response to get more information on each field. +Get information about this HOPR Node. ### Example ```python @@ -77,23 +75,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.node_get_info() + # Get information about this HOPR Node. + api_response = api_instance.info() pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->node_get_info: %s\n" % e) + print("Exception when calling NodeApi->info: %s\n" % e) ``` ### Parameters @@ -101,11 +97,11 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse2003**](InlineResponse2003.md) +[**NodeInfoRes**](NodeInfoRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -114,10 +110,10 @@ This endpoint does not need any parameter. [[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) -# **node_get_metrics** -> str node_get_metrics() - +# **metrics** +> str metrics() +Retrieve Prometheus metrics from the running node. Retrieve Prometheus metrics from the running node. @@ -129,23 +125,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.node_get_metrics() + # Retrieve Prometheus metrics from the running node. + api_response = api_instance.metrics() pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->node_get_metrics: %s\n" % e) + print("Exception when calling NodeApi->metrics: %s\n" % e) ``` ### Parameters @@ -157,21 +151,21 @@ This endpoint does not need any parameter. ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: text/plain; version=0.0.4, application/json + - **Accept**: text/plain, application/json [[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) -# **node_get_peers** -> InlineResponse2002 node_get_peers(quality=quality) +# **peers** +> NodePeersRes peers(quality=quality) +Lists information for `connected peers` and `announced peers`. - -Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally, you can pass `quality` parameter which would filter out peers with lower quality to the one specified. +Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally pass `quality` parameter to get only peers with higher or equal quality to the specified value. ### Example ```python @@ -181,39 +175,37 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration)) -quality = 1.2 # float | When quality is passed, the response will only include peers with higher or equal quality to the one specified. (optional) +quality = 1.2 # float | (optional) try: - api_response = api_instance.node_get_peers(quality=quality) + # Lists information for `connected peers` and `announced peers`. + api_response = api_instance.peers(quality=quality) pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->node_get_peers: %s\n" % e) + print("Exception when calling NodeApi->peers: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **quality** | **float**| When quality is passed, the response will only include peers with higher or equal quality to the one specified. | [optional] + **quality** | **float**| | [optional] ### Return type -[**InlineResponse2002**](InlineResponse2002.md) +[**NodePeersRes**](NodePeersRes.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -222,10 +214,10 @@ Name | Type | Description | Notes [[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) -# **node_get_version** -> str node_get_version() - +# **version** +> NodeVersion version() +Get release version of the running node. Get release version of the running node. @@ -237,23 +229,21 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.NodeApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.node_get_version() + # Get release version of the running node. + api_response = api_instance.version() pprint(api_response) except ApiException as e: - print("Exception when calling NodeApi->node_get_version: %s\n" % e) + print("Exception when calling NodeApi->version: %s\n" % e) ``` ### Parameters @@ -261,11 +251,11 @@ This endpoint does not need any parameter. ### Return type -**str** +[**NodeVersion**](NodeVersion.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers diff --git a/docs/NodeChannel.md b/docs/NodeChannel.md new file mode 100644 index 0000000..920f293 --- /dev/null +++ b/docs/NodeChannel.md @@ -0,0 +1,12 @@ +# NodeChannel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | **str** | | +**id** | **str** | | +**peer_address** | **str** | | +**status** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodeChannels.md b/docs/NodeChannels.md new file mode 100644 index 0000000..b5a0b47 --- /dev/null +++ b/docs/NodeChannels.md @@ -0,0 +1,11 @@ +# NodeChannels + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**all** | [**list[NodeTopologyChannel]**](NodeTopologyChannel.md) | | +**incoming** | [**list[NodeChannel]**](NodeChannel.md) | | +**outgoing** | [**list[NodeChannel]**](NodeChannel.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodeInfoRes.md b/docs/NodeInfoRes.md new file mode 100644 index 0000000..e1d7eff --- /dev/null +++ b/docs/NodeInfoRes.md @@ -0,0 +1,21 @@ +# NodeInfoRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**announced_address** | **list[str]** | | +**chain** | **str** | | +**channel_closure_period** | **int** | Channel closure period in seconds | +**connectivity_status** | **str** | | +**hopr_channels** | **str** | | +**hopr_management_module** | **str** | | +**hopr_network_registry** | **str** | | +**hopr_node_safe** | **str** | | +**hopr_node_sage_registry** | **str** | | +**hopr_token** | **str** | | +**is_eligible** | **bool** | | +**listening_address** | **list[str]** | | +**network** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodePeerInfo.md b/docs/NodePeerInfo.md new file mode 100644 index 0000000..80cfaea --- /dev/null +++ b/docs/NodePeerInfo.md @@ -0,0 +1,10 @@ +# NodePeerInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**announced** | **list[str]** | | +**observed** | **list[str]** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodePeersReqQuery.md b/docs/NodePeersReqQuery.md new file mode 100644 index 0000000..8807d12 --- /dev/null +++ b/docs/NodePeersReqQuery.md @@ -0,0 +1,9 @@ +# NodePeersReqQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quality** | **float** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodePeersRes.md b/docs/NodePeersRes.md new file mode 100644 index 0000000..17693ef --- /dev/null +++ b/docs/NodePeersRes.md @@ -0,0 +1,10 @@ +# NodePeersRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**announced** | [**list[PeerInfo]**](PeerInfo.md) | | +**connected** | [**list[PeerInfo]**](PeerInfo.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodeTicketStatistics.md b/docs/NodeTicketStatistics.md new file mode 100644 index 0000000..0357f02 --- /dev/null +++ b/docs/NodeTicketStatistics.md @@ -0,0 +1,18 @@ +# NodeTicketStatistics + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**losing_tickets** | **int** | | +**neglected** | **int** | | +**neglected_value** | **str** | | +**redeemed** | **int** | | +**redeemed_value** | **str** | | +**rejected** | **int** | | +**rejected_value** | **str** | | +**unredeemed** | **int** | | +**unredeemed_value** | **str** | | +**win_proportion** | **float** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/NodeTopologyChannel.md b/docs/NodeTopologyChannel.md new file mode 100644 index 0000000..7e0b580 --- /dev/null +++ b/docs/NodeTopologyChannel.md @@ -0,0 +1,18 @@ +# NodeTopologyChannel + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**balance** | **str** | | +**channel_epoch** | **int** | | +**channel_id** | **str** | | +**closure_time** | **int** | | +**destination_address** | **str** | | +**destination_peer_id** | **str** | | +**source_address** | **str** | | +**source_peer_id** | **str** | | +**status** | **str** | | +**ticket_index** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ChannelStatus.md b/docs/NodeVersion.md similarity index 86% rename from docs/ChannelStatus.md rename to docs/NodeVersion.md index 6a9d4e7..203c382 100644 --- a/docs/ChannelStatus.md +++ b/docs/NodeVersion.md @@ -1,8 +1,9 @@ -# ChannelStatus +# NodeVersion ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**version** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/OpenChannelReceipt.md b/docs/OpenChannelReceipt.md new file mode 100644 index 0000000..bf59bdb --- /dev/null +++ b/docs/OpenChannelReceipt.md @@ -0,0 +1,10 @@ +# OpenChannelReceipt + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**channel_id** | **str** | | +**transaction_receipt** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/OpenChannelRequest.md b/docs/OpenChannelRequest.md new file mode 100644 index 0000000..b62492a --- /dev/null +++ b/docs/OpenChannelRequest.md @@ -0,0 +1,10 @@ +# OpenChannelRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**amount** | **str** | | +**peer_address** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ChannelId.md b/docs/PeerIdArg.md similarity index 87% rename from docs/ChannelId.md rename to docs/PeerIdArg.md index 1ca4662..50cb228 100644 --- a/docs/ChannelId.md +++ b/docs/PeerIdArg.md @@ -1,8 +1,9 @@ -# ChannelId +# PeerIdArg ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**peer_id** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/PeerInfo.md b/docs/PeerInfo.md new file mode 100644 index 0000000..fd541d7 --- /dev/null +++ b/docs/PeerInfo.md @@ -0,0 +1,18 @@ +# PeerInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**backoff** | **float** | | +**heartbeats** | [**HeartbeatInfo**](HeartbeatInfo.md) | | +**is_new** | **bool** | | +**last_seen** | **int** | | +**last_seen_latency** | **int** | | +**multiaddr** | **str** | | [optional] +**peer_address** | **str** | | [optional] +**peer_id** | **str** | | +**quality** | **float** | | +**reported_version** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/PeerInfoApi.md b/docs/PeerInfoApi.md deleted file mode 100644 index 17a7135..0000000 --- a/docs/PeerInfoApi.md +++ /dev/null @@ -1,64 +0,0 @@ -# hoprd_sdk.PeerInfoApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**peer_info_get_peer_info**](PeerInfoApi.md#peer_info_get_peer_info) | **GET** /peers/{peerid}/ | - -# **peer_info_get_peer_info** -> InlineResponse20012 peer_info_get_peer_info(peerid) - - - -Get information about this peer. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.PeerInfoApi(hoprd_sdk.ApiClient(configuration)) -peerid = 'peerid_example' # str | - -try: - api_response = api_instance.peer_info_get_peer_info(peerid) - pprint(api_response) -except ApiException as e: - print("Exception when calling PeerInfoApi->peer_info_get_peer_info: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **peerid** | **str**| | - -### Return type - -[**InlineResponse20012**](InlineResponse20012.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - diff --git a/docs/PeersApi.md b/docs/PeersApi.md index c97dbed..1d6047f 100644 --- a/docs/PeersApi.md +++ b/docs/PeersApi.md @@ -1,18 +1,17 @@ # hoprd_sdk.PeersApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**peers_ping_peer**](PeersApi.md#peers_ping_peer) | **POST** /peers/{peerid}/ping | +[**ping_peer**](PeersApi.md#ping_peer) | **POST** /api/v3/peers/{peerId}/ping | +[**show_peer_info**](PeersApi.md#show_peer_info) | **GET** /api/v3/peers/{peerId} | -# **peers_ping_peer** -> InlineResponse20011 peers_ping_peer(peerid) +# **ping_peer** +> PingInfo ping_peer(peer_id) -Pings another node to check its availability. - ### Example ```python from __future__ import print_function @@ -21,39 +20,87 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' + +# create an instance of the API class +api_instance = hoprd_sdk.PeersApi(hoprd_sdk.ApiClient(configuration)) +peer_id = 'peer_id_example' # str | PeerID of the requested peer + +try: + api_response = api_instance.ping_peer(peer_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling PeersApi->ping_peer: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **peer_id** | **str**| PeerID of the requested peer | + +### Return type + +[**PingInfo**](PingInfo.md) + +### Authorization + +[api_token](../README.md#api_token) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[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) + +# **show_peer_info** +> NodePeerInfo show_peer_info(peer_id) + + + +### Example +```python +from __future__ import print_function +import time +import hoprd_sdk +from hoprd_sdk.rest import ApiException +from pprint import pprint + +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.PeersApi(hoprd_sdk.ApiClient(configuration)) -peerid = 'peerid_example' # str | Peer id that should be pinged +peer_id = 'peer_id_example' # str | PeerID of the requested peer try: - api_response = api_instance.peers_ping_peer(peerid) + api_response = api_instance.show_peer_info(peer_id) pprint(api_response) except ApiException as e: - print("Exception when calling PeersApi->peers_ping_peer: %s\n" % e) + print("Exception when calling PeersApi->show_peer_info: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **peerid** | **str**| Peer id that should be pinged | + **peer_id** | **str**| PeerID of the requested peer | ### Return type -[**InlineResponse20011**](InlineResponse20011.md) +[**NodePeerInfo**](NodePeerInfo.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers diff --git a/docs/PingInfo.md b/docs/PingInfo.md new file mode 100644 index 0000000..100a2b2 --- /dev/null +++ b/docs/PingInfo.md @@ -0,0 +1,10 @@ +# PingInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**latency** | **int** | | +**reported_version** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ReceivedMessage.md b/docs/ReceivedMessage.md deleted file mode 100644 index e3ed555..0000000 --- a/docs/ReceivedMessage.md +++ /dev/null @@ -1,11 +0,0 @@ -# ReceivedMessage - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tag** | [**MessageTag**](MessageTag.md) | | -**body** | [**MessageBody**](MessageBody.md) | | -**received_at** | **int** | Timestamp when the message was received in seconds since epoch. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/RequestStatus.md b/docs/RequestStatus.md deleted file mode 100644 index f63878b..0000000 --- a/docs/RequestStatus.md +++ /dev/null @@ -1,9 +0,0 @@ -# RequestStatus - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **str** | Status declaring success/failure of the request. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SendMessageReq.md b/docs/SendMessageReq.md new file mode 100644 index 0000000..f4fa5e9 --- /dev/null +++ b/docs/SendMessageReq.md @@ -0,0 +1,13 @@ +# SendMessageReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**body** | **str** | Message to be transmitted over the network | +**hops** | **int** | | [optional] +**path** | **list[str]** | | [optional] +**peer_id** | **str** | The recipient HOPR PeerId | +**tag** | **int** | The message tag used to filter messages based on application | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SendMessageRes.md b/docs/SendMessageRes.md new file mode 100644 index 0000000..c466f2b --- /dev/null +++ b/docs/SendMessageRes.md @@ -0,0 +1,10 @@ +# SendMessageRes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**challenge** | **str** | | +**timestamp** | **int** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Settings.md b/docs/Settings.md deleted file mode 100644 index 32f6fc7..0000000 --- a/docs/Settings.md +++ /dev/null @@ -1,10 +0,0 @@ -# Settings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**include_recipient** | **bool** | Prepends your address to all messages so that receiver of the message can know that you sent that message. | [optional] -**strategy** | **str** | By default, hoprd runs in **passive** mode, this means that your node will not attempt to open or close any channels automatically. When you set your strategy to **promiscuous** mode, your node will attempt to open channels to a _randomly_ selected group of nodes which you have a healthy connection to. At the same time, your node will also attempt to close channels that are running low on balance or are unhealthy. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SettingsApi.md b/docs/SettingsApi.md deleted file mode 100644 index 57b2cb3..0000000 --- a/docs/SettingsApi.md +++ /dev/null @@ -1,118 +0,0 @@ -# hoprd_sdk.SettingsApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**settings_get_settings**](SettingsApi.md#settings_get_settings) | **GET** /settings/ | -[**settings_set_setting**](SettingsApi.md#settings_set_setting) | **PUT** /settings/{setting} | - -# **settings_get_settings** -> Settings settings_get_settings() - - - -Get all of the node's settings. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.SettingsApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.settings_get_settings() - pprint(api_response) -except ApiException as e: - print("Exception when calling SettingsApi->settings_get_settings: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Settings**](Settings.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **settings_set_setting** -> settings_set_setting(setting, body=body) - - - -Change this node's setting value. Check Settings schema to learn more about each setting and the type of value it expects. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.SettingsApi(hoprd_sdk.ApiClient(configuration)) -setting = 'setting_example' # str | -body = hoprd_sdk.SettingsSettingBody() # SettingsSettingBody | (optional) - -try: - api_instance.settings_set_setting(setting, body=body) -except ApiException as e: - print("Exception when calling SettingsApi->settings_set_setting: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **setting** | **str**| | - **body** | [**SettingsSettingBody**](SettingsSettingBody.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[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) - diff --git a/docs/SettingsSettingBody.md b/docs/SettingsSettingBody.md deleted file mode 100644 index a3b3056..0000000 --- a/docs/SettingsSettingBody.md +++ /dev/null @@ -1,9 +0,0 @@ -# SettingsSettingBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**setting_value** | **object** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Signature.md b/docs/Signature.md deleted file mode 100644 index ccd03dc..0000000 --- a/docs/Signature.md +++ /dev/null @@ -1,8 +0,0 @@ -# Signature - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Currency.md b/docs/Size.md similarity index 89% rename from docs/Currency.md rename to docs/Size.md index bec7699..ab456ee 100644 --- a/docs/Currency.md +++ b/docs/Size.md @@ -1,8 +1,9 @@ -# Currency +# Size ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**size** | **int** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/TagQuery.md b/docs/TagQuery.md new file mode 100644 index 0000000..b4ffb07 --- /dev/null +++ b/docs/TagQuery.md @@ -0,0 +1,9 @@ +# TagQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tag** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Ticket.md b/docs/Ticket.md deleted file mode 100644 index a562c54..0000000 --- a/docs/Ticket.md +++ /dev/null @@ -1,15 +0,0 @@ -# Ticket - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**channel_id** | [**ChannelId**](ChannelId.md) | | [optional] -**amount** | **str** | The ticket's value in HOPR. Only relevant if ticket is a win. | [optional] -**index** | **str** | Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. | [optional] -**index_offset** | **str** | Offset by which the on-chain stored ticket index gets increased when redeeming the ticket. Used to aggregate tickets. | [optional] -**channel_epoch** | **str** | Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. | [optional] -**win_prob** | **str** | The ticket's winning probability, going from 0.0 to 1.0 where 0.0 ~= 0% winning probability and 1.0 equals 100% winning probability. | [optional] -**signature** | [**Signature**](Signature.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TicketPriceResponse.md b/docs/TicketPriceResponse.md new file mode 100644 index 0000000..c3d61f3 --- /dev/null +++ b/docs/TicketPriceResponse.md @@ -0,0 +1,9 @@ +# TicketPriceResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**price** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/TicketsApi.md b/docs/TicketsApi.md index e508e9b..83198a3 100644 --- a/docs/TicketsApi.md +++ b/docs/TicketsApi.md @@ -1,21 +1,18 @@ # hoprd_sdk.TicketsApi -All URIs are relative to */api/v3* +All URIs are relative to */* Method | HTTP request | Description ------------- | ------------- | ------------- -[**tickets_get_statistics**](TicketsApi.md#tickets_get_statistics) | **GET** /tickets/statistics | -[**tickets_get_ticket_price**](TicketsApi.md#tickets_get_ticket_price) | **GET** /tickets/price | -[**tickets_get_tickets**](TicketsApi.md#tickets_get_tickets) | **GET** /tickets/ | -[**tickets_redeem_tickets**](TicketsApi.md#tickets_redeem_tickets) | **POST** /tickets/redeem | +[**redeem_all_tickets**](TicketsApi.md#redeem_all_tickets) | **POST** /api/v3/tickets/redeem | +[**show_all_tickets**](TicketsApi.md#show_all_tickets) | **GET** /api/v3/tickets | +[**show_ticket_statistics**](TicketsApi.md#show_ticket_statistics) | **GET** /api/v3/tickets/statistics | -# **tickets_get_statistics** -> InlineResponse200 tickets_get_statistics() +# **redeem_all_tickets** +> redeem_all_tickets() -Get statistics regarding all your tickets. Node gets a ticket everytime it relays data packet in channel. - ### Example ```python from __future__ import print_function @@ -24,23 +21,19 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.TicketsApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.tickets_get_statistics() - pprint(api_response) + api_instance.redeem_all_tickets() except ApiException as e: - print("Exception when calling TicketsApi->tickets_get_statistics: %s\n" % e) + print("Exception when calling TicketsApi->redeem_all_tickets: %s\n" % e) ``` ### Parameters @@ -48,11 +41,11 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse200**](InlineResponse200.md) +void (empty response body) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -61,12 +54,10 @@ This endpoint does not need any parameter. [[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) -# **tickets_get_ticket_price** -> InlineResponse2001 tickets_get_ticket_price() - +# **show_all_tickets** +> list[ChannelTicket] show_all_tickets() -Get the latest ticket price in wei ### Example ```python @@ -76,23 +67,20 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.TicketsApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.tickets_get_ticket_price() + api_response = api_instance.show_all_tickets() pprint(api_response) except ApiException as e: - print("Exception when calling TicketsApi->tickets_get_ticket_price: %s\n" % e) + print("Exception when calling TicketsApi->show_all_tickets: %s\n" % e) ``` ### Parameters @@ -100,11 +88,11 @@ This endpoint does not need any parameter. ### Return type -[**InlineResponse2001**](InlineResponse2001.md) +[**list[ChannelTicket]**](ChannelTicket.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers @@ -113,13 +101,11 @@ This endpoint does not need any parameter. [[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) -# **tickets_get_tickets** -> list[Ticket] tickets_get_tickets() +# **show_ticket_statistics** +> NodeTicketStatistics show_ticket_statistics() -Get all tickets earned by relaying data packets by your node from every channel. - ### Example ```python from __future__ import print_function @@ -128,74 +114,20 @@ import hoprd_sdk from hoprd_sdk.rest import ApiException from pprint import pprint -# Configure API key authorization: keyScheme +# Configure API key authorization: api_token configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' +configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY' # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' +# configuration.api_key_prefix['X-Auth-Token'] = 'Bearer' # create an instance of the API class api_instance = hoprd_sdk.TicketsApi(hoprd_sdk.ApiClient(configuration)) try: - api_response = api_instance.tickets_get_tickets() + api_response = api_instance.show_ticket_statistics() pprint(api_response) except ApiException as e: - print("Exception when calling TicketsApi->tickets_get_tickets: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**list[Ticket]**](Ticket.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **tickets_redeem_tickets** -> tickets_redeem_tickets() - - - -Redeems all tickets from all the channels and exchanges them for Hopr tokens. Every ticket have a chance to be winning one, rewarding you with Hopr tokens. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.TicketsApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_instance.tickets_redeem_tickets() -except ApiException as e: - print("Exception when calling TicketsApi->tickets_redeem_tickets: %s\n" % e) + print("Exception when calling TicketsApi->show_ticket_statistics: %s\n" % e) ``` ### Parameters @@ -203,11 +135,11 @@ This endpoint does not need any parameter. ### Return type -void (empty response body) +[**NodeTicketStatistics**](NodeTicketStatistics.md) ### Authorization -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) +[api_token](../README.md#api_token) ### HTTP request headers diff --git a/docs/Token.md b/docs/Token.md deleted file mode 100644 index f594646..0000000 --- a/docs/Token.md +++ /dev/null @@ -1,12 +0,0 @@ -# Token - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Unique ID of the token | -**description** | **str** | Some description for the token | [optional] -**valid_until** | **int** | Seconds since epoch until the token is valid | [optional] -**capabilities** | [**list[TokenCapability]**](TokenCapability.md) | Array of capabilities associated with the token | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TokenCapability.md b/docs/TokenCapability.md deleted file mode 100644 index 716b5e7..0000000 --- a/docs/TokenCapability.md +++ /dev/null @@ -1,10 +0,0 @@ -# TokenCapability - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**endpoint** | **str** | Short reference of the operation this capability is tied to. | -**limits** | [**list[TokenCapabilityLimit]**](TokenCapabilityLimit.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TokenCapabilityLimit.md b/docs/TokenCapabilityLimit.md deleted file mode 100644 index 7626d50..0000000 --- a/docs/TokenCapabilityLimit.md +++ /dev/null @@ -1,10 +0,0 @@ -# TokenCapabilityLimit - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **str** | Limit type | -**conditions** | [**TokenCapabilityLimitConditions**](TokenCapabilityLimitConditions.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TokenCapabilityLimitConditions.md b/docs/TokenCapabilityLimitConditions.md deleted file mode 100644 index 0cbf5e8..0000000 --- a/docs/TokenCapabilityLimitConditions.md +++ /dev/null @@ -1,9 +0,0 @@ -# TokenCapabilityLimitConditions - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**max** | **int** | Upper ceiling. Applies to limit type calls. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TokensApi.md b/docs/TokensApi.md deleted file mode 100644 index c7b960d..0000000 --- a/docs/TokensApi.md +++ /dev/null @@ -1,173 +0,0 @@ -# hoprd_sdk.TokensApi - -All URIs are relative to */api/v3* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**tokens_create**](TokensApi.md#tokens_create) | **POST** /tokens/ | -[**tokens_delete**](TokensApi.md#tokens_delete) | **DELETE** /tokens/{id} | -[**tokens_get_token**](TokensApi.md#tokens_get_token) | **GET** /token | - -# **tokens_create** -> InlineResponse201 tokens_create(body=body) - - - -Create a new authentication token based on the given information. The new token is returned as part of the response body and must be stored by the client. It cannot be read again in cleartext and is lost, if the client loses the token. An authentication has a lifetime. It can be unbound, meaning it will not expire. Or it has a limited lifetime after which it expires. The requested limited lifetime is requested by the client in seconds. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.TokensApi(hoprd_sdk.ApiClient(configuration)) -body = hoprd_sdk.TokensBody() # TokensBody | (optional) - -try: - api_response = api_instance.tokens_create(body=body) - pprint(api_response) -except ApiException as e: - print("Exception when calling TokensApi->tokens_create: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**TokensBody**](TokensBody.md)| | [optional] - -### Return type - -[**InlineResponse201**](InlineResponse201.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[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) - -# **tokens_delete** -> tokens_delete(id) - - - -Deletes a token. Can only be done before the lifetime expired. After the lifetime expired the token is automatically deleted. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.TokensApi(hoprd_sdk.ApiClient(configuration)) -id = 'id_example' # str | ID of the token which shall be deleted. - -try: - api_instance.tokens_delete(id) -except ApiException as e: - print("Exception when calling TokensApi->tokens_delete: %s\n" % e) -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **str**| ID of the token which shall be deleted. | - -### Return type - -void (empty response body) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **tokens_get_token** -> Token tokens_get_token() - - - -Get the full token information for the token used in authentication. - -### Example -```python -from __future__ import print_function -import time -import hoprd_sdk -from hoprd_sdk.rest import ApiException -from pprint import pprint - -# Configure API key authorization: keyScheme -configuration = hoprd_sdk.Configuration() -configuration.api_key['x-auth-token'] = 'YOUR_API_KEY' -# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -# configuration.api_key_prefix['x-auth-token'] = 'Bearer'# Configure HTTP basic authorization: passwordScheme -configuration = hoprd_sdk.Configuration() -configuration.username = 'YOUR_USERNAME' -configuration.password = 'YOUR_PASSWORD' - -# create an instance of the API class -api_instance = hoprd_sdk.TokensApi(hoprd_sdk.ApiClient(configuration)) - -try: - api_response = api_instance.tokens_get_token() - pprint(api_response) -except ApiException as e: - print("Exception when calling TokensApi->tokens_get_token: %s\n" % e) -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Token**](Token.md) - -### Authorization - -[keyScheme](../README.md#keyScheme), [passwordScheme](../README.md#passwordScheme) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - diff --git a/docs/TokensBody.md b/docs/TokensBody.md deleted file mode 100644 index 726320d..0000000 --- a/docs/TokensBody.md +++ /dev/null @@ -1,11 +0,0 @@ -# TokensBody - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**capabilities** | [**list[TokenCapability]**](TokenCapability.md) | Capabilities attached to the created token. | -**lifetime** | **int** | Lifetime of the token in seconds since creation. Defaults to unlimited lifetime. | [optional] -**description** | **str** | Description associated with the token. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TransactionReceipt.md b/docs/TransactionReceipt.md deleted file mode 100644 index c0bb097..0000000 --- a/docs/TransactionReceipt.md +++ /dev/null @@ -1,8 +0,0 @@ -# TransactionReceipt - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/WithdrawRequest.md b/docs/WithdrawRequest.md new file mode 100644 index 0000000..a968133 --- /dev/null +++ b/docs/WithdrawRequest.md @@ -0,0 +1,11 @@ +# WithdrawRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | +**amount** | **int** | | +**currency** | **str** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/hoprd_sdk/__init__.py b/hoprd_sdk/__init__.py index ade868f..4fc03ca 100644 --- a/hoprd_sdk/__init__.py +++ b/hoprd_sdk/__init__.py @@ -3,11 +3,11 @@ # flake8: noqa """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -16,78 +16,48 @@ # import apis into sdk package from hoprd_sdk.api.account_api import AccountApi -from hoprd_sdk.api.aliases_api import AliasesApi +from hoprd_sdk.api.alias_api import AliasApi from hoprd_sdk.api.channels_api import ChannelsApi -from hoprd_sdk.api.check_healthiness_api import CheckHealthinessApi -from hoprd_sdk.api.check_ready_api import CheckReadyApi -from hoprd_sdk.api.check_started_api import CheckStartedApi +from hoprd_sdk.api.checks_api import ChecksApi from hoprd_sdk.api.messages_api import MessagesApi +from hoprd_sdk.api.network_api import NetworkApi from hoprd_sdk.api.node_api import NodeApi -from hoprd_sdk.api.peer_info_api import PeerInfoApi from hoprd_sdk.api.peers_api import PeersApi -from hoprd_sdk.api.settings_api import SettingsApi from hoprd_sdk.api.tickets_api import TicketsApi -from hoprd_sdk.api.tokens_api import TokensApi # import ApiClient from hoprd_sdk.api_client import ApiClient from hoprd_sdk.configuration import Configuration # import models into sdk package -from hoprd_sdk.models.account_withdraw_body import AccountWithdrawBody -from hoprd_sdk.models.aliases_body import AliasesBody -from hoprd_sdk.models.channel import Channel -from hoprd_sdk.models.channel_id import ChannelId -from hoprd_sdk.models.channel_status import ChannelStatus -from hoprd_sdk.models.channel_topology import ChannelTopology -from hoprd_sdk.models.channelid_fund_body import ChannelidFundBody -from hoprd_sdk.models.channels_body import ChannelsBody -from hoprd_sdk.models.currency import Currency -from hoprd_sdk.models.error import Error -from hoprd_sdk.models.hopr_address import HoprAddress -from hoprd_sdk.models.hopr_balance import HoprBalance -from hoprd_sdk.models.inline_response200 import InlineResponse200 -from hoprd_sdk.models.inline_response2001 import InlineResponse2001 -from hoprd_sdk.models.inline_response20010 import InlineResponse20010 -from hoprd_sdk.models.inline_response20011 import InlineResponse20011 -from hoprd_sdk.models.inline_response20012 import InlineResponse20012 -from hoprd_sdk.models.inline_response20013 import InlineResponse20013 -from hoprd_sdk.models.inline_response20014 import InlineResponse20014 -from hoprd_sdk.models.inline_response20015 import InlineResponse20015 -from hoprd_sdk.models.inline_response2002 import InlineResponse2002 -from hoprd_sdk.models.inline_response2002_connected import InlineResponse2002Connected -from hoprd_sdk.models.inline_response2002_heartbeats import InlineResponse2002Heartbeats -from hoprd_sdk.models.inline_response2003 import InlineResponse2003 -from hoprd_sdk.models.inline_response2004 import InlineResponse2004 -from hoprd_sdk.models.inline_response2005 import InlineResponse2005 -from hoprd_sdk.models.inline_response2006 import InlineResponse2006 -from hoprd_sdk.models.inline_response2007 import InlineResponse2007 -from hoprd_sdk.models.inline_response2008 import InlineResponse2008 -from hoprd_sdk.models.inline_response2009 import InlineResponse2009 -from hoprd_sdk.models.inline_response201 import InlineResponse201 -from hoprd_sdk.models.inline_response2011 import InlineResponse2011 -from hoprd_sdk.models.inline_response403 import InlineResponse403 -from hoprd_sdk.models.inline_response409 import InlineResponse409 -from hoprd_sdk.models.inline_response422 import InlineResponse422 -from hoprd_sdk.models.inline_response4221 import InlineResponse4221 -from hoprd_sdk.models.inline_response_map200 import InlineResponseMap200 -from hoprd_sdk.models.message_body import MessageBody -from hoprd_sdk.models.message_tag import MessageTag -from hoprd_sdk.models.messages_body import MessagesBody -from hoprd_sdk.models.messages_peek_body import MessagesPeekBody -from hoprd_sdk.models.messages_peekall_body import MessagesPeekallBody -from hoprd_sdk.models.messages_pop_body import MessagesPopBody -from hoprd_sdk.models.messages_popall_body import MessagesPopallBody -from hoprd_sdk.models.multi_address import MultiAddress -from hoprd_sdk.models.native_address import NativeAddress -from hoprd_sdk.models.native_balance import NativeBalance -from hoprd_sdk.models.received_message import ReceivedMessage -from hoprd_sdk.models.request_status import RequestStatus -from hoprd_sdk.models.settings import Settings -from hoprd_sdk.models.settings_setting_body import SettingsSettingBody -from hoprd_sdk.models.signature import Signature -from hoprd_sdk.models.ticket import Ticket -from hoprd_sdk.models.token import Token -from hoprd_sdk.models.token_capability import TokenCapability -from hoprd_sdk.models.token_capability_limit import TokenCapabilityLimit -from hoprd_sdk.models.token_capability_limit_conditions import TokenCapabilityLimitConditions -from hoprd_sdk.models.tokens_body import TokensBody -from hoprd_sdk.models.transaction_receipt import TransactionReceipt +from hoprd_sdk.models.account_addresses import AccountAddresses +from hoprd_sdk.models.account_balances import AccountBalances +from hoprd_sdk.models.alias_peer_id import AliasPeerId +from hoprd_sdk.models.api_error import ApiError +from hoprd_sdk.models.channel_ticket import ChannelTicket +from hoprd_sdk.models.channels_query import ChannelsQuery +from hoprd_sdk.models.close_channel_receipt import CloseChannelReceipt +from hoprd_sdk.models.entry_node import EntryNode +from hoprd_sdk.models.fund_request import FundRequest +from hoprd_sdk.models.get_message_req import GetMessageReq +from hoprd_sdk.models.heartbeat_info import HeartbeatInfo +from hoprd_sdk.models.inbox_messages_res import InboxMessagesRes +from hoprd_sdk.models.message_pop_res import MessagePopRes +from hoprd_sdk.models.node_channel import NodeChannel +from hoprd_sdk.models.node_channels import NodeChannels +from hoprd_sdk.models.node_info_res import NodeInfoRes +from hoprd_sdk.models.node_peer_info import NodePeerInfo +from hoprd_sdk.models.node_peers_req_query import NodePeersReqQuery +from hoprd_sdk.models.node_peers_res import NodePeersRes +from hoprd_sdk.models.node_ticket_statistics import NodeTicketStatistics +from hoprd_sdk.models.node_topology_channel import NodeTopologyChannel +from hoprd_sdk.models.node_version import NodeVersion +from hoprd_sdk.models.open_channel_receipt import OpenChannelReceipt +from hoprd_sdk.models.open_channel_request import OpenChannelRequest +from hoprd_sdk.models.peer_id_arg import PeerIdArg +from hoprd_sdk.models.peer_info import PeerInfo +from hoprd_sdk.models.ping_info import PingInfo +from hoprd_sdk.models.send_message_req import SendMessageReq +from hoprd_sdk.models.send_message_res import SendMessageRes +from hoprd_sdk.models.size import Size +from hoprd_sdk.models.tag_query import TagQuery +from hoprd_sdk.models.ticket_price_response import TicketPriceResponse +from hoprd_sdk.models.withdraw_request import WithdrawRequest diff --git a/hoprd_sdk/api/__init__.py b/hoprd_sdk/api/__init__.py index b5066fa..c8dd3c3 100644 --- a/hoprd_sdk/api/__init__.py +++ b/hoprd_sdk/api/__init__.py @@ -4,15 +4,11 @@ # import apis into api package from hoprd_sdk.api.account_api import AccountApi -from hoprd_sdk.api.aliases_api import AliasesApi +from hoprd_sdk.api.alias_api import AliasApi from hoprd_sdk.api.channels_api import ChannelsApi -from hoprd_sdk.api.check_healthiness_api import CheckHealthinessApi -from hoprd_sdk.api.check_ready_api import CheckReadyApi -from hoprd_sdk.api.check_started_api import CheckStartedApi +from hoprd_sdk.api.checks_api import ChecksApi from hoprd_sdk.api.messages_api import MessagesApi +from hoprd_sdk.api.network_api import NetworkApi from hoprd_sdk.api.node_api import NodeApi -from hoprd_sdk.api.peer_info_api import PeerInfoApi from hoprd_sdk.api.peers_api import PeersApi -from hoprd_sdk.api.settings_api import SettingsApi from hoprd_sdk.api.tickets_api import TicketsApi -from hoprd_sdk.api.tokens_api import TokensApi diff --git a/hoprd_sdk/api/account_api.py b/hoprd_sdk/api/account_api.py index 12d3367..52367c5 100644 --- a/hoprd_sdk/api/account_api.py +++ b/hoprd_sdk/api/account_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,38 +32,38 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def account_get_address(self, **kwargs): # noqa: E501 - """account_get_address # noqa: E501 + def addresses(self, **kwargs): # noqa: E501 + """Get node's HOPR and native addresses. # noqa: E501 - Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. # noqa: E501 + Get node's HOPR and native addresses. HOPR address is represented by the P2P PeerId and can be used by other node owner to interact with this node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_address(async_req=True) + >>> thread = api.addresses(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse20010 + :return: AccountAddresses If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.account_get_address_with_http_info(**kwargs) # noqa: E501 + return self.addresses_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.account_get_address_with_http_info(**kwargs) # noqa: E501 + (data) = self.addresses_with_http_info(**kwargs) # noqa: E501 return data - def account_get_address_with_http_info(self, **kwargs): # noqa: E501 - """account_get_address # noqa: E501 + def addresses_with_http_info(self, **kwargs): # noqa: E501 + """Get node's HOPR and native addresses. # noqa: E501 - Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. # noqa: E501 + Get node's HOPR and native addresses. HOPR address is represented by the P2P PeerId and can be used by other node owner to interact with this node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_address_with_http_info(async_req=True) + >>> thread = api.addresses_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse20010 + :return: AccountAddresses If the method is called asynchronously, returns the request thread. """ @@ -79,7 +79,7 @@ def account_get_address_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method account_get_address" % key + " to method addresses" % key ) params[key] = val del params['kwargs'] @@ -101,17 +101,17 @@ def account_get_address_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/account/address', 'GET', + '/api/v3/account/addresses', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20010', # noqa: E501 + response_type='AccountAddresses', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -119,38 +119,38 @@ def account_get_address_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def account_get_addresses(self, **kwargs): # noqa: E501 - """account_get_addresses # noqa: E501 + def balances(self, **kwargs): # noqa: E501 + """Get node's and associated Safe's HOPR and native balances as the allowance for HOPR # noqa: E501 - Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. # noqa: E501 + Get node's and associated Safe's HOPR and native balances as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance are used to fund the payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_addresses(async_req=True) + >>> thread = api.balances(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse20010 + :return: AccountBalances If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.account_get_addresses_with_http_info(**kwargs) # noqa: E501 + return self.balances_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.account_get_addresses_with_http_info(**kwargs) # noqa: E501 + (data) = self.balances_with_http_info(**kwargs) # noqa: E501 return data - def account_get_addresses_with_http_info(self, **kwargs): # noqa: E501 - """account_get_addresses # noqa: E501 + def balances_with_http_info(self, **kwargs): # noqa: E501 + """Get node's and associated Safe's HOPR and native balances as the allowance for HOPR # noqa: E501 - Get node's HOPR and native addresses. HOPR address is also called PeerId and can be used by other node owner to interact with this node. # noqa: E501 + Get node's and associated Safe's HOPR and native balances as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance are used to fund the payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_addresses_with_http_info(async_req=True) + >>> thread = api.balances_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse20010 + :return: AccountBalances If the method is called asynchronously, returns the request thread. """ @@ -166,7 +166,7 @@ def account_get_addresses_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method account_get_addresses" % key + " to method balances" % key ) params[key] = val del params['kwargs'] @@ -188,17 +188,17 @@ def account_get_addresses_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/account/addresses', 'GET', + '/api/v3/account/balances', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20010', # noqa: E501 + response_type='AccountBalances', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -206,127 +206,40 @@ def account_get_addresses_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def account_get_balances(self, **kwargs): # noqa: E501 - """account_get_balances # noqa: E501 + def withdraw(self, body, **kwargs): # noqa: E501 + """Withdraw funds from this node to the ethereum wallet address. # noqa: E501 - Get node's and associated Safe's HOPR and native balances as well as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance is used to fund payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. # noqa: E501 + Withdraw funds from this node to the ethereum wallet address. Both NATIVE or HOPR can be withdrawn using this method. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_balances(async_req=True) + >>> thread = api.withdraw(body, async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2009 + :param WithdrawRequest body: (required) + :return: AccountBalances If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.account_get_balances_with_http_info(**kwargs) # noqa: E501 + return self.withdraw_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.account_get_balances_with_http_info(**kwargs) # noqa: E501 + (data) = self.withdraw_with_http_info(body, **kwargs) # noqa: E501 return data - def account_get_balances_with_http_info(self, **kwargs): # noqa: E501 - """account_get_balances # noqa: E501 + def withdraw_with_http_info(self, body, **kwargs): # noqa: E501 + """Withdraw funds from this node to the ethereum wallet address. # noqa: E501 - Get node's and associated Safe's HOPR and native balances as well as the allowance for HOPR tokens to be drawn by HoprChannels from Safe. HOPR tokens from the Safe balance is used to fund payment channels between this node and other nodes on the network. NATIVE balance of the Node is used to pay for the gas fees for the blockchain. # noqa: E501 + Withdraw funds from this node to the ethereum wallet address. Both NATIVE or HOPR can be withdrawn using this method. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_get_balances_with_http_info(async_req=True) + >>> thread = api.withdraw_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2009 - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method account_get_balances" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/account/balances', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='InlineResponse2009', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def account_withdraw(self, **kwargs): # noqa: E501 - """account_withdraw # noqa: E501 - - Withdraw funds from this node to your ethereum wallet address. You can choose whitch currency you want to withdraw, NATIVE or HOPR. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_withdraw(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AccountWithdrawBody body: - :return: InlineResponse2008 - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.account_withdraw_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.account_withdraw_with_http_info(**kwargs) # noqa: E501 - return data - - def account_withdraw_with_http_info(self, **kwargs): # noqa: E501 - """account_withdraw # noqa: E501 - - Withdraw funds from this node to your ethereum wallet address. You can choose whitch currency you want to withdraw, NATIVE or HOPR. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.account_withdraw_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param AccountWithdrawBody body: - :return: InlineResponse2008 + :param WithdrawRequest body: (required) + :return: AccountBalances If the method is called asynchronously, returns the request thread. """ @@ -342,10 +255,14 @@ def account_withdraw_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method account_withdraw" % key + " to method withdraw" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `withdraw`") # noqa: E501 collection_formats = {} @@ -370,17 +287,17 @@ def account_withdraw_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/account/withdraw', 'POST', + '/api/v3/account/withdraw', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2008', # noqa: E501 + response_type='AccountBalances', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/aliases_api.py b/hoprd_sdk/api/alias_api.py similarity index 68% rename from hoprd_sdk/api/aliases_api.py rename to hoprd_sdk/api/alias_api.py index 10804d8..6e19c63 100644 --- a/hoprd_sdk/api/aliases_api.py +++ b/hoprd_sdk/api/alias_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -20,7 +20,7 @@ from hoprd_sdk.api_client import ApiClient -class AliasesApi(object): +class AliasApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -32,45 +32,43 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def aliases_get_alias(self, alias, **kwargs): # noqa: E501 - """aliases_get_alias # noqa: E501 + def aliases(self, **kwargs): # noqa: E501 + """Get each previously set alias and its corresponding PeerId # noqa: E501 - Get the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 + Get each previously set alias and its corresponding PeerId # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_get_alias(alias, async_req=True) + >>> thread = api.aliases(async_req=True) >>> result = thread.get() :param async_req bool - :param str alias: Alias that we previously assigned to some PeerId. (required) - :return: InlineResponse20015 + :return: dict(str, str) If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.aliases_get_alias_with_http_info(alias, **kwargs) # noqa: E501 + return self.aliases_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.aliases_get_alias_with_http_info(alias, **kwargs) # noqa: E501 + (data) = self.aliases_with_http_info(**kwargs) # noqa: E501 return data - def aliases_get_alias_with_http_info(self, alias, **kwargs): # noqa: E501 - """aliases_get_alias # noqa: E501 + def aliases_with_http_info(self, **kwargs): # noqa: E501 + """Get each previously set alias and its corresponding PeerId # noqa: E501 - Get the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 + Get each previously set alias and its corresponding PeerId # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_get_alias_with_http_info(alias, async_req=True) + >>> thread = api.aliases_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str alias: Alias that we previously assigned to some PeerId. (required) - :return: InlineResponse20015 + :return: dict(str, str) If the method is called asynchronously, returns the request thread. """ - all_params = ['alias'] # noqa: E501 + all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -81,20 +79,14 @@ def aliases_get_alias_with_http_info(self, alias, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method aliases_get_alias" % key + " to method aliases" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'alias' is set - if ('alias' not in params or - params['alias'] is None): - raise ValueError("Missing the required parameter `alias` when calling `aliases_get_alias`") # noqa: E501 collection_formats = {} path_params = {} - if 'alias' in params: - path_params['alias'] = params['alias'] # noqa: E501 query_params = [] @@ -109,17 +101,17 @@ def aliases_get_alias_with_http_info(self, alias, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/aliases/{alias}', 'GET', + '/api/v3/aliases', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20015', # noqa: E501 + response_type='dict(str, str)', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -127,43 +119,45 @@ def aliases_get_alias_with_http_info(self, alias, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def aliases_get_aliases(self, **kwargs): # noqa: E501 - """aliases_get_aliases # noqa: E501 + def delete_alias(self, alias, **kwargs): # noqa: E501 + """Delete an alias. # noqa: E501 - Get all aliases you set previously and thier corresponding peer IDs. # noqa: E501 + Delete an alias. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_get_aliases(async_req=True) + >>> thread = api.delete_alias(alias, async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2007 + :param str alias: Alias to be shown (required) + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.aliases_get_aliases_with_http_info(**kwargs) # noqa: E501 + return self.delete_alias_with_http_info(alias, **kwargs) # noqa: E501 else: - (data) = self.aliases_get_aliases_with_http_info(**kwargs) # noqa: E501 + (data) = self.delete_alias_with_http_info(alias, **kwargs) # noqa: E501 return data - def aliases_get_aliases_with_http_info(self, **kwargs): # noqa: E501 - """aliases_get_aliases # noqa: E501 + def delete_alias_with_http_info(self, alias, **kwargs): # noqa: E501 + """Delete an alias. # noqa: E501 - Get all aliases you set previously and thier corresponding peer IDs. # noqa: E501 + Delete an alias. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_get_aliases_with_http_info(async_req=True) + >>> thread = api.delete_alias_with_http_info(alias, async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2007 + :param str alias: Alias to be shown (required) + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = [] # noqa: E501 + all_params = ['alias'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -174,14 +168,20 @@ def aliases_get_aliases_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method aliases_get_aliases" % key + " to method delete_alias" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'alias' is set + if ('alias' not in params or + params['alias'] is None): + raise ValueError("Missing the required parameter `alias` when calling `delete_alias`") # noqa: E501 collection_formats = {} path_params = {} + if 'alias' in params: + path_params['alias'] = params['alias'] # noqa: E501 query_params = [] @@ -196,17 +196,17 @@ def aliases_get_aliases_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/aliases/', 'GET', + '/api/v3/aliases/{alias}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2007', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -214,40 +214,40 @@ def aliases_get_aliases_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def aliases_remove_alias(self, alias, **kwargs): # noqa: E501 - """aliases_remove_alias # noqa: E501 + def get_alias(self, alias, **kwargs): # noqa: E501 + """Get alias for the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 - Unassign an alias from a PeerId. You can always assign back alias to that PeerId using /aliases endpoint. # noqa: E501 + Get alias for the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_remove_alias(alias, async_req=True) + >>> thread = api.get_alias(alias, async_req=True) >>> result = thread.get() :param async_req bool - :param str alias: Alias that we want to remove. (required) - :return: None + :param str alias: Alias to be shown (required) + :return: PeerIdArg If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.aliases_remove_alias_with_http_info(alias, **kwargs) # noqa: E501 + return self.get_alias_with_http_info(alias, **kwargs) # noqa: E501 else: - (data) = self.aliases_remove_alias_with_http_info(alias, **kwargs) # noqa: E501 + (data) = self.get_alias_with_http_info(alias, **kwargs) # noqa: E501 return data - def aliases_remove_alias_with_http_info(self, alias, **kwargs): # noqa: E501 - """aliases_remove_alias # noqa: E501 + def get_alias_with_http_info(self, alias, **kwargs): # noqa: E501 + """Get alias for the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 - Unassign an alias from a PeerId. You can always assign back alias to that PeerId using /aliases endpoint. # noqa: E501 + Get alias for the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_remove_alias_with_http_info(alias, async_req=True) + >>> thread = api.get_alias_with_http_info(alias, async_req=True) >>> result = thread.get() :param async_req bool - :param str alias: Alias that we want to remove. (required) - :return: None + :param str alias: Alias to be shown (required) + :return: PeerIdArg If the method is called asynchronously, returns the request thread. """ @@ -263,14 +263,14 @@ def aliases_remove_alias_with_http_info(self, alias, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method aliases_remove_alias" % key + " to method get_alias" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'alias' is set if ('alias' not in params or params['alias'] is None): - raise ValueError("Missing the required parameter `alias` when calling `aliases_remove_alias`") # noqa: E501 + raise ValueError("Missing the required parameter `alias` when calling `get_alias`") # noqa: E501 collection_formats = {} @@ -291,17 +291,17 @@ def aliases_remove_alias_with_http_info(self, alias, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/aliases/{alias}', 'DELETE', + '/api/v3/aliases/{alias}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='PeerIdArg', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -309,40 +309,40 @@ def aliases_remove_alias_with_http_info(self, alias, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def aliases_set_alias(self, **kwargs): # noqa: E501 - """aliases_set_alias # noqa: E501 + def set_alias(self, body, **kwargs): # noqa: E501 + """Set alias for a peer with a specific PeerId. # noqa: E501 - Instead of using HOPR address, we can assign HOPR address to a specific name called alias. Give an address a more memorable alias and use it instead of Hopr address. Aliases are kept locally and are not saved or shared on the network. # noqa: E501 + Set alias for a peer with a specific PeerId. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_set_alias(async_req=True) + >>> thread = api.set_alias(body, async_req=True) >>> result = thread.get() :param async_req bool - :param AliasesBody body: - :return: None + :param AliasPeerId body: Alias name along with the PeerId to be aliased (required) + :return: PeerIdArg If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.aliases_set_alias_with_http_info(**kwargs) # noqa: E501 + return self.set_alias_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.aliases_set_alias_with_http_info(**kwargs) # noqa: E501 + (data) = self.set_alias_with_http_info(body, **kwargs) # noqa: E501 return data - def aliases_set_alias_with_http_info(self, **kwargs): # noqa: E501 - """aliases_set_alias # noqa: E501 + def set_alias_with_http_info(self, body, **kwargs): # noqa: E501 + """Set alias for a peer with a specific PeerId. # noqa: E501 - Instead of using HOPR address, we can assign HOPR address to a specific name called alias. Give an address a more memorable alias and use it instead of Hopr address. Aliases are kept locally and are not saved or shared on the network. # noqa: E501 + Set alias for a peer with a specific PeerId. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.aliases_set_alias_with_http_info(async_req=True) + >>> thread = api.set_alias_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param AliasesBody body: - :return: None + :param AliasPeerId body: Alias name along with the PeerId to be aliased (required) + :return: PeerIdArg If the method is called asynchronously, returns the request thread. """ @@ -358,10 +358,14 @@ def aliases_set_alias_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method aliases_set_alias" % key + " to method set_alias" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `set_alias`") # noqa: E501 collection_formats = {} @@ -386,17 +390,17 @@ def aliases_set_alias_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/aliases/', 'POST', + '/api/v3/aliases', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='PeerIdArg', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/channels_api.py b/hoprd_sdk/api/channels_api.py index c708ad6..7de3a13 100644 --- a/hoprd_sdk/api/channels_api.py +++ b/hoprd_sdk/api/channels_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,45 +32,43 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def channels_aggregate_tickets(self, channelid, **kwargs): # noqa: E501 - """channels_aggregate_tickets # noqa: E501 + def aggregate_tickets_in_channel(self, channel_id, **kwargs): # noqa: E501 + """aggregate_tickets_in_channel # noqa: E501 - Takes all acknowledged and winning tickets (if any) from the given channel and aggregates them into a single ticket. Requires cooperation of the ticket issuer. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_aggregate_tickets(channelid, async_req=True) + >>> thread = api.aggregate_tickets_in_channel(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) + :param str channel_id: ID of the channel. (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_aggregate_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + return self.aggregate_tickets_in_channel_with_http_info(channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_aggregate_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.aggregate_tickets_in_channel_with_http_info(channel_id, **kwargs) # noqa: E501 return data - def channels_aggregate_tickets_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_aggregate_tickets # noqa: E501 + def aggregate_tickets_in_channel_with_http_info(self, channel_id, **kwargs): # noqa: E501 + """aggregate_tickets_in_channel # noqa: E501 - Takes all acknowledged and winning tickets (if any) from the given channel and aggregates them into a single ticket. Requires cooperation of the ticket issuer. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_aggregate_tickets_with_http_info(channelid, async_req=True) + >>> thread = api.aggregate_tickets_in_channel_with_http_info(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) + :param str channel_id: ID of the channel. (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid'] # noqa: E501 + all_params = ['channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -81,20 +79,20 @@ def channels_aggregate_tickets_with_http_info(self, channelid, **kwargs): # noq if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_aggregate_tickets" % key + " to method aggregate_tickets_in_channel" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_aggregate_tickets`") # noqa: E501 + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `aggregate_tickets_in_channel`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -109,10 +107,10 @@ def channels_aggregate_tickets_with_http_info(self, channelid, **kwargs): # noq ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/tickets/aggregate', 'POST', + '/api/v3/channels/{channelId}/tickets/aggregate', 'POST', path_params, query_params, header_params, @@ -127,45 +125,43 @@ def channels_aggregate_tickets_with_http_info(self, channelid, **kwargs): # noq _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_close_channel(self, channelid, **kwargs): # noqa: E501 - """channels_close_channel # noqa: E501 + def close_channel(self, channel_id, **kwargs): # noqa: E501 + """close_channel # noqa: E501 - Close a opened channel between this node and other node. Once you've initiated channel closure, you have to wait for a specified closure time, it will show you a closure initiation message with cool-off time you need to wait. Then you will need to send the same command again to finalize closure. This is a cool down period to give the other party in the channel sufficient time to redeem their tickets. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_close_channel(channelid, async_req=True) + >>> thread = api.close_channel(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: InlineResponse20014 + :param str channel_id: ID of the channel. (required) + :return: CloseChannelReceipt If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_close_channel_with_http_info(channelid, **kwargs) # noqa: E501 + return self.close_channel_with_http_info(channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_close_channel_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.close_channel_with_http_info(channel_id, **kwargs) # noqa: E501 return data - def channels_close_channel_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_close_channel # noqa: E501 + def close_channel_with_http_info(self, channel_id, **kwargs): # noqa: E501 + """close_channel # noqa: E501 - Close a opened channel between this node and other node. Once you've initiated channel closure, you have to wait for a specified closure time, it will show you a closure initiation message with cool-off time you need to wait. Then you will need to send the same command again to finalize closure. This is a cool down period to give the other party in the channel sufficient time to redeem their tickets. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_close_channel_with_http_info(channelid, async_req=True) + >>> thread = api.close_channel_with_http_info(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: InlineResponse20014 + :param str channel_id: ID of the channel. (required) + :return: CloseChannelReceipt If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid'] # noqa: E501 + all_params = ['channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -176,20 +172,20 @@ def channels_close_channel_with_http_info(self, channelid, **kwargs): # noqa: E if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_close_channel" % key + " to method close_channel" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_close_channel`") # noqa: E501 + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `close_channel`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -204,17 +200,17 @@ def channels_close_channel_with_http_info(self, channelid, **kwargs): # noqa: E ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/', 'DELETE', + '/api/v3/channels/{channelId}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20014', # noqa: E501 + response_type='CloseChannelReceipt', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -222,47 +218,45 @@ def channels_close_channel_with_http_info(self, channelid, **kwargs): # noqa: E _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_fund_channel(self, channelid, **kwargs): # noqa: E501 - """channels_fund_channel # noqa: E501 + def fund_channel(self, body, channel_id, **kwargs): # noqa: E501 + """fund_channel # noqa: E501 - Funds an existing channel with the given amount. The channel must be in state OPEN # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_fund_channel(channelid, async_req=True) + >>> thread = api.fund_channel(body, channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :param ChannelidFundBody body: - :return: InlineResponse20013 + :param FundRequest body: Amount of HOPR to fund the channel (required) + :param str channel_id: ID of the channel. (required) + :return: str If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_fund_channel_with_http_info(channelid, **kwargs) # noqa: E501 + return self.fund_channel_with_http_info(body, channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_fund_channel_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.fund_channel_with_http_info(body, channel_id, **kwargs) # noqa: E501 return data - def channels_fund_channel_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_fund_channel # noqa: E501 + def fund_channel_with_http_info(self, body, channel_id, **kwargs): # noqa: E501 + """fund_channel # noqa: E501 - Funds an existing channel with the given amount. The channel must be in state OPEN # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_fund_channel_with_http_info(channelid, async_req=True) + >>> thread = api.fund_channel_with_http_info(body, channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :param ChannelidFundBody body: - :return: InlineResponse20013 + :param FundRequest body: Amount of HOPR to fund the channel (required) + :param str channel_id: ID of the channel. (required) + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid', 'body'] # noqa: E501 + all_params = ['body', 'channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -273,20 +267,24 @@ def channels_fund_channel_with_http_info(self, channelid, **kwargs): # noqa: E5 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_fund_channel" % key + " to method fund_channel" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_fund_channel`") # noqa: E501 + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `fund_channel`") # noqa: E501 + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `fund_channel`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -300,24 +298,24 @@ def channels_fund_channel_with_http_info(self, channelid, **kwargs): # noqa: E5 body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + ['text/plain', 'application/json']) # noqa: E501 # HTTP header `Content-Type` header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/fund', 'POST', + '/api/v3/channels/{channelId}/fund', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20013', # noqa: E501 + response_type='str', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -325,45 +323,45 @@ def channels_fund_channel_with_http_info(self, channelid, **kwargs): # noqa: E5 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_get_channel(self, channelid, **kwargs): # noqa: E501 - """channels_get_channel # noqa: E501 + def list_channels(self, **kwargs): # noqa: E501 + """list_channels # noqa: E501 - Returns information about the channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_channel(channelid, async_req=True) + >>> thread = api.list_channels(async_req=True) >>> result = thread.get() :param async_req bool - :param ChannelId channelid: (required) - :return: ChannelTopology + :param bool including_closed: + :param bool full_topology: + :return: NodeChannels If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_get_channel_with_http_info(channelid, **kwargs) # noqa: E501 + return self.list_channels_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.channels_get_channel_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.list_channels_with_http_info(**kwargs) # noqa: E501 return data - def channels_get_channel_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_get_channel # noqa: E501 + def list_channels_with_http_info(self, **kwargs): # noqa: E501 + """list_channels # noqa: E501 - Returns information about the channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_channel_with_http_info(channelid, async_req=True) + >>> thread = api.list_channels_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param ChannelId channelid: (required) - :return: ChannelTopology + :param bool including_closed: + :param bool full_topology: + :return: NodeChannels If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid'] # noqa: E501 + all_params = ['including_closed', 'full_topology'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -374,22 +372,20 @@ def channels_get_channel_with_http_info(self, channelid, **kwargs): # noqa: E50 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_get_channel" % key + " to method list_channels" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_get_channel`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 query_params = [] + if 'including_closed' in params: + query_params.append(('includingClosed', params['including_closed'])) # noqa: E501 + if 'full_topology' in params: + query_params.append(('fullTopology', params['full_topology'])) # noqa: E501 header_params = {} @@ -402,17 +398,17 @@ def channels_get_channel_with_http_info(self, channelid, **kwargs): # noqa: E50 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/', 'GET', + '/api/v3/channels', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ChannelTopology', # noqa: E501 + response_type='NodeChannels', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -420,47 +416,43 @@ def channels_get_channel_with_http_info(self, channelid, **kwargs): # noqa: E50 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_get_channels(self, **kwargs): # noqa: E501 - """channels_get_channels # noqa: E501 + def open_channel(self, body, **kwargs): # noqa: E501 + """open_channel # noqa: E501 - Lists all active channels between this node and other nodes on the Hopr network. By default response will contain all incomming and outgoing channels that are either open, waiting to be opened, or waiting to be closed. If you also want to receive past channels that were closed, you can pass `includingClosed` in the request url query. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_channels(async_req=True) + >>> thread = api.open_channel(body, async_req=True) >>> result = thread.get() :param async_req bool - :param str including_closed: When includingClosed is passed the response will include closed channels which are ommited by default. - :param str full_topology: Get the full payment channel graph indexed by the node. - :return: InlineResponse2006 + :param OpenChannelRequest body: Open channel request specification (required) + :return: OpenChannelReceipt If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_get_channels_with_http_info(**kwargs) # noqa: E501 + return self.open_channel_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.channels_get_channels_with_http_info(**kwargs) # noqa: E501 + (data) = self.open_channel_with_http_info(body, **kwargs) # noqa: E501 return data - def channels_get_channels_with_http_info(self, **kwargs): # noqa: E501 - """channels_get_channels # noqa: E501 + def open_channel_with_http_info(self, body, **kwargs): # noqa: E501 + """open_channel # noqa: E501 - Lists all active channels between this node and other nodes on the Hopr network. By default response will contain all incomming and outgoing channels that are either open, waiting to be opened, or waiting to be closed. If you also want to receive past channels that were closed, you can pass `includingClosed` in the request url query. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_channels_with_http_info(async_req=True) + >>> thread = api.open_channel_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param str including_closed: When includingClosed is passed the response will include closed channels which are ommited by default. - :param str full_topology: Get the full payment channel graph indexed by the node. - :return: InlineResponse2006 + :param OpenChannelRequest body: Open channel request specification (required) + :return: OpenChannelReceipt If the method is called asynchronously, returns the request thread. """ - all_params = ['including_closed', 'full_topology'] # noqa: E501 + all_params = ['body'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -471,20 +463,20 @@ def channels_get_channels_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_get_channels" % key + " to method open_channel" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `open_channel`") # noqa: E501 collection_formats = {} path_params = {} query_params = [] - if 'including_closed' in params: - query_params.append(('includingClosed', params['including_closed'])) # noqa: E501 - if 'full_topology' in params: - query_params.append(('fullTopology', params['full_topology'])) # noqa: E501 header_params = {} @@ -492,22 +484,28 @@ def channels_get_channels_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/', 'GET', + '/api/v3/channels', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2006', # noqa: E501 + response_type='OpenChannelReceipt', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -515,45 +513,43 @@ def channels_get_channels_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_get_tickets(self, channelid, **kwargs): # noqa: E501 - """channels_get_tickets # noqa: E501 + def redeem_tickets_in_channel(self, channel_id, **kwargs): # noqa: E501 + """redeem_tickets_in_channel # noqa: E501 - Get tickets earned by relaying data packets by your node for the particular channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_tickets(channelid, async_req=True) + >>> thread = api.redeem_tickets_in_channel(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: list[Ticket] + :param str channel_id: ID of the channel. (required) + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_get_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + return self.redeem_tickets_in_channel_with_http_info(channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_get_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.redeem_tickets_in_channel_with_http_info(channel_id, **kwargs) # noqa: E501 return data - def channels_get_tickets_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_get_tickets # noqa: E501 + def redeem_tickets_in_channel_with_http_info(self, channel_id, **kwargs): # noqa: E501 + """redeem_tickets_in_channel # noqa: E501 - Get tickets earned by relaying data packets by your node for the particular channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_get_tickets_with_http_info(channelid, async_req=True) + >>> thread = api.redeem_tickets_in_channel_with_http_info(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: list[Ticket] + :param str channel_id: ID of the channel. (required) + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid'] # noqa: E501 + all_params = ['channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -564,20 +560,20 @@ def channels_get_tickets_with_http_info(self, channelid, **kwargs): # noqa: E50 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_get_tickets" % key + " to method redeem_tickets_in_channel" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_get_tickets`") # noqa: E501 + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `redeem_tickets_in_channel`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -592,17 +588,17 @@ def channels_get_tickets_with_http_info(self, channelid, **kwargs): # noqa: E50 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/tickets', 'GET', + '/api/v3/channels/{channelId}/tickets/redeem', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Ticket]', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -610,45 +606,43 @@ def channels_get_tickets_with_http_info(self, channelid, **kwargs): # noqa: E50 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_open_channel(self, **kwargs): # noqa: E501 - """channels_open_channel # noqa: E501 + def show_channel(self, channel_id, **kwargs): # noqa: E501 + """show_channel # noqa: E501 - Opens a payment channel between this node and the counter party provided. This channel can be used to send messages between two nodes using other nodes on the network to relay the messages. Each message will deduce its cost from the funded amount to pay other nodes for relaying your messages. Opening a channel can take a little bit of time, because it requires some block confirmations on the blockchain. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_open_channel(async_req=True) + >>> thread = api.show_channel(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param ChannelsBody body: - :return: InlineResponse2011 + :param str channel_id: ID of the channel. (required) + :return: NodeTopologyChannel If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_open_channel_with_http_info(**kwargs) # noqa: E501 + return self.show_channel_with_http_info(channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_open_channel_with_http_info(**kwargs) # noqa: E501 + (data) = self.show_channel_with_http_info(channel_id, **kwargs) # noqa: E501 return data - def channels_open_channel_with_http_info(self, **kwargs): # noqa: E501 - """channels_open_channel # noqa: E501 + def show_channel_with_http_info(self, channel_id, **kwargs): # noqa: E501 + """show_channel # noqa: E501 - Opens a payment channel between this node and the counter party provided. This channel can be used to send messages between two nodes using other nodes on the network to relay the messages. Each message will deduce its cost from the funded amount to pay other nodes for relaying your messages. Opening a channel can take a little bit of time, because it requires some block confirmations on the blockchain. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_open_channel_with_http_info(async_req=True) + >>> thread = api.show_channel_with_http_info(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param ChannelsBody body: - :return: InlineResponse2011 + :param str channel_id: ID of the channel. (required) + :return: NodeTopologyChannel If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] # noqa: E501 + all_params = ['channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -659,14 +653,20 @@ def channels_open_channel_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_open_channel" % key + " to method show_channel" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `show_channel`") # noqa: E501 collection_formats = {} path_params = {} + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -676,28 +676,22 @@ def channels_open_channel_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/', 'POST', + '/api/v3/channels/{channelId}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2011', # noqa: E501 + response_type='NodeTopologyChannel', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -705,45 +699,43 @@ def channels_open_channel_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def channels_redeem_tickets(self, channelid, **kwargs): # noqa: E501 - """channels_redeem_tickets # noqa: E501 + def show_channel_tickets(self, channel_id, **kwargs): # noqa: E501 + """show_channel_tickets # noqa: E501 - Redeems your tickets for this channel. Redeeming will change your tickets into Hopr tokens if they are winning ones. You can check how much tickets given channel has by calling /channels/{channelid}/tickets endpoint. Do this before channel is closed as neglected tickets are no longer valid for redeeming. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_redeem_tickets(channelid, async_req=True) + >>> thread = api.show_channel_tickets(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: None + :param str channel_id: ID of the channel. (required) + :return: list[ChannelTicket] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.channels_redeem_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + return self.show_channel_tickets_with_http_info(channel_id, **kwargs) # noqa: E501 else: - (data) = self.channels_redeem_tickets_with_http_info(channelid, **kwargs) # noqa: E501 + (data) = self.show_channel_tickets_with_http_info(channel_id, **kwargs) # noqa: E501 return data - def channels_redeem_tickets_with_http_info(self, channelid, **kwargs): # noqa: E501 - """channels_redeem_tickets # noqa: E501 + def show_channel_tickets_with_http_info(self, channel_id, **kwargs): # noqa: E501 + """show_channel_tickets # noqa: E501 - Redeems your tickets for this channel. Redeeming will change your tickets into Hopr tokens if they are winning ones. You can check how much tickets given channel has by calling /channels/{channelid}/tickets endpoint. Do this before channel is closed as neglected tickets are no longer valid for redeeming. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.channels_redeem_tickets_with_http_info(channelid, async_req=True) + >>> thread = api.show_channel_tickets_with_http_info(channel_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str channelid: (required) - :return: None + :param str channel_id: ID of the channel. (required) + :return: list[ChannelTicket] If the method is called asynchronously, returns the request thread. """ - all_params = ['channelid'] # noqa: E501 + all_params = ['channel_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -754,20 +746,20 @@ def channels_redeem_tickets_with_http_info(self, channelid, **kwargs): # noqa: if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method channels_redeem_tickets" % key + " to method show_channel_tickets" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'channelid' is set - if ('channelid' not in params or - params['channelid'] is None): - raise ValueError("Missing the required parameter `channelid` when calling `channels_redeem_tickets`") # noqa: E501 + # verify the required parameter 'channel_id' is set + if ('channel_id' not in params or + params['channel_id'] is None): + raise ValueError("Missing the required parameter `channel_id` when calling `show_channel_tickets`") # noqa: E501 collection_formats = {} path_params = {} - if 'channelid' in params: - path_params['channelid'] = params['channelid'] # noqa: E501 + if 'channel_id' in params: + path_params['channelId'] = params['channel_id'] # noqa: E501 query_params = [] @@ -782,17 +774,17 @@ def channels_redeem_tickets_with_http_info(self, channelid, **kwargs): # noqa: ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/channels/{channelid}/tickets/redeem', 'POST', + '/api/v3/channels/{channelId}/tickets', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='list[ChannelTicket]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/check_healthiness_api.py b/hoprd_sdk/api/check_healthiness_api.py deleted file mode 100644 index cdefcc1..0000000 --- a/hoprd_sdk/api/check_healthiness_api.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from hoprd_sdk.api_client import ApiClient - - -class CheckHealthinessApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def check_node_healthy(self, **kwargs): # noqa: E501 - """check_node_healthy # noqa: E501 - - Check whether the node is healthy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_healthy(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.check_node_healthy_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.check_node_healthy_with_http_info(**kwargs) # noqa: E501 - return data - - def check_node_healthy_with_http_info(self, **kwargs): # noqa: E501 - """check_node_healthy # noqa: E501 - - Check whether the node is healthy # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_healthy_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method check_node_healthy" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/healthyz/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/hoprd_sdk/api/check_started_api.py b/hoprd_sdk/api/check_started_api.py deleted file mode 100644 index 0e3c836..0000000 --- a/hoprd_sdk/api/check_started_api.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from hoprd_sdk.api_client import ApiClient - - -class CheckStartedApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def check_node_started(self, **kwargs): # noqa: E501 - """check_node_started # noqa: E501 - - Check whether the node is started # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_started(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.check_node_started_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.check_node_started_with_http_info(**kwargs) # noqa: E501 - return data - - def check_node_started_with_http_info(self, **kwargs): # noqa: E501 - """check_node_started # noqa: E501 - - Check whether the node is started # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_started_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: object - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method check_node_started" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/startedz/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='object', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/hoprd_sdk/api/tokens_api.py b/hoprd_sdk/api/checks_api.py similarity index 57% rename from hoprd_sdk/api/tokens_api.py rename to hoprd_sdk/api/checks_api.py index 9812bf8..3d0ebdd 100644 --- a/hoprd_sdk/api/tokens_api.py +++ b/hoprd_sdk/api/checks_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -20,7 +20,7 @@ from hoprd_sdk.api_client import ApiClient -class TokensApi(object): +class ChecksApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -32,45 +32,43 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def tokens_create(self, **kwargs): # noqa: E501 - """tokens_create # noqa: E501 + def healthyz(self, **kwargs): # noqa: E501 + """Check whether the node is healthy # noqa: E501 - Create a new authentication token based on the given information. The new token is returned as part of the response body and must be stored by the client. It cannot be read again in cleartext and is lost, if the client loses the token. An authentication has a lifetime. It can be unbound, meaning it will not expire. Or it has a limited lifetime after which it expires. The requested limited lifetime is requested by the client in seconds. # noqa: E501 + Check whether the node is healthy # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_create(async_req=True) + >>> thread = api.healthyz(async_req=True) >>> result = thread.get() :param async_req bool - :param TokensBody body: - :return: InlineResponse201 + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tokens_create_with_http_info(**kwargs) # noqa: E501 + return self.healthyz_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tokens_create_with_http_info(**kwargs) # noqa: E501 + (data) = self.healthyz_with_http_info(**kwargs) # noqa: E501 return data - def tokens_create_with_http_info(self, **kwargs): # noqa: E501 - """tokens_create # noqa: E501 + def healthyz_with_http_info(self, **kwargs): # noqa: E501 + """Check whether the node is healthy # noqa: E501 - Create a new authentication token based on the given information. The new token is returned as part of the response body and must be stored by the client. It cannot be read again in cleartext and is lost, if the client loses the token. An authentication has a lifetime. It can be unbound, meaning it will not expire. Or it has a limited lifetime after which it expires. The requested limited lifetime is requested by the client in seconds. # noqa: E501 + Check whether the node is healthy # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_create_with_http_info(async_req=True) + >>> thread = api.healthyz_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param TokensBody body: - :return: InlineResponse201 + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] # noqa: E501 + all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -81,7 +79,7 @@ def tokens_create_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tokens_create" % key + " to method healthyz" % key ) params[key] = val del params['kwargs'] @@ -98,28 +96,18 @@ def tokens_create_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tokens/', 'POST', + '/healthyz', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse201', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -127,45 +115,43 @@ def tokens_create_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def tokens_delete(self, id, **kwargs): # noqa: E501 - """tokens_delete # noqa: E501 + def readyz(self, **kwargs): # noqa: E501 + """Check whether the node is ready to accept connections. # noqa: E501 - Deletes a token. Can only be done before the lifetime expired. After the lifetime expired the token is automatically deleted. # noqa: E501 + Check whether the node is ready to accept connections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_delete(id, async_req=True) + >>> thread = api.readyz(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ID of the token which shall be deleted. (required) :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tokens_delete_with_http_info(id, **kwargs) # noqa: E501 + return self.readyz_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tokens_delete_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.readyz_with_http_info(**kwargs) # noqa: E501 return data - def tokens_delete_with_http_info(self, id, **kwargs): # noqa: E501 - """tokens_delete # noqa: E501 + def readyz_with_http_info(self, **kwargs): # noqa: E501 + """Check whether the node is ready to accept connections. # noqa: E501 - Deletes a token. Can only be done before the lifetime expired. After the lifetime expired the token is automatically deleted. # noqa: E501 + Check whether the node is ready to accept connections. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_delete_with_http_info(id, async_req=True) + >>> thread = api.readyz_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param str id: ID of the token which shall be deleted. (required) :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = [] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -176,20 +162,14 @@ def tokens_delete_with_http_info(self, id, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tokens_delete" % key + " to method readyz" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `tokens_delete`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] @@ -199,15 +179,11 @@ def tokens_delete_with_http_info(self, id, **kwargs): # noqa: E501 local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/tokens/{id}', 'DELETE', + '/readyz', 'GET', path_params, query_params, header_params, @@ -222,38 +198,38 @@ def tokens_delete_with_http_info(self, id, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def tokens_get_token(self, **kwargs): # noqa: E501 - """tokens_get_token # noqa: E501 + def startedz(self, **kwargs): # noqa: E501 + """Check whether the node is started. # noqa: E501 - Get the full token information for the token used in authentication. # noqa: E501 + Check whether the node is started. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_get_token(async_req=True) + >>> thread = api.startedz(async_req=True) >>> result = thread.get() :param async_req bool - :return: Token + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tokens_get_token_with_http_info(**kwargs) # noqa: E501 + return self.startedz_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tokens_get_token_with_http_info(**kwargs) # noqa: E501 + (data) = self.startedz_with_http_info(**kwargs) # noqa: E501 return data - def tokens_get_token_with_http_info(self, **kwargs): # noqa: E501 - """tokens_get_token # noqa: E501 + def startedz_with_http_info(self, **kwargs): # noqa: E501 + """Check whether the node is started. # noqa: E501 - Get the full token information for the token used in authentication. # noqa: E501 + Check whether the node is started. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tokens_get_token_with_http_info(async_req=True) + >>> thread = api.startedz_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: Token + :return: None If the method is called asynchronously, returns the request thread. """ @@ -269,7 +245,7 @@ def tokens_get_token_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tokens_get_token" % key + " to method startedz" % key ) params[key] = val del params['kwargs'] @@ -286,22 +262,18 @@ def tokens_get_token_with_http_info(self, **kwargs): # noqa: E501 local_var_files = {} body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/token', 'GET', + '/startedz', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Token', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/messages_api.py b/hoprd_sdk/api/messages_api.py index f254336..b10d238 100644 --- a/hoprd_sdk/api/messages_api.py +++ b/hoprd_sdk/api/messages_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,39 +32,39 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def messages_delete_messages(self, tag, **kwargs): # noqa: E501 - """messages_delete_messages # noqa: E501 + def delete_messages(self, **kwargs): # noqa: E501 + """Delete messages from nodes message inbox. # noqa: E501 - Delete messages from nodes message inbox. Does not return any data. # noqa: E501 + Delete messages from nodes message inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_delete_messages(tag, async_req=True) + >>> thread = api.delete_messages(async_req=True) >>> result = thread.get() :param async_req bool - :param MessageTag tag: Tag used to filter target messages. (required) + :param int tag: :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_delete_messages_with_http_info(tag, **kwargs) # noqa: E501 + return self.delete_messages_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.messages_delete_messages_with_http_info(tag, **kwargs) # noqa: E501 + (data) = self.delete_messages_with_http_info(**kwargs) # noqa: E501 return data - def messages_delete_messages_with_http_info(self, tag, **kwargs): # noqa: E501 - """messages_delete_messages # noqa: E501 + def delete_messages_with_http_info(self, **kwargs): # noqa: E501 + """Delete messages from nodes message inbox. # noqa: E501 - Delete messages from nodes message inbox. Does not return any data. # noqa: E501 + Delete messages from nodes message inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_delete_messages_with_http_info(tag, async_req=True) + >>> thread = api.delete_messages_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param MessageTag tag: Tag used to filter target messages. (required) + :param int tag: :return: None If the method is called asynchronously, returns the request thread. @@ -81,14 +81,10 @@ def messages_delete_messages_with_http_info(self, tag, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_delete_messages" % key + " to method delete_messages" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'tag' is set - if ('tag' not in params or - params['tag'] is None): - raise ValueError("Missing the required parameter `tag` when calling `messages_delete_messages`") # noqa: E501 collection_formats = {} @@ -109,10 +105,10 @@ def messages_delete_messages_with_http_info(self, tag, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/', 'DELETE', + '/api/v3/messages', 'DELETE', path_params, query_params, header_params, @@ -127,135 +123,40 @@ def messages_delete_messages_with_http_info(self, tag, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_get_size(self, tag, **kwargs): # noqa: E501 - """messages_get_size # noqa: E501 + def peek(self, body, **kwargs): # noqa: E501 + """Peek the oldest message currently present in the nodes message inbox. # noqa: E501 - Get size of filtered message inbox. # noqa: E501 + Peek the oldest message currently present in the nodes message inbox. The message is not removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_get_size(tag, async_req=True) + >>> thread = api.peek(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessageTag tag: Tag used to filter target messages. (required) - :return: InlineResponse2004 + :param TagQuery body: Tag of message queue to peek from (required) + :return: MessagePopRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_get_size_with_http_info(tag, **kwargs) # noqa: E501 + return self.peek_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.messages_get_size_with_http_info(tag, **kwargs) # noqa: E501 + (data) = self.peek_with_http_info(body, **kwargs) # noqa: E501 return data - def messages_get_size_with_http_info(self, tag, **kwargs): # noqa: E501 - """messages_get_size # noqa: E501 + def peek_with_http_info(self, body, **kwargs): # noqa: E501 + """Peek the oldest message currently present in the nodes message inbox. # noqa: E501 - Get size of filtered message inbox. # noqa: E501 + Peek the oldest message currently present in the nodes message inbox. The message is not removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_get_size_with_http_info(tag, async_req=True) + >>> thread = api.peek_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessageTag tag: Tag used to filter target messages. (required) - :return: InlineResponse2004 - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['tag'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method messages_get_size" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'tag' is set - if ('tag' not in params or - params['tag'] is None): - raise ValueError("Missing the required parameter `tag` when calling `messages_get_size`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [] - if 'tag' in params: - query_params.append(('tag', params['tag'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/messages/size', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='InlineResponse2004', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def messages_peek_all_message(self, **kwargs): # noqa: E501 - """messages_peek_all_message # noqa: E501 - - Get list of messages currently present in the nodes message inbox. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_peek_all_message(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param MessagesPeekallBody body: - :return: InlineResponse2005 - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.messages_peek_all_message_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.messages_peek_all_message_with_http_info(**kwargs) # noqa: E501 - return data - - def messages_peek_all_message_with_http_info(self, **kwargs): # noqa: E501 - """messages_peek_all_message # noqa: E501 - - Get list of messages currently present in the nodes message inbox. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_peek_all_message_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :param MessagesPeekallBody body: - :return: InlineResponse2005 + :param TagQuery body: Tag of message queue to peek from (required) + :return: MessagePopRes If the method is called asynchronously, returns the request thread. """ @@ -271,10 +172,14 @@ def messages_peek_all_message_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_peek_all_message" % key + " to method peek" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `peek`") # noqa: E501 collection_formats = {} @@ -299,17 +204,17 @@ def messages_peek_all_message_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/peek-all', 'POST', + '/api/v3/messages/peek', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2005', # noqa: E501 + response_type='MessagePopRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -317,40 +222,40 @@ def messages_peek_all_message_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_peek_message(self, **kwargs): # noqa: E501 - """messages_peek_message # noqa: E501 + def peek_all(self, body, **kwargs): # noqa: E501 + """Peek the list of messages currently present in the nodes message inbox, filtered by tag, # noqa: E501 - Get oldest message currently present in the nodes message inbox. # noqa: E501 + Peek the list of messages currently present in the nodes message inbox, filtered by tag, and optionally by timestamp (epoch in milliseconds). The messages are not removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_peek_message(async_req=True) + >>> thread = api.peek_all(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPeekBody body: - :return: ReceivedMessage + :param GetMessageReq body: Tag of message queue and optionally a timestamp since from to peek from (required) + :return: InboxMessagesRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_peek_message_with_http_info(**kwargs) # noqa: E501 + return self.peek_all_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.messages_peek_message_with_http_info(**kwargs) # noqa: E501 + (data) = self.peek_all_with_http_info(body, **kwargs) # noqa: E501 return data - def messages_peek_message_with_http_info(self, **kwargs): # noqa: E501 - """messages_peek_message # noqa: E501 + def peek_all_with_http_info(self, body, **kwargs): # noqa: E501 + """Peek the list of messages currently present in the nodes message inbox, filtered by tag, # noqa: E501 - Get oldest message currently present in the nodes message inbox. # noqa: E501 + Peek the list of messages currently present in the nodes message inbox, filtered by tag, and optionally by timestamp (epoch in milliseconds). The messages are not removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_peek_message_with_http_info(async_req=True) + >>> thread = api.peek_all_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPeekBody body: - :return: ReceivedMessage + :param GetMessageReq body: Tag of message queue and optionally a timestamp since from to peek from (required) + :return: InboxMessagesRes If the method is called asynchronously, returns the request thread. """ @@ -366,10 +271,14 @@ def messages_peek_message_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_peek_message" % key + " to method peek_all" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `peek_all`") # noqa: E501 collection_formats = {} @@ -394,17 +303,17 @@ def messages_peek_message_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/peek', 'POST', + '/api/v3/messages/peek-all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ReceivedMessage', # noqa: E501 + response_type='InboxMessagesRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -412,40 +321,40 @@ def messages_peek_message_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_pop_all_message(self, **kwargs): # noqa: E501 - """messages_pop_all_message # noqa: E501 + def pop(self, body, **kwargs): # noqa: E501 + """Get the oldest message currently present in the nodes message inbox. # noqa: E501 - Get list of messages currently present in the nodes message inbox. The messages are removed from the inbox. # noqa: E501 + Get the oldest message currently present in the nodes message inbox. The message is removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_pop_all_message(async_req=True) + >>> thread = api.pop(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPopallBody body: - :return: InlineResponse2005 + :param TagQuery body: Tag of message queue to pop from (required) + :return: MessagePopRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_pop_all_message_with_http_info(**kwargs) # noqa: E501 + return self.pop_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.messages_pop_all_message_with_http_info(**kwargs) # noqa: E501 + (data) = self.pop_with_http_info(body, **kwargs) # noqa: E501 return data - def messages_pop_all_message_with_http_info(self, **kwargs): # noqa: E501 - """messages_pop_all_message # noqa: E501 + def pop_with_http_info(self, body, **kwargs): # noqa: E501 + """Get the oldest message currently present in the nodes message inbox. # noqa: E501 - Get list of messages currently present in the nodes message inbox. The messages are removed from the inbox. # noqa: E501 + Get the oldest message currently present in the nodes message inbox. The message is removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_pop_all_message_with_http_info(async_req=True) + >>> thread = api.pop_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPopallBody body: - :return: InlineResponse2005 + :param TagQuery body: Tag of message queue to pop from (required) + :return: MessagePopRes If the method is called asynchronously, returns the request thread. """ @@ -461,10 +370,14 @@ def messages_pop_all_message_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_pop_all_message" % key + " to method pop" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `pop`") # noqa: E501 collection_formats = {} @@ -489,17 +402,17 @@ def messages_pop_all_message_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/pop-all', 'POST', + '/api/v3/messages/pop', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2005', # noqa: E501 + response_type='MessagePopRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -507,40 +420,40 @@ def messages_pop_all_message_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_pop_message(self, **kwargs): # noqa: E501 - """messages_pop_message # noqa: E501 + def pop_all(self, body, **kwargs): # noqa: E501 + """Get the list of messages currently present in the nodes message inbox. # noqa: E501 - Get oldest message currently present in the nodes message inbox. The message is removed from the inbox. # noqa: E501 + Get the list of messages currently present in the nodes message inbox. The messages are removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_pop_message(async_req=True) + >>> thread = api.pop_all(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPopBody body: - :return: ReceivedMessage + :param TagQuery body: Tag of message queue to pop from (required) + :return: InboxMessagesRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_pop_message_with_http_info(**kwargs) # noqa: E501 + return self.pop_all_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.messages_pop_message_with_http_info(**kwargs) # noqa: E501 + (data) = self.pop_all_with_http_info(body, **kwargs) # noqa: E501 return data - def messages_pop_message_with_http_info(self, **kwargs): # noqa: E501 - """messages_pop_message # noqa: E501 + def pop_all_with_http_info(self, body, **kwargs): # noqa: E501 + """Get the list of messages currently present in the nodes message inbox. # noqa: E501 - Get oldest message currently present in the nodes message inbox. The message is removed from the inbox. # noqa: E501 + Get the list of messages currently present in the nodes message inbox. The messages are removed from the inbox. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_pop_message_with_http_info(async_req=True) + >>> thread = api.pop_all_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesPopBody body: - :return: ReceivedMessage + :param TagQuery body: Tag of message queue to pop from (required) + :return: InboxMessagesRes If the method is called asynchronously, returns the request thread. """ @@ -556,10 +469,14 @@ def messages_pop_message_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_pop_message" % key + " to method pop_all" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `pop_all`") # noqa: E501 collection_formats = {} @@ -584,17 +501,17 @@ def messages_pop_message_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/pop', 'POST', + '/api/v3/messages/pop-all', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ReceivedMessage', # noqa: E501 + response_type='InboxMessagesRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -602,40 +519,40 @@ def messages_pop_message_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_send_message(self, **kwargs): # noqa: E501 - """messages_send_message # noqa: E501 + def send_message(self, body, **kwargs): # noqa: E501 + """Send a message to another peer using a given path. # noqa: E501 - Send a message to another peer using a given path (list of node addresses that should relay our message through network). If no path is given, HOPR will attempt to find a path. # noqa: E501 + Send a message to another peer using a given path. The message can be sent either over a specified path or using a specified number of HOPS, if no path is given. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_send_message(async_req=True) + >>> thread = api.send_message(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesBody body: - :return: str + :param SendMessageReq body: Body of a message to send (required) + :return: SendMessageRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_send_message_with_http_info(**kwargs) # noqa: E501 + return self.send_message_with_http_info(body, **kwargs) # noqa: E501 else: - (data) = self.messages_send_message_with_http_info(**kwargs) # noqa: E501 + (data) = self.send_message_with_http_info(body, **kwargs) # noqa: E501 return data - def messages_send_message_with_http_info(self, **kwargs): # noqa: E501 - """messages_send_message # noqa: E501 + def send_message_with_http_info(self, body, **kwargs): # noqa: E501 + """Send a message to another peer using a given path. # noqa: E501 - Send a message to another peer using a given path (list of node addresses that should relay our message through network). If no path is given, HOPR will attempt to find a path. # noqa: E501 + Send a message to another peer using a given path. The message can be sent either over a specified path or using a specified number of HOPS, if no path is given. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_send_message_with_http_info(async_req=True) + >>> thread = api.send_message_with_http_info(body, async_req=True) >>> result = thread.get() :param async_req bool - :param MessagesBody body: - :return: str + :param SendMessageReq body: Body of a message to send (required) + :return: SendMessageRes If the method is called asynchronously, returns the request thread. """ @@ -651,10 +568,14 @@ def messages_send_message_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_send_message" % key + " to method send_message" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `send_message`") # noqa: E501 collection_formats = {} @@ -679,17 +600,17 @@ def messages_send_message_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/', 'POST', + '/api/v3/messages', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='str', # noqa: E501 + response_type='SendMessageRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -697,43 +618,45 @@ def messages_send_message_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def messages_websocket(self, **kwargs): # noqa: E501 - """messages_websocket # noqa: E501 + def size(self, **kwargs): # noqa: E501 + """Get size of filtered message inbox for a specific tag # noqa: E501 - This is a websocket endpoint which exposes a subset of message functions. Incoming messages from other nodes are sent to the websocket client. A client may also send message by sending the following data: { cmd: \"sendmsg\", args: { peerId: \"SOME_PEER_ID\", path: [], hops: 1} } The command arguments follow the same semantics as in the dedicated API endpoint for sending messages. The following messages may be sent by the server over the Websocket connection: { type: \"message\", tag: 12, body: \"my example message\" } { type: \"message-ack\", id: \"some challenge id\" } { type: \"message-ack-challenge\", id: \"some challenge id\" } Authentication (if enabled) is done via either passing an `apiToken` parameter in the url or cookie `X-Auth-Token`. Connect to the endpoint by using a WS client. No preview available. Example: `ws://127.0.0.1:3001/api/v2/messages/websocket/?apiToken=myApiToken` # noqa: E501 + Get size of filtered message inbox for a specific tag # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_websocket(async_req=True) + >>> thread = api.size(async_req=True) >>> result = thread.get() :param async_req bool - :return: str + :param int tag: + :return: Size If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.messages_websocket_with_http_info(**kwargs) # noqa: E501 + return self.size_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.messages_websocket_with_http_info(**kwargs) # noqa: E501 + (data) = self.size_with_http_info(**kwargs) # noqa: E501 return data - def messages_websocket_with_http_info(self, **kwargs): # noqa: E501 - """messages_websocket # noqa: E501 + def size_with_http_info(self, **kwargs): # noqa: E501 + """Get size of filtered message inbox for a specific tag # noqa: E501 - This is a websocket endpoint which exposes a subset of message functions. Incoming messages from other nodes are sent to the websocket client. A client may also send message by sending the following data: { cmd: \"sendmsg\", args: { peerId: \"SOME_PEER_ID\", path: [], hops: 1} } The command arguments follow the same semantics as in the dedicated API endpoint for sending messages. The following messages may be sent by the server over the Websocket connection: { type: \"message\", tag: 12, body: \"my example message\" } { type: \"message-ack\", id: \"some challenge id\" } { type: \"message-ack-challenge\", id: \"some challenge id\" } Authentication (if enabled) is done via either passing an `apiToken` parameter in the url or cookie `X-Auth-Token`. Connect to the endpoint by using a WS client. No preview available. Example: `ws://127.0.0.1:3001/api/v2/messages/websocket/?apiToken=myApiToken` # noqa: E501 + Get size of filtered message inbox for a specific tag # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.messages_websocket_with_http_info(async_req=True) + >>> thread = api.size_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: str + :param int tag: + :return: Size If the method is called asynchronously, returns the request thread. """ - all_params = [] # noqa: E501 + all_params = ['tag'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -744,7 +667,7 @@ def messages_websocket_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method messages_websocket" % key + " to method size" % key ) params[key] = val del params['kwargs'] @@ -754,6 +677,8 @@ def messages_websocket_with_http_info(self, **kwargs): # noqa: E501 path_params = {} query_params = [] + if 'tag' in params: + query_params.append(('tag', params['tag'])) # noqa: E501 header_params = {} @@ -763,20 +688,20 @@ def messages_websocket_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/text', 'application/json']) # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/messages/websocket', 'GET', + '/api/v3/messages/size', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='str', # noqa: E501 + response_type='Size', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/check_ready_api.py b/hoprd_sdk/api/network_api.py similarity index 73% rename from hoprd_sdk/api/check_ready_api.py rename to hoprd_sdk/api/network_api.py index 1f5d339..1416534 100644 --- a/hoprd_sdk/api/check_ready_api.py +++ b/hoprd_sdk/api/network_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -20,7 +20,7 @@ from hoprd_sdk.api_client import ApiClient -class CheckReadyApi(object): +class NetworkApi(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -32,38 +32,36 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def check_node_ready(self, **kwargs): # noqa: E501 - """check_node_ready # noqa: E501 + def price(self, **kwargs): # noqa: E501 + """price # noqa: E501 - Check whether the node is ready # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_ready(async_req=True) + >>> thread = api.price(async_req=True) >>> result = thread.get() :param async_req bool - :return: object + :return: TicketPriceResponse If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.check_node_ready_with_http_info(**kwargs) # noqa: E501 + return self.price_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.check_node_ready_with_http_info(**kwargs) # noqa: E501 + (data) = self.price_with_http_info(**kwargs) # noqa: E501 return data - def check_node_ready_with_http_info(self, **kwargs): # noqa: E501 - """check_node_ready # noqa: E501 + def price_with_http_info(self, **kwargs): # noqa: E501 + """price # noqa: E501 - Check whether the node is ready # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.check_node_ready_with_http_info(async_req=True) + >>> thread = api.price_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: object + :return: TicketPriceResponse If the method is called asynchronously, returns the request thread. """ @@ -79,7 +77,7 @@ def check_node_ready_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method check_node_ready" % key + " to method price" % key ) params[key] = val del params['kwargs'] @@ -101,17 +99,17 @@ def check_node_ready_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/readyz/', 'GET', + '/api/v3/network/price', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='object', # noqa: E501 + response_type='TicketPriceResponse', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/node_api.py b/hoprd_sdk/api/node_api.py index fbcb814..bc805d2 100644 --- a/hoprd_sdk/api/node_api.py +++ b/hoprd_sdk/api/node_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,38 +32,38 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def node_get_entry_nodes(self, **kwargs): # noqa: E501 - """node_get_entry_nodes # noqa: E501 + def entry_nodes(self, **kwargs): # noqa: E501 + """List all known entry nodes with multiaddrs and eligibility. # noqa: E501 - List all known entry nodes and their multiaddrs and their eligibility state # noqa: E501 + List all known entry nodes with multiaddrs and eligibility. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_entry_nodes(async_req=True) + >>> thread = api.entry_nodes(async_req=True) >>> result = thread.get() :param async_req bool - :return: dict(str, InlineResponseMap200) + :return: dict(str, EntryNode) If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.node_get_entry_nodes_with_http_info(**kwargs) # noqa: E501 + return self.entry_nodes_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.node_get_entry_nodes_with_http_info(**kwargs) # noqa: E501 + (data) = self.entry_nodes_with_http_info(**kwargs) # noqa: E501 return data - def node_get_entry_nodes_with_http_info(self, **kwargs): # noqa: E501 - """node_get_entry_nodes # noqa: E501 + def entry_nodes_with_http_info(self, **kwargs): # noqa: E501 + """List all known entry nodes with multiaddrs and eligibility. # noqa: E501 - List all known entry nodes and their multiaddrs and their eligibility state # noqa: E501 + List all known entry nodes with multiaddrs and eligibility. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_entry_nodes_with_http_info(async_req=True) + >>> thread = api.entry_nodes_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: dict(str, InlineResponseMap200) + :return: dict(str, EntryNode) If the method is called asynchronously, returns the request thread. """ @@ -79,7 +79,7 @@ def node_get_entry_nodes_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method node_get_entry_nodes" % key + " to method entry_nodes" % key ) params[key] = val del params['kwargs'] @@ -101,17 +101,17 @@ def node_get_entry_nodes_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/node/entryNodes', 'GET', + '/api/v3/node/entryNodes', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='dict(str, InlineResponseMap200)', # noqa: E501 + response_type='dict(str, EntryNode)', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -119,38 +119,38 @@ def node_get_entry_nodes_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def node_get_info(self, **kwargs): # noqa: E501 - """node_get_info # noqa: E501 + def info(self, **kwargs): # noqa: E501 + """Get information about this HOPR Node. # noqa: E501 - Information about the HOPR Node, including any options it started with. See the schema of the response to get more information on each field. # noqa: E501 + Get information about this HOPR Node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_info(async_req=True) + >>> thread = api.info(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2003 + :return: NodeInfoRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.node_get_info_with_http_info(**kwargs) # noqa: E501 + return self.info_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.node_get_info_with_http_info(**kwargs) # noqa: E501 + (data) = self.info_with_http_info(**kwargs) # noqa: E501 return data - def node_get_info_with_http_info(self, **kwargs): # noqa: E501 - """node_get_info # noqa: E501 + def info_with_http_info(self, **kwargs): # noqa: E501 + """Get information about this HOPR Node. # noqa: E501 - Information about the HOPR Node, including any options it started with. See the schema of the response to get more information on each field. # noqa: E501 + Get information about this HOPR Node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_info_with_http_info(async_req=True) + >>> thread = api.info_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2003 + :return: NodeInfoRes If the method is called asynchronously, returns the request thread. """ @@ -166,7 +166,7 @@ def node_get_info_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method node_get_info" % key + " to method info" % key ) params[key] = val del params['kwargs'] @@ -188,17 +188,17 @@ def node_get_info_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/node/info', 'GET', + '/api/v3/node/info', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2003', # noqa: E501 + response_type='NodeInfoRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -206,13 +206,13 @@ def node_get_info_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def node_get_metrics(self, **kwargs): # noqa: E501 - """node_get_metrics # noqa: E501 + def metrics(self, **kwargs): # noqa: E501 + """Retrieve Prometheus metrics from the running node. # noqa: E501 Retrieve Prometheus metrics from the running node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_metrics(async_req=True) + >>> thread = api.metrics(async_req=True) >>> result = thread.get() :param async_req bool @@ -222,18 +222,18 @@ def node_get_metrics(self, **kwargs): # noqa: E501 """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.node_get_metrics_with_http_info(**kwargs) # noqa: E501 + return self.metrics_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.node_get_metrics_with_http_info(**kwargs) # noqa: E501 + (data) = self.metrics_with_http_info(**kwargs) # noqa: E501 return data - def node_get_metrics_with_http_info(self, **kwargs): # noqa: E501 - """node_get_metrics # noqa: E501 + def metrics_with_http_info(self, **kwargs): # noqa: E501 + """Retrieve Prometheus metrics from the running node. # noqa: E501 Retrieve Prometheus metrics from the running node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_metrics_with_http_info(async_req=True) + >>> thread = api.metrics_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool @@ -253,7 +253,7 @@ def node_get_metrics_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method node_get_metrics" % key + " to method metrics" % key ) params[key] = val del params['kwargs'] @@ -272,13 +272,13 @@ def node_get_metrics_with_http_info(self, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['text/plain; version=0.0.4', 'application/json']) # noqa: E501 + ['text/plain', 'application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/node/metrics', 'GET', + '/api/v3/node/metrics', 'GET', path_params, query_params, header_params, @@ -293,40 +293,40 @@ def node_get_metrics_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def node_get_peers(self, **kwargs): # noqa: E501 - """node_get_peers # noqa: E501 + def peers(self, **kwargs): # noqa: E501 + """Lists information for `connected peers` and `announced peers`. # noqa: E501 - Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally, you can pass `quality` parameter which would filter out peers with lower quality to the one specified. # noqa: E501 + Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally pass `quality` parameter to get only peers with higher or equal quality to the specified value. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_peers(async_req=True) + >>> thread = api.peers(async_req=True) >>> result = thread.get() :param async_req bool - :param float quality: When quality is passed, the response will only include peers with higher or equal quality to the one specified. - :return: InlineResponse2002 + :param float quality: + :return: NodePeersRes If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.node_get_peers_with_http_info(**kwargs) # noqa: E501 + return self.peers_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.node_get_peers_with_http_info(**kwargs) # noqa: E501 + (data) = self.peers_with_http_info(**kwargs) # noqa: E501 return data - def node_get_peers_with_http_info(self, **kwargs): # noqa: E501 - """node_get_peers # noqa: E501 + def peers_with_http_info(self, **kwargs): # noqa: E501 + """Lists information for `connected peers` and `announced peers`. # noqa: E501 - Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally, you can pass `quality` parameter which would filter out peers with lower quality to the one specified. # noqa: E501 + Lists information for `connected peers` and `announced peers`. Connected peers are nodes which are connected to the node while announced peers are nodes which have announced to the network. Optionally pass `quality` parameter to get only peers with higher or equal quality to the specified value. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_peers_with_http_info(async_req=True) + >>> thread = api.peers_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :param float quality: When quality is passed, the response will only include peers with higher or equal quality to the one specified. - :return: InlineResponse2002 + :param float quality: + :return: NodePeersRes If the method is called asynchronously, returns the request thread. """ @@ -342,7 +342,7 @@ def node_get_peers_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method node_get_peers" % key + " to method peers" % key ) params[key] = val del params['kwargs'] @@ -366,17 +366,17 @@ def node_get_peers_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/node/peers', 'GET', + '/api/v3/node/peers', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2002', # noqa: E501 + response_type='NodePeersRes', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -384,38 +384,38 @@ def node_get_peers_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def node_get_version(self, **kwargs): # noqa: E501 - """node_get_version # noqa: E501 + def version(self, **kwargs): # noqa: E501 + """Get release version of the running node. # noqa: E501 Get release version of the running node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_version(async_req=True) + >>> thread = api.version(async_req=True) >>> result = thread.get() :param async_req bool - :return: str + :return: NodeVersion If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.node_get_version_with_http_info(**kwargs) # noqa: E501 + return self.version_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.node_get_version_with_http_info(**kwargs) # noqa: E501 + (data) = self.version_with_http_info(**kwargs) # noqa: E501 return data - def node_get_version_with_http_info(self, **kwargs): # noqa: E501 - """node_get_version # noqa: E501 + def version_with_http_info(self, **kwargs): # noqa: E501 + """Get release version of the running node. # noqa: E501 Get release version of the running node. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.node_get_version_with_http_info(async_req=True) + >>> thread = api.version_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: str + :return: NodeVersion If the method is called asynchronously, returns the request thread. """ @@ -431,7 +431,7 @@ def node_get_version_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method node_get_version" % key + " to method version" % key ) params[key] = val del params['kwargs'] @@ -453,17 +453,17 @@ def node_get_version_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/node/version', 'GET', + '/api/v3/node/version', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='str', # noqa: E501 + response_type='NodeVersion', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/peer_info_api.py b/hoprd_sdk/api/peer_info_api.py deleted file mode 100644 index 6fe011e..0000000 --- a/hoprd_sdk/api/peer_info_api.py +++ /dev/null @@ -1,128 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from hoprd_sdk.api_client import ApiClient - - -class PeerInfoApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def peer_info_get_peer_info(self, peerid, **kwargs): # noqa: E501 - """peer_info_get_peer_info # noqa: E501 - - Get information about this peer. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.peer_info_get_peer_info(peerid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str peerid: (required) - :return: InlineResponse20012 - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.peer_info_get_peer_info_with_http_info(peerid, **kwargs) # noqa: E501 - else: - (data) = self.peer_info_get_peer_info_with_http_info(peerid, **kwargs) # noqa: E501 - return data - - def peer_info_get_peer_info_with_http_info(self, peerid, **kwargs): # noqa: E501 - """peer_info_get_peer_info # noqa: E501 - - Get information about this peer. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.peer_info_get_peer_info_with_http_info(peerid, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str peerid: (required) - :return: InlineResponse20012 - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['peerid'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method peer_info_get_peer_info" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'peerid' is set - if ('peerid' not in params or - params['peerid'] is None): - raise ValueError("Missing the required parameter `peerid` when calling `peer_info_get_peer_info`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'peerid' in params: - path_params['peerid'] = params['peerid'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/peers/{peerid}/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='InlineResponse20012', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/hoprd_sdk/api/peers_api.py b/hoprd_sdk/api/peers_api.py index 11b0fae..01e96a8 100644 --- a/hoprd_sdk/api/peers_api.py +++ b/hoprd_sdk/api/peers_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,45 +32,43 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def peers_ping_peer(self, peerid, **kwargs): # noqa: E501 - """peers_ping_peer # noqa: E501 + def ping_peer(self, peer_id, **kwargs): # noqa: E501 + """ping_peer # noqa: E501 - Pings another node to check its availability. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.peers_ping_peer(peerid, async_req=True) + >>> thread = api.ping_peer(peer_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str peerid: Peer id that should be pinged (required) - :return: InlineResponse20011 + :param str peer_id: PeerID of the requested peer (required) + :return: PingInfo If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.peers_ping_peer_with_http_info(peerid, **kwargs) # noqa: E501 + return self.ping_peer_with_http_info(peer_id, **kwargs) # noqa: E501 else: - (data) = self.peers_ping_peer_with_http_info(peerid, **kwargs) # noqa: E501 + (data) = self.ping_peer_with_http_info(peer_id, **kwargs) # noqa: E501 return data - def peers_ping_peer_with_http_info(self, peerid, **kwargs): # noqa: E501 - """peers_ping_peer # noqa: E501 + def ping_peer_with_http_info(self, peer_id, **kwargs): # noqa: E501 + """ping_peer # noqa: E501 - Pings another node to check its availability. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.peers_ping_peer_with_http_info(peerid, async_req=True) + >>> thread = api.ping_peer_with_http_info(peer_id, async_req=True) >>> result = thread.get() :param async_req bool - :param str peerid: Peer id that should be pinged (required) - :return: InlineResponse20011 + :param str peer_id: PeerID of the requested peer (required) + :return: PingInfo If the method is called asynchronously, returns the request thread. """ - all_params = ['peerid'] # noqa: E501 + all_params = ['peer_id'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -81,20 +79,20 @@ def peers_ping_peer_with_http_info(self, peerid, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method peers_ping_peer" % key + " to method ping_peer" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'peerid' is set - if ('peerid' not in params or - params['peerid'] is None): - raise ValueError("Missing the required parameter `peerid` when calling `peers_ping_peer`") # noqa: E501 + # verify the required parameter 'peer_id' is set + if ('peer_id' not in params or + params['peer_id'] is None): + raise ValueError("Missing the required parameter `peer_id` when calling `ping_peer`") # noqa: E501 collection_formats = {} path_params = {} - if 'peerid' in params: - path_params['peerid'] = params['peerid'] # noqa: E501 + if 'peer_id' in params: + path_params['peerId'] = params['peer_id'] # noqa: E501 query_params = [] @@ -109,17 +107,110 @@ def peers_ping_peer_with_http_info(self, peerid, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/peers/{peerid}/ping', 'POST', + '/api/v3/peers/{peerId}/ping', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse20011', # noqa: E501 + response_type='PingInfo', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def show_peer_info(self, peer_id, **kwargs): # noqa: E501 + """show_peer_info # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.show_peer_info(peer_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str peer_id: PeerID of the requested peer (required) + :return: NodePeerInfo + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.show_peer_info_with_http_info(peer_id, **kwargs) # noqa: E501 + else: + (data) = self.show_peer_info_with_http_info(peer_id, **kwargs) # noqa: E501 + return data + + def show_peer_info_with_http_info(self, peer_id, **kwargs): # noqa: E501 + """show_peer_info # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.show_peer_info_with_http_info(peer_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str peer_id: PeerID of the requested peer (required) + :return: NodePeerInfo + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['peer_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method show_peer_info" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'peer_id' is set + if ('peer_id' not in params or + params['peer_id'] is None): + raise ValueError("Missing the required parameter `peer_id` when calling `show_peer_info`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'peer_id' in params: + path_params['peerId'] = params['peer_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['api_token'] # noqa: E501 + + return self.api_client.call_api( + '/api/v3/peers/{peerId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='NodePeerInfo', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api/settings_api.py b/hoprd_sdk/api/settings_api.py deleted file mode 100644 index a8c9a5d..0000000 --- a/hoprd_sdk/api/settings_api.py +++ /dev/null @@ -1,223 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import re # noqa: F401 - -# python 2 and python 3 compatibility library -import six - -from hoprd_sdk.api_client import ApiClient - - -class SettingsApi(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen - """ - - def __init__(self, api_client=None): - if api_client is None: - api_client = ApiClient() - self.api_client = api_client - - def settings_get_settings(self, **kwargs): # noqa: E501 - """settings_get_settings # noqa: E501 - - Get all of the node's settings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.settings_get_settings(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: Settings - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.settings_get_settings_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.settings_get_settings_with_http_info(**kwargs) # noqa: E501 - return data - - def settings_get_settings_with_http_info(self, **kwargs): # noqa: E501 - """settings_get_settings # noqa: E501 - - Get all of the node's settings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.settings_get_settings_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: Settings - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method settings_get_settings" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/settings/', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='Settings', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def settings_set_setting(self, setting, **kwargs): # noqa: E501 - """settings_set_setting # noqa: E501 - - Change this node's setting value. Check Settings schema to learn more about each setting and the type of value it expects. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.settings_set_setting(setting, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str setting: (required) - :param SettingsSettingBody body: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.settings_set_setting_with_http_info(setting, **kwargs) # noqa: E501 - else: - (data) = self.settings_set_setting_with_http_info(setting, **kwargs) # noqa: E501 - return data - - def settings_set_setting_with_http_info(self, setting, **kwargs): # noqa: E501 - """settings_set_setting # noqa: E501 - - Change this node's setting value. Check Settings schema to learn more about each setting and the type of value it expects. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.settings_set_setting_with_http_info(setting, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str setting: (required) - :param SettingsSettingBody body: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['setting', 'body'] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method settings_set_setting" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'setting' is set - if ('setting' not in params or - params['setting'] is None): - raise ValueError("Missing the required parameter `setting` when calling `settings_set_setting`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'setting' in params: - path_params['setting'] = params['setting'] # noqa: E501 - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/settings/{setting}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) diff --git a/hoprd_sdk/api/tickets_api.py b/hoprd_sdk/api/tickets_api.py index 3ee2f45..32a4d55 100644 --- a/hoprd_sdk/api/tickets_api.py +++ b/hoprd_sdk/api/tickets_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -32,125 +32,36 @@ def __init__(self, api_client=None): api_client = ApiClient() self.api_client = api_client - def tickets_get_statistics(self, **kwargs): # noqa: E501 - """tickets_get_statistics # noqa: E501 + def redeem_all_tickets(self, **kwargs): # noqa: E501 + """redeem_all_tickets # noqa: E501 - Get statistics regarding all your tickets. Node gets a ticket everytime it relays data packet in channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_statistics(async_req=True) + >>> thread = api.redeem_all_tickets(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse200 - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.tickets_get_statistics_with_http_info(**kwargs) # noqa: E501 - else: - (data) = self.tickets_get_statistics_with_http_info(**kwargs) # noqa: E501 - return data - - def tickets_get_statistics_with_http_info(self, **kwargs): # noqa: E501 - """tickets_get_statistics # noqa: E501 - - Get statistics regarding all your tickets. Node gets a ticket everytime it relays data packet in channel. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_statistics_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: InlineResponse200 - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] # noqa: E501 - all_params.append('async_req') - all_params.append('_return_http_data_only') - all_params.append('_preload_content') - all_params.append('_request_timeout') - - params = locals() - for key, val in six.iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method tickets_get_statistics" % key - ) - params[key] = val - del params['kwargs'] - - collection_formats = {} - - path_params = {} - - query_params = [] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 - - return self.api_client.call_api( - '/tickets/statistics', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='InlineResponse200', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - - def tickets_get_ticket_price(self, **kwargs): # noqa: E501 - """tickets_get_ticket_price # noqa: E501 - - Get the latest ticket price in wei # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_ticket_price(async_req=True) - >>> result = thread.get() - - :param async_req bool - :return: InlineResponse2001 + :return: None If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tickets_get_ticket_price_with_http_info(**kwargs) # noqa: E501 + return self.redeem_all_tickets_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tickets_get_ticket_price_with_http_info(**kwargs) # noqa: E501 + (data) = self.redeem_all_tickets_with_http_info(**kwargs) # noqa: E501 return data - def tickets_get_ticket_price_with_http_info(self, **kwargs): # noqa: E501 - """tickets_get_ticket_price # noqa: E501 + def redeem_all_tickets_with_http_info(self, **kwargs): # noqa: E501 + """redeem_all_tickets # noqa: E501 - Get the latest ticket price in wei # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_ticket_price_with_http_info(async_req=True) + >>> thread = api.redeem_all_tickets_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: InlineResponse2001 + :return: None If the method is called asynchronously, returns the request thread. """ @@ -166,7 +77,7 @@ def tickets_get_ticket_price_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tickets_get_ticket_price" % key + " to method redeem_all_tickets" % key ) params[key] = val del params['kwargs'] @@ -188,17 +99,17 @@ def tickets_get_ticket_price_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/tickets/price', 'GET', + '/api/v3/tickets/redeem', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='InlineResponse2001', # noqa: E501 + response_type=None, # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -206,38 +117,36 @@ def tickets_get_ticket_price_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def tickets_get_tickets(self, **kwargs): # noqa: E501 - """tickets_get_tickets # noqa: E501 + def show_all_tickets(self, **kwargs): # noqa: E501 + """show_all_tickets # noqa: E501 - Get all tickets earned by relaying data packets by your node from every channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_tickets(async_req=True) + >>> thread = api.show_all_tickets(async_req=True) >>> result = thread.get() :param async_req bool - :return: list[Ticket] + :return: list[ChannelTicket] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tickets_get_tickets_with_http_info(**kwargs) # noqa: E501 + return self.show_all_tickets_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tickets_get_tickets_with_http_info(**kwargs) # noqa: E501 + (data) = self.show_all_tickets_with_http_info(**kwargs) # noqa: E501 return data - def tickets_get_tickets_with_http_info(self, **kwargs): # noqa: E501 - """tickets_get_tickets # noqa: E501 + def show_all_tickets_with_http_info(self, **kwargs): # noqa: E501 + """show_all_tickets # noqa: E501 - Get all tickets earned by relaying data packets by your node from every channel. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_get_tickets_with_http_info(async_req=True) + >>> thread = api.show_all_tickets_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: list[Ticket] + :return: list[ChannelTicket] If the method is called asynchronously, returns the request thread. """ @@ -253,7 +162,7 @@ def tickets_get_tickets_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tickets_get_tickets" % key + " to method show_all_tickets" % key ) params[key] = val del params['kwargs'] @@ -275,17 +184,17 @@ def tickets_get_tickets_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/tickets/', 'GET', + '/api/v3/tickets', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[Ticket]', # noqa: E501 + response_type='list[ChannelTicket]', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), @@ -293,38 +202,36 @@ def tickets_get_tickets_with_http_info(self, **kwargs): # noqa: E501 _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def tickets_redeem_tickets(self, **kwargs): # noqa: E501 - """tickets_redeem_tickets # noqa: E501 + def show_ticket_statistics(self, **kwargs): # noqa: E501 + """show_ticket_statistics # noqa: E501 - Redeems all tickets from all the channels and exchanges them for Hopr tokens. Every ticket have a chance to be winning one, rewarding you with Hopr tokens. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_redeem_tickets(async_req=True) + >>> thread = api.show_ticket_statistics(async_req=True) >>> result = thread.get() :param async_req bool - :return: None + :return: NodeTicketStatistics If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): - return self.tickets_redeem_tickets_with_http_info(**kwargs) # noqa: E501 + return self.show_ticket_statistics_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.tickets_redeem_tickets_with_http_info(**kwargs) # noqa: E501 + (data) = self.show_ticket_statistics_with_http_info(**kwargs) # noqa: E501 return data - def tickets_redeem_tickets_with_http_info(self, **kwargs): # noqa: E501 - """tickets_redeem_tickets # noqa: E501 + def show_ticket_statistics_with_http_info(self, **kwargs): # noqa: E501 + """show_ticket_statistics # noqa: E501 - Redeems all tickets from all the channels and exchanges them for Hopr tokens. Every ticket have a chance to be winning one, rewarding you with Hopr tokens. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.tickets_redeem_tickets_with_http_info(async_req=True) + >>> thread = api.show_ticket_statistics_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool - :return: None + :return: NodeTicketStatistics If the method is called asynchronously, returns the request thread. """ @@ -340,7 +247,7 @@ def tickets_redeem_tickets_with_http_info(self, **kwargs): # noqa: E501 if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method tickets_redeem_tickets" % key + " to method show_ticket_statistics" % key ) params[key] = val del params['kwargs'] @@ -362,17 +269,17 @@ def tickets_redeem_tickets_with_http_info(self, **kwargs): # noqa: E501 ['application/json']) # noqa: E501 # Authentication setting - auth_settings = ['keyScheme', 'passwordScheme'] # noqa: E501 + auth_settings = ['api_token'] # noqa: E501 return self.api_client.call_api( - '/tickets/redeem', 'POST', + '/api/v3/tickets/statistics', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type=None, # noqa: E501 + response_type='NodeTicketStatistics', # noqa: E501 auth_settings=auth_settings, async_req=params.get('async_req'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/hoprd_sdk/api_client.py b/hoprd_sdk/api_client.py index e372bb1..4ed36dc 100644 --- a/hoprd_sdk/api_client.py +++ b/hoprd_sdk/api_client.py @@ -1,31 +1,31 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import -import atexit import datetime import json import mimetypes +from multiprocessing.pool import ThreadPool import os import re import tempfile -from multiprocessing.pool import ThreadPool +import atexit # python 2 and python 3 compatibility library import six from six.moves.urllib.parse import quote +from hoprd_sdk.configuration import Configuration import hoprd_sdk.models from hoprd_sdk import rest -from hoprd_sdk.configuration import Configuration class ApiClient(object): @@ -59,7 +59,6 @@ class ApiClient(object): "datetime": datetime.datetime, "object": object, } - _pool = None def __init__( @@ -69,6 +68,7 @@ def __init__( configuration = Configuration() self.configuration = configuration + # self.pool = ThreadPool() self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: @@ -279,7 +279,7 @@ def __deserialize(self, data, klass): if data is None: return None - if isinstance(klass, str): + if type(klass) == str: if klass.startswith("list["): sub_kls = re.match(r"list\[(.*)\]", klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] @@ -530,7 +530,7 @@ def prepare_post_parameters(self, post_params=None, files=None): for k, v in six.iteritems(files): if not v: continue - file_names = v if isinstance(v, list) else [v] + file_names = v if type(v) is list else [v] for n in file_names: with open(n, "rb") as f: filename = os.path.basename(f.name) diff --git a/hoprd_sdk/api_client.py.orig b/hoprd_sdk/api_client.py.orig deleted file mode 100644 index 2d0cc3a..0000000 --- a/hoprd_sdk/api_client.py.orig +++ /dev/null @@ -1,632 +0,0 @@ -# coding: utf-8 -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" -from __future__ import absolute_import - -import datetime -import json -import mimetypes -from multiprocessing.pool import ThreadPool -import os -import re -import tempfile - -# python 2 and python 3 compatibility library -import six -from six.moves.urllib.parse import quote - -from hoprd_sdk.configuration import Configuration -import hoprd_sdk.models -from hoprd_sdk import rest - - -class ApiClient(object): - """Generic API client for Swagger client library builds. - - Swagger generic API client. This client handles the client- - server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the Swagger - templates. - - NOTE: This class is auto generated by the swagger code generator program. - Ref: https://github.com/swagger-api/swagger-codegen - Do not edit the class manually. - - :param configuration: .Configuration object for this client - :param header_name: a header to pass when making calls to the API. - :param header_value: a header value to pass when making calls to - the API. - :param cookie: a cookie to include in the header when making calls - to the API - """ - - PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types - NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int if six.PY3 else long, # noqa: F821 - 'float': float, - 'str': str, - 'bool': bool, - 'date': datetime.date, - 'datetime': datetime.datetime, - 'object': object, - } - - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None): - if configuration is None: - configuration = Configuration() - self.configuration = configuration - - self.pool = ThreadPool() - self.rest_client = rest.RESTClientObject(configuration) - self.default_headers = {} - if header_name is not None: - self.default_headers[header_name] = header_value - self.cookie = cookie - # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/2.0.0-rc.1/python' - - def __del__(self): - self.pool.close() - self.pool.join() - - @property - def user_agent(self): - """User agent for this API client""" - return self.default_headers['User-Agent'] - - @user_agent.setter - def user_agent(self, value): - self.default_headers['User-Agent'] = value - - def set_default_header(self, header_name, header_value): - self.default_headers[header_name] = header_value - - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_type=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - - config = self.configuration - - # header parameters - header_params = header_params or {} - header_params.update(self.default_headers) - if self.cookie: - header_params['Cookie'] = self.cookie - if header_params: - header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) - - # path parameters - if path_params: - path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) - for k, v in path_params: - # specified safe chars, encode everything - resource_path = resource_path.replace( - '{%s}' % k, - quote(str(v), safe=config.safe_chars_for_path_param) - ) - - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - - # post parameters - if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) - post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - - # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) - - # body - if body: - body = self.sanitize_for_serialization(body) - - # request url - url = self.configuration.host + resource_path - - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - - self.last_response = response_data - - return_data = response_data - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) - - def sanitize_for_serialization(self, obj): - """Builds a JSON POST object. - - If obj is None, return None. - If obj is str, int, long, float, bool, return directly. - If obj is datetime.datetime, datetime.date - convert to string in iso8601 format. - If obj is list, sanitize each element in the list. - If obj is dict, return the dict. - If obj is swagger model, return the properties dict. - - :param obj: The data to serialize. - :return: The serialized form of data. - """ - if obj is None: - return None - elif isinstance(obj, self.PRIMITIVE_TYPES): - return obj - elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] - elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime.datetime, datetime.date)): - return obj.isoformat() - - if isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `swagger_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in six.iteritems(obj.swagger_types) - if getattr(obj, attr) is not None} - - return {key: self.sanitize_for_serialization(val) - for key, val in six.iteritems(obj_dict)} - - def deserialize(self, response, response_type): - """Deserializes response into an object. - - :param response: RESTResponse object to be deserialized. - :param response_type: class literal for - deserialized object, or string of class name. - - :return: deserialized object. - """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - - # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data - - return self.__deserialize(data, response_type) - - def __deserialize(self, data, klass): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [self.__deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: self.__deserialize(v, sub_kls) - for k, v in six.iteritems(data)} - - # convert str to class - if klass in self.NATIVE_TYPES_MAPPING: - klass = self.NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(hoprd_sdk.models, klass) - - if klass in self.PRIMITIVE_TYPES: - return self.__deserialize_primitive(data, klass) - elif klass == object: - return self.__deserialize_object(data) - elif klass == datetime.date: - return self.__deserialize_date(data) - elif klass == datetime.datetime: - return self.__deserialize_datatime(data) - else: - return self.__deserialize_model(data, klass) - - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_type=None, auth_settings=None, async_req=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.GET(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.HEAD(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.OPTIONS(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "POST": - return self.rest_client.POST(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.PUT(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.PATCH(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.DELETE(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - - def parameters_to_tuples(self, params, collection_formats): - """Get parameters as list of tuples, formatting collections. - - :param params: Parameters as dict or list of two-tuples - :param dict collection_formats: Parameter collection formats - :return: Parameters as list of tuples, collections formatted - """ - new_params = [] - if collection_formats is None: - collection_formats = {} - for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 - if k in collection_formats: - collection_format = collection_formats[k] - if collection_format == 'multi': - new_params.extend((k, value) for value in v) - else: - if collection_format == 'ssv': - delimiter = ' ' - elif collection_format == 'tsv': - delimiter = '\t' - elif collection_format == 'pipes': - delimiter = '|' - else: # csv is the default - delimiter = ',' - new_params.append( - (k, delimiter.join(str(value) for value in v))) - else: - new_params.append((k, v)) - return new_params - - def prepare_post_parameters(self, post_params=None, files=None): - """Builds form parameters. - - :param post_params: Normal form parameters. - :param files: File parameters. - :return: Form parameters with files. - """ - params = [] - - if post_params: - params = post_params - - if files: - for k, v in six.iteritems(files): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - - return params - - def select_header_accept(self, accepts): - """Returns `Accept` based on an array of accepts provided. - - :param accepts: List of headers. - :return: Accept (e.g. application/json). - """ - if not accepts: - return - - accepts = [x.lower() for x in accepts] - - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) - - def select_header_content_type(self, content_types): - """Returns `Content-Type` based on an array of content_types provided. - - :param content_types: List of content-types. - :return: Content-Type (e.g. application/json). - """ - if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] - - def update_params_for_auth(self, headers, querys, auth_settings): - """Updates header and query params based on authentication setting. - - :param headers: Header parameters dict to be updated. - :param querys: Query parameters tuple list to be updated. - :param auth_settings: Authentication setting identifiers list. - """ - if not auth_settings: - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - querys.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' - ) - - def __deserialize_file(self, response): - """Deserializes body to file - - Saves response body into a file in a temporary folder, - using the filename from the `Content-Disposition` header if provided. - - :param response: RESTResponse. - :return: file path. - """ - fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) - os.close(fd) - os.remove(path) - - content_disposition = response.getheader("Content-Disposition") - if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) - path = os.path.join(os.path.dirname(path), filename) - response_data = response.data - with open(path, "wb") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - else: - f.write(response_data) - return path - - def __deserialize_primitive(self, data, klass): - """Deserializes string to primitive type. - - :param data: str. - :param klass: class literal. - - :return: int, long, float, str, bool. - """ - try: - return klass(data) - except UnicodeEncodeError: - return six.text_type(data) - except TypeError: - return data - - def __deserialize_object(self, value): - """Return a original value. - - :return: object. - """ - return value - - def __deserialize_date(self, string): - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason="Failed to parse `{0}` as date object".format(string) - ) - - def __deserialize_datatime(self, string): - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - except ValueError: - raise rest.ApiException( - status=0, - reason=( - "Failed to parse `{0}` as datetime object" - .format(string) - ) - ) - - def __hasattr(self, object, name): - return name in object.__class__.__dict__ - - def __deserialize_model(self, data, klass): - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - - if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): - return data - - kwargs = {} - if klass.swagger_types is not None: - for attr, attr_type in six.iteritems(klass.swagger_types): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = self.__deserialize(value, attr_type) - - instance = klass(**kwargs) - - if (isinstance(instance, dict) and - klass.swagger_types is not None and - isinstance(data, dict)): - for key, value in data.items(): - if key not in klass.swagger_types: - instance[key] = value - if self.__hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = self.__deserialize(data, klass_name) - return instance diff --git a/hoprd_sdk/configuration.py b/hoprd_sdk/configuration.py index c16eefb..acfe4cc 100644 --- a/hoprd_sdk/configuration.py +++ b/hoprd_sdk/configuration.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -46,7 +46,7 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)): def __init__(self): """Constructor""" # Default Base url - self.host = "/api/v3" + self.host = "/" # Temp file folder for downloading files self.temp_folder_path = None @@ -229,19 +229,12 @@ def auth_settings(self): :return: The Auth Settings information dict. """ return { - 'keyScheme': + 'api_token': { 'type': 'api_key', 'in': 'header', - 'key': 'x-auth-token', - 'value': self.get_api_key_with_prefix('x-auth-token') - }, - 'passwordScheme': - { - 'type': 'basic', - 'in': 'header', - 'key': 'Authorization', - 'value': self.get_basic_auth_token() + 'key': 'X-Auth-Token', + 'value': self.get_api_key_with_prefix('X-Auth-Token') }, } @@ -253,6 +246,6 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 3.0.0\n"\ + "Version of the API: 0.1.0\n"\ "SDK Package Version: 2.0.0-rc.1".\ format(env=sys.platform, pyversion=sys.version) diff --git a/hoprd_sdk/models/__init__.py b/hoprd_sdk/models/__init__.py index 6ea8d09..3f3c3ec 100644 --- a/hoprd_sdk/models/__init__.py +++ b/hoprd_sdk/models/__init__.py @@ -2,11 +2,11 @@ # flake8: noqa """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -14,62 +14,36 @@ from __future__ import absolute_import # import models into model package -from hoprd_sdk.models.account_withdraw_body import AccountWithdrawBody -from hoprd_sdk.models.aliases_body import AliasesBody -from hoprd_sdk.models.channel import Channel -from hoprd_sdk.models.channel_id import ChannelId -from hoprd_sdk.models.channel_status import ChannelStatus -from hoprd_sdk.models.channel_topology import ChannelTopology -from hoprd_sdk.models.channelid_fund_body import ChannelidFundBody -from hoprd_sdk.models.channels_body import ChannelsBody -from hoprd_sdk.models.currency import Currency -from hoprd_sdk.models.error import Error -from hoprd_sdk.models.hopr_address import HoprAddress -from hoprd_sdk.models.hopr_balance import HoprBalance -from hoprd_sdk.models.inline_response200 import InlineResponse200 -from hoprd_sdk.models.inline_response2001 import InlineResponse2001 -from hoprd_sdk.models.inline_response20010 import InlineResponse20010 -from hoprd_sdk.models.inline_response20011 import InlineResponse20011 -from hoprd_sdk.models.inline_response20012 import InlineResponse20012 -from hoprd_sdk.models.inline_response20013 import InlineResponse20013 -from hoprd_sdk.models.inline_response20014 import InlineResponse20014 -from hoprd_sdk.models.inline_response20015 import InlineResponse20015 -from hoprd_sdk.models.inline_response2002 import InlineResponse2002 -from hoprd_sdk.models.inline_response2002_connected import InlineResponse2002Connected -from hoprd_sdk.models.inline_response2002_heartbeats import InlineResponse2002Heartbeats -from hoprd_sdk.models.inline_response2003 import InlineResponse2003 -from hoprd_sdk.models.inline_response2004 import InlineResponse2004 -from hoprd_sdk.models.inline_response2005 import InlineResponse2005 -from hoprd_sdk.models.inline_response2006 import InlineResponse2006 -from hoprd_sdk.models.inline_response2007 import InlineResponse2007 -from hoprd_sdk.models.inline_response2008 import InlineResponse2008 -from hoprd_sdk.models.inline_response2009 import InlineResponse2009 -from hoprd_sdk.models.inline_response201 import InlineResponse201 -from hoprd_sdk.models.inline_response2011 import InlineResponse2011 -from hoprd_sdk.models.inline_response403 import InlineResponse403 -from hoprd_sdk.models.inline_response409 import InlineResponse409 -from hoprd_sdk.models.inline_response422 import InlineResponse422 -from hoprd_sdk.models.inline_response4221 import InlineResponse4221 -from hoprd_sdk.models.inline_response_map200 import InlineResponseMap200 -from hoprd_sdk.models.message_body import MessageBody -from hoprd_sdk.models.message_tag import MessageTag -from hoprd_sdk.models.messages_body import MessagesBody -from hoprd_sdk.models.messages_peek_body import MessagesPeekBody -from hoprd_sdk.models.messages_peekall_body import MessagesPeekallBody -from hoprd_sdk.models.messages_pop_body import MessagesPopBody -from hoprd_sdk.models.messages_popall_body import MessagesPopallBody -from hoprd_sdk.models.multi_address import MultiAddress -from hoprd_sdk.models.native_address import NativeAddress -from hoprd_sdk.models.native_balance import NativeBalance -from hoprd_sdk.models.received_message import ReceivedMessage -from hoprd_sdk.models.request_status import RequestStatus -from hoprd_sdk.models.settings import Settings -from hoprd_sdk.models.settings_setting_body import SettingsSettingBody -from hoprd_sdk.models.signature import Signature -from hoprd_sdk.models.ticket import Ticket -from hoprd_sdk.models.token import Token -from hoprd_sdk.models.token_capability import TokenCapability -from hoprd_sdk.models.token_capability_limit import TokenCapabilityLimit -from hoprd_sdk.models.token_capability_limit_conditions import TokenCapabilityLimitConditions -from hoprd_sdk.models.tokens_body import TokensBody -from hoprd_sdk.models.transaction_receipt import TransactionReceipt +from hoprd_sdk.models.account_addresses import AccountAddresses +from hoprd_sdk.models.account_balances import AccountBalances +from hoprd_sdk.models.alias_peer_id import AliasPeerId +from hoprd_sdk.models.api_error import ApiError +from hoprd_sdk.models.channel_ticket import ChannelTicket +from hoprd_sdk.models.channels_query import ChannelsQuery +from hoprd_sdk.models.close_channel_receipt import CloseChannelReceipt +from hoprd_sdk.models.entry_node import EntryNode +from hoprd_sdk.models.fund_request import FundRequest +from hoprd_sdk.models.get_message_req import GetMessageReq +from hoprd_sdk.models.heartbeat_info import HeartbeatInfo +from hoprd_sdk.models.inbox_messages_res import InboxMessagesRes +from hoprd_sdk.models.message_pop_res import MessagePopRes +from hoprd_sdk.models.node_channel import NodeChannel +from hoprd_sdk.models.node_channels import NodeChannels +from hoprd_sdk.models.node_info_res import NodeInfoRes +from hoprd_sdk.models.node_peer_info import NodePeerInfo +from hoprd_sdk.models.node_peers_req_query import NodePeersReqQuery +from hoprd_sdk.models.node_peers_res import NodePeersRes +from hoprd_sdk.models.node_ticket_statistics import NodeTicketStatistics +from hoprd_sdk.models.node_topology_channel import NodeTopologyChannel +from hoprd_sdk.models.node_version import NodeVersion +from hoprd_sdk.models.open_channel_receipt import OpenChannelReceipt +from hoprd_sdk.models.open_channel_request import OpenChannelRequest +from hoprd_sdk.models.peer_id_arg import PeerIdArg +from hoprd_sdk.models.peer_info import PeerInfo +from hoprd_sdk.models.ping_info import PingInfo +from hoprd_sdk.models.send_message_req import SendMessageReq +from hoprd_sdk.models.send_message_res import SendMessageRes +from hoprd_sdk.models.size import Size +from hoprd_sdk.models.tag_query import TagQuery +from hoprd_sdk.models.ticket_price_response import TicketPriceResponse +from hoprd_sdk.models.withdraw_request import WithdrawRequest diff --git a/hoprd_sdk/models/inline_response20010.py b/hoprd_sdk/models/account_addresses.py similarity index 64% rename from hoprd_sdk/models/inline_response20010.py rename to hoprd_sdk/models/account_addresses.py index fa840c0..273c160 100644 --- a/hoprd_sdk/models/inline_response20010.py +++ b/hoprd_sdk/models/account_addresses.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse20010(object): +class AccountAddresses(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,66 +28,68 @@ class InlineResponse20010(object): and the value is json key in definition. """ swagger_types = { - 'native': 'NativeAddress', - 'hopr': 'HoprAddress' + 'hopr': 'str', + 'native': 'str' } attribute_map = { - 'native': 'native', - 'hopr': 'hopr' + 'hopr': 'hopr', + 'native': 'native' } - def __init__(self, native=None, hopr=None): # noqa: E501 - """InlineResponse20010 - a model defined in Swagger""" # noqa: E501 - self._native = None + def __init__(self, hopr=None, native=None): # noqa: E501 + """AccountAddresses - a model defined in Swagger""" # noqa: E501 self._hopr = None + self._native = None self.discriminator = None - if native is not None: - self.native = native - if hopr is not None: - self.hopr = hopr + self.hopr = hopr + self.native = native @property - def native(self): - """Gets the native of this InlineResponse20010. # noqa: E501 + def hopr(self): + """Gets the hopr of this AccountAddresses. # noqa: E501 - :return: The native of this InlineResponse20010. # noqa: E501 - :rtype: NativeAddress + :return: The hopr of this AccountAddresses. # noqa: E501 + :rtype: str """ - return self._native + return self._hopr - @native.setter - def native(self, native): - """Sets the native of this InlineResponse20010. + @hopr.setter + def hopr(self, hopr): + """Sets the hopr of this AccountAddresses. - :param native: The native of this InlineResponse20010. # noqa: E501 - :type: NativeAddress + :param hopr: The hopr of this AccountAddresses. # noqa: E501 + :type: str """ + if hopr is None: + raise ValueError("Invalid value for `hopr`, must not be `None`") # noqa: E501 - self._native = native + self._hopr = hopr @property - def hopr(self): - """Gets the hopr of this InlineResponse20010. # noqa: E501 + def native(self): + """Gets the native of this AccountAddresses. # noqa: E501 - :return: The hopr of this InlineResponse20010. # noqa: E501 - :rtype: HoprAddress + :return: The native of this AccountAddresses. # noqa: E501 + :rtype: str """ - return self._hopr + return self._native - @hopr.setter - def hopr(self, hopr): - """Sets the hopr of this InlineResponse20010. + @native.setter + def native(self, native): + """Sets the native of this AccountAddresses. - :param hopr: The hopr of this InlineResponse20010. # noqa: E501 - :type: HoprAddress + :param native: The native of this AccountAddresses. # noqa: E501 + :type: str """ + if native is None: + raise ValueError("Invalid value for `native`, must not be `None`") # noqa: E501 - self._hopr = hopr + self._native = native def to_dict(self): """Returns the model properties as a dict""" @@ -110,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse20010, dict): + if issubclass(AccountAddresses, dict): for key, value in self.items(): result[key] = value @@ -126,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20010): + if not isinstance(other, AccountAddresses): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response2009.py b/hoprd_sdk/models/account_balances.py similarity index 53% rename from hoprd_sdk/models/inline_response2009.py rename to hoprd_sdk/models/account_balances.py index a777003..a3219ec 100644 --- a/hoprd_sdk/models/inline_response2009.py +++ b/hoprd_sdk/models/account_balances.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2009(object): +class AccountBalances(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,145 +28,150 @@ class InlineResponse2009(object): and the value is json key in definition. """ swagger_types = { - 'native': 'NativeBalance', - 'hopr': 'HoprBalance', - 'safe_native': 'NativeBalance', - 'safe_hopr': 'HoprBalance', - 'safe_hopr_allowance': 'HoprBalance' + 'hopr': 'str', + 'native': 'str', + 'safe_hopr': 'str', + 'safe_hopr_allowance': 'str', + 'safe_native': 'str' } attribute_map = { - 'native': 'native', 'hopr': 'hopr', - 'safe_native': 'safeNative', + 'native': 'native', 'safe_hopr': 'safeHopr', - 'safe_hopr_allowance': 'safeHoprAllowance' + 'safe_hopr_allowance': 'safeHoprAllowance', + 'safe_native': 'safeNative' } - def __init__(self, native=None, hopr=None, safe_native=None, safe_hopr=None, safe_hopr_allowance=None): # noqa: E501 - """InlineResponse2009 - a model defined in Swagger""" # noqa: E501 - self._native = None + def __init__(self, hopr=None, native=None, safe_hopr=None, safe_hopr_allowance=None, safe_native=None): # noqa: E501 + """AccountBalances - a model defined in Swagger""" # noqa: E501 self._hopr = None - self._safe_native = None + self._native = None self._safe_hopr = None self._safe_hopr_allowance = None + self._safe_native = None self.discriminator = None - if native is not None: - self.native = native - if hopr is not None: - self.hopr = hopr - if safe_native is not None: - self.safe_native = safe_native - if safe_hopr is not None: - self.safe_hopr = safe_hopr - if safe_hopr_allowance is not None: - self.safe_hopr_allowance = safe_hopr_allowance - - @property - def native(self): - """Gets the native of this InlineResponse2009. # noqa: E501 - - - :return: The native of this InlineResponse2009. # noqa: E501 - :rtype: NativeBalance - """ - return self._native - - @native.setter - def native(self, native): - """Sets the native of this InlineResponse2009. - - - :param native: The native of this InlineResponse2009. # noqa: E501 - :type: NativeBalance - """ - - self._native = native + self.hopr = hopr + self.native = native + self.safe_hopr = safe_hopr + self.safe_hopr_allowance = safe_hopr_allowance + self.safe_native = safe_native @property def hopr(self): - """Gets the hopr of this InlineResponse2009. # noqa: E501 + """Gets the hopr of this AccountBalances. # noqa: E501 - :return: The hopr of this InlineResponse2009. # noqa: E501 - :rtype: HoprBalance + :return: The hopr of this AccountBalances. # noqa: E501 + :rtype: str """ return self._hopr @hopr.setter def hopr(self, hopr): - """Sets the hopr of this InlineResponse2009. + """Sets the hopr of this AccountBalances. - :param hopr: The hopr of this InlineResponse2009. # noqa: E501 - :type: HoprBalance + :param hopr: The hopr of this AccountBalances. # noqa: E501 + :type: str """ + if hopr is None: + raise ValueError("Invalid value for `hopr`, must not be `None`") # noqa: E501 self._hopr = hopr @property - def safe_native(self): - """Gets the safe_native of this InlineResponse2009. # noqa: E501 + def native(self): + """Gets the native of this AccountBalances. # noqa: E501 - :return: The safe_native of this InlineResponse2009. # noqa: E501 - :rtype: NativeBalance + :return: The native of this AccountBalances. # noqa: E501 + :rtype: str """ - return self._safe_native + return self._native - @safe_native.setter - def safe_native(self, safe_native): - """Sets the safe_native of this InlineResponse2009. + @native.setter + def native(self, native): + """Sets the native of this AccountBalances. - :param safe_native: The safe_native of this InlineResponse2009. # noqa: E501 - :type: NativeBalance + :param native: The native of this AccountBalances. # noqa: E501 + :type: str """ + if native is None: + raise ValueError("Invalid value for `native`, must not be `None`") # noqa: E501 - self._safe_native = safe_native + self._native = native @property def safe_hopr(self): - """Gets the safe_hopr of this InlineResponse2009. # noqa: E501 + """Gets the safe_hopr of this AccountBalances. # noqa: E501 - :return: The safe_hopr of this InlineResponse2009. # noqa: E501 - :rtype: HoprBalance + :return: The safe_hopr of this AccountBalances. # noqa: E501 + :rtype: str """ return self._safe_hopr @safe_hopr.setter def safe_hopr(self, safe_hopr): - """Sets the safe_hopr of this InlineResponse2009. + """Sets the safe_hopr of this AccountBalances. - :param safe_hopr: The safe_hopr of this InlineResponse2009. # noqa: E501 - :type: HoprBalance + :param safe_hopr: The safe_hopr of this AccountBalances. # noqa: E501 + :type: str """ + if safe_hopr is None: + raise ValueError("Invalid value for `safe_hopr`, must not be `None`") # noqa: E501 self._safe_hopr = safe_hopr @property def safe_hopr_allowance(self): - """Gets the safe_hopr_allowance of this InlineResponse2009. # noqa: E501 + """Gets the safe_hopr_allowance of this AccountBalances. # noqa: E501 - :return: The safe_hopr_allowance of this InlineResponse2009. # noqa: E501 - :rtype: HoprBalance + :return: The safe_hopr_allowance of this AccountBalances. # noqa: E501 + :rtype: str """ return self._safe_hopr_allowance @safe_hopr_allowance.setter def safe_hopr_allowance(self, safe_hopr_allowance): - """Sets the safe_hopr_allowance of this InlineResponse2009. + """Sets the safe_hopr_allowance of this AccountBalances. - :param safe_hopr_allowance: The safe_hopr_allowance of this InlineResponse2009. # noqa: E501 - :type: HoprBalance + :param safe_hopr_allowance: The safe_hopr_allowance of this AccountBalances. # noqa: E501 + :type: str """ + if safe_hopr_allowance is None: + raise ValueError("Invalid value for `safe_hopr_allowance`, must not be `None`") # noqa: E501 self._safe_hopr_allowance = safe_hopr_allowance + @property + def safe_native(self): + """Gets the safe_native of this AccountBalances. # noqa: E501 + + + :return: The safe_native of this AccountBalances. # noqa: E501 + :rtype: str + """ + return self._safe_native + + @safe_native.setter + def safe_native(self, safe_native): + """Sets the safe_native of this AccountBalances. + + + :param safe_native: The safe_native of this AccountBalances. # noqa: E501 + :type: str + """ + if safe_native is None: + raise ValueError("Invalid value for `safe_native`, must not be `None`") # noqa: E501 + + self._safe_native = safe_native + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -188,7 +193,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2009, dict): + if issubclass(AccountBalances, dict): for key, value in self.items(): result[key] = value @@ -204,7 +209,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2009): + if not isinstance(other, AccountBalances): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/aliases_body.py b/hoprd_sdk/models/alias_peer_id.py similarity index 70% rename from hoprd_sdk/models/aliases_body.py rename to hoprd_sdk/models/alias_peer_id.py index 320e01f..f8596c6 100644 --- a/hoprd_sdk/models/aliases_body.py +++ b/hoprd_sdk/models/alias_peer_id.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class AliasesBody(object): +class AliasPeerId(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,72 +28,68 @@ class AliasesBody(object): and the value is json key in definition. """ swagger_types = { - 'peer_id': 'str', - 'alias': 'str' + 'alias': 'str', + 'peer_id': 'str' } attribute_map = { - 'peer_id': 'peerId', - 'alias': 'alias' + 'alias': 'alias', + 'peer_id': 'peerId' } - def __init__(self, peer_id=None, alias=None): # noqa: E501 - """AliasesBody - a model defined in Swagger""" # noqa: E501 - self._peer_id = None + def __init__(self, alias=None, peer_id=None): # noqa: E501 + """AliasPeerId - a model defined in Swagger""" # noqa: E501 self._alias = None + self._peer_id = None self.discriminator = None - self.peer_id = peer_id self.alias = alias + self.peer_id = peer_id @property - def peer_id(self): - """Gets the peer_id of this AliasesBody. # noqa: E501 + def alias(self): + """Gets the alias of this AliasPeerId. # noqa: E501 - PeerId that we want to set alias to. # noqa: E501 - :return: The peer_id of this AliasesBody. # noqa: E501 + :return: The alias of this AliasPeerId. # noqa: E501 :rtype: str """ - return self._peer_id + return self._alias - @peer_id.setter - def peer_id(self, peer_id): - """Sets the peer_id of this AliasesBody. + @alias.setter + def alias(self, alias): + """Sets the alias of this AliasPeerId. - PeerId that we want to set alias to. # noqa: E501 - :param peer_id: The peer_id of this AliasesBody. # noqa: E501 + :param alias: The alias of this AliasPeerId. # noqa: E501 :type: str """ - if peer_id is None: - raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 + if alias is None: + raise ValueError("Invalid value for `alias`, must not be `None`") # noqa: E501 - self._peer_id = peer_id + self._alias = alias @property - def alias(self): - """Gets the alias of this AliasesBody. # noqa: E501 + def peer_id(self): + """Gets the peer_id of this AliasPeerId. # noqa: E501 - Alias that we want to attach to peerId. # noqa: E501 - :return: The alias of this AliasesBody. # noqa: E501 + :return: The peer_id of this AliasPeerId. # noqa: E501 :rtype: str """ - return self._alias + return self._peer_id - @alias.setter - def alias(self, alias): - """Sets the alias of this AliasesBody. + @peer_id.setter + def peer_id(self, peer_id): + """Sets the peer_id of this AliasPeerId. - Alias that we want to attach to peerId. # noqa: E501 - :param alias: The alias of this AliasesBody. # noqa: E501 + :param peer_id: The peer_id of this AliasPeerId. # noqa: E501 :type: str """ - if alias is None: - raise ValueError("Invalid value for `alias`, must not be `None`") # noqa: E501 + if peer_id is None: + raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 - self._alias = alias + self._peer_id = peer_id def to_dict(self): """Returns the model properties as a dict""" @@ -116,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(AliasesBody, dict): + if issubclass(AliasPeerId, dict): for key, value in self.items(): result[key] = value @@ -132,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, AliasesBody): + if not isinstance(other, AliasPeerId): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/error.py b/hoprd_sdk/models/api_error.py similarity index 71% rename from hoprd_sdk/models/error.py rename to hoprd_sdk/models/api_error.py index 2a2f6e3..944ac48 100644 --- a/hoprd_sdk/models/error.py +++ b/hoprd_sdk/models/api_error.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class Error(object): +class ApiError(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,68 +28,67 @@ class Error(object): and the value is json key in definition. """ swagger_types = { - 'status': 'str', - 'error': 'str' + 'error': 'str', + 'status': 'str' } attribute_map = { - 'status': 'status', - 'error': 'error' + 'error': 'error', + 'status': 'status' } - def __init__(self, status=None, error=None): # noqa: E501 - """Error - a model defined in Swagger""" # noqa: E501 - self._status = None + def __init__(self, error=None, status=None): # noqa: E501 + """ApiError - a model defined in Swagger""" # noqa: E501 self._error = None + self._status = None self.discriminator = None + if error is not None: + self.error = error self.status = status - self.error = error @property - def status(self): - """Gets the status of this Error. # noqa: E501 + def error(self): + """Gets the error of this ApiError. # noqa: E501 - :return: The status of this Error. # noqa: E501 + :return: The error of this ApiError. # noqa: E501 :rtype: str """ - return self._status + return self._error - @status.setter - def status(self, status): - """Sets the status of this Error. + @error.setter + def error(self, error): + """Sets the error of this ApiError. - :param status: The status of this Error. # noqa: E501 + :param error: The error of this ApiError. # noqa: E501 :type: str """ - if status is None: - raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - self._status = status + self._error = error @property - def error(self): - """Gets the error of this Error. # noqa: E501 + def status(self): + """Gets the status of this ApiError. # noqa: E501 - :return: The error of this Error. # noqa: E501 + :return: The status of this ApiError. # noqa: E501 :rtype: str """ - return self._error + return self._status - @error.setter - def error(self, error): - """Sets the error of this Error. + @status.setter + def status(self, status): + """Sets the status of this ApiError. - :param error: The error of this Error. # noqa: E501 + :param status: The status of this ApiError. # noqa: E501 :type: str """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 - self._error = error + self._status = status def to_dict(self): """Returns the model properties as a dict""" @@ -112,7 +111,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(Error, dict): + if issubclass(ApiError, dict): for key, value in self.items(): result[key] = value @@ -128,7 +127,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Error): + if not isinstance(other, ApiError): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/channel.py b/hoprd_sdk/models/channel.py deleted file mode 100644 index de70333..0000000 --- a/hoprd_sdk/models/channel.py +++ /dev/null @@ -1,222 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Channel(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'type': 'str', - 'id': 'ChannelId', - 'peer_id': 'HoprAddress', - 'status': 'ChannelStatus', - 'balance': 'HoprBalance' - } - - attribute_map = { - 'type': 'type', - 'id': 'id', - 'peer_id': 'peerId', - 'status': 'status', - 'balance': 'balance' - } - - def __init__(self, type=None, id=None, peer_id=None, status=None, balance=None): # noqa: E501 - """Channel - a model defined in Swagger""" # noqa: E501 - self._type = None - self._id = None - self._peer_id = None - self._status = None - self._balance = None - self.discriminator = None - if type is not None: - self.type = type - if id is not None: - self.id = id - if peer_id is not None: - self.peer_id = peer_id - if status is not None: - self.status = status - if balance is not None: - self.balance = balance - - @property - def type(self): - """Gets the type of this Channel. # noqa: E501 - - Channel can be either incomming or outgoing. Incomming means that other node can send messages using this node as relay. Outgoing means that this node can use other node to send message as realy. # noqa: E501 - - :return: The type of this Channel. # noqa: E501 - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this Channel. - - Channel can be either incomming or outgoing. Incomming means that other node can send messages using this node as relay. Outgoing means that this node can use other node to send message as realy. # noqa: E501 - - :param type: The type of this Channel. # noqa: E501 - :type: str - """ - allowed_values = ["incoming", "outgoing"] # noqa: E501 - if type not in allowed_values: - raise ValueError( - "Invalid value for `type` ({0}), must be one of {1}" # noqa: E501 - .format(type, allowed_values) - ) - - self._type = type - - @property - def id(self): - """Gets the id of this Channel. # noqa: E501 - - - :return: The id of this Channel. # noqa: E501 - :rtype: ChannelId - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Channel. - - - :param id: The id of this Channel. # noqa: E501 - :type: ChannelId - """ - - self._id = id - - @property - def peer_id(self): - """Gets the peer_id of this Channel. # noqa: E501 - - - :return: The peer_id of this Channel. # noqa: E501 - :rtype: HoprAddress - """ - return self._peer_id - - @peer_id.setter - def peer_id(self, peer_id): - """Sets the peer_id of this Channel. - - - :param peer_id: The peer_id of this Channel. # noqa: E501 - :type: HoprAddress - """ - - self._peer_id = peer_id - - @property - def status(self): - """Gets the status of this Channel. # noqa: E501 - - - :return: The status of this Channel. # noqa: E501 - :rtype: ChannelStatus - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Channel. - - - :param status: The status of this Channel. # noqa: E501 - :type: ChannelStatus - """ - - self._status = status - - @property - def balance(self): - """Gets the balance of this Channel. # noqa: E501 - - - :return: The balance of this Channel. # noqa: E501 - :rtype: HoprBalance - """ - return self._balance - - @balance.setter - def balance(self, balance): - """Sets the balance of this Channel. - - - :param balance: The balance of this Channel. # noqa: E501 - :type: HoprBalance - """ - - self._balance = balance - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Channel, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Channel): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/channel_id.py b/hoprd_sdk/models/channel_id.py deleted file mode 100644 index 03ce0b8..0000000 --- a/hoprd_sdk/models/channel_id.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class ChannelId(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """ChannelId - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ChannelId, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ChannelId): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/channel_status.py b/hoprd_sdk/models/channel_status.py deleted file mode 100644 index 4740b26..0000000 --- a/hoprd_sdk/models/channel_status.py +++ /dev/null @@ -1,91 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class ChannelStatus(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - OPEN = "Open" - PENDINGTOCLOSE = "PendingToClose" - CLOSED = "Closed" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """ChannelStatus - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ChannelStatus, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ChannelStatus): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/channel_ticket.py b/hoprd_sdk/models/channel_ticket.py new file mode 100644 index 0000000..cc19695 --- /dev/null +++ b/hoprd_sdk/models/channel_ticket.py @@ -0,0 +1,273 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ChannelTicket(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'amount': 'str', + 'channel_epoch': 'int', + 'channel_id': 'str', + 'index': 'int', + 'index_offset': 'int', + 'signature': 'str', + 'win_prob': 'str' + } + + attribute_map = { + 'amount': 'amount', + 'channel_epoch': 'channelEpoch', + 'channel_id': 'channelId', + 'index': 'index', + 'index_offset': 'indexOffset', + 'signature': 'signature', + 'win_prob': 'winProb' + } + + def __init__(self, amount=None, channel_epoch=None, channel_id=None, index=None, index_offset=None, signature=None, win_prob=None): # noqa: E501 + """ChannelTicket - a model defined in Swagger""" # noqa: E501 + self._amount = None + self._channel_epoch = None + self._channel_id = None + self._index = None + self._index_offset = None + self._signature = None + self._win_prob = None + self.discriminator = None + self.amount = amount + self.channel_epoch = channel_epoch + self.channel_id = channel_id + self.index = index + self.index_offset = index_offset + self.signature = signature + self.win_prob = win_prob + + @property + def amount(self): + """Gets the amount of this ChannelTicket. # noqa: E501 + + + :return: The amount of this ChannelTicket. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this ChannelTicket. + + + :param amount: The amount of this ChannelTicket. # noqa: E501 + :type: str + """ + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def channel_epoch(self): + """Gets the channel_epoch of this ChannelTicket. # noqa: E501 + + + :return: The channel_epoch of this ChannelTicket. # noqa: E501 + :rtype: int + """ + return self._channel_epoch + + @channel_epoch.setter + def channel_epoch(self, channel_epoch): + """Sets the channel_epoch of this ChannelTicket. + + + :param channel_epoch: The channel_epoch of this ChannelTicket. # noqa: E501 + :type: int + """ + if channel_epoch is None: + raise ValueError("Invalid value for `channel_epoch`, must not be `None`") # noqa: E501 + + self._channel_epoch = channel_epoch + + @property + def channel_id(self): + """Gets the channel_id of this ChannelTicket. # noqa: E501 + + + :return: The channel_id of this ChannelTicket. # noqa: E501 + :rtype: str + """ + return self._channel_id + + @channel_id.setter + def channel_id(self, channel_id): + """Sets the channel_id of this ChannelTicket. + + + :param channel_id: The channel_id of this ChannelTicket. # noqa: E501 + :type: str + """ + if channel_id is None: + raise ValueError("Invalid value for `channel_id`, must not be `None`") # noqa: E501 + + self._channel_id = channel_id + + @property + def index(self): + """Gets the index of this ChannelTicket. # noqa: E501 + + + :return: The index of this ChannelTicket. # noqa: E501 + :rtype: int + """ + return self._index + + @index.setter + def index(self, index): + """Sets the index of this ChannelTicket. + + + :param index: The index of this ChannelTicket. # noqa: E501 + :type: int + """ + if index is None: + raise ValueError("Invalid value for `index`, must not be `None`") # noqa: E501 + + self._index = index + + @property + def index_offset(self): + """Gets the index_offset of this ChannelTicket. # noqa: E501 + + + :return: The index_offset of this ChannelTicket. # noqa: E501 + :rtype: int + """ + return self._index_offset + + @index_offset.setter + def index_offset(self, index_offset): + """Sets the index_offset of this ChannelTicket. + + + :param index_offset: The index_offset of this ChannelTicket. # noqa: E501 + :type: int + """ + if index_offset is None: + raise ValueError("Invalid value for `index_offset`, must not be `None`") # noqa: E501 + + self._index_offset = index_offset + + @property + def signature(self): + """Gets the signature of this ChannelTicket. # noqa: E501 + + + :return: The signature of this ChannelTicket. # noqa: E501 + :rtype: str + """ + return self._signature + + @signature.setter + def signature(self, signature): + """Sets the signature of this ChannelTicket. + + + :param signature: The signature of this ChannelTicket. # noqa: E501 + :type: str + """ + if signature is None: + raise ValueError("Invalid value for `signature`, must not be `None`") # noqa: E501 + + self._signature = signature + + @property + def win_prob(self): + """Gets the win_prob of this ChannelTicket. # noqa: E501 + + + :return: The win_prob of this ChannelTicket. # noqa: E501 + :rtype: str + """ + return self._win_prob + + @win_prob.setter + def win_prob(self, win_prob): + """Sets the win_prob of this ChannelTicket. + + + :param win_prob: The win_prob of this ChannelTicket. # noqa: E501 + :type: str + """ + if win_prob is None: + raise ValueError("Invalid value for `win_prob`, must not be `None`") # noqa: E501 + + self._win_prob = win_prob + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(ChannelTicket, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ChannelTicket): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/channel_topology.py b/hoprd_sdk/models/channel_topology.py deleted file mode 100644 index 8849e54..0000000 --- a/hoprd_sdk/models/channel_topology.py +++ /dev/null @@ -1,350 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class ChannelTopology(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'channel_id': 'ChannelId', - 'source_peer_id': 'HoprAddress', - 'destination_peer_id': 'HoprAddress', - 'source_address': 'NativeAddress', - 'destination_address': 'NativeAddress', - 'balance': 'HoprBalance', - 'status': 'ChannelStatus', - 'ticket_index': 'str', - 'channel_epoch': 'str', - 'closure_time': 'str' - } - - attribute_map = { - 'channel_id': 'channelId', - 'source_peer_id': 'sourcePeerId', - 'destination_peer_id': 'destinationPeerId', - 'source_address': 'sourceAddress', - 'destination_address': 'destinationAddress', - 'balance': 'balance', - 'status': 'status', - 'ticket_index': 'ticketIndex', - 'channel_epoch': 'channelEpoch', - 'closure_time': 'closureTime' - } - - def __init__(self, channel_id=None, source_peer_id=None, destination_peer_id=None, source_address=None, destination_address=None, balance=None, status=None, ticket_index=None, channel_epoch=None, closure_time=None): # noqa: E501 - """ChannelTopology - a model defined in Swagger""" # noqa: E501 - self._channel_id = None - self._source_peer_id = None - self._destination_peer_id = None - self._source_address = None - self._destination_address = None - self._balance = None - self._status = None - self._ticket_index = None - self._channel_epoch = None - self._closure_time = None - self.discriminator = None - if channel_id is not None: - self.channel_id = channel_id - if source_peer_id is not None: - self.source_peer_id = source_peer_id - if destination_peer_id is not None: - self.destination_peer_id = destination_peer_id - if source_address is not None: - self.source_address = source_address - if destination_address is not None: - self.destination_address = destination_address - if balance is not None: - self.balance = balance - if status is not None: - self.status = status - if ticket_index is not None: - self.ticket_index = ticket_index - if channel_epoch is not None: - self.channel_epoch = channel_epoch - if closure_time is not None: - self.closure_time = closure_time - - @property - def channel_id(self): - """Gets the channel_id of this ChannelTopology. # noqa: E501 - - - :return: The channel_id of this ChannelTopology. # noqa: E501 - :rtype: ChannelId - """ - return self._channel_id - - @channel_id.setter - def channel_id(self, channel_id): - """Sets the channel_id of this ChannelTopology. - - - :param channel_id: The channel_id of this ChannelTopology. # noqa: E501 - :type: ChannelId - """ - - self._channel_id = channel_id - - @property - def source_peer_id(self): - """Gets the source_peer_id of this ChannelTopology. # noqa: E501 - - - :return: The source_peer_id of this ChannelTopology. # noqa: E501 - :rtype: HoprAddress - """ - return self._source_peer_id - - @source_peer_id.setter - def source_peer_id(self, source_peer_id): - """Sets the source_peer_id of this ChannelTopology. - - - :param source_peer_id: The source_peer_id of this ChannelTopology. # noqa: E501 - :type: HoprAddress - """ - - self._source_peer_id = source_peer_id - - @property - def destination_peer_id(self): - """Gets the destination_peer_id of this ChannelTopology. # noqa: E501 - - - :return: The destination_peer_id of this ChannelTopology. # noqa: E501 - :rtype: HoprAddress - """ - return self._destination_peer_id - - @destination_peer_id.setter - def destination_peer_id(self, destination_peer_id): - """Sets the destination_peer_id of this ChannelTopology. - - - :param destination_peer_id: The destination_peer_id of this ChannelTopology. # noqa: E501 - :type: HoprAddress - """ - - self._destination_peer_id = destination_peer_id - - @property - def source_address(self): - """Gets the source_address of this ChannelTopology. # noqa: E501 - - - :return: The source_address of this ChannelTopology. # noqa: E501 - :rtype: NativeAddress - """ - return self._source_address - - @source_address.setter - def source_address(self, source_address): - """Sets the source_address of this ChannelTopology. - - - :param source_address: The source_address of this ChannelTopology. # noqa: E501 - :type: NativeAddress - """ - - self._source_address = source_address - - @property - def destination_address(self): - """Gets the destination_address of this ChannelTopology. # noqa: E501 - - - :return: The destination_address of this ChannelTopology. # noqa: E501 - :rtype: NativeAddress - """ - return self._destination_address - - @destination_address.setter - def destination_address(self, destination_address): - """Sets the destination_address of this ChannelTopology. - - - :param destination_address: The destination_address of this ChannelTopology. # noqa: E501 - :type: NativeAddress - """ - - self._destination_address = destination_address - - @property - def balance(self): - """Gets the balance of this ChannelTopology. # noqa: E501 - - - :return: The balance of this ChannelTopology. # noqa: E501 - :rtype: HoprBalance - """ - return self._balance - - @balance.setter - def balance(self, balance): - """Sets the balance of this ChannelTopology. - - - :param balance: The balance of this ChannelTopology. # noqa: E501 - :type: HoprBalance - """ - - self._balance = balance - - @property - def status(self): - """Gets the status of this ChannelTopology. # noqa: E501 - - - :return: The status of this ChannelTopology. # noqa: E501 - :rtype: ChannelStatus - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this ChannelTopology. - - - :param status: The status of this ChannelTopology. # noqa: E501 - :type: ChannelStatus - """ - - self._status = status - - @property - def ticket_index(self): - """Gets the ticket_index of this ChannelTopology. # noqa: E501 - - Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. # noqa: E501 - - :return: The ticket_index of this ChannelTopology. # noqa: E501 - :rtype: str - """ - return self._ticket_index - - @ticket_index.setter - def ticket_index(self, ticket_index): - """Sets the ticket_index of this ChannelTopology. - - Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. # noqa: E501 - - :param ticket_index: The ticket_index of this ChannelTopology. # noqa: E501 - :type: str - """ - - self._ticket_index = ticket_index - - @property - def channel_epoch(self): - """Gets the channel_epoch of this ChannelTopology. # noqa: E501 - - Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. # noqa: E501 - - :return: The channel_epoch of this ChannelTopology. # noqa: E501 - :rtype: str - """ - return self._channel_epoch - - @channel_epoch.setter - def channel_epoch(self, channel_epoch): - """Sets the channel_epoch of this ChannelTopology. - - Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. # noqa: E501 - - :param channel_epoch: The channel_epoch of this ChannelTopology. # noqa: E501 - :type: str - """ - - self._channel_epoch = channel_epoch - - @property - def closure_time(self): - """Gets the closure_time of this ChannelTopology. # noqa: E501 - - Time when the channel can be closed # noqa: E501 - - :return: The closure_time of this ChannelTopology. # noqa: E501 - :rtype: str - """ - return self._closure_time - - @closure_time.setter - def closure_time(self, closure_time): - """Sets the closure_time of this ChannelTopology. - - Time when the channel can be closed # noqa: E501 - - :param closure_time: The closure_time of this ChannelTopology. # noqa: E501 - :type: str - """ - - self._closure_time = closure_time - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(ChannelTopology, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, ChannelTopology): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/token_capability_limit.py b/hoprd_sdk/models/channels_query.py similarity index 53% rename from hoprd_sdk/models/token_capability_limit.py rename to hoprd_sdk/models/channels_query.py index fd6bf9b..79a2f07 100644 --- a/hoprd_sdk/models/token_capability_limit.py +++ b/hoprd_sdk/models/channels_query.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class TokenCapabilityLimit(object): +class ChannelsQuery(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,69 +28,66 @@ class TokenCapabilityLimit(object): and the value is json key in definition. """ swagger_types = { - 'type': 'str', - 'conditions': 'TokenCapabilityLimitConditions' + 'full_topology': 'bool', + 'including_closed': 'bool' } attribute_map = { - 'type': 'type', - 'conditions': 'conditions' + 'full_topology': 'fullTopology', + 'including_closed': 'includingClosed' } - def __init__(self, type=None, conditions=None): # noqa: E501 - """TokenCapabilityLimit - a model defined in Swagger""" # noqa: E501 - self._type = None - self._conditions = None + def __init__(self, full_topology=False, including_closed=False): # noqa: E501 + """ChannelsQuery - a model defined in Swagger""" # noqa: E501 + self._full_topology = None + self._including_closed = None self.discriminator = None - self.type = type - if conditions is not None: - self.conditions = conditions + if full_topology is not None: + self.full_topology = full_topology + if including_closed is not None: + self.including_closed = including_closed @property - def type(self): - """Gets the type of this TokenCapabilityLimit. # noqa: E501 + def full_topology(self): + """Gets the full_topology of this ChannelsQuery. # noqa: E501 - Limit type # noqa: E501 - :return: The type of this TokenCapabilityLimit. # noqa: E501 - :rtype: str + :return: The full_topology of this ChannelsQuery. # noqa: E501 + :rtype: bool """ - return self._type + return self._full_topology - @type.setter - def type(self, type): - """Sets the type of this TokenCapabilityLimit. + @full_topology.setter + def full_topology(self, full_topology): + """Sets the full_topology of this ChannelsQuery. - Limit type # noqa: E501 - :param type: The type of this TokenCapabilityLimit. # noqa: E501 - :type: str + :param full_topology: The full_topology of this ChannelsQuery. # noqa: E501 + :type: bool """ - if type is None: - raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 - self._type = type + self._full_topology = full_topology @property - def conditions(self): - """Gets the conditions of this TokenCapabilityLimit. # noqa: E501 + def including_closed(self): + """Gets the including_closed of this ChannelsQuery. # noqa: E501 - :return: The conditions of this TokenCapabilityLimit. # noqa: E501 - :rtype: TokenCapabilityLimitConditions + :return: The including_closed of this ChannelsQuery. # noqa: E501 + :rtype: bool """ - return self._conditions + return self._including_closed - @conditions.setter - def conditions(self, conditions): - """Sets the conditions of this TokenCapabilityLimit. + @including_closed.setter + def including_closed(self, including_closed): + """Sets the including_closed of this ChannelsQuery. - :param conditions: The conditions of this TokenCapabilityLimit. # noqa: E501 - :type: TokenCapabilityLimitConditions + :param including_closed: The including_closed of this ChannelsQuery. # noqa: E501 + :type: bool """ - self._conditions = conditions + self._including_closed = including_closed def to_dict(self): """Returns the model properties as a dict""" @@ -113,7 +110,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(TokenCapabilityLimit, dict): + if issubclass(ChannelsQuery, dict): for key, value in self.items(): result[key] = value @@ -129,7 +126,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, TokenCapabilityLimit): + if not isinstance(other, ChannelsQuery): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response20014.py b/hoprd_sdk/models/close_channel_receipt.py similarity index 65% rename from hoprd_sdk/models/inline_response20014.py rename to hoprd_sdk/models/close_channel_receipt.py index ccf0176..311a608 100644 --- a/hoprd_sdk/models/inline_response20014.py +++ b/hoprd_sdk/models/close_channel_receipt.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse20014(object): +class CloseChannelReceipt(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,70 +28,68 @@ class InlineResponse20014(object): and the value is json key in definition. """ swagger_types = { - 'receipt': 'str', - 'channel_status': 'str' + 'channel_status': 'str', + 'receipt': 'str' } attribute_map = { - 'receipt': 'receipt', - 'channel_status': 'channelStatus' + 'channel_status': 'channelStatus', + 'receipt': 'receipt' } - def __init__(self, receipt=None, channel_status=None): # noqa: E501 - """InlineResponse20014 - a model defined in Swagger""" # noqa: E501 - self._receipt = None + def __init__(self, channel_status=None, receipt=None): # noqa: E501 + """CloseChannelReceipt - a model defined in Swagger""" # noqa: E501 self._channel_status = None + self._receipt = None self.discriminator = None - if receipt is not None: - self.receipt = receipt - if channel_status is not None: - self.channel_status = channel_status + self.channel_status = channel_status + self.receipt = receipt @property - def receipt(self): - """Gets the receipt of this InlineResponse20014. # noqa: E501 + def channel_status(self): + """Gets the channel_status of this CloseChannelReceipt. # noqa: E501 - Receipt of the closing transaction # noqa: E501 - :return: The receipt of this InlineResponse20014. # noqa: E501 + :return: The channel_status of this CloseChannelReceipt. # noqa: E501 :rtype: str """ - return self._receipt + return self._channel_status - @receipt.setter - def receipt(self, receipt): - """Sets the receipt of this InlineResponse20014. + @channel_status.setter + def channel_status(self, channel_status): + """Sets the channel_status of this CloseChannelReceipt. - Receipt of the closing transaction # noqa: E501 - :param receipt: The receipt of this InlineResponse20014. # noqa: E501 + :param channel_status: The channel_status of this CloseChannelReceipt. # noqa: E501 :type: str """ + if channel_status is None: + raise ValueError("Invalid value for `channel_status`, must not be `None`") # noqa: E501 - self._receipt = receipt + self._channel_status = channel_status @property - def channel_status(self): - """Gets the channel_status of this InlineResponse20014. # noqa: E501 + def receipt(self): + """Gets the receipt of this CloseChannelReceipt. # noqa: E501 - Current status of the channel # noqa: E501 - :return: The channel_status of this InlineResponse20014. # noqa: E501 + :return: The receipt of this CloseChannelReceipt. # noqa: E501 :rtype: str """ - return self._channel_status + return self._receipt - @channel_status.setter - def channel_status(self, channel_status): - """Sets the channel_status of this InlineResponse20014. + @receipt.setter + def receipt(self, receipt): + """Sets the receipt of this CloseChannelReceipt. - Current status of the channel # noqa: E501 - :param channel_status: The channel_status of this InlineResponse20014. # noqa: E501 + :param receipt: The receipt of this CloseChannelReceipt. # noqa: E501 :type: str """ + if receipt is None: + raise ValueError("Invalid value for `receipt`, must not be `None`") # noqa: E501 - self._channel_status = channel_status + self._receipt = receipt def to_dict(self): """Returns the model properties as a dict""" @@ -114,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse20014, dict): + if issubclass(CloseChannelReceipt, dict): for key, value in self.items(): result[key] = value @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20014): + if not isinstance(other, CloseChannelReceipt): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/currency.py b/hoprd_sdk/models/currency.py deleted file mode 100644 index 361ffb7..0000000 --- a/hoprd_sdk/models/currency.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Currency(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - NATIVE = "NATIVE" - HOPR = "HOPR" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """Currency - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Currency, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Currency): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response_map200.py b/hoprd_sdk/models/entry_node.py similarity index 57% rename from hoprd_sdk/models/inline_response_map200.py rename to hoprd_sdk/models/entry_node.py index c84fbe6..9415242 100644 --- a/hoprd_sdk/models/inline_response_map200.py +++ b/hoprd_sdk/models/entry_node.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponseMap200(object): +class EntryNode(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,70 +28,68 @@ class InlineResponseMap200(object): and the value is json key in definition. """ swagger_types = { - 'multiaddrs': 'list[str]', - 'is_eligible': 'bool' + 'is_elligible': 'bool', + 'multiaddrs': 'list[str]' } attribute_map = { - 'multiaddrs': 'multiaddrs', - 'is_eligible': 'isEligible' + 'is_elligible': 'isElligible', + 'multiaddrs': 'multiaddrs' } - def __init__(self, multiaddrs=None, is_eligible=None): # noqa: E501 - """InlineResponseMap200 - a model defined in Swagger""" # noqa: E501 + def __init__(self, is_elligible=None, multiaddrs=None): # noqa: E501 + """EntryNode - a model defined in Swagger""" # noqa: E501 + self._is_elligible = None self._multiaddrs = None - self._is_eligible = None self.discriminator = None - if multiaddrs is not None: - self.multiaddrs = multiaddrs - if is_eligible is not None: - self.is_eligible = is_eligible + self.is_elligible = is_elligible + self.multiaddrs = multiaddrs @property - def multiaddrs(self): - """Gets the multiaddrs of this InlineResponseMap200. # noqa: E501 + def is_elligible(self): + """Gets the is_elligible of this EntryNode. # noqa: E501 - Known Multiaddrs of the node # noqa: E501 - :return: The multiaddrs of this InlineResponseMap200. # noqa: E501 - :rtype: list[str] + :return: The is_elligible of this EntryNode. # noqa: E501 + :rtype: bool """ - return self._multiaddrs + return self._is_elligible - @multiaddrs.setter - def multiaddrs(self, multiaddrs): - """Sets the multiaddrs of this InlineResponseMap200. + @is_elligible.setter + def is_elligible(self, is_elligible): + """Sets the is_elligible of this EntryNode. - Known Multiaddrs of the node # noqa: E501 - :param multiaddrs: The multiaddrs of this InlineResponseMap200. # noqa: E501 - :type: list[str] + :param is_elligible: The is_elligible of this EntryNode. # noqa: E501 + :type: bool """ + if is_elligible is None: + raise ValueError("Invalid value for `is_elligible`, must not be `None`") # noqa: E501 - self._multiaddrs = multiaddrs + self._is_elligible = is_elligible @property - def is_eligible(self): - """Gets the is_eligible of this InlineResponseMap200. # noqa: E501 + def multiaddrs(self): + """Gets the multiaddrs of this EntryNode. # noqa: E501 - true if peer is allowed to access network, otherwise false # noqa: E501 - :return: The is_eligible of this InlineResponseMap200. # noqa: E501 - :rtype: bool + :return: The multiaddrs of this EntryNode. # noqa: E501 + :rtype: list[str] """ - return self._is_eligible + return self._multiaddrs - @is_eligible.setter - def is_eligible(self, is_eligible): - """Sets the is_eligible of this InlineResponseMap200. + @multiaddrs.setter + def multiaddrs(self, multiaddrs): + """Sets the multiaddrs of this EntryNode. - true if peer is allowed to access network, otherwise false # noqa: E501 - :param is_eligible: The is_eligible of this InlineResponseMap200. # noqa: E501 - :type: bool + :param multiaddrs: The multiaddrs of this EntryNode. # noqa: E501 + :type: list[str] """ + if multiaddrs is None: + raise ValueError("Invalid value for `multiaddrs`, must not be `None`") # noqa: E501 - self._is_eligible = is_eligible + self._multiaddrs = multiaddrs def to_dict(self): """Returns the model properties as a dict""" @@ -114,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponseMap200, dict): + if issubclass(EntryNode, dict): for key, value in self.items(): result[key] = value @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponseMap200): + if not isinstance(other, EntryNode): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/channelid_fund_body.py b/hoprd_sdk/models/fund_request.py similarity index 74% rename from hoprd_sdk/models/channelid_fund_body.py rename to hoprd_sdk/models/fund_request.py index 6f29da0..9646df5 100644 --- a/hoprd_sdk/models/channelid_fund_body.py +++ b/hoprd_sdk/models/fund_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class ChannelidFundBody(object): +class FundRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -36,29 +36,27 @@ class ChannelidFundBody(object): } def __init__(self, amount=None): # noqa: E501 - """ChannelidFundBody - a model defined in Swagger""" # noqa: E501 + """FundRequest - a model defined in Swagger""" # noqa: E501 self._amount = None self.discriminator = None self.amount = amount @property def amount(self): - """Gets the amount of this ChannelidFundBody. # noqa: E501 + """Gets the amount of this FundRequest. # noqa: E501 - Amount of weiHOPR tokens to fund the channel. It will be used to pay for sending messages through channel # noqa: E501 - :return: The amount of this ChannelidFundBody. # noqa: E501 + :return: The amount of this FundRequest. # noqa: E501 :rtype: str """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this ChannelidFundBody. + """Sets the amount of this FundRequest. - Amount of weiHOPR tokens to fund the channel. It will be used to pay for sending messages through channel # noqa: E501 - :param amount: The amount of this ChannelidFundBody. # noqa: E501 + :param amount: The amount of this FundRequest. # noqa: E501 :type: str """ if amount is None: @@ -87,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ChannelidFundBody, dict): + if issubclass(FundRequest, dict): for key, value in self.items(): result[key] = value @@ -103,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ChannelidFundBody): + if not isinstance(other, FundRequest): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/messages_peekall_body.py b/hoprd_sdk/models/get_message_req.py similarity index 56% rename from hoprd_sdk/models/messages_peekall_body.py rename to hoprd_sdk/models/get_message_req.py index af55541..6f8c42c 100644 --- a/hoprd_sdk/models/messages_peekall_body.py +++ b/hoprd_sdk/models/get_message_req.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class MessagesPeekallBody(object): +class GetMessageReq(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,42 +28,71 @@ class MessagesPeekallBody(object): and the value is json key in definition. """ swagger_types = { - 'tag': 'MessageTag' + 'tag': 'int', + 'timestamp': 'int' } attribute_map = { - 'tag': 'tag' + 'tag': 'tag', + 'timestamp': 'timestamp' } - def __init__(self, tag=None): # noqa: E501 - """MessagesPeekallBody - a model defined in Swagger""" # noqa: E501 + def __init__(self, tag=None, timestamp=None): # noqa: E501 + """GetMessageReq - a model defined in Swagger""" # noqa: E501 self._tag = None + self._timestamp = None self.discriminator = None - self.tag = tag + if tag is not None: + self.tag = tag + if timestamp is not None: + self.timestamp = timestamp @property def tag(self): - """Gets the tag of this MessagesPeekallBody. # noqa: E501 + """Gets the tag of this GetMessageReq. # noqa: E501 + The message tag used to filter messages based on application # noqa: E501 - :return: The tag of this MessagesPeekallBody. # noqa: E501 - :rtype: MessageTag + :return: The tag of this GetMessageReq. # noqa: E501 + :rtype: int """ return self._tag @tag.setter def tag(self, tag): - """Sets the tag of this MessagesPeekallBody. + """Sets the tag of this GetMessageReq. + The message tag used to filter messages based on application # noqa: E501 - :param tag: The tag of this MessagesPeekallBody. # noqa: E501 - :type: MessageTag + :param tag: The tag of this GetMessageReq. # noqa: E501 + :type: int """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 self._tag = tag + @property + def timestamp(self): + """Gets the timestamp of this GetMessageReq. # noqa: E501 + + Timestamp to filter messages received after this timestamp # noqa: E501 + + :return: The timestamp of this GetMessageReq. # noqa: E501 + :rtype: int + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this GetMessageReq. + + Timestamp to filter messages received after this timestamp # noqa: E501 + + :param timestamp: The timestamp of this GetMessageReq. # noqa: E501 + :type: int + """ + + self._timestamp = timestamp + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -85,7 +114,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(MessagesPeekallBody, dict): + if issubclass(GetMessageReq, dict): for key, value in self.items(): result[key] = value @@ -101,7 +130,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, MessagesPeekallBody): + if not isinstance(other, GetMessageReq): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response2002_heartbeats.py b/hoprd_sdk/models/heartbeat_info.py similarity index 63% rename from hoprd_sdk/models/inline_response2002_heartbeats.py rename to hoprd_sdk/models/heartbeat_info.py index 3cd3f88..3313316 100644 --- a/hoprd_sdk/models/inline_response2002_heartbeats.py +++ b/hoprd_sdk/models/heartbeat_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2002Heartbeats(object): +class HeartbeatInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,8 +28,8 @@ class InlineResponse2002Heartbeats(object): and the value is json key in definition. """ swagger_types = { - 'sent': 'float', - 'success': 'float' + 'sent': 'int', + 'success': 'int' } attribute_map = { @@ -38,58 +38,56 @@ class InlineResponse2002Heartbeats(object): } def __init__(self, sent=None, success=None): # noqa: E501 - """InlineResponse2002Heartbeats - a model defined in Swagger""" # noqa: E501 + """HeartbeatInfo - a model defined in Swagger""" # noqa: E501 self._sent = None self._success = None self.discriminator = None - if sent is not None: - self.sent = sent - if success is not None: - self.success = success + self.sent = sent + self.success = success @property def sent(self): - """Gets the sent of this InlineResponse2002Heartbeats. # noqa: E501 + """Gets the sent of this HeartbeatInfo. # noqa: E501 - Heartbeats sent to the node # noqa: E501 - :return: The sent of this InlineResponse2002Heartbeats. # noqa: E501 - :rtype: float + :return: The sent of this HeartbeatInfo. # noqa: E501 + :rtype: int """ return self._sent @sent.setter def sent(self, sent): - """Sets the sent of this InlineResponse2002Heartbeats. + """Sets the sent of this HeartbeatInfo. - Heartbeats sent to the node # noqa: E501 - :param sent: The sent of this InlineResponse2002Heartbeats. # noqa: E501 - :type: float + :param sent: The sent of this HeartbeatInfo. # noqa: E501 + :type: int """ + if sent is None: + raise ValueError("Invalid value for `sent`, must not be `None`") # noqa: E501 self._sent = sent @property def success(self): - """Gets the success of this InlineResponse2002Heartbeats. # noqa: E501 + """Gets the success of this HeartbeatInfo. # noqa: E501 - Successful heartbeats sent to the node # noqa: E501 - :return: The success of this InlineResponse2002Heartbeats. # noqa: E501 - :rtype: float + :return: The success of this HeartbeatInfo. # noqa: E501 + :rtype: int """ return self._success @success.setter def success(self, success): - """Sets the success of this InlineResponse2002Heartbeats. + """Sets the success of this HeartbeatInfo. - Successful heartbeats sent to the node # noqa: E501 - :param success: The success of this InlineResponse2002Heartbeats. # noqa: E501 - :type: float + :param success: The success of this HeartbeatInfo. # noqa: E501 + :type: int """ + if success is None: + raise ValueError("Invalid value for `success`, must not be `None`") # noqa: E501 self._success = success @@ -114,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2002Heartbeats, dict): + if issubclass(HeartbeatInfo, dict): for key, value in self.items(): result[key] = value @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2002Heartbeats): + if not isinstance(other, HeartbeatInfo): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/hopr_address.py b/hoprd_sdk/models/hopr_address.py deleted file mode 100644 index 8d46f4a..0000000 --- a/hoprd_sdk/models/hopr_address.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class HoprAddress(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """HoprAddress - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(HoprAddress, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HoprAddress): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/hopr_balance.py b/hoprd_sdk/models/hopr_balance.py deleted file mode 100644 index 1caf07e..0000000 --- a/hoprd_sdk/models/hopr_balance.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class HoprBalance(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """HoprBalance - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(HoprBalance, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, HoprBalance): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2005.py b/hoprd_sdk/models/inbox_messages_res.py similarity index 76% rename from hoprd_sdk/models/inline_response2005.py rename to hoprd_sdk/models/inbox_messages_res.py index 65f51d1..b86cdd4 100644 --- a/hoprd_sdk/models/inline_response2005.py +++ b/hoprd_sdk/models/inbox_messages_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2005(object): +class InboxMessagesRes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class InlineResponse2005(object): and the value is json key in definition. """ swagger_types = { - 'messages': 'list[ReceivedMessage]' + 'messages': 'list[MessagePopRes]' } attribute_map = { @@ -36,28 +36,28 @@ class InlineResponse2005(object): } def __init__(self, messages=None): # noqa: E501 - """InlineResponse2005 - a model defined in Swagger""" # noqa: E501 + """InboxMessagesRes - a model defined in Swagger""" # noqa: E501 self._messages = None self.discriminator = None self.messages = messages @property def messages(self): - """Gets the messages of this InlineResponse2005. # noqa: E501 + """Gets the messages of this InboxMessagesRes. # noqa: E501 - :return: The messages of this InlineResponse2005. # noqa: E501 - :rtype: list[ReceivedMessage] + :return: The messages of this InboxMessagesRes. # noqa: E501 + :rtype: list[MessagePopRes] """ return self._messages @messages.setter def messages(self, messages): - """Sets the messages of this InlineResponse2005. + """Sets the messages of this InboxMessagesRes. - :param messages: The messages of this InlineResponse2005. # noqa: E501 - :type: list[ReceivedMessage] + :param messages: The messages of this InboxMessagesRes. # noqa: E501 + :type: list[MessagePopRes] """ if messages is None: raise ValueError("Invalid value for `messages`, must not be `None`") # noqa: E501 @@ -85,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2005, dict): + if issubclass(InboxMessagesRes, dict): for key, value in self.items(): result[key] = value @@ -101,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2005): + if not isinstance(other, InboxMessagesRes): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response200.py b/hoprd_sdk/models/inline_response200.py deleted file mode 100644 index 49e6030..0000000 --- a/hoprd_sdk/models/inline_response200.py +++ /dev/null @@ -1,364 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse200(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'unredeemed': 'float', - 'unredeemed_value': 'str', - 'redeemed': 'float', - 'redeemed_value': 'str', - 'losing_tickets': 'float', - 'win_proportion': 'float', - 'neglected': 'float', - 'neglected_value': 'str', - 'rejected': 'float', - 'rejected_value': 'str' - } - - attribute_map = { - 'unredeemed': 'unredeemed', - 'unredeemed_value': 'unredeemedValue', - 'redeemed': 'redeemed', - 'redeemed_value': 'redeemedValue', - 'losing_tickets': 'losingTickets', - 'win_proportion': 'winProportion', - 'neglected': 'neglected', - 'neglected_value': 'neglectedValue', - 'rejected': 'rejected', - 'rejected_value': 'rejectedValue' - } - - def __init__(self, unredeemed=None, unredeemed_value=None, redeemed=None, redeemed_value=None, losing_tickets=None, win_proportion=None, neglected=None, neglected_value=None, rejected=None, rejected_value=None): # noqa: E501 - """InlineResponse200 - a model defined in Swagger""" # noqa: E501 - self._unredeemed = None - self._unredeemed_value = None - self._redeemed = None - self._redeemed_value = None - self._losing_tickets = None - self._win_proportion = None - self._neglected = None - self._neglected_value = None - self._rejected = None - self._rejected_value = None - self.discriminator = None - if unredeemed is not None: - self.unredeemed = unredeemed - if unredeemed_value is not None: - self.unredeemed_value = unredeemed_value - if redeemed is not None: - self.redeemed = redeemed - if redeemed_value is not None: - self.redeemed_value = redeemed_value - if losing_tickets is not None: - self.losing_tickets = losing_tickets - if win_proportion is not None: - self.win_proportion = win_proportion - if neglected is not None: - self.neglected = neglected - if neglected_value is not None: - self.neglected_value = neglected_value - if rejected is not None: - self.rejected = rejected - if rejected_value is not None: - self.rejected_value = rejected_value - - @property - def unredeemed(self): - """Gets the unredeemed of this InlineResponse200. # noqa: E501 - - Number of tickets that wait to be redeemed as for Hopr tokens. # noqa: E501 - - :return: The unredeemed of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._unredeemed - - @unredeemed.setter - def unredeemed(self, unredeemed): - """Sets the unredeemed of this InlineResponse200. - - Number of tickets that wait to be redeemed as for Hopr tokens. # noqa: E501 - - :param unredeemed: The unredeemed of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._unredeemed = unredeemed - - @property - def unredeemed_value(self): - """Gets the unredeemed_value of this InlineResponse200. # noqa: E501 - - Total value of all unredeemed tickets in Hopr tokens. # noqa: E501 - - :return: The unredeemed_value of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._unredeemed_value - - @unredeemed_value.setter - def unredeemed_value(self, unredeemed_value): - """Sets the unredeemed_value of this InlineResponse200. - - Total value of all unredeemed tickets in Hopr tokens. # noqa: E501 - - :param unredeemed_value: The unredeemed_value of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._unredeemed_value = unredeemed_value - - @property - def redeemed(self): - """Gets the redeemed of this InlineResponse200. # noqa: E501 - - Number of tickets already redeemed on this node. # noqa: E501 - - :return: The redeemed of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._redeemed - - @redeemed.setter - def redeemed(self, redeemed): - """Sets the redeemed of this InlineResponse200. - - Number of tickets already redeemed on this node. # noqa: E501 - - :param redeemed: The redeemed of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._redeemed = redeemed - - @property - def redeemed_value(self): - """Gets the redeemed_value of this InlineResponse200. # noqa: E501 - - Total value of all redeemed tickets in Hopr tokens. # noqa: E501 - - :return: The redeemed_value of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._redeemed_value - - @redeemed_value.setter - def redeemed_value(self, redeemed_value): - """Sets the redeemed_value of this InlineResponse200. - - Total value of all redeemed tickets in Hopr tokens. # noqa: E501 - - :param redeemed_value: The redeemed_value of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._redeemed_value = redeemed_value - - @property - def losing_tickets(self): - """Gets the losing_tickets of this InlineResponse200. # noqa: E501 - - Number of tickets that didn't win any Hopr tokens. To better understand how tickets work read about probabilistic payments (https://docs.hoprnet.org/core/probabilistic-payments) # noqa: E501 - - :return: The losing_tickets of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._losing_tickets - - @losing_tickets.setter - def losing_tickets(self, losing_tickets): - """Sets the losing_tickets of this InlineResponse200. - - Number of tickets that didn't win any Hopr tokens. To better understand how tickets work read about probabilistic payments (https://docs.hoprnet.org/core/probabilistic-payments) # noqa: E501 - - :param losing_tickets: The losing_tickets of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._losing_tickets = losing_tickets - - @property - def win_proportion(self): - """Gets the win_proportion of this InlineResponse200. # noqa: E501 - - Proportion of number of winning tickets vs loosing tickets, 1 means 100% of tickets won and 0 means that all tickets were losing ones. # noqa: E501 - - :return: The win_proportion of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._win_proportion - - @win_proportion.setter - def win_proportion(self, win_proportion): - """Sets the win_proportion of this InlineResponse200. - - Proportion of number of winning tickets vs loosing tickets, 1 means 100% of tickets won and 0 means that all tickets were losing ones. # noqa: E501 - - :param win_proportion: The win_proportion of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._win_proportion = win_proportion - - @property - def neglected(self): - """Gets the neglected of this InlineResponse200. # noqa: E501 - - Number of tickets that were not redeemed in time before channel was closed. Those cannot be redeemed anymore. # noqa: E501 - - :return: The neglected of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._neglected - - @neglected.setter - def neglected(self, neglected): - """Sets the neglected of this InlineResponse200. - - Number of tickets that were not redeemed in time before channel was closed. Those cannot be redeemed anymore. # noqa: E501 - - :param neglected: The neglected of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._neglected = neglected - - @property - def neglected_value(self): - """Gets the neglected_value of this InlineResponse200. # noqa: E501 - - Total value of all neglected tickets in Hopr tokens. # noqa: E501 - - :return: The neglected_value of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._neglected_value - - @neglected_value.setter - def neglected_value(self, neglected_value): - """Sets the neglected_value of this InlineResponse200. - - Total value of all neglected tickets in Hopr tokens. # noqa: E501 - - :param neglected_value: The neglected_value of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._neglected_value = neglected_value - - @property - def rejected(self): - """Gets the rejected of this InlineResponse200. # noqa: E501 - - Number of tickets that were rejected by the network by not passing validation. In other words tickets that look suspicious and are not eligible for redeeming. # noqa: E501 - - :return: The rejected of this InlineResponse200. # noqa: E501 - :rtype: float - """ - return self._rejected - - @rejected.setter - def rejected(self, rejected): - """Sets the rejected of this InlineResponse200. - - Number of tickets that were rejected by the network by not passing validation. In other words tickets that look suspicious and are not eligible for redeeming. # noqa: E501 - - :param rejected: The rejected of this InlineResponse200. # noqa: E501 - :type: float - """ - - self._rejected = rejected - - @property - def rejected_value(self): - """Gets the rejected_value of this InlineResponse200. # noqa: E501 - - Total value of rejected tickets in Hopr tokens # noqa: E501 - - :return: The rejected_value of this InlineResponse200. # noqa: E501 - :rtype: str - """ - return self._rejected_value - - @rejected_value.setter - def rejected_value(self, rejected_value): - """Sets the rejected_value of this InlineResponse200. - - Total value of rejected tickets in Hopr tokens # noqa: E501 - - :param rejected_value: The rejected_value of this InlineResponse200. # noqa: E501 - :type: str - """ - - self._rejected_value = rejected_value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse200, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse200): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response20013.py b/hoprd_sdk/models/inline_response20013.py deleted file mode 100644 index 96e9cac..0000000 --- a/hoprd_sdk/models/inline_response20013.py +++ /dev/null @@ -1,113 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse20013(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'receipt': 'str' - } - - attribute_map = { - 'receipt': 'receipt' - } - - def __init__(self, receipt=None): # noqa: E501 - """InlineResponse20013 - a model defined in Swagger""" # noqa: E501 - self._receipt = None - self.discriminator = None - self.receipt = receipt - - @property - def receipt(self): - """Gets the receipt of this InlineResponse20013. # noqa: E501 - - Receipt of the funding transaction # noqa: E501 - - :return: The receipt of this InlineResponse20013. # noqa: E501 - :rtype: str - """ - return self._receipt - - @receipt.setter - def receipt(self, receipt): - """Sets the receipt of this InlineResponse20013. - - Receipt of the funding transaction # noqa: E501 - - :param receipt: The receipt of this InlineResponse20013. # noqa: E501 - :type: str - """ - if receipt is None: - raise ValueError("Invalid value for `receipt`, must not be `None`") # noqa: E501 - - self._receipt = receipt - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse20013, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20013): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2002_connected.py b/hoprd_sdk/models/inline_response2002_connected.py deleted file mode 100644 index 3754b50..0000000 --- a/hoprd_sdk/models/inline_response2002_connected.py +++ /dev/null @@ -1,354 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse2002Connected(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'peer_id': 'HoprAddress', - 'peer_address': 'NativeAddress', - 'multi_addr': 'MultiAddress', - 'heartbeats': 'InlineResponse2002Heartbeats', - 'last_seen': 'float', - 'last_seen_latency': 'float', - 'quality': 'float', - 'backoff': 'float', - 'is_new': 'bool', - 'reported_version': 'str' - } - - attribute_map = { - 'peer_id': 'peerId', - 'peer_address': 'peerAddress', - 'multi_addr': 'multiAddr', - 'heartbeats': 'heartbeats', - 'last_seen': 'lastSeen', - 'last_seen_latency': 'lastSeenLatency', - 'quality': 'quality', - 'backoff': 'backoff', - 'is_new': 'isNew', - 'reported_version': 'reportedVersion' - } - - def __init__(self, peer_id=None, peer_address=None, multi_addr=None, heartbeats=None, last_seen=None, last_seen_latency=None, quality=None, backoff=None, is_new=None, reported_version=None): # noqa: E501 - """InlineResponse2002Connected - a model defined in Swagger""" # noqa: E501 - self._peer_id = None - self._peer_address = None - self._multi_addr = None - self._heartbeats = None - self._last_seen = None - self._last_seen_latency = None - self._quality = None - self._backoff = None - self._is_new = None - self._reported_version = None - self.discriminator = None - if peer_id is not None: - self.peer_id = peer_id - if peer_address is not None: - self.peer_address = peer_address - if multi_addr is not None: - self.multi_addr = multi_addr - if heartbeats is not None: - self.heartbeats = heartbeats - if last_seen is not None: - self.last_seen = last_seen - if last_seen_latency is not None: - self.last_seen_latency = last_seen_latency - if quality is not None: - self.quality = quality - if backoff is not None: - self.backoff = backoff - if is_new is not None: - self.is_new = is_new - if reported_version is not None: - self.reported_version = reported_version - - @property - def peer_id(self): - """Gets the peer_id of this InlineResponse2002Connected. # noqa: E501 - - - :return: The peer_id of this InlineResponse2002Connected. # noqa: E501 - :rtype: HoprAddress - """ - return self._peer_id - - @peer_id.setter - def peer_id(self, peer_id): - """Sets the peer_id of this InlineResponse2002Connected. - - - :param peer_id: The peer_id of this InlineResponse2002Connected. # noqa: E501 - :type: HoprAddress - """ - - self._peer_id = peer_id - - @property - def peer_address(self): - """Gets the peer_address of this InlineResponse2002Connected. # noqa: E501 - - - :return: The peer_address of this InlineResponse2002Connected. # noqa: E501 - :rtype: NativeAddress - """ - return self._peer_address - - @peer_address.setter - def peer_address(self, peer_address): - """Sets the peer_address of this InlineResponse2002Connected. - - - :param peer_address: The peer_address of this InlineResponse2002Connected. # noqa: E501 - :type: NativeAddress - """ - - self._peer_address = peer_address - - @property - def multi_addr(self): - """Gets the multi_addr of this InlineResponse2002Connected. # noqa: E501 - - - :return: The multi_addr of this InlineResponse2002Connected. # noqa: E501 - :rtype: MultiAddress - """ - return self._multi_addr - - @multi_addr.setter - def multi_addr(self, multi_addr): - """Sets the multi_addr of this InlineResponse2002Connected. - - - :param multi_addr: The multi_addr of this InlineResponse2002Connected. # noqa: E501 - :type: MultiAddress - """ - - self._multi_addr = multi_addr - - @property - def heartbeats(self): - """Gets the heartbeats of this InlineResponse2002Connected. # noqa: E501 - - - :return: The heartbeats of this InlineResponse2002Connected. # noqa: E501 - :rtype: InlineResponse2002Heartbeats - """ - return self._heartbeats - - @heartbeats.setter - def heartbeats(self, heartbeats): - """Sets the heartbeats of this InlineResponse2002Connected. - - - :param heartbeats: The heartbeats of this InlineResponse2002Connected. # noqa: E501 - :type: InlineResponse2002Heartbeats - """ - - self._heartbeats = heartbeats - - @property - def last_seen(self): - """Gets the last_seen of this InlineResponse2002Connected. # noqa: E501 - - Timestamp on when the node was last seen (in milliseconds) # noqa: E501 - - :return: The last_seen of this InlineResponse2002Connected. # noqa: E501 - :rtype: float - """ - return self._last_seen - - @last_seen.setter - def last_seen(self, last_seen): - """Sets the last_seen of this InlineResponse2002Connected. - - Timestamp on when the node was last seen (in milliseconds) # noqa: E501 - - :param last_seen: The last_seen of this InlineResponse2002Connected. # noqa: E501 - :type: float - """ - - self._last_seen = last_seen - - @property - def last_seen_latency(self): - """Gets the last_seen_latency of this InlineResponse2002Connected. # noqa: E501 - - Latency recorded the last time a node was measured when seen (in milliseconds) # noqa: E501 - - :return: The last_seen_latency of this InlineResponse2002Connected. # noqa: E501 - :rtype: float - """ - return self._last_seen_latency - - @last_seen_latency.setter - def last_seen_latency(self, last_seen_latency): - """Sets the last_seen_latency of this InlineResponse2002Connected. - - Latency recorded the last time a node was measured when seen (in milliseconds) # noqa: E501 - - :param last_seen_latency: The last_seen_latency of this InlineResponse2002Connected. # noqa: E501 - :type: float - """ - - self._last_seen_latency = last_seen_latency - - @property - def quality(self): - """Gets the quality of this InlineResponse2002Connected. # noqa: E501 - - A float between 0 (completely unreliable) and 1 (completely reliable) estimating the quality of service of a peer's network connection # noqa: E501 - - :return: The quality of this InlineResponse2002Connected. # noqa: E501 - :rtype: float - """ - return self._quality - - @quality.setter - def quality(self, quality): - """Sets the quality of this InlineResponse2002Connected. - - A float between 0 (completely unreliable) and 1 (completely reliable) estimating the quality of service of a peer's network connection # noqa: E501 - - :param quality: The quality of this InlineResponse2002Connected. # noqa: E501 - :type: float - """ - - self._quality = quality - - @property - def backoff(self): - """Gets the backoff of this InlineResponse2002Connected. # noqa: E501 - - - :return: The backoff of this InlineResponse2002Connected. # noqa: E501 - :rtype: float - """ - return self._backoff - - @backoff.setter - def backoff(self, backoff): - """Sets the backoff of this InlineResponse2002Connected. - - - :param backoff: The backoff of this InlineResponse2002Connected. # noqa: E501 - :type: float - """ - - self._backoff = backoff - - @property - def is_new(self): - """Gets the is_new of this InlineResponse2002Connected. # noqa: E501 - - True if the node is new (no heartbeats sent yet). # noqa: E501 - - :return: The is_new of this InlineResponse2002Connected. # noqa: E501 - :rtype: bool - """ - return self._is_new - - @is_new.setter - def is_new(self, is_new): - """Sets the is_new of this InlineResponse2002Connected. - - True if the node is new (no heartbeats sent yet). # noqa: E501 - - :param is_new: The is_new of this InlineResponse2002Connected. # noqa: E501 - :type: bool - """ - - self._is_new = is_new - - @property - def reported_version(self): - """Gets the reported_version of this InlineResponse2002Connected. # noqa: E501 - - HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" # noqa: E501 - - :return: The reported_version of this InlineResponse2002Connected. # noqa: E501 - :rtype: str - """ - return self._reported_version - - @reported_version.setter - def reported_version(self, reported_version): - """Sets the reported_version of this InlineResponse2002Connected. - - HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" # noqa: E501 - - :param reported_version: The reported_version of this InlineResponse2002Connected. # noqa: E501 - :type: str - """ - - self._reported_version = reported_version - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse2002Connected, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2002Connected): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2003.py b/hoprd_sdk/models/inline_response2003.py deleted file mode 100644 index 59de607..0000000 --- a/hoprd_sdk/models/inline_response2003.py +++ /dev/null @@ -1,444 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse2003(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'network': 'str', - 'announced_address': 'list[str]', - 'listening_address': 'list[str]', - 'chain': 'str', - 'hopr_token': 'str', - 'hopr_channels': 'str', - 'hopr_network_registry_address': 'str', - 'hopr_node_safe_registry_address': 'str', - 'node_management_module': 'str', - 'node_safe': 'str', - 'connectivity_status': 'str', - 'is_eligible': 'bool', - 'channel_closure_period': 'float' - } - - attribute_map = { - 'network': 'network', - 'announced_address': 'announcedAddress', - 'listening_address': 'listeningAddress', - 'chain': 'chain', - 'hopr_token': 'hoprToken', - 'hopr_channels': 'hoprChannels', - 'hopr_network_registry_address': 'hoprNetworkRegistryAddress', - 'hopr_node_safe_registry_address': 'hoprNodeSafeRegistryAddress', - 'node_management_module': 'nodeManagementModule', - 'node_safe': 'nodeSafe', - 'connectivity_status': 'connectivityStatus', - 'is_eligible': 'isEligible', - 'channel_closure_period': 'channelClosurePeriod' - } - - def __init__(self, network=None, announced_address=None, listening_address=None, chain=None, hopr_token=None, hopr_channels=None, hopr_network_registry_address=None, hopr_node_safe_registry_address=None, node_management_module=None, node_safe=None, connectivity_status=None, is_eligible=None, channel_closure_period=None): # noqa: E501 - """InlineResponse2003 - a model defined in Swagger""" # noqa: E501 - self._network = None - self._announced_address = None - self._listening_address = None - self._chain = None - self._hopr_token = None - self._hopr_channels = None - self._hopr_network_registry_address = None - self._hopr_node_safe_registry_address = None - self._node_management_module = None - self._node_safe = None - self._connectivity_status = None - self._is_eligible = None - self._channel_closure_period = None - self.discriminator = None - if network is not None: - self.network = network - if announced_address is not None: - self.announced_address = announced_address - if listening_address is not None: - self.listening_address = listening_address - if chain is not None: - self.chain = chain - if hopr_token is not None: - self.hopr_token = hopr_token - if hopr_channels is not None: - self.hopr_channels = hopr_channels - if hopr_network_registry_address is not None: - self.hopr_network_registry_address = hopr_network_registry_address - if hopr_node_safe_registry_address is not None: - self.hopr_node_safe_registry_address = hopr_node_safe_registry_address - if node_management_module is not None: - self.node_management_module = node_management_module - if node_safe is not None: - self.node_safe = node_safe - if connectivity_status is not None: - self.connectivity_status = connectivity_status - if is_eligible is not None: - self.is_eligible = is_eligible - if channel_closure_period is not None: - self.channel_closure_period = channel_closure_period - - @property - def network(self): - """Gets the network of this InlineResponse2003. # noqa: E501 - - Name of the network the node is running on. # noqa: E501 - - :return: The network of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._network - - @network.setter - def network(self, network): - """Sets the network of this InlineResponse2003. - - Name of the network the node is running on. # noqa: E501 - - :param network: The network of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._network = network - - @property - def announced_address(self): - """Gets the announced_address of this InlineResponse2003. # noqa: E501 - - - :return: The announced_address of this InlineResponse2003. # noqa: E501 - :rtype: list[str] - """ - return self._announced_address - - @announced_address.setter - def announced_address(self, announced_address): - """Sets the announced_address of this InlineResponse2003. - - - :param announced_address: The announced_address of this InlineResponse2003. # noqa: E501 - :type: list[str] - """ - - self._announced_address = announced_address - - @property - def listening_address(self): - """Gets the listening_address of this InlineResponse2003. # noqa: E501 - - - :return: The listening_address of this InlineResponse2003. # noqa: E501 - :rtype: list[str] - """ - return self._listening_address - - @listening_address.setter - def listening_address(self, listening_address): - """Sets the listening_address of this InlineResponse2003. - - - :param listening_address: The listening_address of this InlineResponse2003. # noqa: E501 - :type: list[str] - """ - - self._listening_address = listening_address - - @property - def chain(self): - """Gets the chain of this InlineResponse2003. # noqa: E501 - - Name of the Hopr network this node connects to. # noqa: E501 - - :return: The chain of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._chain - - @chain.setter - def chain(self, chain): - """Sets the chain of this InlineResponse2003. - - Name of the Hopr network this node connects to. # noqa: E501 - - :param chain: The chain of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._chain = chain - - @property - def hopr_token(self): - """Gets the hopr_token of this InlineResponse2003. # noqa: E501 - - Contract address of the Hopr token on the ethereum chain. # noqa: E501 - - :return: The hopr_token of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._hopr_token - - @hopr_token.setter - def hopr_token(self, hopr_token): - """Sets the hopr_token of this InlineResponse2003. - - Contract address of the Hopr token on the ethereum chain. # noqa: E501 - - :param hopr_token: The hopr_token of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._hopr_token = hopr_token - - @property - def hopr_channels(self): - """Gets the hopr_channels of this InlineResponse2003. # noqa: E501 - - Contract address of the HoprChannels smart contract on ethereum chain. This smart contract is used to open payment channels between nodes on blockchain. # noqa: E501 - - :return: The hopr_channels of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._hopr_channels - - @hopr_channels.setter - def hopr_channels(self, hopr_channels): - """Sets the hopr_channels of this InlineResponse2003. - - Contract address of the HoprChannels smart contract on ethereum chain. This smart contract is used to open payment channels between nodes on blockchain. # noqa: E501 - - :param hopr_channels: The hopr_channels of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._hopr_channels = hopr_channels - - @property - def hopr_network_registry_address(self): - """Gets the hopr_network_registry_address of this InlineResponse2003. # noqa: E501 - - Contract address of the contract that allows to control the number of nodes in the network # noqa: E501 - - :return: The hopr_network_registry_address of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._hopr_network_registry_address - - @hopr_network_registry_address.setter - def hopr_network_registry_address(self, hopr_network_registry_address): - """Sets the hopr_network_registry_address of this InlineResponse2003. - - Contract address of the contract that allows to control the number of nodes in the network # noqa: E501 - - :param hopr_network_registry_address: The hopr_network_registry_address of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._hopr_network_registry_address = hopr_network_registry_address - - @property - def hopr_node_safe_registry_address(self): - """Gets the hopr_node_safe_registry_address of this InlineResponse2003. # noqa: E501 - - Contract address of the contract that register node and safe pairs # noqa: E501 - - :return: The hopr_node_safe_registry_address of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._hopr_node_safe_registry_address - - @hopr_node_safe_registry_address.setter - def hopr_node_safe_registry_address(self, hopr_node_safe_registry_address): - """Sets the hopr_node_safe_registry_address of this InlineResponse2003. - - Contract address of the contract that register node and safe pairs # noqa: E501 - - :param hopr_node_safe_registry_address: The hopr_node_safe_registry_address of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._hopr_node_safe_registry_address = hopr_node_safe_registry_address - - @property - def node_management_module(self): - """Gets the node_management_module of this InlineResponse2003. # noqa: E501 - - Contract address of the Safe module for managing the current hopr node # noqa: E501 - - :return: The node_management_module of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._node_management_module - - @node_management_module.setter - def node_management_module(self, node_management_module): - """Sets the node_management_module of this InlineResponse2003. - - Contract address of the Safe module for managing the current hopr node # noqa: E501 - - :param node_management_module: The node_management_module of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._node_management_module = node_management_module - - @property - def node_safe(self): - """Gets the node_safe of this InlineResponse2003. # noqa: E501 - - Contract address of the safe that holds asset for the current node # noqa: E501 - - :return: The node_safe of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._node_safe - - @node_safe.setter - def node_safe(self, node_safe): - """Sets the node_safe of this InlineResponse2003. - - Contract address of the safe that holds asset for the current node # noqa: E501 - - :param node_safe: The node_safe of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._node_safe = node_safe - - @property - def connectivity_status(self): - """Gets the connectivity_status of this InlineResponse2003. # noqa: E501 - - Indicates how good is the connectivity of this node to the HOPR network: either RED, ORANGE, YELLOW or GREEN # noqa: E501 - - :return: The connectivity_status of this InlineResponse2003. # noqa: E501 - :rtype: str - """ - return self._connectivity_status - - @connectivity_status.setter - def connectivity_status(self, connectivity_status): - """Sets the connectivity_status of this InlineResponse2003. - - Indicates how good is the connectivity of this node to the HOPR network: either RED, ORANGE, YELLOW or GREEN # noqa: E501 - - :param connectivity_status: The connectivity_status of this InlineResponse2003. # noqa: E501 - :type: str - """ - - self._connectivity_status = connectivity_status - - @property - def is_eligible(self): - """Gets the is_eligible of this InlineResponse2003. # noqa: E501 - - Determines whether the staking account associated with this node is eligible for accessing the HOPR network. Always true if network registry is disabled. # noqa: E501 - - :return: The is_eligible of this InlineResponse2003. # noqa: E501 - :rtype: bool - """ - return self._is_eligible - - @is_eligible.setter - def is_eligible(self, is_eligible): - """Sets the is_eligible of this InlineResponse2003. - - Determines whether the staking account associated with this node is eligible for accessing the HOPR network. Always true if network registry is disabled. # noqa: E501 - - :param is_eligible: The is_eligible of this InlineResponse2003. # noqa: E501 - :type: bool - """ - - self._is_eligible = is_eligible - - @property - def channel_closure_period(self): - """Gets the channel_closure_period of this InlineResponse2003. # noqa: E501 - - Time (in minutes) that this node needs in order to clean up before closing the channel. When requesting to close the channel each node needs some time to make sure that channel can be closed securely and cleanly. After this channelClosurePeriod passes the second request for closing channel will close the channel. # noqa: E501 - - :return: The channel_closure_period of this InlineResponse2003. # noqa: E501 - :rtype: float - """ - return self._channel_closure_period - - @channel_closure_period.setter - def channel_closure_period(self, channel_closure_period): - """Sets the channel_closure_period of this InlineResponse2003. - - Time (in minutes) that this node needs in order to clean up before closing the channel. When requesting to close the channel each node needs some time to make sure that channel can be closed securely and cleanly. After this channelClosurePeriod passes the second request for closing channel will close the channel. # noqa: E501 - - :param channel_closure_period: The channel_closure_period of this InlineResponse2003. # noqa: E501 - :type: float - """ - - self._channel_closure_period = channel_closure_period - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse2003, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2003): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2007.py b/hoprd_sdk/models/inline_response2007.py deleted file mode 100644 index 331c97f..0000000 --- a/hoprd_sdk/models/inline_response2007.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse2007(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'alice': 'HoprAddress', - 'bob': 'HoprAddress' - } - - attribute_map = { - 'alice': 'alice', - 'bob': 'bob' - } - - def __init__(self, alice=None, bob=None): # noqa: E501 - """InlineResponse2007 - a model defined in Swagger""" # noqa: E501 - self._alice = None - self._bob = None - self.discriminator = None - if alice is not None: - self.alice = alice - if bob is not None: - self.bob = bob - - @property - def alice(self): - """Gets the alice of this InlineResponse2007. # noqa: E501 - - - :return: The alice of this InlineResponse2007. # noqa: E501 - :rtype: HoprAddress - """ - return self._alice - - @alice.setter - def alice(self, alice): - """Sets the alice of this InlineResponse2007. - - - :param alice: The alice of this InlineResponse2007. # noqa: E501 - :type: HoprAddress - """ - - self._alice = alice - - @property - def bob(self): - """Gets the bob of this InlineResponse2007. # noqa: E501 - - - :return: The bob of this InlineResponse2007. # noqa: E501 - :rtype: HoprAddress - """ - return self._bob - - @bob.setter - def bob(self, bob): - """Sets the bob of this InlineResponse2007. - - - :param bob: The bob of this InlineResponse2007. # noqa: E501 - :type: HoprAddress - """ - - self._bob = bob - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse2007, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2007): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2008.py b/hoprd_sdk/models/inline_response2008.py deleted file mode 100644 index 97ef8d6..0000000 --- a/hoprd_sdk/models/inline_response2008.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse2008(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'receipt': 'str' - } - - attribute_map = { - 'receipt': 'receipt' - } - - def __init__(self, receipt=None): # noqa: E501 - """InlineResponse2008 - a model defined in Swagger""" # noqa: E501 - self._receipt = None - self.discriminator = None - if receipt is not None: - self.receipt = receipt - - @property - def receipt(self): - """Gets the receipt of this InlineResponse2008. # noqa: E501 - - Withdraw txn hash that can be used to check details of the transaction on ethereum chain. # noqa: E501 - - :return: The receipt of this InlineResponse2008. # noqa: E501 - :rtype: str - """ - return self._receipt - - @receipt.setter - def receipt(self, receipt): - """Sets the receipt of this InlineResponse2008. - - Withdraw txn hash that can be used to check details of the transaction on ethereum chain. # noqa: E501 - - :param receipt: The receipt of this InlineResponse2008. # noqa: E501 - :type: str - """ - - self._receipt = receipt - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse2008, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2008): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response201.py b/hoprd_sdk/models/inline_response201.py deleted file mode 100644 index df8aa68..0000000 --- a/hoprd_sdk/models/inline_response201.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse201(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'token': 'str' - } - - attribute_map = { - 'token': 'token' - } - - def __init__(self, token=None): # noqa: E501 - """InlineResponse201 - a model defined in Swagger""" # noqa: E501 - self._token = None - self.discriminator = None - if token is not None: - self.token = token - - @property - def token(self): - """Gets the token of this InlineResponse201. # noqa: E501 - - The generated token which must be used when authenticating for API calls. # noqa: E501 - - :return: The token of this InlineResponse201. # noqa: E501 - :rtype: str - """ - return self._token - - @token.setter - def token(self, token): - """Sets the token of this InlineResponse201. - - The generated token which must be used when authenticating for API calls. # noqa: E501 - - :param token: The token of this InlineResponse201. # noqa: E501 - :type: str - """ - - self._token = token - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse201, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse201): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response403.py b/hoprd_sdk/models/inline_response403.py deleted file mode 100644 index d31e73d..0000000 --- a/hoprd_sdk/models/inline_response403.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse403(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'status': 'str' - } - - attribute_map = { - 'status': 'status' - } - - def __init__(self, status=None): # noqa: E501 - """InlineResponse403 - a model defined in Swagger""" # noqa: E501 - self._status = None - self.discriminator = None - if status is not None: - self.status = status - - @property - def status(self): - """Gets the status of this InlineResponse403. # noqa: E501 - - Insufficient balance to open channel. Amount passed in request body exeeds current balance. # noqa: E501 - - :return: The status of this InlineResponse403. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this InlineResponse403. - - Insufficient balance to open channel. Amount passed in request body exeeds current balance. # noqa: E501 - - :param status: The status of this InlineResponse403. # noqa: E501 - :type: str - """ - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse403, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse403): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response409.py b/hoprd_sdk/models/inline_response409.py deleted file mode 100644 index abccb3e..0000000 --- a/hoprd_sdk/models/inline_response409.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse409(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'status': 'str' - } - - attribute_map = { - 'status': 'status' - } - - def __init__(self, status=None): # noqa: E501 - """InlineResponse409 - a model defined in Swagger""" # noqa: E501 - self._status = None - self.discriminator = None - if status is not None: - self.status = status - - @property - def status(self): - """Gets the status of this InlineResponse409. # noqa: E501 - - Channel already open. Cannot open more than one channel between two nodes. # noqa: E501 - - :return: The status of this InlineResponse409. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this InlineResponse409. - - Channel already open. Cannot open more than one channel between two nodes. # noqa: E501 - - :param status: The status of this InlineResponse409. # noqa: E501 - :type: str - """ - - self._status = status - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse409, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse409): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response422.py b/hoprd_sdk/models/inline_response422.py deleted file mode 100644 index 68c5213..0000000 --- a/hoprd_sdk/models/inline_response422.py +++ /dev/null @@ -1,136 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class InlineResponse422(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'status': 'str', - 'error': 'str' - } - - attribute_map = { - 'status': 'status', - 'error': 'error' - } - - def __init__(self, status=None, error=None): # noqa: E501 - """InlineResponse422 - a model defined in Swagger""" # noqa: E501 - self._status = None - self._error = None - self.discriminator = None - if status is not None: - self.status = status - if error is not None: - self.error = error - - @property - def status(self): - """Gets the status of this InlineResponse422. # noqa: E501 - - - :return: The status of this InlineResponse422. # noqa: E501 - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this InlineResponse422. - - - :param status: The status of this InlineResponse422. # noqa: E501 - :type: str - """ - - self._status = status - - @property - def error(self): - """Gets the error of this InlineResponse422. # noqa: E501 - - - :return: The error of this InlineResponse422. # noqa: E501 - :rtype: str - """ - return self._error - - @error.setter - def error(self, error): - """Sets the error of this InlineResponse422. - - - :param error: The error of this InlineResponse422. # noqa: E501 - :type: str - """ - - self._error = error - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(InlineResponse422, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse422): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/message_body.py b/hoprd_sdk/models/message_body.py deleted file mode 100644 index ab9202d..0000000 --- a/hoprd_sdk/models/message_body.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class MessageBody(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """MessageBody - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MessageBody, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MessageBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/received_message.py b/hoprd_sdk/models/message_pop_res.py similarity index 66% rename from hoprd_sdk/models/received_message.py rename to hoprd_sdk/models/message_pop_res.py index ece275a..540f53f 100644 --- a/hoprd_sdk/models/received_message.py +++ b/hoprd_sdk/models/message_pop_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class ReceivedMessage(object): +class MessagePopRes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,67 +28,44 @@ class ReceivedMessage(object): and the value is json key in definition. """ swagger_types = { - 'tag': 'MessageTag', - 'body': 'MessageBody', - 'received_at': 'int' + 'body': 'str', + 'received_at': 'int', + 'tag': 'int' } attribute_map = { - 'tag': 'tag', 'body': 'body', - 'received_at': 'receivedAt' + 'received_at': 'receivedAt', + 'tag': 'tag' } - def __init__(self, tag=None, body=None, received_at=None): # noqa: E501 - """ReceivedMessage - a model defined in Swagger""" # noqa: E501 - self._tag = None + def __init__(self, body=None, received_at=None, tag=None): # noqa: E501 + """MessagePopRes - a model defined in Swagger""" # noqa: E501 self._body = None self._received_at = None + self._tag = None self.discriminator = None - self.tag = tag self.body = body self.received_at = received_at - - @property - def tag(self): - """Gets the tag of this ReceivedMessage. # noqa: E501 - - - :return: The tag of this ReceivedMessage. # noqa: E501 - :rtype: MessageTag - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this ReceivedMessage. - - - :param tag: The tag of this ReceivedMessage. # noqa: E501 - :type: MessageTag - """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - - self._tag = tag + self.tag = tag @property def body(self): - """Gets the body of this ReceivedMessage. # noqa: E501 + """Gets the body of this MessagePopRes. # noqa: E501 - :return: The body of this ReceivedMessage. # noqa: E501 - :rtype: MessageBody + :return: The body of this MessagePopRes. # noqa: E501 + :rtype: str """ return self._body @body.setter def body(self, body): - """Sets the body of this ReceivedMessage. + """Sets the body of this MessagePopRes. - :param body: The body of this ReceivedMessage. # noqa: E501 - :type: MessageBody + :param body: The body of this MessagePopRes. # noqa: E501 + :type: str """ if body is None: raise ValueError("Invalid value for `body`, must not be `None`") # noqa: E501 @@ -97,22 +74,20 @@ def body(self, body): @property def received_at(self): - """Gets the received_at of this ReceivedMessage. # noqa: E501 + """Gets the received_at of this MessagePopRes. # noqa: E501 - Timestamp when the message was received in seconds since epoch. # noqa: E501 - :return: The received_at of this ReceivedMessage. # noqa: E501 + :return: The received_at of this MessagePopRes. # noqa: E501 :rtype: int """ return self._received_at @received_at.setter def received_at(self, received_at): - """Sets the received_at of this ReceivedMessage. + """Sets the received_at of this MessagePopRes. - Timestamp when the message was received in seconds since epoch. # noqa: E501 - :param received_at: The received_at of this ReceivedMessage. # noqa: E501 + :param received_at: The received_at of this MessagePopRes. # noqa: E501 :type: int """ if received_at is None: @@ -120,6 +95,29 @@ def received_at(self, received_at): self._received_at = received_at + @property + def tag(self): + """Gets the tag of this MessagePopRes. # noqa: E501 + + + :return: The tag of this MessagePopRes. # noqa: E501 + :rtype: int + """ + return self._tag + + @tag.setter + def tag(self, tag): + """Sets the tag of this MessagePopRes. + + + :param tag: The tag of this MessagePopRes. # noqa: E501 + :type: int + """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 + + self._tag = tag + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -141,7 +139,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ReceivedMessage, dict): + if issubclass(MessagePopRes, dict): for key, value in self.items(): result[key] = value @@ -157,7 +155,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ReceivedMessage): + if not isinstance(other, MessagePopRes): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/message_tag.py b/hoprd_sdk/models/message_tag.py deleted file mode 100644 index bbc8aba..0000000 --- a/hoprd_sdk/models/message_tag.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class MessageTag(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """MessageTag - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MessageTag, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MessageTag): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/messages_popall_body.py b/hoprd_sdk/models/messages_popall_body.py deleted file mode 100644 index 3d42120..0000000 --- a/hoprd_sdk/models/messages_popall_body.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class MessagesPopallBody(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'tag': 'MessageTag' - } - - attribute_map = { - 'tag': 'tag' - } - - def __init__(self, tag=None): # noqa: E501 - """MessagesPopallBody - a model defined in Swagger""" # noqa: E501 - self._tag = None - self.discriminator = None - self.tag = tag - - @property - def tag(self): - """Gets the tag of this MessagesPopallBody. # noqa: E501 - - - :return: The tag of this MessagesPopallBody. # noqa: E501 - :rtype: MessageTag - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this MessagesPopallBody. - - - :param tag: The tag of this MessagesPopallBody. # noqa: E501 - :type: MessageTag - """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - - self._tag = tag - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MessagesPopallBody, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MessagesPopallBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/multi_address.py b/hoprd_sdk/models/multi_address.py deleted file mode 100644 index 935f104..0000000 --- a/hoprd_sdk/models/multi_address.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class MultiAddress(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """MultiAddress - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(MultiAddress, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, MultiAddress): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/native_address.py b/hoprd_sdk/models/native_address.py deleted file mode 100644 index 346f5bc..0000000 --- a/hoprd_sdk/models/native_address.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class NativeAddress(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """NativeAddress - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(NativeAddress, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NativeAddress): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/native_balance.py b/hoprd_sdk/models/native_balance.py deleted file mode 100644 index 3dd2dcb..0000000 --- a/hoprd_sdk/models/native_balance.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class NativeBalance(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """NativeBalance - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(NativeBalance, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, NativeBalance): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/node_channel.py b/hoprd_sdk/models/node_channel.py new file mode 100644 index 0000000..a408e14 --- /dev/null +++ b/hoprd_sdk/models/node_channel.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NodeChannel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'balance': 'str', + 'id': 'str', + 'peer_address': 'str', + 'status': 'str' + } + + attribute_map = { + 'balance': 'balance', + 'id': 'id', + 'peer_address': 'peerAddress', + 'status': 'status' + } + + def __init__(self, balance=None, id=None, peer_address=None, status=None): # noqa: E501 + """NodeChannel - a model defined in Swagger""" # noqa: E501 + self._balance = None + self._id = None + self._peer_address = None + self._status = None + self.discriminator = None + self.balance = balance + self.id = id + self.peer_address = peer_address + self.status = status + + @property + def balance(self): + """Gets the balance of this NodeChannel. # noqa: E501 + + + :return: The balance of this NodeChannel. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this NodeChannel. + + + :param balance: The balance of this NodeChannel. # noqa: E501 + :type: str + """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + + self._balance = balance + + @property + def id(self): + """Gets the id of this NodeChannel. # noqa: E501 + + + :return: The id of this NodeChannel. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this NodeChannel. + + + :param id: The id of this NodeChannel. # noqa: E501 + :type: str + """ + if id is None: + raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 + + self._id = id + + @property + def peer_address(self): + """Gets the peer_address of this NodeChannel. # noqa: E501 + + + :return: The peer_address of this NodeChannel. # noqa: E501 + :rtype: str + """ + return self._peer_address + + @peer_address.setter + def peer_address(self, peer_address): + """Sets the peer_address of this NodeChannel. + + + :param peer_address: The peer_address of this NodeChannel. # noqa: E501 + :type: str + """ + if peer_address is None: + raise ValueError("Invalid value for `peer_address`, must not be `None`") # noqa: E501 + + self._peer_address = peer_address + + @property + def status(self): + """Gets the status of this NodeChannel. # noqa: E501 + + + :return: The status of this NodeChannel. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this NodeChannel. + + + :param status: The status of this NodeChannel. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NodeChannel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NodeChannel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/inline_response2006.py b/hoprd_sdk/models/node_channels.py similarity index 52% rename from hoprd_sdk/models/inline_response2006.py rename to hoprd_sdk/models/node_channels.py index 29bbf6c..b996176 100644 --- a/hoprd_sdk/models/inline_response2006.py +++ b/hoprd_sdk/models/node_channels.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2006(object): +class NodeChannels(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,98 +28,95 @@ class InlineResponse2006(object): and the value is json key in definition. """ swagger_types = { - 'incoming': 'list[Channel]', - 'outgoing': 'list[Channel]', - 'all': 'list[ChannelTopology]' + 'all': 'list[NodeTopologyChannel]', + 'incoming': 'list[NodeChannel]', + 'outgoing': 'list[NodeChannel]' } attribute_map = { + 'all': 'all', 'incoming': 'incoming', - 'outgoing': 'outgoing', - 'all': 'all' + 'outgoing': 'outgoing' } - def __init__(self, incoming=None, outgoing=None, all=None): # noqa: E501 - """InlineResponse2006 - a model defined in Swagger""" # noqa: E501 + def __init__(self, all=None, incoming=None, outgoing=None): # noqa: E501 + """NodeChannels - a model defined in Swagger""" # noqa: E501 + self._all = None self._incoming = None self._outgoing = None - self._all = None self.discriminator = None - if incoming is not None: - self.incoming = incoming - if outgoing is not None: - self.outgoing = outgoing - if all is not None: - self.all = all + self.all = all + self.incoming = incoming + self.outgoing = outgoing @property - def incoming(self): - """Gets the incoming of this InlineResponse2006. # noqa: E501 + def all(self): + """Gets the all of this NodeChannels. # noqa: E501 - Incomming channels are the ones that were opened by a different node and this node acts as relay. # noqa: E501 - :return: The incoming of this InlineResponse2006. # noqa: E501 - :rtype: list[Channel] + :return: The all of this NodeChannels. # noqa: E501 + :rtype: list[NodeTopologyChannel] """ - return self._incoming + return self._all - @incoming.setter - def incoming(self, incoming): - """Sets the incoming of this InlineResponse2006. + @all.setter + def all(self, all): + """Sets the all of this NodeChannels. - Incomming channels are the ones that were opened by a different node and this node acts as relay. # noqa: E501 - :param incoming: The incoming of this InlineResponse2006. # noqa: E501 - :type: list[Channel] + :param all: The all of this NodeChannels. # noqa: E501 + :type: list[NodeTopologyChannel] """ + if all is None: + raise ValueError("Invalid value for `all`, must not be `None`") # noqa: E501 - self._incoming = incoming + self._all = all @property - def outgoing(self): - """Gets the outgoing of this InlineResponse2006. # noqa: E501 + def incoming(self): + """Gets the incoming of this NodeChannels. # noqa: E501 - Outgoing channels are the ones that were opened by this node and is using other node as relay. # noqa: E501 - :return: The outgoing of this InlineResponse2006. # noqa: E501 - :rtype: list[Channel] + :return: The incoming of this NodeChannels. # noqa: E501 + :rtype: list[NodeChannel] """ - return self._outgoing + return self._incoming - @outgoing.setter - def outgoing(self, outgoing): - """Sets the outgoing of this InlineResponse2006. + @incoming.setter + def incoming(self, incoming): + """Sets the incoming of this NodeChannels. - Outgoing channels are the ones that were opened by this node and is using other node as relay. # noqa: E501 - :param outgoing: The outgoing of this InlineResponse2006. # noqa: E501 - :type: list[Channel] + :param incoming: The incoming of this NodeChannels. # noqa: E501 + :type: list[NodeChannel] """ + if incoming is None: + raise ValueError("Invalid value for `incoming`, must not be `None`") # noqa: E501 - self._outgoing = outgoing + self._incoming = incoming @property - def all(self): - """Gets the all of this InlineResponse2006. # noqa: E501 + def outgoing(self): + """Gets the outgoing of this NodeChannels. # noqa: E501 - All the channels indexed by the node in the current network. # noqa: E501 - :return: The all of this InlineResponse2006. # noqa: E501 - :rtype: list[ChannelTopology] + :return: The outgoing of this NodeChannels. # noqa: E501 + :rtype: list[NodeChannel] """ - return self._all + return self._outgoing - @all.setter - def all(self, all): - """Sets the all of this InlineResponse2006. + @outgoing.setter + def outgoing(self, outgoing): + """Sets the outgoing of this NodeChannels. - All the channels indexed by the node in the current network. # noqa: E501 - :param all: The all of this InlineResponse2006. # noqa: E501 - :type: list[ChannelTopology] + :param outgoing: The outgoing of this NodeChannels. # noqa: E501 + :type: list[NodeChannel] """ + if outgoing is None: + raise ValueError("Invalid value for `outgoing`, must not be `None`") # noqa: E501 - self._all = all + self._outgoing = outgoing def to_dict(self): """Returns the model properties as a dict""" @@ -142,7 +139,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2006, dict): + if issubclass(NodeChannels, dict): for key, value in self.items(): result[key] = value @@ -158,7 +155,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2006): + if not isinstance(other, NodeChannels): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/node_info_res.py b/hoprd_sdk/models/node_info_res.py new file mode 100644 index 0000000..28fb5da --- /dev/null +++ b/hoprd_sdk/models/node_info_res.py @@ -0,0 +1,437 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NodeInfoRes(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'announced_address': 'list[str]', + 'chain': 'str', + 'channel_closure_period': 'int', + 'connectivity_status': 'str', + 'hopr_channels': 'str', + 'hopr_management_module': 'str', + 'hopr_network_registry': 'str', + 'hopr_node_safe': 'str', + 'hopr_node_sage_registry': 'str', + 'hopr_token': 'str', + 'is_eligible': 'bool', + 'listening_address': 'list[str]', + 'network': 'str' + } + + attribute_map = { + 'announced_address': 'announcedAddress', + 'chain': 'chain', + 'channel_closure_period': 'channelClosurePeriod', + 'connectivity_status': 'connectivityStatus', + 'hopr_channels': 'hoprChannels', + 'hopr_management_module': 'hoprManagementModule', + 'hopr_network_registry': 'hoprNetworkRegistry', + 'hopr_node_safe': 'hoprNodeSafe', + 'hopr_node_sage_registry': 'hoprNodeSageRegistry', + 'hopr_token': 'hoprToken', + 'is_eligible': 'isEligible', + 'listening_address': 'listeningAddress', + 'network': 'network' + } + + def __init__(self, announced_address=None, chain=None, channel_closure_period=None, connectivity_status=None, hopr_channels=None, hopr_management_module=None, hopr_network_registry=None, hopr_node_safe=None, hopr_node_sage_registry=None, hopr_token=None, is_eligible=None, listening_address=None, network=None): # noqa: E501 + """NodeInfoRes - a model defined in Swagger""" # noqa: E501 + self._announced_address = None + self._chain = None + self._channel_closure_period = None + self._connectivity_status = None + self._hopr_channels = None + self._hopr_management_module = None + self._hopr_network_registry = None + self._hopr_node_safe = None + self._hopr_node_sage_registry = None + self._hopr_token = None + self._is_eligible = None + self._listening_address = None + self._network = None + self.discriminator = None + self.announced_address = announced_address + self.chain = chain + self.channel_closure_period = channel_closure_period + self.connectivity_status = connectivity_status + self.hopr_channels = hopr_channels + self.hopr_management_module = hopr_management_module + self.hopr_network_registry = hopr_network_registry + self.hopr_node_safe = hopr_node_safe + self.hopr_node_sage_registry = hopr_node_sage_registry + self.hopr_token = hopr_token + self.is_eligible = is_eligible + self.listening_address = listening_address + self.network = network + + @property + def announced_address(self): + """Gets the announced_address of this NodeInfoRes. # noqa: E501 + + + :return: The announced_address of this NodeInfoRes. # noqa: E501 + :rtype: list[str] + """ + return self._announced_address + + @announced_address.setter + def announced_address(self, announced_address): + """Sets the announced_address of this NodeInfoRes. + + + :param announced_address: The announced_address of this NodeInfoRes. # noqa: E501 + :type: list[str] + """ + if announced_address is None: + raise ValueError("Invalid value for `announced_address`, must not be `None`") # noqa: E501 + + self._announced_address = announced_address + + @property + def chain(self): + """Gets the chain of this NodeInfoRes. # noqa: E501 + + + :return: The chain of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this NodeInfoRes. + + + :param chain: The chain of this NodeInfoRes. # noqa: E501 + :type: str + """ + if chain is None: + raise ValueError("Invalid value for `chain`, must not be `None`") # noqa: E501 + + self._chain = chain + + @property + def channel_closure_period(self): + """Gets the channel_closure_period of this NodeInfoRes. # noqa: E501 + + Channel closure period in seconds # noqa: E501 + + :return: The channel_closure_period of this NodeInfoRes. # noqa: E501 + :rtype: int + """ + return self._channel_closure_period + + @channel_closure_period.setter + def channel_closure_period(self, channel_closure_period): + """Sets the channel_closure_period of this NodeInfoRes. + + Channel closure period in seconds # noqa: E501 + + :param channel_closure_period: The channel_closure_period of this NodeInfoRes. # noqa: E501 + :type: int + """ + if channel_closure_period is None: + raise ValueError("Invalid value for `channel_closure_period`, must not be `None`") # noqa: E501 + + self._channel_closure_period = channel_closure_period + + @property + def connectivity_status(self): + """Gets the connectivity_status of this NodeInfoRes. # noqa: E501 + + + :return: The connectivity_status of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._connectivity_status + + @connectivity_status.setter + def connectivity_status(self, connectivity_status): + """Sets the connectivity_status of this NodeInfoRes. + + + :param connectivity_status: The connectivity_status of this NodeInfoRes. # noqa: E501 + :type: str + """ + if connectivity_status is None: + raise ValueError("Invalid value for `connectivity_status`, must not be `None`") # noqa: E501 + + self._connectivity_status = connectivity_status + + @property + def hopr_channels(self): + """Gets the hopr_channels of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_channels of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_channels + + @hopr_channels.setter + def hopr_channels(self, hopr_channels): + """Sets the hopr_channels of this NodeInfoRes. + + + :param hopr_channels: The hopr_channels of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_channels is None: + raise ValueError("Invalid value for `hopr_channels`, must not be `None`") # noqa: E501 + + self._hopr_channels = hopr_channels + + @property + def hopr_management_module(self): + """Gets the hopr_management_module of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_management_module of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_management_module + + @hopr_management_module.setter + def hopr_management_module(self, hopr_management_module): + """Sets the hopr_management_module of this NodeInfoRes. + + + :param hopr_management_module: The hopr_management_module of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_management_module is None: + raise ValueError("Invalid value for `hopr_management_module`, must not be `None`") # noqa: E501 + + self._hopr_management_module = hopr_management_module + + @property + def hopr_network_registry(self): + """Gets the hopr_network_registry of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_network_registry of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_network_registry + + @hopr_network_registry.setter + def hopr_network_registry(self, hopr_network_registry): + """Sets the hopr_network_registry of this NodeInfoRes. + + + :param hopr_network_registry: The hopr_network_registry of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_network_registry is None: + raise ValueError("Invalid value for `hopr_network_registry`, must not be `None`") # noqa: E501 + + self._hopr_network_registry = hopr_network_registry + + @property + def hopr_node_safe(self): + """Gets the hopr_node_safe of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_node_safe of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_node_safe + + @hopr_node_safe.setter + def hopr_node_safe(self, hopr_node_safe): + """Sets the hopr_node_safe of this NodeInfoRes. + + + :param hopr_node_safe: The hopr_node_safe of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_node_safe is None: + raise ValueError("Invalid value for `hopr_node_safe`, must not be `None`") # noqa: E501 + + self._hopr_node_safe = hopr_node_safe + + @property + def hopr_node_sage_registry(self): + """Gets the hopr_node_sage_registry of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_node_sage_registry of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_node_sage_registry + + @hopr_node_sage_registry.setter + def hopr_node_sage_registry(self, hopr_node_sage_registry): + """Sets the hopr_node_sage_registry of this NodeInfoRes. + + + :param hopr_node_sage_registry: The hopr_node_sage_registry of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_node_sage_registry is None: + raise ValueError("Invalid value for `hopr_node_sage_registry`, must not be `None`") # noqa: E501 + + self._hopr_node_sage_registry = hopr_node_sage_registry + + @property + def hopr_token(self): + """Gets the hopr_token of this NodeInfoRes. # noqa: E501 + + + :return: The hopr_token of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._hopr_token + + @hopr_token.setter + def hopr_token(self, hopr_token): + """Sets the hopr_token of this NodeInfoRes. + + + :param hopr_token: The hopr_token of this NodeInfoRes. # noqa: E501 + :type: str + """ + if hopr_token is None: + raise ValueError("Invalid value for `hopr_token`, must not be `None`") # noqa: E501 + + self._hopr_token = hopr_token + + @property + def is_eligible(self): + """Gets the is_eligible of this NodeInfoRes. # noqa: E501 + + + :return: The is_eligible of this NodeInfoRes. # noqa: E501 + :rtype: bool + """ + return self._is_eligible + + @is_eligible.setter + def is_eligible(self, is_eligible): + """Sets the is_eligible of this NodeInfoRes. + + + :param is_eligible: The is_eligible of this NodeInfoRes. # noqa: E501 + :type: bool + """ + if is_eligible is None: + raise ValueError("Invalid value for `is_eligible`, must not be `None`") # noqa: E501 + + self._is_eligible = is_eligible + + @property + def listening_address(self): + """Gets the listening_address of this NodeInfoRes. # noqa: E501 + + + :return: The listening_address of this NodeInfoRes. # noqa: E501 + :rtype: list[str] + """ + return self._listening_address + + @listening_address.setter + def listening_address(self, listening_address): + """Sets the listening_address of this NodeInfoRes. + + + :param listening_address: The listening_address of this NodeInfoRes. # noqa: E501 + :type: list[str] + """ + if listening_address is None: + raise ValueError("Invalid value for `listening_address`, must not be `None`") # noqa: E501 + + self._listening_address = listening_address + + @property + def network(self): + """Gets the network of this NodeInfoRes. # noqa: E501 + + + :return: The network of this NodeInfoRes. # noqa: E501 + :rtype: str + """ + return self._network + + @network.setter + def network(self, network): + """Sets the network of this NodeInfoRes. + + + :param network: The network of this NodeInfoRes. # noqa: E501 + :type: str + """ + if network is None: + raise ValueError("Invalid value for `network`, must not be `None`") # noqa: E501 + + self._network = network + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NodeInfoRes, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NodeInfoRes): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/inline_response20012.py b/hoprd_sdk/models/node_peer_info.py similarity index 66% rename from hoprd_sdk/models/inline_response20012.py rename to hoprd_sdk/models/node_peer_info.py index 0bcb4d8..a20b319 100644 --- a/hoprd_sdk/models/inline_response20012.py +++ b/hoprd_sdk/models/node_peer_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse20012(object): +class NodePeerInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,8 +28,8 @@ class InlineResponse20012(object): and the value is json key in definition. """ swagger_types = { - 'announced': 'list[MultiAddress]', - 'observed': 'list[MultiAddress]' + 'announced': 'list[str]', + 'observed': 'list[str]' } attribute_map = { @@ -38,54 +38,56 @@ class InlineResponse20012(object): } def __init__(self, announced=None, observed=None): # noqa: E501 - """InlineResponse20012 - a model defined in Swagger""" # noqa: E501 + """NodePeerInfo - a model defined in Swagger""" # noqa: E501 self._announced = None self._observed = None self.discriminator = None - if announced is not None: - self.announced = announced - if observed is not None: - self.observed = observed + self.announced = announced + self.observed = observed @property def announced(self): - """Gets the announced of this InlineResponse20012. # noqa: E501 + """Gets the announced of this NodePeerInfo. # noqa: E501 - :return: The announced of this InlineResponse20012. # noqa: E501 - :rtype: list[MultiAddress] + :return: The announced of this NodePeerInfo. # noqa: E501 + :rtype: list[str] """ return self._announced @announced.setter def announced(self, announced): - """Sets the announced of this InlineResponse20012. + """Sets the announced of this NodePeerInfo. - :param announced: The announced of this InlineResponse20012. # noqa: E501 - :type: list[MultiAddress] + :param announced: The announced of this NodePeerInfo. # noqa: E501 + :type: list[str] """ + if announced is None: + raise ValueError("Invalid value for `announced`, must not be `None`") # noqa: E501 self._announced = announced @property def observed(self): - """Gets the observed of this InlineResponse20012. # noqa: E501 + """Gets the observed of this NodePeerInfo. # noqa: E501 - :return: The observed of this InlineResponse20012. # noqa: E501 - :rtype: list[MultiAddress] + :return: The observed of this NodePeerInfo. # noqa: E501 + :rtype: list[str] """ return self._observed @observed.setter def observed(self, observed): - """Sets the observed of this InlineResponse20012. + """Sets the observed of this NodePeerInfo. - :param observed: The observed of this InlineResponse20012. # noqa: E501 - :type: list[MultiAddress] + :param observed: The observed of this NodePeerInfo. # noqa: E501 + :type: list[str] """ + if observed is None: + raise ValueError("Invalid value for `observed`, must not be `None`") # noqa: E501 self._observed = observed @@ -110,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse20012, dict): + if issubclass(NodePeerInfo, dict): for key, value in self.items(): result[key] = value @@ -126,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20012): + if not isinstance(other, NodePeerInfo): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/messages_peek_body.py b/hoprd_sdk/models/node_peers_req_query.py similarity index 67% rename from hoprd_sdk/models/messages_peek_body.py rename to hoprd_sdk/models/node_peers_req_query.py index c4c0be3..5d7410b 100644 --- a/hoprd_sdk/models/messages_peek_body.py +++ b/hoprd_sdk/models/node_peers_req_query.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class MessagesPeekBody(object): +class NodePeersReqQuery(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,41 +28,40 @@ class MessagesPeekBody(object): and the value is json key in definition. """ swagger_types = { - 'tag': 'MessageTag' + 'quality': 'float' } attribute_map = { - 'tag': 'tag' + 'quality': 'quality' } - def __init__(self, tag=None): # noqa: E501 - """MessagesPeekBody - a model defined in Swagger""" # noqa: E501 - self._tag = None + def __init__(self, quality=None): # noqa: E501 + """NodePeersReqQuery - a model defined in Swagger""" # noqa: E501 + self._quality = None self.discriminator = None - self.tag = tag + if quality is not None: + self.quality = quality @property - def tag(self): - """Gets the tag of this MessagesPeekBody. # noqa: E501 + def quality(self): + """Gets the quality of this NodePeersReqQuery. # noqa: E501 - :return: The tag of this MessagesPeekBody. # noqa: E501 - :rtype: MessageTag + :return: The quality of this NodePeersReqQuery. # noqa: E501 + :rtype: float """ - return self._tag + return self._quality - @tag.setter - def tag(self, tag): - """Sets the tag of this MessagesPeekBody. + @quality.setter + def quality(self, quality): + """Sets the quality of this NodePeersReqQuery. - :param tag: The tag of this MessagesPeekBody. # noqa: E501 - :type: MessageTag + :param quality: The quality of this NodePeersReqQuery. # noqa: E501 + :type: float """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - self._tag = tag + self._quality = quality def to_dict(self): """Returns the model properties as a dict""" @@ -85,7 +84,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(MessagesPeekBody, dict): + if issubclass(NodePeersReqQuery, dict): for key, value in self.items(): result[key] = value @@ -101,7 +100,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, MessagesPeekBody): + if not isinstance(other, NodePeersReqQuery): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response2002.py b/hoprd_sdk/models/node_peers_res.py similarity index 62% rename from hoprd_sdk/models/inline_response2002.py rename to hoprd_sdk/models/node_peers_res.py index 3be9f8c..6e925e9 100644 --- a/hoprd_sdk/models/inline_response2002.py +++ b/hoprd_sdk/models/node_peers_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2002(object): +class NodePeersRes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,66 +28,68 @@ class InlineResponse2002(object): and the value is json key in definition. """ swagger_types = { - 'connected': 'list[InlineResponse2002Connected]', - 'announced': 'list[InlineResponse2002Connected]' + 'announced': 'list[PeerInfo]', + 'connected': 'list[PeerInfo]' } attribute_map = { - 'connected': 'connected', - 'announced': 'announced' + 'announced': 'announced', + 'connected': 'connected' } - def __init__(self, connected=None, announced=None): # noqa: E501 - """InlineResponse2002 - a model defined in Swagger""" # noqa: E501 - self._connected = None + def __init__(self, announced=None, connected=None): # noqa: E501 + """NodePeersRes - a model defined in Swagger""" # noqa: E501 self._announced = None + self._connected = None self.discriminator = None - if connected is not None: - self.connected = connected - if announced is not None: - self.announced = announced + self.announced = announced + self.connected = connected @property - def connected(self): - """Gets the connected of this InlineResponse2002. # noqa: E501 + def announced(self): + """Gets the announced of this NodePeersRes. # noqa: E501 - :return: The connected of this InlineResponse2002. # noqa: E501 - :rtype: list[InlineResponse2002Connected] + :return: The announced of this NodePeersRes. # noqa: E501 + :rtype: list[PeerInfo] """ - return self._connected + return self._announced - @connected.setter - def connected(self, connected): - """Sets the connected of this InlineResponse2002. + @announced.setter + def announced(self, announced): + """Sets the announced of this NodePeersRes. - :param connected: The connected of this InlineResponse2002. # noqa: E501 - :type: list[InlineResponse2002Connected] + :param announced: The announced of this NodePeersRes. # noqa: E501 + :type: list[PeerInfo] """ + if announced is None: + raise ValueError("Invalid value for `announced`, must not be `None`") # noqa: E501 - self._connected = connected + self._announced = announced @property - def announced(self): - """Gets the announced of this InlineResponse2002. # noqa: E501 + def connected(self): + """Gets the connected of this NodePeersRes. # noqa: E501 - :return: The announced of this InlineResponse2002. # noqa: E501 - :rtype: list[InlineResponse2002Connected] + :return: The connected of this NodePeersRes. # noqa: E501 + :rtype: list[PeerInfo] """ - return self._announced + return self._connected - @announced.setter - def announced(self, announced): - """Sets the announced of this InlineResponse2002. + @connected.setter + def connected(self, connected): + """Sets the connected of this NodePeersRes. - :param announced: The announced of this InlineResponse2002. # noqa: E501 - :type: list[InlineResponse2002Connected] + :param connected: The connected of this NodePeersRes. # noqa: E501 + :type: list[PeerInfo] """ + if connected is None: + raise ValueError("Invalid value for `connected`, must not be `None`") # noqa: E501 - self._announced = announced + self._connected = connected def to_dict(self): """Returns the model properties as a dict""" @@ -110,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2002, dict): + if issubclass(NodePeersRes, dict): for key, value in self.items(): result[key] = value @@ -126,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2002): + if not isinstance(other, NodePeersRes): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/node_ticket_statistics.py b/hoprd_sdk/models/node_ticket_statistics.py new file mode 100644 index 0000000..fdcaa0c --- /dev/null +++ b/hoprd_sdk/models/node_ticket_statistics.py @@ -0,0 +1,354 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NodeTicketStatistics(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'losing_tickets': 'int', + 'neglected': 'int', + 'neglected_value': 'str', + 'redeemed': 'int', + 'redeemed_value': 'str', + 'rejected': 'int', + 'rejected_value': 'str', + 'unredeemed': 'int', + 'unredeemed_value': 'str', + 'win_proportion': 'float' + } + + attribute_map = { + 'losing_tickets': 'losingTickets', + 'neglected': 'neglected', + 'neglected_value': 'neglectedValue', + 'redeemed': 'redeemed', + 'redeemed_value': 'redeemedValue', + 'rejected': 'rejected', + 'rejected_value': 'rejectedValue', + 'unredeemed': 'unredeemed', + 'unredeemed_value': 'unredeemedValue', + 'win_proportion': 'winProportion' + } + + def __init__(self, losing_tickets=None, neglected=None, neglected_value=None, redeemed=None, redeemed_value=None, rejected=None, rejected_value=None, unredeemed=None, unredeemed_value=None, win_proportion=None): # noqa: E501 + """NodeTicketStatistics - a model defined in Swagger""" # noqa: E501 + self._losing_tickets = None + self._neglected = None + self._neglected_value = None + self._redeemed = None + self._redeemed_value = None + self._rejected = None + self._rejected_value = None + self._unredeemed = None + self._unredeemed_value = None + self._win_proportion = None + self.discriminator = None + self.losing_tickets = losing_tickets + self.neglected = neglected + self.neglected_value = neglected_value + self.redeemed = redeemed + self.redeemed_value = redeemed_value + self.rejected = rejected + self.rejected_value = rejected_value + self.unredeemed = unredeemed + self.unredeemed_value = unredeemed_value + self.win_proportion = win_proportion + + @property + def losing_tickets(self): + """Gets the losing_tickets of this NodeTicketStatistics. # noqa: E501 + + + :return: The losing_tickets of this NodeTicketStatistics. # noqa: E501 + :rtype: int + """ + return self._losing_tickets + + @losing_tickets.setter + def losing_tickets(self, losing_tickets): + """Sets the losing_tickets of this NodeTicketStatistics. + + + :param losing_tickets: The losing_tickets of this NodeTicketStatistics. # noqa: E501 + :type: int + """ + if losing_tickets is None: + raise ValueError("Invalid value for `losing_tickets`, must not be `None`") # noqa: E501 + + self._losing_tickets = losing_tickets + + @property + def neglected(self): + """Gets the neglected of this NodeTicketStatistics. # noqa: E501 + + + :return: The neglected of this NodeTicketStatistics. # noqa: E501 + :rtype: int + """ + return self._neglected + + @neglected.setter + def neglected(self, neglected): + """Sets the neglected of this NodeTicketStatistics. + + + :param neglected: The neglected of this NodeTicketStatistics. # noqa: E501 + :type: int + """ + if neglected is None: + raise ValueError("Invalid value for `neglected`, must not be `None`") # noqa: E501 + + self._neglected = neglected + + @property + def neglected_value(self): + """Gets the neglected_value of this NodeTicketStatistics. # noqa: E501 + + + :return: The neglected_value of this NodeTicketStatistics. # noqa: E501 + :rtype: str + """ + return self._neglected_value + + @neglected_value.setter + def neglected_value(self, neglected_value): + """Sets the neglected_value of this NodeTicketStatistics. + + + :param neglected_value: The neglected_value of this NodeTicketStatistics. # noqa: E501 + :type: str + """ + if neglected_value is None: + raise ValueError("Invalid value for `neglected_value`, must not be `None`") # noqa: E501 + + self._neglected_value = neglected_value + + @property + def redeemed(self): + """Gets the redeemed of this NodeTicketStatistics. # noqa: E501 + + + :return: The redeemed of this NodeTicketStatistics. # noqa: E501 + :rtype: int + """ + return self._redeemed + + @redeemed.setter + def redeemed(self, redeemed): + """Sets the redeemed of this NodeTicketStatistics. + + + :param redeemed: The redeemed of this NodeTicketStatistics. # noqa: E501 + :type: int + """ + if redeemed is None: + raise ValueError("Invalid value for `redeemed`, must not be `None`") # noqa: E501 + + self._redeemed = redeemed + + @property + def redeemed_value(self): + """Gets the redeemed_value of this NodeTicketStatistics. # noqa: E501 + + + :return: The redeemed_value of this NodeTicketStatistics. # noqa: E501 + :rtype: str + """ + return self._redeemed_value + + @redeemed_value.setter + def redeemed_value(self, redeemed_value): + """Sets the redeemed_value of this NodeTicketStatistics. + + + :param redeemed_value: The redeemed_value of this NodeTicketStatistics. # noqa: E501 + :type: str + """ + if redeemed_value is None: + raise ValueError("Invalid value for `redeemed_value`, must not be `None`") # noqa: E501 + + self._redeemed_value = redeemed_value + + @property + def rejected(self): + """Gets the rejected of this NodeTicketStatistics. # noqa: E501 + + + :return: The rejected of this NodeTicketStatistics. # noqa: E501 + :rtype: int + """ + return self._rejected + + @rejected.setter + def rejected(self, rejected): + """Sets the rejected of this NodeTicketStatistics. + + + :param rejected: The rejected of this NodeTicketStatistics. # noqa: E501 + :type: int + """ + if rejected is None: + raise ValueError("Invalid value for `rejected`, must not be `None`") # noqa: E501 + + self._rejected = rejected + + @property + def rejected_value(self): + """Gets the rejected_value of this NodeTicketStatistics. # noqa: E501 + + + :return: The rejected_value of this NodeTicketStatistics. # noqa: E501 + :rtype: str + """ + return self._rejected_value + + @rejected_value.setter + def rejected_value(self, rejected_value): + """Sets the rejected_value of this NodeTicketStatistics. + + + :param rejected_value: The rejected_value of this NodeTicketStatistics. # noqa: E501 + :type: str + """ + if rejected_value is None: + raise ValueError("Invalid value for `rejected_value`, must not be `None`") # noqa: E501 + + self._rejected_value = rejected_value + + @property + def unredeemed(self): + """Gets the unredeemed of this NodeTicketStatistics. # noqa: E501 + + + :return: The unredeemed of this NodeTicketStatistics. # noqa: E501 + :rtype: int + """ + return self._unredeemed + + @unredeemed.setter + def unredeemed(self, unredeemed): + """Sets the unredeemed of this NodeTicketStatistics. + + + :param unredeemed: The unredeemed of this NodeTicketStatistics. # noqa: E501 + :type: int + """ + if unredeemed is None: + raise ValueError("Invalid value for `unredeemed`, must not be `None`") # noqa: E501 + + self._unredeemed = unredeemed + + @property + def unredeemed_value(self): + """Gets the unredeemed_value of this NodeTicketStatistics. # noqa: E501 + + + :return: The unredeemed_value of this NodeTicketStatistics. # noqa: E501 + :rtype: str + """ + return self._unredeemed_value + + @unredeemed_value.setter + def unredeemed_value(self, unredeemed_value): + """Sets the unredeemed_value of this NodeTicketStatistics. + + + :param unredeemed_value: The unredeemed_value of this NodeTicketStatistics. # noqa: E501 + :type: str + """ + if unredeemed_value is None: + raise ValueError("Invalid value for `unredeemed_value`, must not be `None`") # noqa: E501 + + self._unredeemed_value = unredeemed_value + + @property + def win_proportion(self): + """Gets the win_proportion of this NodeTicketStatistics. # noqa: E501 + + + :return: The win_proportion of this NodeTicketStatistics. # noqa: E501 + :rtype: float + """ + return self._win_proportion + + @win_proportion.setter + def win_proportion(self, win_proportion): + """Sets the win_proportion of this NodeTicketStatistics. + + + :param win_proportion: The win_proportion of this NodeTicketStatistics. # noqa: E501 + :type: float + """ + if win_proportion is None: + raise ValueError("Invalid value for `win_proportion`, must not be `None`") # noqa: E501 + + self._win_proportion = win_proportion + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NodeTicketStatistics, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NodeTicketStatistics): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/node_topology_channel.py b/hoprd_sdk/models/node_topology_channel.py new file mode 100644 index 0000000..de89eab --- /dev/null +++ b/hoprd_sdk/models/node_topology_channel.py @@ -0,0 +1,354 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class NodeTopologyChannel(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'balance': 'str', + 'channel_epoch': 'int', + 'channel_id': 'str', + 'closure_time': 'int', + 'destination_address': 'str', + 'destination_peer_id': 'str', + 'source_address': 'str', + 'source_peer_id': 'str', + 'status': 'str', + 'ticket_index': 'int' + } + + attribute_map = { + 'balance': 'balance', + 'channel_epoch': 'channelEpoch', + 'channel_id': 'channelId', + 'closure_time': 'closureTime', + 'destination_address': 'destinationAddress', + 'destination_peer_id': 'destinationPeerId', + 'source_address': 'sourceAddress', + 'source_peer_id': 'sourcePeerId', + 'status': 'status', + 'ticket_index': 'ticketIndex' + } + + def __init__(self, balance=None, channel_epoch=None, channel_id=None, closure_time=None, destination_address=None, destination_peer_id=None, source_address=None, source_peer_id=None, status=None, ticket_index=None): # noqa: E501 + """NodeTopologyChannel - a model defined in Swagger""" # noqa: E501 + self._balance = None + self._channel_epoch = None + self._channel_id = None + self._closure_time = None + self._destination_address = None + self._destination_peer_id = None + self._source_address = None + self._source_peer_id = None + self._status = None + self._ticket_index = None + self.discriminator = None + self.balance = balance + self.channel_epoch = channel_epoch + self.channel_id = channel_id + self.closure_time = closure_time + self.destination_address = destination_address + self.destination_peer_id = destination_peer_id + self.source_address = source_address + self.source_peer_id = source_peer_id + self.status = status + self.ticket_index = ticket_index + + @property + def balance(self): + """Gets the balance of this NodeTopologyChannel. # noqa: E501 + + + :return: The balance of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._balance + + @balance.setter + def balance(self, balance): + """Sets the balance of this NodeTopologyChannel. + + + :param balance: The balance of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if balance is None: + raise ValueError("Invalid value for `balance`, must not be `None`") # noqa: E501 + + self._balance = balance + + @property + def channel_epoch(self): + """Gets the channel_epoch of this NodeTopologyChannel. # noqa: E501 + + + :return: The channel_epoch of this NodeTopologyChannel. # noqa: E501 + :rtype: int + """ + return self._channel_epoch + + @channel_epoch.setter + def channel_epoch(self, channel_epoch): + """Sets the channel_epoch of this NodeTopologyChannel. + + + :param channel_epoch: The channel_epoch of this NodeTopologyChannel. # noqa: E501 + :type: int + """ + if channel_epoch is None: + raise ValueError("Invalid value for `channel_epoch`, must not be `None`") # noqa: E501 + + self._channel_epoch = channel_epoch + + @property + def channel_id(self): + """Gets the channel_id of this NodeTopologyChannel. # noqa: E501 + + + :return: The channel_id of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._channel_id + + @channel_id.setter + def channel_id(self, channel_id): + """Sets the channel_id of this NodeTopologyChannel. + + + :param channel_id: The channel_id of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if channel_id is None: + raise ValueError("Invalid value for `channel_id`, must not be `None`") # noqa: E501 + + self._channel_id = channel_id + + @property + def closure_time(self): + """Gets the closure_time of this NodeTopologyChannel. # noqa: E501 + + + :return: The closure_time of this NodeTopologyChannel. # noqa: E501 + :rtype: int + """ + return self._closure_time + + @closure_time.setter + def closure_time(self, closure_time): + """Sets the closure_time of this NodeTopologyChannel. + + + :param closure_time: The closure_time of this NodeTopologyChannel. # noqa: E501 + :type: int + """ + if closure_time is None: + raise ValueError("Invalid value for `closure_time`, must not be `None`") # noqa: E501 + + self._closure_time = closure_time + + @property + def destination_address(self): + """Gets the destination_address of this NodeTopologyChannel. # noqa: E501 + + + :return: The destination_address of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._destination_address + + @destination_address.setter + def destination_address(self, destination_address): + """Sets the destination_address of this NodeTopologyChannel. + + + :param destination_address: The destination_address of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if destination_address is None: + raise ValueError("Invalid value for `destination_address`, must not be `None`") # noqa: E501 + + self._destination_address = destination_address + + @property + def destination_peer_id(self): + """Gets the destination_peer_id of this NodeTopologyChannel. # noqa: E501 + + + :return: The destination_peer_id of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._destination_peer_id + + @destination_peer_id.setter + def destination_peer_id(self, destination_peer_id): + """Sets the destination_peer_id of this NodeTopologyChannel. + + + :param destination_peer_id: The destination_peer_id of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if destination_peer_id is None: + raise ValueError("Invalid value for `destination_peer_id`, must not be `None`") # noqa: E501 + + self._destination_peer_id = destination_peer_id + + @property + def source_address(self): + """Gets the source_address of this NodeTopologyChannel. # noqa: E501 + + + :return: The source_address of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._source_address + + @source_address.setter + def source_address(self, source_address): + """Sets the source_address of this NodeTopologyChannel. + + + :param source_address: The source_address of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if source_address is None: + raise ValueError("Invalid value for `source_address`, must not be `None`") # noqa: E501 + + self._source_address = source_address + + @property + def source_peer_id(self): + """Gets the source_peer_id of this NodeTopologyChannel. # noqa: E501 + + + :return: The source_peer_id of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._source_peer_id + + @source_peer_id.setter + def source_peer_id(self, source_peer_id): + """Sets the source_peer_id of this NodeTopologyChannel. + + + :param source_peer_id: The source_peer_id of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if source_peer_id is None: + raise ValueError("Invalid value for `source_peer_id`, must not be `None`") # noqa: E501 + + self._source_peer_id = source_peer_id + + @property + def status(self): + """Gets the status of this NodeTopologyChannel. # noqa: E501 + + + :return: The status of this NodeTopologyChannel. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this NodeTopologyChannel. + + + :param status: The status of this NodeTopologyChannel. # noqa: E501 + :type: str + """ + if status is None: + raise ValueError("Invalid value for `status`, must not be `None`") # noqa: E501 + + self._status = status + + @property + def ticket_index(self): + """Gets the ticket_index of this NodeTopologyChannel. # noqa: E501 + + + :return: The ticket_index of this NodeTopologyChannel. # noqa: E501 + :rtype: int + """ + return self._ticket_index + + @ticket_index.setter + def ticket_index(self, ticket_index): + """Sets the ticket_index of this NodeTopologyChannel. + + + :param ticket_index: The ticket_index of this NodeTopologyChannel. # noqa: E501 + :type: int + """ + if ticket_index is None: + raise ValueError("Invalid value for `ticket_index`, must not be `None`") # noqa: E501 + + self._ticket_index = ticket_index + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(NodeTopologyChannel, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, NodeTopologyChannel): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/request_status.py b/hoprd_sdk/models/node_version.py similarity index 67% rename from hoprd_sdk/models/request_status.py rename to hoprd_sdk/models/node_version.py index 80008d3..d88b554 100644 --- a/hoprd_sdk/models/request_status.py +++ b/hoprd_sdk/models/node_version.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class RequestStatus(object): +class NodeVersion(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,42 +28,41 @@ class RequestStatus(object): and the value is json key in definition. """ swagger_types = { - 'status': 'str' + 'version': 'str' } attribute_map = { - 'status': 'status' + 'version': 'version' } - def __init__(self, status=None): # noqa: E501 - """RequestStatus - a model defined in Swagger""" # noqa: E501 - self._status = None + def __init__(self, version=None): # noqa: E501 + """NodeVersion - a model defined in Swagger""" # noqa: E501 + self._version = None self.discriminator = None - if status is not None: - self.status = status + self.version = version @property - def status(self): - """Gets the status of this RequestStatus. # noqa: E501 + def version(self): + """Gets the version of this NodeVersion. # noqa: E501 - Status declaring success/failure of the request. # noqa: E501 - :return: The status of this RequestStatus. # noqa: E501 + :return: The version of this NodeVersion. # noqa: E501 :rtype: str """ - return self._status + return self._version - @status.setter - def status(self, status): - """Sets the status of this RequestStatus. + @version.setter + def version(self, version): + """Sets the version of this NodeVersion. - Status declaring success/failure of the request. # noqa: E501 - :param status: The status of this RequestStatus. # noqa: E501 + :param version: The version of this NodeVersion. # noqa: E501 :type: str """ + if version is None: + raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 - self._status = status + self._version = version def to_dict(self): """Returns the model properties as a dict""" @@ -86,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(RequestStatus, dict): + if issubclass(NodeVersion, dict): for key, value in self.items(): result[key] = value @@ -102,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, RequestStatus): + if not isinstance(other, NodeVersion): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response2011.py b/hoprd_sdk/models/open_channel_receipt.py similarity index 67% rename from hoprd_sdk/models/inline_response2011.py rename to hoprd_sdk/models/open_channel_receipt.py index aa286e7..a08af34 100644 --- a/hoprd_sdk/models/inline_response2011.py +++ b/hoprd_sdk/models/open_channel_receipt.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2011(object): +class OpenChannelReceipt(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,8 +28,8 @@ class InlineResponse2011(object): and the value is json key in definition. """ swagger_types = { - 'channel_id': 'ChannelId', - 'transaction_receipt': 'TransactionReceipt' + 'channel_id': 'str', + 'transaction_receipt': 'str' } attribute_map = { @@ -38,54 +38,56 @@ class InlineResponse2011(object): } def __init__(self, channel_id=None, transaction_receipt=None): # noqa: E501 - """InlineResponse2011 - a model defined in Swagger""" # noqa: E501 + """OpenChannelReceipt - a model defined in Swagger""" # noqa: E501 self._channel_id = None self._transaction_receipt = None self.discriminator = None - if channel_id is not None: - self.channel_id = channel_id - if transaction_receipt is not None: - self.transaction_receipt = transaction_receipt + self.channel_id = channel_id + self.transaction_receipt = transaction_receipt @property def channel_id(self): - """Gets the channel_id of this InlineResponse2011. # noqa: E501 + """Gets the channel_id of this OpenChannelReceipt. # noqa: E501 - :return: The channel_id of this InlineResponse2011. # noqa: E501 - :rtype: ChannelId + :return: The channel_id of this OpenChannelReceipt. # noqa: E501 + :rtype: str """ return self._channel_id @channel_id.setter def channel_id(self, channel_id): - """Sets the channel_id of this InlineResponse2011. + """Sets the channel_id of this OpenChannelReceipt. - :param channel_id: The channel_id of this InlineResponse2011. # noqa: E501 - :type: ChannelId + :param channel_id: The channel_id of this OpenChannelReceipt. # noqa: E501 + :type: str """ + if channel_id is None: + raise ValueError("Invalid value for `channel_id`, must not be `None`") # noqa: E501 self._channel_id = channel_id @property def transaction_receipt(self): - """Gets the transaction_receipt of this InlineResponse2011. # noqa: E501 + """Gets the transaction_receipt of this OpenChannelReceipt. # noqa: E501 - :return: The transaction_receipt of this InlineResponse2011. # noqa: E501 - :rtype: TransactionReceipt + :return: The transaction_receipt of this OpenChannelReceipt. # noqa: E501 + :rtype: str """ return self._transaction_receipt @transaction_receipt.setter def transaction_receipt(self, transaction_receipt): - """Sets the transaction_receipt of this InlineResponse2011. + """Sets the transaction_receipt of this OpenChannelReceipt. - :param transaction_receipt: The transaction_receipt of this InlineResponse2011. # noqa: E501 - :type: TransactionReceipt + :param transaction_receipt: The transaction_receipt of this OpenChannelReceipt. # noqa: E501 + :type: str """ + if transaction_receipt is None: + raise ValueError("Invalid value for `transaction_receipt`, must not be `None`") # noqa: E501 self._transaction_receipt = transaction_receipt @@ -110,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2011, dict): + if issubclass(OpenChannelReceipt, dict): for key, value in self.items(): result[key] = value @@ -126,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2011): + if not isinstance(other, OpenChannelReceipt): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/channels_body.py b/hoprd_sdk/models/open_channel_request.py similarity index 66% rename from hoprd_sdk/models/channels_body.py rename to hoprd_sdk/models/open_channel_request.py index 602d57f..62ed4ae 100644 --- a/hoprd_sdk/models/channels_body.py +++ b/hoprd_sdk/models/open_channel_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class ChannelsBody(object): +class OpenChannelRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,72 +28,68 @@ class ChannelsBody(object): and the value is json key in definition. """ swagger_types = { - 'peer_address': 'str', - 'amount': 'str' + 'amount': 'str', + 'peer_address': 'str' } attribute_map = { - 'peer_address': 'peerAddress', - 'amount': 'amount' + 'amount': 'amount', + 'peer_address': 'peerAddress' } - def __init__(self, peer_address=None, amount=None): # noqa: E501 - """ChannelsBody - a model defined in Swagger""" # noqa: E501 - self._peer_address = None + def __init__(self, amount=None, peer_address=None): # noqa: E501 + """OpenChannelRequest - a model defined in Swagger""" # noqa: E501 self._amount = None + self._peer_address = None self.discriminator = None - self.peer_address = peer_address self.amount = amount + self.peer_address = peer_address @property - def peer_address(self): - """Gets the peer_address of this ChannelsBody. # noqa: E501 + def amount(self): + """Gets the amount of this OpenChannelRequest. # noqa: E501 - Peer address that we want to transact with using this channel. # noqa: E501 - :return: The peer_address of this ChannelsBody. # noqa: E501 + :return: The amount of this OpenChannelRequest. # noqa: E501 :rtype: str """ - return self._peer_address + return self._amount - @peer_address.setter - def peer_address(self, peer_address): - """Sets the peer_address of this ChannelsBody. + @amount.setter + def amount(self, amount): + """Sets the amount of this OpenChannelRequest. - Peer address that we want to transact with using this channel. # noqa: E501 - :param peer_address: The peer_address of this ChannelsBody. # noqa: E501 + :param amount: The amount of this OpenChannelRequest. # noqa: E501 :type: str """ - if peer_address is None: - raise ValueError("Invalid value for `peer_address`, must not be `None`") # noqa: E501 + if amount is None: + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 - self._peer_address = peer_address + self._amount = amount @property - def amount(self): - """Gets the amount of this ChannelsBody. # noqa: E501 + def peer_address(self): + """Gets the peer_address of this OpenChannelRequest. # noqa: E501 - Amount of HOPR tokens to fund the channel. It will be used to pay for sending messages through channel # noqa: E501 - :return: The amount of this ChannelsBody. # noqa: E501 + :return: The peer_address of this OpenChannelRequest. # noqa: E501 :rtype: str """ - return self._amount + return self._peer_address - @amount.setter - def amount(self, amount): - """Sets the amount of this ChannelsBody. + @peer_address.setter + def peer_address(self, peer_address): + """Sets the peer_address of this OpenChannelRequest. - Amount of HOPR tokens to fund the channel. It will be used to pay for sending messages through channel # noqa: E501 - :param amount: The amount of this ChannelsBody. # noqa: E501 + :param peer_address: The peer_address of this OpenChannelRequest. # noqa: E501 :type: str """ - if amount is None: - raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + if peer_address is None: + raise ValueError("Invalid value for `peer_address`, must not be `None`") # noqa: E501 - self._amount = amount + self._peer_address = peer_address def to_dict(self): """Returns the model properties as a dict""" @@ -116,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ChannelsBody, dict): + if issubclass(OpenChannelRequest, dict): for key, value in self.items(): result[key] = value @@ -132,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ChannelsBody): + if not isinstance(other, OpenChannelRequest): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response20015.py b/hoprd_sdk/models/peer_id_arg.py similarity index 74% rename from hoprd_sdk/models/inline_response20015.py rename to hoprd_sdk/models/peer_id_arg.py index d4d80e1..bb04378 100644 --- a/hoprd_sdk/models/inline_response20015.py +++ b/hoprd_sdk/models/peer_id_arg.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse20015(object): +class PeerIdArg(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class InlineResponse20015(object): and the value is json key in definition. """ swagger_types = { - 'peer_id': 'HoprAddress' + 'peer_id': 'str' } attribute_map = { @@ -36,30 +36,31 @@ class InlineResponse20015(object): } def __init__(self, peer_id=None): # noqa: E501 - """InlineResponse20015 - a model defined in Swagger""" # noqa: E501 + """PeerIdArg - a model defined in Swagger""" # noqa: E501 self._peer_id = None self.discriminator = None - if peer_id is not None: - self.peer_id = peer_id + self.peer_id = peer_id @property def peer_id(self): - """Gets the peer_id of this InlineResponse20015. # noqa: E501 + """Gets the peer_id of this PeerIdArg. # noqa: E501 - :return: The peer_id of this InlineResponse20015. # noqa: E501 - :rtype: HoprAddress + :return: The peer_id of this PeerIdArg. # noqa: E501 + :rtype: str """ return self._peer_id @peer_id.setter def peer_id(self, peer_id): - """Sets the peer_id of this InlineResponse20015. + """Sets the peer_id of this PeerIdArg. - :param peer_id: The peer_id of this InlineResponse20015. # noqa: E501 - :type: HoprAddress + :param peer_id: The peer_id of this PeerIdArg. # noqa: E501 + :type: str """ + if peer_id is None: + raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 self._peer_id = peer_id @@ -84,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse20015, dict): + if issubclass(PeerIdArg, dict): for key, value in self.items(): result[key] = value @@ -100,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20015): + if not isinstance(other, PeerIdArg): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/peer_info.py b/hoprd_sdk/models/peer_info.py new file mode 100644 index 0000000..656db00 --- /dev/null +++ b/hoprd_sdk/models/peer_info.py @@ -0,0 +1,352 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PeerInfo(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'backoff': 'float', + 'heartbeats': 'HeartbeatInfo', + 'is_new': 'bool', + 'last_seen': 'int', + 'last_seen_latency': 'int', + 'multiaddr': 'str', + 'peer_address': 'str', + 'peer_id': 'str', + 'quality': 'float', + 'reported_version': 'str' + } + + attribute_map = { + 'backoff': 'backoff', + 'heartbeats': 'heartbeats', + 'is_new': 'isNew', + 'last_seen': 'lastSeen', + 'last_seen_latency': 'lastSeenLatency', + 'multiaddr': 'multiaddr', + 'peer_address': 'peerAddress', + 'peer_id': 'peerId', + 'quality': 'quality', + 'reported_version': 'reportedVersion' + } + + def __init__(self, backoff=None, heartbeats=None, is_new=None, last_seen=None, last_seen_latency=None, multiaddr=None, peer_address=None, peer_id=None, quality=None, reported_version=None): # noqa: E501 + """PeerInfo - a model defined in Swagger""" # noqa: E501 + self._backoff = None + self._heartbeats = None + self._is_new = None + self._last_seen = None + self._last_seen_latency = None + self._multiaddr = None + self._peer_address = None + self._peer_id = None + self._quality = None + self._reported_version = None + self.discriminator = None + self.backoff = backoff + self.heartbeats = heartbeats + self.is_new = is_new + self.last_seen = last_seen + self.last_seen_latency = last_seen_latency + if multiaddr is not None: + self.multiaddr = multiaddr + if peer_address is not None: + self.peer_address = peer_address + self.peer_id = peer_id + self.quality = quality + self.reported_version = reported_version + + @property + def backoff(self): + """Gets the backoff of this PeerInfo. # noqa: E501 + + + :return: The backoff of this PeerInfo. # noqa: E501 + :rtype: float + """ + return self._backoff + + @backoff.setter + def backoff(self, backoff): + """Sets the backoff of this PeerInfo. + + + :param backoff: The backoff of this PeerInfo. # noqa: E501 + :type: float + """ + if backoff is None: + raise ValueError("Invalid value for `backoff`, must not be `None`") # noqa: E501 + + self._backoff = backoff + + @property + def heartbeats(self): + """Gets the heartbeats of this PeerInfo. # noqa: E501 + + + :return: The heartbeats of this PeerInfo. # noqa: E501 + :rtype: HeartbeatInfo + """ + return self._heartbeats + + @heartbeats.setter + def heartbeats(self, heartbeats): + """Sets the heartbeats of this PeerInfo. + + + :param heartbeats: The heartbeats of this PeerInfo. # noqa: E501 + :type: HeartbeatInfo + """ + if heartbeats is None: + raise ValueError("Invalid value for `heartbeats`, must not be `None`") # noqa: E501 + + self._heartbeats = heartbeats + + @property + def is_new(self): + """Gets the is_new of this PeerInfo. # noqa: E501 + + + :return: The is_new of this PeerInfo. # noqa: E501 + :rtype: bool + """ + return self._is_new + + @is_new.setter + def is_new(self, is_new): + """Sets the is_new of this PeerInfo. + + + :param is_new: The is_new of this PeerInfo. # noqa: E501 + :type: bool + """ + if is_new is None: + raise ValueError("Invalid value for `is_new`, must not be `None`") # noqa: E501 + + self._is_new = is_new + + @property + def last_seen(self): + """Gets the last_seen of this PeerInfo. # noqa: E501 + + + :return: The last_seen of this PeerInfo. # noqa: E501 + :rtype: int + """ + return self._last_seen + + @last_seen.setter + def last_seen(self, last_seen): + """Sets the last_seen of this PeerInfo. + + + :param last_seen: The last_seen of this PeerInfo. # noqa: E501 + :type: int + """ + if last_seen is None: + raise ValueError("Invalid value for `last_seen`, must not be `None`") # noqa: E501 + + self._last_seen = last_seen + + @property + def last_seen_latency(self): + """Gets the last_seen_latency of this PeerInfo. # noqa: E501 + + + :return: The last_seen_latency of this PeerInfo. # noqa: E501 + :rtype: int + """ + return self._last_seen_latency + + @last_seen_latency.setter + def last_seen_latency(self, last_seen_latency): + """Sets the last_seen_latency of this PeerInfo. + + + :param last_seen_latency: The last_seen_latency of this PeerInfo. # noqa: E501 + :type: int + """ + if last_seen_latency is None: + raise ValueError("Invalid value for `last_seen_latency`, must not be `None`") # noqa: E501 + + self._last_seen_latency = last_seen_latency + + @property + def multiaddr(self): + """Gets the multiaddr of this PeerInfo. # noqa: E501 + + + :return: The multiaddr of this PeerInfo. # noqa: E501 + :rtype: str + """ + return self._multiaddr + + @multiaddr.setter + def multiaddr(self, multiaddr): + """Sets the multiaddr of this PeerInfo. + + + :param multiaddr: The multiaddr of this PeerInfo. # noqa: E501 + :type: str + """ + + self._multiaddr = multiaddr + + @property + def peer_address(self): + """Gets the peer_address of this PeerInfo. # noqa: E501 + + + :return: The peer_address of this PeerInfo. # noqa: E501 + :rtype: str + """ + return self._peer_address + + @peer_address.setter + def peer_address(self, peer_address): + """Sets the peer_address of this PeerInfo. + + + :param peer_address: The peer_address of this PeerInfo. # noqa: E501 + :type: str + """ + + self._peer_address = peer_address + + @property + def peer_id(self): + """Gets the peer_id of this PeerInfo. # noqa: E501 + + + :return: The peer_id of this PeerInfo. # noqa: E501 + :rtype: str + """ + return self._peer_id + + @peer_id.setter + def peer_id(self, peer_id): + """Sets the peer_id of this PeerInfo. + + + :param peer_id: The peer_id of this PeerInfo. # noqa: E501 + :type: str + """ + if peer_id is None: + raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 + + self._peer_id = peer_id + + @property + def quality(self): + """Gets the quality of this PeerInfo. # noqa: E501 + + + :return: The quality of this PeerInfo. # noqa: E501 + :rtype: float + """ + return self._quality + + @quality.setter + def quality(self, quality): + """Sets the quality of this PeerInfo. + + + :param quality: The quality of this PeerInfo. # noqa: E501 + :type: float + """ + if quality is None: + raise ValueError("Invalid value for `quality`, must not be `None`") # noqa: E501 + + self._quality = quality + + @property + def reported_version(self): + """Gets the reported_version of this PeerInfo. # noqa: E501 + + + :return: The reported_version of this PeerInfo. # noqa: E501 + :rtype: str + """ + return self._reported_version + + @reported_version.setter + def reported_version(self, reported_version): + """Sets the reported_version of this PeerInfo. + + + :param reported_version: The reported_version of this PeerInfo. # noqa: E501 + :type: str + """ + if reported_version is None: + raise ValueError("Invalid value for `reported_version`, must not be `None`") # noqa: E501 + + self._reported_version = reported_version + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PeerInfo, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PeerInfo): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/hoprd_sdk/models/inline_response20011.py b/hoprd_sdk/models/ping_info.py similarity index 62% rename from hoprd_sdk/models/inline_response20011.py rename to hoprd_sdk/models/ping_info.py index e580c23..29824f1 100644 --- a/hoprd_sdk/models/inline_response20011.py +++ b/hoprd_sdk/models/ping_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse20011(object): +class PingInfo(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class InlineResponse20011(object): and the value is json key in definition. """ swagger_types = { - 'latency': 'float', + 'latency': 'int', 'reported_version': 'str' } @@ -38,58 +38,56 @@ class InlineResponse20011(object): } def __init__(self, latency=None, reported_version=None): # noqa: E501 - """InlineResponse20011 - a model defined in Swagger""" # noqa: E501 + """PingInfo - a model defined in Swagger""" # noqa: E501 self._latency = None self._reported_version = None self.discriminator = None - if latency is not None: - self.latency = latency - if reported_version is not None: - self.reported_version = reported_version + self.latency = latency + self.reported_version = reported_version @property def latency(self): - """Gets the latency of this InlineResponse20011. # noqa: E501 + """Gets the latency of this PingInfo. # noqa: E501 - Number of milliseconds it took to get the response from the pinged node. # noqa: E501 - :return: The latency of this InlineResponse20011. # noqa: E501 - :rtype: float + :return: The latency of this PingInfo. # noqa: E501 + :rtype: int """ return self._latency @latency.setter def latency(self, latency): - """Sets the latency of this InlineResponse20011. + """Sets the latency of this PingInfo. - Number of milliseconds it took to get the response from the pinged node. # noqa: E501 - :param latency: The latency of this InlineResponse20011. # noqa: E501 - :type: float + :param latency: The latency of this PingInfo. # noqa: E501 + :type: int """ + if latency is None: + raise ValueError("Invalid value for `latency`, must not be `None`") # noqa: E501 self._latency = latency @property def reported_version(self): - """Gets the reported_version of this InlineResponse20011. # noqa: E501 + """Gets the reported_version of this PingInfo. # noqa: E501 - HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" # noqa: E501 - :return: The reported_version of this InlineResponse20011. # noqa: E501 + :return: The reported_version of this PingInfo. # noqa: E501 :rtype: str """ return self._reported_version @reported_version.setter def reported_version(self, reported_version): - """Sets the reported_version of this InlineResponse20011. + """Sets the reported_version of this PingInfo. - HOPR protocol version as determined from the successful ping in the Major.Minor.Patch format or \"unknown\" # noqa: E501 - :param reported_version: The reported_version of this InlineResponse20011. # noqa: E501 + :param reported_version: The reported_version of this PingInfo. # noqa: E501 :type: str """ + if reported_version is None: + raise ValueError("Invalid value for `reported_version`, must not be `None`") # noqa: E501 self._reported_version = reported_version @@ -114,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse20011, dict): + if issubclass(PingInfo, dict): for key, value in self.items(): result[key] = value @@ -130,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse20011): + if not isinstance(other, PingInfo): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/messages_body.py b/hoprd_sdk/models/send_message_req.py similarity index 59% rename from hoprd_sdk/models/messages_body.py rename to hoprd_sdk/models/send_message_req.py index deb59d9..96da5c5 100644 --- a/hoprd_sdk/models/messages_body.py +++ b/hoprd_sdk/models/send_message_req.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class MessagesBody(object): +class SendMessageReq(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,77 +28,56 @@ class MessagesBody(object): and the value is json key in definition. """ swagger_types = { - 'tag': 'MessageTag', - 'body': 'MessageBody', - 'peer_id': 'str', + 'body': 'str', + 'hops': 'int', 'path': 'list[str]', - 'hops': 'int' + 'peer_id': 'str', + 'tag': 'int' } attribute_map = { - 'tag': 'tag', 'body': 'body', - 'peer_id': 'peerId', + 'hops': 'hops', 'path': 'path', - 'hops': 'hops' + 'peer_id': 'peerId', + 'tag': 'tag' } - def __init__(self, tag=None, body=None, peer_id=None, path=None, hops=None): # noqa: E501 - """MessagesBody - a model defined in Swagger""" # noqa: E501 - self._tag = None + def __init__(self, body=None, hops=None, path=None, peer_id=None, tag=None): # noqa: E501 + """SendMessageReq - a model defined in Swagger""" # noqa: E501 self._body = None - self._peer_id = None - self._path = None self._hops = None + self._path = None + self._peer_id = None + self._tag = None self.discriminator = None - self.tag = tag self.body = body - self.peer_id = peer_id - if path is not None: - self.path = path if hops is not None: self.hops = hops - - @property - def tag(self): - """Gets the tag of this MessagesBody. # noqa: E501 - - - :return: The tag of this MessagesBody. # noqa: E501 - :rtype: MessageTag - """ - return self._tag - - @tag.setter - def tag(self, tag): - """Sets the tag of this MessagesBody. - - - :param tag: The tag of this MessagesBody. # noqa: E501 - :type: MessageTag - """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - - self._tag = tag + if path is not None: + self.path = path + self.peer_id = peer_id + self.tag = tag @property def body(self): - """Gets the body of this MessagesBody. # noqa: E501 + """Gets the body of this SendMessageReq. # noqa: E501 + Message to be transmitted over the network # noqa: E501 - :return: The body of this MessagesBody. # noqa: E501 - :rtype: MessageBody + :return: The body of this SendMessageReq. # noqa: E501 + :rtype: str """ return self._body @body.setter def body(self, body): - """Sets the body of this MessagesBody. + """Sets the body of this SendMessageReq. + Message to be transmitted over the network # noqa: E501 - :param body: The body of this MessagesBody. # noqa: E501 - :type: MessageBody + :param body: The body of this SendMessageReq. # noqa: E501 + :type: str """ if body is None: raise ValueError("Invalid value for `body`, must not be `None`") # noqa: E501 @@ -106,75 +85,96 @@ def body(self, body): self._body = body @property - def peer_id(self): - """Gets the peer_id of this MessagesBody. # noqa: E501 + def hops(self): + """Gets the hops of this SendMessageReq. # noqa: E501 - The recipient HOPR peer id, to which the message is sent. # noqa: E501 - :return: The peer_id of this MessagesBody. # noqa: E501 - :rtype: str + :return: The hops of this SendMessageReq. # noqa: E501 + :rtype: int """ - return self._peer_id + return self._hops - @peer_id.setter - def peer_id(self, peer_id): - """Sets the peer_id of this MessagesBody. + @hops.setter + def hops(self, hops): + """Sets the hops of this SendMessageReq. - The recipient HOPR peer id, to which the message is sent. # noqa: E501 - :param peer_id: The peer_id of this MessagesBody. # noqa: E501 - :type: str + :param hops: The hops of this SendMessageReq. # noqa: E501 + :type: int """ - if peer_id is None: - raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 - self._peer_id = peer_id + self._hops = hops @property def path(self): - """Gets the path of this MessagesBody. # noqa: E501 + """Gets the path of this SendMessageReq. # noqa: E501 - The path is ordered list of peer ids through which the message should be sent. If no path is provided, a path which covers the nodes minimum required hops will be determined automatically. # noqa: E501 - :return: The path of this MessagesBody. # noqa: E501 + :return: The path of this SendMessageReq. # noqa: E501 :rtype: list[str] """ return self._path @path.setter def path(self, path): - """Sets the path of this MessagesBody. + """Sets the path of this SendMessageReq. - The path is ordered list of peer ids through which the message should be sent. If no path is provided, a path which covers the nodes minimum required hops will be determined automatically. # noqa: E501 - :param path: The path of this MessagesBody. # noqa: E501 + :param path: The path of this SendMessageReq. # noqa: E501 :type: list[str] """ self._path = path @property - def hops(self): - """Gets the hops of this MessagesBody. # noqa: E501 + def peer_id(self): + """Gets the peer_id of this SendMessageReq. # noqa: E501 + + The recipient HOPR PeerId # noqa: E501 + + :return: The peer_id of this SendMessageReq. # noqa: E501 + :rtype: str + """ + return self._peer_id + + @peer_id.setter + def peer_id(self, peer_id): + """Sets the peer_id of this SendMessageReq. - Number of required intermediate nodes. This parameter is ignored if path is set. # noqa: E501 + The recipient HOPR PeerId # noqa: E501 - :return: The hops of this MessagesBody. # noqa: E501 + :param peer_id: The peer_id of this SendMessageReq. # noqa: E501 + :type: str + """ + if peer_id is None: + raise ValueError("Invalid value for `peer_id`, must not be `None`") # noqa: E501 + + self._peer_id = peer_id + + @property + def tag(self): + """Gets the tag of this SendMessageReq. # noqa: E501 + + The message tag used to filter messages based on application # noqa: E501 + + :return: The tag of this SendMessageReq. # noqa: E501 :rtype: int """ - return self._hops + return self._tag - @hops.setter - def hops(self, hops): - """Sets the hops of this MessagesBody. + @tag.setter + def tag(self, tag): + """Sets the tag of this SendMessageReq. - Number of required intermediate nodes. This parameter is ignored if path is set. # noqa: E501 + The message tag used to filter messages based on application # noqa: E501 - :param hops: The hops of this MessagesBody. # noqa: E501 + :param tag: The tag of this SendMessageReq. # noqa: E501 :type: int """ + if tag is None: + raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - self._hops = hops + self._tag = tag def to_dict(self): """Returns the model properties as a dict""" @@ -197,7 +197,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(MessagesBody, dict): + if issubclass(SendMessageReq, dict): for key, value in self.items(): result[key] = value @@ -213,7 +213,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, MessagesBody): + if not isinstance(other, SendMessageReq): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/inline_response4221.py b/hoprd_sdk/models/send_message_res.py similarity index 55% rename from hoprd_sdk/models/inline_response4221.py rename to hoprd_sdk/models/send_message_res.py index b53061e..8efb99d 100644 --- a/hoprd_sdk/models/inline_response4221.py +++ b/hoprd_sdk/models/send_message_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse4221(object): +class SendMessageRes(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,66 +28,68 @@ class InlineResponse4221(object): and the value is json key in definition. """ swagger_types = { - 'status': 'str', - 'error': 'str' + 'challenge': 'str', + 'timestamp': 'int' } attribute_map = { - 'status': 'status', - 'error': 'error' + 'challenge': 'challenge', + 'timestamp': 'timestamp' } - def __init__(self, status=None, error=None): # noqa: E501 - """InlineResponse4221 - a model defined in Swagger""" # noqa: E501 - self._status = None - self._error = None + def __init__(self, challenge=None, timestamp=None): # noqa: E501 + """SendMessageRes - a model defined in Swagger""" # noqa: E501 + self._challenge = None + self._timestamp = None self.discriminator = None - if status is not None: - self.status = status - if error is not None: - self.error = error + self.challenge = challenge + self.timestamp = timestamp @property - def status(self): - """Gets the status of this InlineResponse4221. # noqa: E501 + def challenge(self): + """Gets the challenge of this SendMessageRes. # noqa: E501 - :return: The status of this InlineResponse4221. # noqa: E501 + :return: The challenge of this SendMessageRes. # noqa: E501 :rtype: str """ - return self._status + return self._challenge - @status.setter - def status(self, status): - """Sets the status of this InlineResponse4221. + @challenge.setter + def challenge(self, challenge): + """Sets the challenge of this SendMessageRes. - :param status: The status of this InlineResponse4221. # noqa: E501 + :param challenge: The challenge of this SendMessageRes. # noqa: E501 :type: str """ + if challenge is None: + raise ValueError("Invalid value for `challenge`, must not be `None`") # noqa: E501 - self._status = status + self._challenge = challenge @property - def error(self): - """Gets the error of this InlineResponse4221. # noqa: E501 + def timestamp(self): + """Gets the timestamp of this SendMessageRes. # noqa: E501 - :return: The error of this InlineResponse4221. # noqa: E501 - :rtype: str + :return: The timestamp of this SendMessageRes. # noqa: E501 + :rtype: int """ - return self._error + return self._timestamp - @error.setter - def error(self, error): - """Sets the error of this InlineResponse4221. + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this SendMessageRes. - :param error: The error of this InlineResponse4221. # noqa: E501 - :type: str + :param timestamp: The timestamp of this SendMessageRes. # noqa: E501 + :type: int """ + if timestamp is None: + raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - self._error = error + self._timestamp = timestamp def to_dict(self): """Returns the model properties as a dict""" @@ -110,7 +112,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse4221, dict): + if issubclass(SendMessageRes, dict): for key, value in self.items(): result[key] = value @@ -126,7 +128,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse4221): + if not isinstance(other, SendMessageRes): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/settings.py b/hoprd_sdk/models/settings.py deleted file mode 100644 index 7152890..0000000 --- a/hoprd_sdk/models/settings.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Settings(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'include_recipient': 'bool', - 'strategy': 'str' - } - - attribute_map = { - 'include_recipient': 'includeRecipient', - 'strategy': 'strategy' - } - - def __init__(self, include_recipient=None, strategy=None): # noqa: E501 - """Settings - a model defined in Swagger""" # noqa: E501 - self._include_recipient = None - self._strategy = None - self.discriminator = None - if include_recipient is not None: - self.include_recipient = include_recipient - if strategy is not None: - self.strategy = strategy - - @property - def include_recipient(self): - """Gets the include_recipient of this Settings. # noqa: E501 - - Prepends your address to all messages so that receiver of the message can know that you sent that message. # noqa: E501 - - :return: The include_recipient of this Settings. # noqa: E501 - :rtype: bool - """ - return self._include_recipient - - @include_recipient.setter - def include_recipient(self, include_recipient): - """Sets the include_recipient of this Settings. - - Prepends your address to all messages so that receiver of the message can know that you sent that message. # noqa: E501 - - :param include_recipient: The include_recipient of this Settings. # noqa: E501 - :type: bool - """ - - self._include_recipient = include_recipient - - @property - def strategy(self): - """Gets the strategy of this Settings. # noqa: E501 - - By default, hoprd runs in **passive** mode, this means that your node will not attempt to open or close any channels automatically. When you set your strategy to **promiscuous** mode, your node will attempt to open channels to a _randomly_ selected group of nodes which you have a healthy connection to. At the same time, your node will also attempt to close channels that are running low on balance or are unhealthy. # noqa: E501 - - :return: The strategy of this Settings. # noqa: E501 - :rtype: str - """ - return self._strategy - - @strategy.setter - def strategy(self, strategy): - """Sets the strategy of this Settings. - - By default, hoprd runs in **passive** mode, this means that your node will not attempt to open or close any channels automatically. When you set your strategy to **promiscuous** mode, your node will attempt to open channels to a _randomly_ selected group of nodes which you have a healthy connection to. At the same time, your node will also attempt to close channels that are running low on balance or are unhealthy. # noqa: E501 - - :param strategy: The strategy of this Settings. # noqa: E501 - :type: str - """ - allowed_values = ["passive", "promiscuous"] # noqa: E501 - if strategy not in allowed_values: - raise ValueError( - "Invalid value for `strategy` ({0}), must be one of {1}" # noqa: E501 - .format(strategy, allowed_values) - ) - - self._strategy = strategy - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Settings, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Settings): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/settings_setting_body.py b/hoprd_sdk/models/settings_setting_body.py deleted file mode 100644 index 08034b0..0000000 --- a/hoprd_sdk/models/settings_setting_body.py +++ /dev/null @@ -1,111 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class SettingsSettingBody(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'setting_value': 'object' - } - - attribute_map = { - 'setting_value': 'settingValue' - } - - def __init__(self, setting_value=None): # noqa: E501 - """SettingsSettingBody - a model defined in Swagger""" # noqa: E501 - self._setting_value = None - self.discriminator = None - self.setting_value = setting_value - - @property - def setting_value(self): - """Gets the setting_value of this SettingsSettingBody. # noqa: E501 - - - :return: The setting_value of this SettingsSettingBody. # noqa: E501 - :rtype: object - """ - return self._setting_value - - @setting_value.setter - def setting_value(self, setting_value): - """Sets the setting_value of this SettingsSettingBody. - - - :param setting_value: The setting_value of this SettingsSettingBody. # noqa: E501 - :type: object - """ - if setting_value is None: - raise ValueError("Invalid value for `setting_value`, must not be `None`") # noqa: E501 - - self._setting_value = setting_value - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(SettingsSettingBody, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, SettingsSettingBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/signature.py b/hoprd_sdk/models/signature.py deleted file mode 100644 index 8129ae9..0000000 --- a/hoprd_sdk/models/signature.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Signature(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """Signature - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Signature, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Signature): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2004.py b/hoprd_sdk/models/size.py similarity index 77% rename from hoprd_sdk/models/inline_response2004.py rename to hoprd_sdk/models/size.py index 1eafd26..73d42f4 100644 --- a/hoprd_sdk/models/inline_response2004.py +++ b/hoprd_sdk/models/size.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2004(object): +class Size(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -36,30 +36,31 @@ class InlineResponse2004(object): } def __init__(self, size=None): # noqa: E501 - """InlineResponse2004 - a model defined in Swagger""" # noqa: E501 + """Size - a model defined in Swagger""" # noqa: E501 self._size = None self.discriminator = None - if size is not None: - self.size = size + self.size = size @property def size(self): - """Gets the size of this InlineResponse2004. # noqa: E501 + """Gets the size of this Size. # noqa: E501 - :return: The size of this InlineResponse2004. # noqa: E501 + :return: The size of this Size. # noqa: E501 :rtype: int """ return self._size @size.setter def size(self, size): - """Sets the size of this InlineResponse2004. + """Sets the size of this Size. - :param size: The size of this InlineResponse2004. # noqa: E501 + :param size: The size of this Size. # noqa: E501 :type: int """ + if size is None: + raise ValueError("Invalid value for `size`, must not be `None`") # noqa: E501 self._size = size @@ -84,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2004, dict): + if issubclass(Size, dict): for key, value in self.items(): result[key] = value @@ -100,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2004): + if not isinstance(other, Size): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/messages_pop_body.py b/hoprd_sdk/models/tag_query.py similarity index 74% rename from hoprd_sdk/models/messages_pop_body.py rename to hoprd_sdk/models/tag_query.py index 9aea261..8ca6430 100644 --- a/hoprd_sdk/models/messages_pop_body.py +++ b/hoprd_sdk/models/tag_query.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class MessagesPopBody(object): +class TagQuery(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class MessagesPopBody(object): and the value is json key in definition. """ swagger_types = { - 'tag': 'MessageTag' + 'tag': 'int' } attribute_map = { @@ -36,31 +36,30 @@ class MessagesPopBody(object): } def __init__(self, tag=None): # noqa: E501 - """MessagesPopBody - a model defined in Swagger""" # noqa: E501 + """TagQuery - a model defined in Swagger""" # noqa: E501 self._tag = None self.discriminator = None - self.tag = tag + if tag is not None: + self.tag = tag @property def tag(self): - """Gets the tag of this MessagesPopBody. # noqa: E501 + """Gets the tag of this TagQuery. # noqa: E501 - :return: The tag of this MessagesPopBody. # noqa: E501 - :rtype: MessageTag + :return: The tag of this TagQuery. # noqa: E501 + :rtype: int """ return self._tag @tag.setter def tag(self, tag): - """Sets the tag of this MessagesPopBody. + """Sets the tag of this TagQuery. - :param tag: The tag of this MessagesPopBody. # noqa: E501 - :type: MessageTag + :param tag: The tag of this TagQuery. # noqa: E501 + :type: int """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 self._tag = tag @@ -85,7 +84,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(MessagesPopBody, dict): + if issubclass(TagQuery, dict): for key, value in self.items(): result[key] = value @@ -101,7 +100,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, MessagesPopBody): + if not isinstance(other, TagQuery): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/ticket.py b/hoprd_sdk/models/ticket.py deleted file mode 100644 index ad1e671..0000000 --- a/hoprd_sdk/models/ticket.py +++ /dev/null @@ -1,276 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Ticket(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'channel_id': 'ChannelId', - 'amount': 'str', - 'index': 'str', - 'index_offset': 'str', - 'channel_epoch': 'str', - 'win_prob': 'str', - 'signature': 'Signature' - } - - attribute_map = { - 'channel_id': 'channelId', - 'amount': 'amount', - 'index': 'index', - 'index_offset': 'indexOffset', - 'channel_epoch': 'channelEpoch', - 'win_prob': 'winProb', - 'signature': 'signature' - } - - def __init__(self, channel_id=None, amount=None, index=None, index_offset=None, channel_epoch=None, win_prob=None, signature=None): # noqa: E501 - """Ticket - a model defined in Swagger""" # noqa: E501 - self._channel_id = None - self._amount = None - self._index = None - self._index_offset = None - self._channel_epoch = None - self._win_prob = None - self._signature = None - self.discriminator = None - if channel_id is not None: - self.channel_id = channel_id - if amount is not None: - self.amount = amount - if index is not None: - self.index = index - if index_offset is not None: - self.index_offset = index_offset - if channel_epoch is not None: - self.channel_epoch = channel_epoch - if win_prob is not None: - self.win_prob = win_prob - if signature is not None: - self.signature = signature - - @property - def channel_id(self): - """Gets the channel_id of this Ticket. # noqa: E501 - - - :return: The channel_id of this Ticket. # noqa: E501 - :rtype: ChannelId - """ - return self._channel_id - - @channel_id.setter - def channel_id(self, channel_id): - """Sets the channel_id of this Ticket. - - - :param channel_id: The channel_id of this Ticket. # noqa: E501 - :type: ChannelId - """ - - self._channel_id = channel_id - - @property - def amount(self): - """Gets the amount of this Ticket. # noqa: E501 - - The ticket's value in HOPR. Only relevant if ticket is a win. # noqa: E501 - - :return: The amount of this Ticket. # noqa: E501 - :rtype: str - """ - return self._amount - - @amount.setter - def amount(self, amount): - """Sets the amount of this Ticket. - - The ticket's value in HOPR. Only relevant if ticket is a win. # noqa: E501 - - :param amount: The amount of this Ticket. # noqa: E501 - :type: str - """ - - self._amount = amount - - @property - def index(self): - """Gets the index of this Ticket. # noqa: E501 - - Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. # noqa: E501 - - :return: The index of this Ticket. # noqa: E501 - :rtype: str - """ - return self._index - - @index.setter - def index(self, index): - """Sets the index of this Ticket. - - Each ticket is labeled by an ongoing serial number named ticket index i and its current value is stored in the smart contract. # noqa: E501 - - :param index: The index of this Ticket. # noqa: E501 - :type: str - """ - - self._index = index - - @property - def index_offset(self): - """Gets the index_offset of this Ticket. # noqa: E501 - - Offset by which the on-chain stored ticket index gets increased when redeeming the ticket. Used to aggregate tickets. # noqa: E501 - - :return: The index_offset of this Ticket. # noqa: E501 - :rtype: str - """ - return self._index_offset - - @index_offset.setter - def index_offset(self, index_offset): - """Sets the index_offset of this Ticket. - - Offset by which the on-chain stored ticket index gets increased when redeeming the ticket. Used to aggregate tickets. # noqa: E501 - - :param index_offset: The index_offset of this Ticket. # noqa: E501 - :type: str - """ - - self._index_offset = index_offset - - @property - def channel_epoch(self): - """Gets the channel_epoch of this Ticket. # noqa: E501 - - Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. # noqa: E501 - - :return: The channel_epoch of this Ticket. # noqa: E501 - :rtype: str - """ - return self._channel_epoch - - @channel_epoch.setter - def channel_epoch(self, channel_epoch): - """Sets the channel_epoch of this Ticket. - - Payment channels might run through multiple open and close sequences, this epoch tracks the sequence. # noqa: E501 - - :param channel_epoch: The channel_epoch of this Ticket. # noqa: E501 - :type: str - """ - - self._channel_epoch = channel_epoch - - @property - def win_prob(self): - """Gets the win_prob of this Ticket. # noqa: E501 - - The ticket's winning probability, going from 0.0 to 1.0 where 0.0 ~= 0% winning probability and 1.0 equals 100% winning probability. # noqa: E501 - - :return: The win_prob of this Ticket. # noqa: E501 - :rtype: str - """ - return self._win_prob - - @win_prob.setter - def win_prob(self, win_prob): - """Sets the win_prob of this Ticket. - - The ticket's winning probability, going from 0.0 to 1.0 where 0.0 ~= 0% winning probability and 1.0 equals 100% winning probability. # noqa: E501 - - :param win_prob: The win_prob of this Ticket. # noqa: E501 - :type: str - """ - - self._win_prob = win_prob - - @property - def signature(self): - """Gets the signature of this Ticket. # noqa: E501 - - - :return: The signature of this Ticket. # noqa: E501 - :rtype: Signature - """ - return self._signature - - @signature.setter - def signature(self, signature): - """Sets the signature of this Ticket. - - - :param signature: The signature of this Ticket. # noqa: E501 - :type: Signature - """ - - self._signature = signature - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Ticket, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Ticket): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/inline_response2001.py b/hoprd_sdk/models/ticket_price_response.py similarity index 73% rename from hoprd_sdk/models/inline_response2001.py rename to hoprd_sdk/models/ticket_price_response.py index e80911d..d6264ac 100644 --- a/hoprd_sdk/models/inline_response2001.py +++ b/hoprd_sdk/models/ticket_price_response.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class InlineResponse2001(object): +class TicketPriceResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class InlineResponse2001(object): and the value is json key in definition. """ swagger_types = { - 'price': 'float' + 'price': 'str' } attribute_map = { @@ -36,32 +36,31 @@ class InlineResponse2001(object): } def __init__(self, price=None): # noqa: E501 - """InlineResponse2001 - a model defined in Swagger""" # noqa: E501 + """TicketPriceResponse - a model defined in Swagger""" # noqa: E501 self._price = None self.discriminator = None - if price is not None: - self.price = price + self.price = price @property def price(self): - """Gets the price of this InlineResponse2001. # noqa: E501 + """Gets the price of this TicketPriceResponse. # noqa: E501 - Latest ticket price update. # noqa: E501 - :return: The price of this InlineResponse2001. # noqa: E501 - :rtype: float + :return: The price of this TicketPriceResponse. # noqa: E501 + :rtype: str """ return self._price @price.setter def price(self, price): - """Sets the price of this InlineResponse2001. + """Sets the price of this TicketPriceResponse. - Latest ticket price update. # noqa: E501 - :param price: The price of this InlineResponse2001. # noqa: E501 - :type: float + :param price: The price of this TicketPriceResponse. # noqa: E501 + :type: str """ + if price is None: + raise ValueError("Invalid value for `price`, must not be `None`") # noqa: E501 self._price = price @@ -86,7 +85,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(InlineResponse2001, dict): + if issubclass(TicketPriceResponse, dict): for key, value in self.items(): result[key] = value @@ -102,7 +101,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, InlineResponse2001): + if not isinstance(other, TicketPriceResponse): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/models/token.py b/hoprd_sdk/models/token.py deleted file mode 100644 index a656e54..0000000 --- a/hoprd_sdk/models/token.py +++ /dev/null @@ -1,198 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class Token(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'description': 'str', - 'valid_until': 'int', - 'capabilities': 'list[TokenCapability]' - } - - attribute_map = { - 'id': 'id', - 'description': 'description', - 'valid_until': 'valid_until', - 'capabilities': 'capabilities' - } - - def __init__(self, id=None, description=None, valid_until=None, capabilities=None): # noqa: E501 - """Token - a model defined in Swagger""" # noqa: E501 - self._id = None - self._description = None - self._valid_until = None - self._capabilities = None - self.discriminator = None - self.id = id - if description is not None: - self.description = description - if valid_until is not None: - self.valid_until = valid_until - self.capabilities = capabilities - - @property - def id(self): - """Gets the id of this Token. # noqa: E501 - - Unique ID of the token # noqa: E501 - - :return: The id of this Token. # noqa: E501 - :rtype: str - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Token. - - Unique ID of the token # noqa: E501 - - :param id: The id of this Token. # noqa: E501 - :type: str - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def description(self): - """Gets the description of this Token. # noqa: E501 - - Some description for the token # noqa: E501 - - :return: The description of this Token. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this Token. - - Some description for the token # noqa: E501 - - :param description: The description of this Token. # noqa: E501 - :type: str - """ - - self._description = description - - @property - def valid_until(self): - """Gets the valid_until of this Token. # noqa: E501 - - Seconds since epoch until the token is valid # noqa: E501 - - :return: The valid_until of this Token. # noqa: E501 - :rtype: int - """ - return self._valid_until - - @valid_until.setter - def valid_until(self, valid_until): - """Sets the valid_until of this Token. - - Seconds since epoch until the token is valid # noqa: E501 - - :param valid_until: The valid_until of this Token. # noqa: E501 - :type: int - """ - - self._valid_until = valid_until - - @property - def capabilities(self): - """Gets the capabilities of this Token. # noqa: E501 - - Array of capabilities associated with the token # noqa: E501 - - :return: The capabilities of this Token. # noqa: E501 - :rtype: list[TokenCapability] - """ - return self._capabilities - - @capabilities.setter - def capabilities(self, capabilities): - """Sets the capabilities of this Token. - - Array of capabilities associated with the token # noqa: E501 - - :param capabilities: The capabilities of this Token. # noqa: E501 - :type: list[TokenCapability] - """ - if capabilities is None: - raise ValueError("Invalid value for `capabilities`, must not be `None`") # noqa: E501 - - self._capabilities = capabilities - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(Token, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Token): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/token_capability.py b/hoprd_sdk/models/token_capability.py deleted file mode 100644 index f292573..0000000 --- a/hoprd_sdk/models/token_capability.py +++ /dev/null @@ -1,145 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class TokenCapability(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'endpoint': 'str', - 'limits': 'list[TokenCapabilityLimit]' - } - - attribute_map = { - 'endpoint': 'endpoint', - 'limits': 'limits' - } - - def __init__(self, endpoint=None, limits=None): # noqa: E501 - """TokenCapability - a model defined in Swagger""" # noqa: E501 - self._endpoint = None - self._limits = None - self.discriminator = None - self.endpoint = endpoint - if limits is not None: - self.limits = limits - - @property - def endpoint(self): - """Gets the endpoint of this TokenCapability. # noqa: E501 - - Short reference of the operation this capability is tied to. # noqa: E501 - - :return: The endpoint of this TokenCapability. # noqa: E501 - :rtype: str - """ - return self._endpoint - - @endpoint.setter - def endpoint(self, endpoint): - """Sets the endpoint of this TokenCapability. - - Short reference of the operation this capability is tied to. # noqa: E501 - - :param endpoint: The endpoint of this TokenCapability. # noqa: E501 - :type: str - """ - if endpoint is None: - raise ValueError("Invalid value for `endpoint`, must not be `None`") # noqa: E501 - allowed_values = ["tokensCreate", "tokensGetToken", "ticketsGetStatistics", "ticketsRedeemTickets", "ticketsGetTickets", "settingsGetSettings", "nodeGetVersion", "nodeGetPeers", "nodeGetMetrics", "nodeGetInfo", "nodeGetEntryNodes", "messagesWebsocket", "messagesGetSize", "messagesPopAllMessage", "messagesPopMessage", "messagesSendMessage", "messagesDeleteMessages", "channelsOpenChannel", "channelsGetChannels", "aliasesSetAlias", "aliasesGetAliases", "accountWithdraw", "accountGetBalances", "accountGetAddresses", "accountGetAddress", "tokensDelete", "settingsSetSetting", "peersPingPeer", "peerInfoGetPeerInfo", "channelsRedeemTickets", "channelsGetTickets", "channelsGetChannel", "channelsCloseChannel", "aliasesGetAlias", "aliasesRemoveAlias", "nodeStreamWebsocket", "nodePing", "messagesSign", "messageSign", "channelsFundChannels"] # noqa: E501 - if endpoint not in allowed_values: - raise ValueError( - "Invalid value for `endpoint` ({0}), must be one of {1}" # noqa: E501 - .format(endpoint, allowed_values) - ) - - self._endpoint = endpoint - - @property - def limits(self): - """Gets the limits of this TokenCapability. # noqa: E501 - - - :return: The limits of this TokenCapability. # noqa: E501 - :rtype: list[TokenCapabilityLimit] - """ - return self._limits - - @limits.setter - def limits(self, limits): - """Sets the limits of this TokenCapability. - - - :param limits: The limits of this TokenCapability. # noqa: E501 - :type: list[TokenCapabilityLimit] - """ - - self._limits = limits - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TokenCapability, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TokenCapability): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/token_capability_limit_conditions.py b/hoprd_sdk/models/token_capability_limit_conditions.py deleted file mode 100644 index 7db2704..0000000 --- a/hoprd_sdk/models/token_capability_limit_conditions.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class TokenCapabilityLimitConditions(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'max': 'int' - } - - attribute_map = { - 'max': 'max' - } - - def __init__(self, max=None): # noqa: E501 - """TokenCapabilityLimitConditions - a model defined in Swagger""" # noqa: E501 - self._max = None - self.discriminator = None - if max is not None: - self.max = max - - @property - def max(self): - """Gets the max of this TokenCapabilityLimitConditions. # noqa: E501 - - Upper ceiling. Applies to limit type calls. # noqa: E501 - - :return: The max of this TokenCapabilityLimitConditions. # noqa: E501 - :rtype: int - """ - return self._max - - @max.setter - def max(self, max): - """Sets the max of this TokenCapabilityLimitConditions. - - Upper ceiling. Applies to limit type calls. # noqa: E501 - - :param max: The max of this TokenCapabilityLimitConditions. # noqa: E501 - :type: int - """ - - self._max = max - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TokenCapabilityLimitConditions, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TokenCapabilityLimitConditions): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/tokens_body.py b/hoprd_sdk/models/tokens_body.py deleted file mode 100644 index 20be66e..0000000 --- a/hoprd_sdk/models/tokens_body.py +++ /dev/null @@ -1,169 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class TokensBody(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'capabilities': 'list[TokenCapability]', - 'lifetime': 'int', - 'description': 'str' - } - - attribute_map = { - 'capabilities': 'capabilities', - 'lifetime': 'lifetime', - 'description': 'description' - } - - def __init__(self, capabilities=None, lifetime=None, description=None): # noqa: E501 - """TokensBody - a model defined in Swagger""" # noqa: E501 - self._capabilities = None - self._lifetime = None - self._description = None - self.discriminator = None - self.capabilities = capabilities - if lifetime is not None: - self.lifetime = lifetime - if description is not None: - self.description = description - - @property - def capabilities(self): - """Gets the capabilities of this TokensBody. # noqa: E501 - - Capabilities attached to the created token. # noqa: E501 - - :return: The capabilities of this TokensBody. # noqa: E501 - :rtype: list[TokenCapability] - """ - return self._capabilities - - @capabilities.setter - def capabilities(self, capabilities): - """Sets the capabilities of this TokensBody. - - Capabilities attached to the created token. # noqa: E501 - - :param capabilities: The capabilities of this TokensBody. # noqa: E501 - :type: list[TokenCapability] - """ - if capabilities is None: - raise ValueError("Invalid value for `capabilities`, must not be `None`") # noqa: E501 - - self._capabilities = capabilities - - @property - def lifetime(self): - """Gets the lifetime of this TokensBody. # noqa: E501 - - Lifetime of the token in seconds since creation. Defaults to unlimited lifetime. # noqa: E501 - - :return: The lifetime of this TokensBody. # noqa: E501 - :rtype: int - """ - return self._lifetime - - @lifetime.setter - def lifetime(self, lifetime): - """Sets the lifetime of this TokensBody. - - Lifetime of the token in seconds since creation. Defaults to unlimited lifetime. # noqa: E501 - - :param lifetime: The lifetime of this TokensBody. # noqa: E501 - :type: int - """ - - self._lifetime = lifetime - - @property - def description(self): - """Gets the description of this TokensBody. # noqa: E501 - - Description associated with the token. # noqa: E501 - - :return: The description of this TokensBody. # noqa: E501 - :rtype: str - """ - return self._description - - @description.setter - def description(self, description): - """Sets the description of this TokensBody. - - Description associated with the token. # noqa: E501 - - :param description: The description of this TokensBody. # noqa: E501 - :type: str - """ - - self._description = description - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TokensBody, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TokensBody): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/transaction_receipt.py b/hoprd_sdk/models/transaction_receipt.py deleted file mode 100644 index ba07ee1..0000000 --- a/hoprd_sdk/models/transaction_receipt.py +++ /dev/null @@ -1,84 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import pprint -import re # noqa: F401 - -import six - -class TransactionReceipt(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """TransactionReceipt - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - if issubclass(TransactionReceipt, dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, TransactionReceipt): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/hoprd_sdk/models/account_withdraw_body.py b/hoprd_sdk/models/withdraw_request.py similarity index 57% rename from hoprd_sdk/models/account_withdraw_body.py rename to hoprd_sdk/models/withdraw_request.py index 7da379e..9a93d40 100644 --- a/hoprd_sdk/models/account_withdraw_body.py +++ b/hoprd_sdk/models/withdraw_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,7 +15,7 @@ import six -class AccountWithdrawBody(object): +class WithdrawRequest(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,69 +28,67 @@ class AccountWithdrawBody(object): and the value is json key in definition. """ swagger_types = { - 'currency': 'Currency', - 'amount': 'str', - 'ethereum_address': 'NativeAddress' + 'address': 'str', + 'amount': 'int', + 'currency': 'str' } attribute_map = { - 'currency': 'currency', + 'address': 'address', 'amount': 'amount', - 'ethereum_address': 'ethereumAddress' + 'currency': 'currency' } - def __init__(self, currency=None, amount=None, ethereum_address=None): # noqa: E501 - """AccountWithdrawBody - a model defined in Swagger""" # noqa: E501 - self._currency = None + def __init__(self, address=None, amount=None, currency=None): # noqa: E501 + """WithdrawRequest - a model defined in Swagger""" # noqa: E501 + self._address = None self._amount = None - self._ethereum_address = None + self._currency = None self.discriminator = None - self.currency = currency + self.address = address self.amount = amount - self.ethereum_address = ethereum_address + self.currency = currency @property - def currency(self): - """Gets the currency of this AccountWithdrawBody. # noqa: E501 + def address(self): + """Gets the address of this WithdrawRequest. # noqa: E501 - :return: The currency of this AccountWithdrawBody. # noqa: E501 - :rtype: Currency + :return: The address of this WithdrawRequest. # noqa: E501 + :rtype: str """ - return self._currency + return self._address - @currency.setter - def currency(self, currency): - """Sets the currency of this AccountWithdrawBody. + @address.setter + def address(self, address): + """Sets the address of this WithdrawRequest. - :param currency: The currency of this AccountWithdrawBody. # noqa: E501 - :type: Currency + :param address: The address of this WithdrawRequest. # noqa: E501 + :type: str """ - if currency is None: - raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + if address is None: + raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 - self._currency = currency + self._address = address @property def amount(self): - """Gets the amount of this AccountWithdrawBody. # noqa: E501 + """Gets the amount of this WithdrawRequest. # noqa: E501 - Amount to withdraw in the currency's smallest unit. # noqa: E501 - :return: The amount of this AccountWithdrawBody. # noqa: E501 - :rtype: str + :return: The amount of this WithdrawRequest. # noqa: E501 + :rtype: int """ return self._amount @amount.setter def amount(self, amount): - """Sets the amount of this AccountWithdrawBody. + """Sets the amount of this WithdrawRequest. - Amount to withdraw in the currency's smallest unit. # noqa: E501 - :param amount: The amount of this AccountWithdrawBody. # noqa: E501 - :type: str + :param amount: The amount of this WithdrawRequest. # noqa: E501 + :type: int """ if amount is None: raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 @@ -98,27 +96,27 @@ def amount(self, amount): self._amount = amount @property - def ethereum_address(self): - """Gets the ethereum_address of this AccountWithdrawBody. # noqa: E501 + def currency(self): + """Gets the currency of this WithdrawRequest. # noqa: E501 - :return: The ethereum_address of this AccountWithdrawBody. # noqa: E501 - :rtype: NativeAddress + :return: The currency of this WithdrawRequest. # noqa: E501 + :rtype: str """ - return self._ethereum_address + return self._currency - @ethereum_address.setter - def ethereum_address(self, ethereum_address): - """Sets the ethereum_address of this AccountWithdrawBody. + @currency.setter + def currency(self, currency): + """Sets the currency of this WithdrawRequest. - :param ethereum_address: The ethereum_address of this AccountWithdrawBody. # noqa: E501 - :type: NativeAddress + :param currency: The currency of this WithdrawRequest. # noqa: E501 + :type: str """ - if ethereum_address is None: - raise ValueError("Invalid value for `ethereum_address`, must not be `None`") # noqa: E501 + if currency is None: + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 - self._ethereum_address = ethereum_address + self._currency = currency def to_dict(self): """Returns the model properties as a dict""" @@ -141,7 +139,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(AccountWithdrawBody, dict): + if issubclass(WithdrawRequest, dict): for key, value in self.items(): result[key] = value @@ -157,7 +155,7 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, AccountWithdrawBody): + if not isinstance(other, WithdrawRequest): return False return self.__dict__ == other.__dict__ diff --git a/hoprd_sdk/rest.py b/hoprd_sdk/rest.py index 979d587..f669cbf 100644 --- a/hoprd_sdk/rest.py +++ b/hoprd_sdk/rest.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ diff --git a/setup.py b/setup.py index 97d2768..a49a281 100644 --- a/setup.py +++ b/setup.py @@ -1,19 +1,19 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ -from setuptools import find_packages, setup # noqa: H301 +from setuptools import setup, find_packages # noqa: H301 NAME = "hoprd-sdk" -VERSION = "2.0.5" +VERSION = "2.0.0-rc.1" # To install the library, run the following # # python setup.py install @@ -26,14 +26,14 @@ setup( name=NAME, version=VERSION, - description="HOPRd Rest API v3", + description="hoprd-api", author_email="tech@hoprnet.org", url="https://github.com/hoprnet/hoprd-sdk-python", - keywords=["Swagger", "HOPRd Rest API v3"], + keywords=["Swagger", "hoprd-api"], install_requires=REQUIRES, packages=find_packages(), include_package_data=True, long_description="""\ - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 """ ) diff --git a/test/test_multi_address.py b/test/test_account_addresses.py similarity index 50% rename from test/test_multi_address.py rename to test/test_account_addresses.py index d350bfd..51a3282 100644 --- a/test/test_multi_address.py +++ b/test/test_account_addresses.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.multi_address import MultiAddress # noqa: E501 +from hoprd_sdk.models.account_addresses import AccountAddresses # noqa: E501 from hoprd_sdk.rest import ApiException -class TestMultiAddress(unittest.TestCase): - """MultiAddress unit test stubs""" +class TestAccountAddresses(unittest.TestCase): + """AccountAddresses unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testMultiAddress(self): - """Test MultiAddress""" + def testAccountAddresses(self): + """Test AccountAddresses""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.multi_address.MultiAddress() # noqa: E501 + # model = hoprd_sdk.models.account_addresses.AccountAddresses() # noqa: E501 pass diff --git a/test/test_account_api.py b/test/test_account_api.py index ac6330f..625431d 100644 --- a/test/test_account_api.py +++ b/test/test_account_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,27 +28,24 @@ def setUp(self): def tearDown(self): pass - def test_account_get_address(self): - """Test case for account_get_address + def test_addresses(self): + """Test case for addresses + Get node's HOPR and native addresses. # noqa: E501 """ pass - def test_account_get_addresses(self): - """Test case for account_get_addresses + def test_balances(self): + """Test case for balances + Get node's and associated Safe's HOPR and native balances as the allowance for HOPR # noqa: E501 """ pass - def test_account_get_balances(self): - """Test case for account_get_balances - - """ - pass - - def test_account_withdraw(self): - """Test case for account_withdraw + def test_withdraw(self): + """Test case for withdraw + Withdraw funds from this node to the ethereum wallet address. # noqa: E501 """ pass diff --git a/test/test_message_body.py b/test/test_account_balances.py similarity index 50% rename from test/test_message_body.py rename to test/test_account_balances.py index 910e059..91f4532 100644 --- a/test/test_message_body.py +++ b/test/test_account_balances.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.message_body import MessageBody # noqa: E501 +from hoprd_sdk.models.account_balances import AccountBalances # noqa: E501 from hoprd_sdk.rest import ApiException -class TestMessageBody(unittest.TestCase): - """MessageBody unit test stubs""" +class TestAccountBalances(unittest.TestCase): + """AccountBalances unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testMessageBody(self): - """Test MessageBody""" + def testAccountBalances(self): + """Test AccountBalances""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.message_body.MessageBody() # noqa: E501 + # model = hoprd_sdk.models.account_balances.AccountBalances() # noqa: E501 pass diff --git a/test/test_account_withdraw_body.py b/test/test_account_withdraw_body.py deleted file mode 100644 index 77909e9..0000000 --- a/test/test_account_withdraw_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.account_withdraw_body import AccountWithdrawBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestAccountWithdrawBody(unittest.TestCase): - """AccountWithdrawBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAccountWithdrawBody(self): - """Test AccountWithdrawBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.account_withdraw_body.AccountWithdrawBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_alias_api.py b/test/test_alias_api.py new file mode 100644 index 0000000..7c9b5c9 --- /dev/null +++ b/test/test_alias_api.py @@ -0,0 +1,61 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.api.alias_api import AliasApi # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestAliasApi(unittest.TestCase): + """AliasApi unit test stubs""" + + def setUp(self): + self.api = AliasApi() # noqa: E501 + + def tearDown(self): + pass + + def test_aliases(self): + """Test case for aliases + + Get each previously set alias and its corresponding PeerId # noqa: E501 + """ + pass + + def test_delete_alias(self): + """Test case for delete_alias + + Delete an alias. # noqa: E501 + """ + pass + + def test_get_alias(self): + """Test case for get_alias + + Get alias for the PeerId (Hopr address) that have this alias assigned to it. # noqa: E501 + """ + pass + + def test_set_alias(self): + """Test case for set_alias + + Set alias for a peer with a specific PeerId. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_alias_peer_id.py b/test/test_alias_peer_id.py new file mode 100644 index 0000000..a30fe5e --- /dev/null +++ b/test/test_alias_peer_id.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.alias_peer_id import AliasPeerId # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestAliasPeerId(unittest.TestCase): + """AliasPeerId unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testAliasPeerId(self): + """Test AliasPeerId""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.alias_peer_id.AliasPeerId() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_aliases_api.py b/test/test_aliases_api.py deleted file mode 100644 index 508729f..0000000 --- a/test/test_aliases_api.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.aliases_api import AliasesApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestAliasesApi(unittest.TestCase): - """AliasesApi unit test stubs""" - - def setUp(self): - self.api = AliasesApi() # noqa: E501 - - def tearDown(self): - pass - - def test_aliases_get_alias(self): - """Test case for aliases_get_alias - - """ - pass - - def test_aliases_get_aliases(self): - """Test case for aliases_get_aliases - - """ - pass - - def test_aliases_remove_alias(self): - """Test case for aliases_remove_alias - - """ - pass - - def test_aliases_set_alias(self): - """Test case for aliases_set_alias - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_channel.py b/test/test_api_error.py similarity index 52% rename from test/test_channel.py rename to test/test_api_error.py index ca003e0..2ca7672 100644 --- a/test/test_channel.py +++ b/test/test_api_error.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.channel import Channel # noqa: E501 +from hoprd_sdk.models.api_error import ApiError # noqa: E501 from hoprd_sdk.rest import ApiException -class TestChannel(unittest.TestCase): - """Channel unit test stubs""" +class TestApiError(unittest.TestCase): + """ApiError unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testChannel(self): - """Test Channel""" + def testApiError(self): + """Test ApiError""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channel.Channel() # noqa: E501 + # model = hoprd_sdk.models.api_error.ApiError() # noqa: E501 pass diff --git a/test/test_request_status.py b/test/test_channel_ticket.py similarity index 52% rename from test/test_request_status.py rename to test/test_channel_ticket.py index 76f4288..fd6df45 100644 --- a/test/test_request_status.py +++ b/test/test_channel_ticket.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.request_status import RequestStatus # noqa: E501 +from hoprd_sdk.models.channel_ticket import ChannelTicket # noqa: E501 from hoprd_sdk.rest import ApiException -class TestRequestStatus(unittest.TestCase): - """RequestStatus unit test stubs""" +class TestChannelTicket(unittest.TestCase): + """ChannelTicket unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testRequestStatus(self): - """Test RequestStatus""" + def testChannelTicket(self): + """Test ChannelTicket""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.request_status.RequestStatus() # noqa: E501 + # model = hoprd_sdk.models.channel_ticket.ChannelTicket() # noqa: E501 pass diff --git a/test/test_channel_topology.py b/test/test_channel_topology.py deleted file mode 100644 index 532f902..0000000 --- a/test/test_channel_topology.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.channel_topology import ChannelTopology # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestChannelTopology(unittest.TestCase): - """ChannelTopology unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChannelTopology(self): - """Test ChannelTopology""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channel_topology.ChannelTopology() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_channelid_fund_body.py b/test/test_channelid_fund_body.py deleted file mode 100644 index dee17da..0000000 --- a/test/test_channelid_fund_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.channelid_fund_body import ChannelidFundBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestChannelidFundBody(unittest.TestCase): - """ChannelidFundBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testChannelidFundBody(self): - """Test ChannelidFundBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channelid_fund_body.ChannelidFundBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_channels_api.py b/test/test_channels_api.py index 7ac436b..48961ba 100644 --- a/test/test_channels_api.py +++ b/test/test_channels_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,50 +28,50 @@ def setUp(self): def tearDown(self): pass - def test_channels_aggregate_tickets(self): - """Test case for channels_aggregate_tickets + def test_aggregate_tickets_in_channel(self): + """Test case for aggregate_tickets_in_channel """ pass - def test_channels_close_channel(self): - """Test case for channels_close_channel + def test_close_channel(self): + """Test case for close_channel """ pass - def test_channels_fund_channel(self): - """Test case for channels_fund_channel + def test_fund_channel(self): + """Test case for fund_channel """ pass - def test_channels_get_channel(self): - """Test case for channels_get_channel + def test_list_channels(self): + """Test case for list_channels """ pass - def test_channels_get_channels(self): - """Test case for channels_get_channels + def test_open_channel(self): + """Test case for open_channel """ pass - def test_channels_get_tickets(self): - """Test case for channels_get_tickets + def test_redeem_tickets_in_channel(self): + """Test case for redeem_tickets_in_channel """ pass - def test_channels_open_channel(self): - """Test case for channels_open_channel + def test_show_channel(self): + """Test case for show_channel """ pass - def test_channels_redeem_tickets(self): - """Test case for channels_redeem_tickets + def test_show_channel_tickets(self): + """Test case for show_channel_tickets """ pass diff --git a/test/test_native_address.py b/test/test_channels_query.py similarity index 52% rename from test/test_native_address.py rename to test/test_channels_query.py index 86357e5..958e96d 100644 --- a/test/test_native_address.py +++ b/test/test_channels_query.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.native_address import NativeAddress # noqa: E501 +from hoprd_sdk.models.channels_query import ChannelsQuery # noqa: E501 from hoprd_sdk.rest import ApiException -class TestNativeAddress(unittest.TestCase): - """NativeAddress unit test stubs""" +class TestChannelsQuery(unittest.TestCase): + """ChannelsQuery unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testNativeAddress(self): - """Test NativeAddress""" + def testChannelsQuery(self): + """Test ChannelsQuery""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.native_address.NativeAddress() # noqa: E501 + # model = hoprd_sdk.models.channels_query.ChannelsQuery() # noqa: E501 pass diff --git a/test/test_check_healthiness_api.py b/test/test_check_healthiness_api.py deleted file mode 100644 index 6a4c95f..0000000 --- a/test/test_check_healthiness_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.check_healthiness_api import CheckHealthinessApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestCheckHealthinessApi(unittest.TestCase): - """CheckHealthinessApi unit test stubs""" - - def setUp(self): - self.api = CheckHealthinessApi() # noqa: E501 - - def tearDown(self): - pass - - def test_check_node_healthy(self): - """Test case for check_node_healthy - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_check_ready_api.py b/test/test_check_ready_api.py deleted file mode 100644 index a96b426..0000000 --- a/test/test_check_ready_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.check_ready_api import CheckReadyApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestCheckReadyApi(unittest.TestCase): - """CheckReadyApi unit test stubs""" - - def setUp(self): - self.api = CheckReadyApi() # noqa: E501 - - def tearDown(self): - pass - - def test_check_node_ready(self): - """Test case for check_node_ready - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_check_started_api.py b/test/test_check_started_api.py deleted file mode 100644 index 6d0c017..0000000 --- a/test/test_check_started_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.check_started_api import CheckStartedApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestCheckStartedApi(unittest.TestCase): - """CheckStartedApi unit test stubs""" - - def setUp(self): - self.api = CheckStartedApi() # noqa: E501 - - def tearDown(self): - pass - - def test_check_node_started(self): - """Test case for check_node_started - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_checks_api.py b/test/test_checks_api.py new file mode 100644 index 0000000..ffec331 --- /dev/null +++ b/test/test_checks_api.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.api.checks_api import ChecksApi # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestChecksApi(unittest.TestCase): + """ChecksApi unit test stubs""" + + def setUp(self): + self.api = ChecksApi() # noqa: E501 + + def tearDown(self): + pass + + def test_healthyz(self): + """Test case for healthyz + + Check whether the node is healthy # noqa: E501 + """ + pass + + def test_readyz(self): + """Test case for readyz + + Check whether the node is ready to accept connections. # noqa: E501 + """ + pass + + def test_startedz(self): + """Test case for startedz + + Check whether the node is started. # noqa: E501 + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_close_channel_receipt.py b/test/test_close_channel_receipt.py new file mode 100644 index 0000000..ae67a0f --- /dev/null +++ b/test/test_close_channel_receipt.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.close_channel_receipt import CloseChannelReceipt # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestCloseChannelReceipt(unittest.TestCase): + """CloseChannelReceipt unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testCloseChannelReceipt(self): + """Test CloseChannelReceipt""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.close_channel_receipt.CloseChannelReceipt() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channel_id.py b/test/test_entry_node.py similarity index 53% rename from test/test_channel_id.py rename to test/test_entry_node.py index 8a01ceb..8a23322 100644 --- a/test/test_channel_id.py +++ b/test/test_entry_node.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.channel_id import ChannelId # noqa: E501 +from hoprd_sdk.models.entry_node import EntryNode # noqa: E501 from hoprd_sdk.rest import ApiException -class TestChannelId(unittest.TestCase): - """ChannelId unit test stubs""" +class TestEntryNode(unittest.TestCase): + """EntryNode unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testChannelId(self): - """Test ChannelId""" + def testEntryNode(self): + """Test EntryNode""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channel_id.ChannelId() # noqa: E501 + # model = hoprd_sdk.models.entry_node.EntryNode() # noqa: E501 pass diff --git a/test/test_hopr_address.py b/test/test_fund_request.py similarity index 52% rename from test/test_hopr_address.py rename to test/test_fund_request.py index 488d09d..035da1e 100644 --- a/test/test_hopr_address.py +++ b/test/test_fund_request.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.hopr_address import HoprAddress # noqa: E501 +from hoprd_sdk.models.fund_request import FundRequest # noqa: E501 from hoprd_sdk.rest import ApiException -class TestHoprAddress(unittest.TestCase): - """HoprAddress unit test stubs""" +class TestFundRequest(unittest.TestCase): + """FundRequest unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testHoprAddress(self): - """Test HoprAddress""" + def testFundRequest(self): + """Test FundRequest""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.hopr_address.HoprAddress() # noqa: E501 + # model = hoprd_sdk.models.fund_request.FundRequest() # noqa: E501 pass diff --git a/test/test_channel_status.py b/test/test_get_message_req.py similarity index 50% rename from test/test_channel_status.py rename to test/test_get_message_req.py index cc59fa1..4946be2 100644 --- a/test/test_channel_status.py +++ b/test/test_get_message_req.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.channel_status import ChannelStatus # noqa: E501 +from hoprd_sdk.models.get_message_req import GetMessageReq # noqa: E501 from hoprd_sdk.rest import ApiException -class TestChannelStatus(unittest.TestCase): - """ChannelStatus unit test stubs""" +class TestGetMessageReq(unittest.TestCase): + """GetMessageReq unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testChannelStatus(self): - """Test ChannelStatus""" + def testGetMessageReq(self): + """Test GetMessageReq""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channel_status.ChannelStatus() # noqa: E501 + # model = hoprd_sdk.models.get_message_req.GetMessageReq() # noqa: E501 pass diff --git a/test/test_native_balance.py b/test/test_heartbeat_info.py similarity index 52% rename from test/test_native_balance.py rename to test/test_heartbeat_info.py index 4959abb..a976645 100644 --- a/test/test_native_balance.py +++ b/test/test_heartbeat_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.native_balance import NativeBalance # noqa: E501 +from hoprd_sdk.models.heartbeat_info import HeartbeatInfo # noqa: E501 from hoprd_sdk.rest import ApiException -class TestNativeBalance(unittest.TestCase): - """NativeBalance unit test stubs""" +class TestHeartbeatInfo(unittest.TestCase): + """HeartbeatInfo unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testNativeBalance(self): - """Test NativeBalance""" + def testHeartbeatInfo(self): + """Test HeartbeatInfo""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.native_balance.NativeBalance() # noqa: E501 + # model = hoprd_sdk.models.heartbeat_info.HeartbeatInfo() # noqa: E501 pass diff --git a/test/test_messages_peek_body.py b/test/test_inbox_messages_res.py similarity index 50% rename from test/test_messages_peek_body.py rename to test/test_inbox_messages_res.py index ce1e29e..2139597 100644 --- a/test/test_messages_peek_body.py +++ b/test/test_inbox_messages_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.messages_peek_body import MessagesPeekBody # noqa: E501 +from hoprd_sdk.models.inbox_messages_res import InboxMessagesRes # noqa: E501 from hoprd_sdk.rest import ApiException -class TestMessagesPeekBody(unittest.TestCase): - """MessagesPeekBody unit test stubs""" +class TestInboxMessagesRes(unittest.TestCase): + """InboxMessagesRes unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testMessagesPeekBody(self): - """Test MessagesPeekBody""" + def testInboxMessagesRes(self): + """Test InboxMessagesRes""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.messages_peek_body.MessagesPeekBody() # noqa: E501 + # model = hoprd_sdk.models.inbox_messages_res.InboxMessagesRes() # noqa: E501 pass diff --git a/test/test_inline_response200.py b/test/test_inline_response200.py deleted file mode 100644 index bf5b9bf..0000000 --- a/test/test_inline_response200.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response200 import InlineResponse200 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse200(unittest.TestCase): - """InlineResponse200 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse200(self): - """Test InlineResponse200""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response200.InlineResponse200() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2001.py b/test/test_inline_response2001.py deleted file mode 100644 index bee390e..0000000 --- a/test/test_inline_response2001.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2001 import InlineResponse2001 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2001(unittest.TestCase): - """InlineResponse2001 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2001(self): - """Test InlineResponse2001""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2001.InlineResponse2001() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20010.py b/test/test_inline_response20010.py deleted file mode 100644 index 13e754c..0000000 --- a/test/test_inline_response20010.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20010 import InlineResponse20010 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20010(unittest.TestCase): - """InlineResponse20010 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20010(self): - """Test InlineResponse20010""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20010.InlineResponse20010() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20011.py b/test/test_inline_response20011.py deleted file mode 100644 index 376dd31..0000000 --- a/test/test_inline_response20011.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20011 import InlineResponse20011 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20011(unittest.TestCase): - """InlineResponse20011 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20011(self): - """Test InlineResponse20011""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20011.InlineResponse20011() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20012.py b/test/test_inline_response20012.py deleted file mode 100644 index ba8db86..0000000 --- a/test/test_inline_response20012.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20012 import InlineResponse20012 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20012(unittest.TestCase): - """InlineResponse20012 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20012(self): - """Test InlineResponse20012""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20012.InlineResponse20012() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20013.py b/test/test_inline_response20013.py deleted file mode 100644 index 56e50f0..0000000 --- a/test/test_inline_response20013.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20013 import InlineResponse20013 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20013(unittest.TestCase): - """InlineResponse20013 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20013(self): - """Test InlineResponse20013""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20013.InlineResponse20013() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20014.py b/test/test_inline_response20014.py deleted file mode 100644 index 49314d5..0000000 --- a/test/test_inline_response20014.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20014 import InlineResponse20014 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20014(unittest.TestCase): - """InlineResponse20014 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20014(self): - """Test InlineResponse20014""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20014.InlineResponse20014() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response20015.py b/test/test_inline_response20015.py deleted file mode 100644 index 24708a4..0000000 --- a/test/test_inline_response20015.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response20015 import InlineResponse20015 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse20015(unittest.TestCase): - """InlineResponse20015 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse20015(self): - """Test InlineResponse20015""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response20015.InlineResponse20015() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2002.py b/test/test_inline_response2002.py deleted file mode 100644 index 25b9f82..0000000 --- a/test/test_inline_response2002.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2002 import InlineResponse2002 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2002(unittest.TestCase): - """InlineResponse2002 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2002(self): - """Test InlineResponse2002""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2002.InlineResponse2002() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2002_connected.py b/test/test_inline_response2002_connected.py deleted file mode 100644 index b1d1411..0000000 --- a/test/test_inline_response2002_connected.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2002_connected import InlineResponse2002Connected # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2002Connected(unittest.TestCase): - """InlineResponse2002Connected unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2002Connected(self): - """Test InlineResponse2002Connected""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2002_connected.InlineResponse2002Connected() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2002_heartbeats.py b/test/test_inline_response2002_heartbeats.py deleted file mode 100644 index f6badcf..0000000 --- a/test/test_inline_response2002_heartbeats.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2002_heartbeats import InlineResponse2002Heartbeats # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2002Heartbeats(unittest.TestCase): - """InlineResponse2002Heartbeats unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2002Heartbeats(self): - """Test InlineResponse2002Heartbeats""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2002_heartbeats.InlineResponse2002Heartbeats() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2003.py b/test/test_inline_response2003.py deleted file mode 100644 index 69c72d0..0000000 --- a/test/test_inline_response2003.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2003 import InlineResponse2003 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2003(unittest.TestCase): - """InlineResponse2003 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2003(self): - """Test InlineResponse2003""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2003.InlineResponse2003() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2004.py b/test/test_inline_response2004.py deleted file mode 100644 index f404da5..0000000 --- a/test/test_inline_response2004.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2004 import InlineResponse2004 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2004(unittest.TestCase): - """InlineResponse2004 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2004(self): - """Test InlineResponse2004""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2004.InlineResponse2004() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2005.py b/test/test_inline_response2005.py deleted file mode 100644 index 317873a..0000000 --- a/test/test_inline_response2005.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2005 import InlineResponse2005 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2005(unittest.TestCase): - """InlineResponse2005 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2005(self): - """Test InlineResponse2005""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2005.InlineResponse2005() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2006.py b/test/test_inline_response2006.py deleted file mode 100644 index 2a98ca7..0000000 --- a/test/test_inline_response2006.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2006 import InlineResponse2006 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2006(unittest.TestCase): - """InlineResponse2006 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2006(self): - """Test InlineResponse2006""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2006.InlineResponse2006() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2007.py b/test/test_inline_response2007.py deleted file mode 100644 index ace49fb..0000000 --- a/test/test_inline_response2007.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2007 import InlineResponse2007 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2007(unittest.TestCase): - """InlineResponse2007 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2007(self): - """Test InlineResponse2007""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2007.InlineResponse2007() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2008.py b/test/test_inline_response2008.py deleted file mode 100644 index daacb62..0000000 --- a/test/test_inline_response2008.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2008 import InlineResponse2008 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2008(unittest.TestCase): - """InlineResponse2008 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2008(self): - """Test InlineResponse2008""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2008.InlineResponse2008() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2009.py b/test/test_inline_response2009.py deleted file mode 100644 index cbd8001..0000000 --- a/test/test_inline_response2009.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2009 import InlineResponse2009 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2009(unittest.TestCase): - """InlineResponse2009 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2009(self): - """Test InlineResponse2009""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2009.InlineResponse2009() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response201.py b/test/test_inline_response201.py deleted file mode 100644 index 63b7ff2..0000000 --- a/test/test_inline_response201.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response201 import InlineResponse201 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse201(unittest.TestCase): - """InlineResponse201 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse201(self): - """Test InlineResponse201""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response201.InlineResponse201() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response2011.py b/test/test_inline_response2011.py deleted file mode 100644 index 9b518bd..0000000 --- a/test/test_inline_response2011.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response2011 import InlineResponse2011 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse2011(unittest.TestCase): - """InlineResponse2011 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse2011(self): - """Test InlineResponse2011""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response2011.InlineResponse2011() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response403.py b/test/test_inline_response403.py deleted file mode 100644 index c780820..0000000 --- a/test/test_inline_response403.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response403 import InlineResponse403 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse403(unittest.TestCase): - """InlineResponse403 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse403(self): - """Test InlineResponse403""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response403.InlineResponse403() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response409.py b/test/test_inline_response409.py deleted file mode 100644 index fd1046b..0000000 --- a/test/test_inline_response409.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response409 import InlineResponse409 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse409(unittest.TestCase): - """InlineResponse409 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse409(self): - """Test InlineResponse409""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response409.InlineResponse409() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response422.py b/test/test_inline_response422.py deleted file mode 100644 index c8c8c89..0000000 --- a/test/test_inline_response422.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response422 import InlineResponse422 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse422(unittest.TestCase): - """InlineResponse422 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse422(self): - """Test InlineResponse422""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response422.InlineResponse422() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response4221.py b/test/test_inline_response4221.py deleted file mode 100644 index 5eb91bb..0000000 --- a/test/test_inline_response4221.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response4221 import InlineResponse4221 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponse4221(unittest.TestCase): - """InlineResponse4221 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponse4221(self): - """Test InlineResponse4221""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response4221.InlineResponse4221() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_inline_response_map200.py b/test/test_inline_response_map200.py deleted file mode 100644 index be3c5fe..0000000 --- a/test/test_inline_response_map200.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.inline_response_map200 import InlineResponseMap200 # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestInlineResponseMap200(unittest.TestCase): - """InlineResponseMap200 unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testInlineResponseMap200(self): - """Test InlineResponseMap200""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.inline_response_map200.InlineResponseMap200() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_message_pop_res.py b/test/test_message_pop_res.py new file mode 100644 index 0000000..301b5f0 --- /dev/null +++ b/test/test_message_pop_res.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.message_pop_res import MessagePopRes # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestMessagePopRes(unittest.TestCase): + """MessagePopRes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testMessagePopRes(self): + """Test MessagePopRes""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.message_pop_res.MessagePopRes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_message_tag.py b/test/test_message_tag.py deleted file mode 100644 index 3dc95dd..0000000 --- a/test/test_message_tag.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.message_tag import MessageTag # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestMessageTag(unittest.TestCase): - """MessageTag unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessageTag(self): - """Test MessageTag""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.message_tag.MessageTag() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messages_api.py b/test/test_messages_api.py index 59ced13..a332215 100644 --- a/test/test_messages_api.py +++ b/test/test_messages_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,51 +28,52 @@ def setUp(self): def tearDown(self): pass - def test_messages_delete_messages(self): - """Test case for messages_delete_messages + def test_delete_messages(self): + """Test case for delete_messages + Delete messages from nodes message inbox. # noqa: E501 """ pass - def test_messages_get_size(self): - """Test case for messages_get_size + def test_peek(self): + """Test case for peek + Peek the oldest message currently present in the nodes message inbox. # noqa: E501 """ pass - def test_messages_peek_all_message(self): - """Test case for messages_peek_all_message + def test_peek_all(self): + """Test case for peek_all + Peek the list of messages currently present in the nodes message inbox, filtered by tag, # noqa: E501 """ pass - def test_messages_peek_message(self): - """Test case for messages_peek_message + def test_pop(self): + """Test case for pop + Get the oldest message currently present in the nodes message inbox. # noqa: E501 """ pass - def test_messages_pop_all_message(self): - """Test case for messages_pop_all_message + def test_pop_all(self): + """Test case for pop_all + Get the list of messages currently present in the nodes message inbox. # noqa: E501 """ pass - def test_messages_pop_message(self): - """Test case for messages_pop_message + def test_send_message(self): + """Test case for send_message + Send a message to another peer using a given path. # noqa: E501 """ pass - def test_messages_send_message(self): - """Test case for messages_send_message - - """ - pass - - def test_messages_websocket(self): - """Test case for messages_websocket + def test_size(self): + """Test case for size + Get size of filtered message inbox for a specific tag # noqa: E501 """ pass diff --git a/test/test_messages_peekall_body.py b/test/test_messages_peekall_body.py deleted file mode 100644 index a395719..0000000 --- a/test/test_messages_peekall_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.messages_peekall_body import MessagesPeekallBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestMessagesPeekallBody(unittest.TestCase): - """MessagesPeekallBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessagesPeekallBody(self): - """Test MessagesPeekallBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.messages_peekall_body.MessagesPeekallBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messages_pop_body.py b/test/test_messages_pop_body.py deleted file mode 100644 index 5cb63f6..0000000 --- a/test/test_messages_pop_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.messages_pop_body import MessagesPopBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestMessagesPopBody(unittest.TestCase): - """MessagesPopBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessagesPopBody(self): - """Test MessagesPopBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.messages_pop_body.MessagesPopBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_messages_popall_body.py b/test/test_messages_popall_body.py deleted file mode 100644 index 1eda64f..0000000 --- a/test/test_messages_popall_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.messages_popall_body import MessagesPopallBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestMessagesPopallBody(unittest.TestCase): - """MessagesPopallBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMessagesPopallBody(self): - """Test MessagesPopallBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.messages_popall_body.MessagesPopallBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_network_api.py b/test/test_network_api.py new file mode 100644 index 0000000..4d296f3 --- /dev/null +++ b/test/test_network_api.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.api.network_api import NetworkApi # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestNetworkApi(unittest.TestCase): + """NetworkApi unit test stubs""" + + def setUp(self): + self.api = NetworkApi() # noqa: E501 + + def tearDown(self): + pass + + def test_price(self): + """Test case for price + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_node_api.py b/test/test_node_api.py index afe1083..ace6281 100644 --- a/test/test_node_api.py +++ b/test/test_node_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,33 +28,38 @@ def setUp(self): def tearDown(self): pass - def test_node_get_entry_nodes(self): - """Test case for node_get_entry_nodes + def test_entry_nodes(self): + """Test case for entry_nodes + List all known entry nodes with multiaddrs and eligibility. # noqa: E501 """ pass - def test_node_get_info(self): - """Test case for node_get_info + def test_info(self): + """Test case for info + Get information about this HOPR Node. # noqa: E501 """ pass - def test_node_get_metrics(self): - """Test case for node_get_metrics + def test_metrics(self): + """Test case for metrics + Retrieve Prometheus metrics from the running node. # noqa: E501 """ pass - def test_node_get_peers(self): - """Test case for node_get_peers + def test_peers(self): + """Test case for peers + Lists information for `connected peers` and `announced peers`. # noqa: E501 """ pass - def test_node_get_version(self): - """Test case for node_get_version + def test_version(self): + """Test case for version + Get release version of the running node. # noqa: E501 """ pass diff --git a/test/test_hopr_balance.py b/test/test_node_channel.py similarity index 52% rename from test/test_hopr_balance.py rename to test/test_node_channel.py index 6a9e203..9c19404 100644 --- a/test/test_hopr_balance.py +++ b/test/test_node_channel.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.hopr_balance import HoprBalance # noqa: E501 +from hoprd_sdk.models.node_channel import NodeChannel # noqa: E501 from hoprd_sdk.rest import ApiException -class TestHoprBalance(unittest.TestCase): - """HoprBalance unit test stubs""" +class TestNodeChannel(unittest.TestCase): + """NodeChannel unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testHoprBalance(self): - """Test HoprBalance""" + def testNodeChannel(self): + """Test NodeChannel""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.hopr_balance.HoprBalance() # noqa: E501 + # model = hoprd_sdk.models.node_channel.NodeChannel() # noqa: E501 pass diff --git a/test/test_messages_body.py b/test/test_node_channels.py similarity index 52% rename from test/test_messages_body.py rename to test/test_node_channels.py index b46088e..a8d361b 100644 --- a/test/test_messages_body.py +++ b/test/test_node_channels.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.messages_body import MessagesBody # noqa: E501 +from hoprd_sdk.models.node_channels import NodeChannels # noqa: E501 from hoprd_sdk.rest import ApiException -class TestMessagesBody(unittest.TestCase): - """MessagesBody unit test stubs""" +class TestNodeChannels(unittest.TestCase): + """NodeChannels unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testMessagesBody(self): - """Test MessagesBody""" + def testNodeChannels(self): + """Test NodeChannels""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.messages_body.MessagesBody() # noqa: E501 + # model = hoprd_sdk.models.node_channels.NodeChannels() # noqa: E501 pass diff --git a/test/test_node_info_res.py b/test/test_node_info_res.py new file mode 100644 index 0000000..63234c7 --- /dev/null +++ b/test/test_node_info_res.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.node_info_res import NodeInfoRes # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestNodeInfoRes(unittest.TestCase): + """NodeInfoRes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNodeInfoRes(self): + """Test NodeInfoRes""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.node_info_res.NodeInfoRes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_signature.py b/test/test_node_peer_info.py similarity index 51% rename from test/test_signature.py rename to test/test_node_peer_info.py index beb61af..78381dd 100644 --- a/test/test_signature.py +++ b/test/test_node_peer_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.signature import Signature # noqa: E501 +from hoprd_sdk.models.node_peer_info import NodePeerInfo # noqa: E501 from hoprd_sdk.rest import ApiException -class TestSignature(unittest.TestCase): - """Signature unit test stubs""" +class TestNodePeerInfo(unittest.TestCase): + """NodePeerInfo unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testSignature(self): - """Test Signature""" + def testNodePeerInfo(self): + """Test NodePeerInfo""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.signature.Signature() # noqa: E501 + # model = hoprd_sdk.models.node_peer_info.NodePeerInfo() # noqa: E501 pass diff --git a/test/test_node_peers_req_query.py b/test/test_node_peers_req_query.py new file mode 100644 index 0000000..3eb6cb8 --- /dev/null +++ b/test/test_node_peers_req_query.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.node_peers_req_query import NodePeersReqQuery # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestNodePeersReqQuery(unittest.TestCase): + """NodePeersReqQuery unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNodePeersReqQuery(self): + """Test NodePeersReqQuery""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.node_peers_req_query.NodePeersReqQuery() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_channels_body.py b/test/test_node_peers_res.py similarity index 50% rename from test/test_channels_body.py rename to test/test_node_peers_res.py index 495a8b7..a5d65da 100644 --- a/test/test_channels_body.py +++ b/test/test_node_peers_res.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.channels_body import ChannelsBody # noqa: E501 +from hoprd_sdk.models.node_peers_res import NodePeersRes # noqa: E501 from hoprd_sdk.rest import ApiException -class TestChannelsBody(unittest.TestCase): - """ChannelsBody unit test stubs""" +class TestNodePeersRes(unittest.TestCase): + """NodePeersRes unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testChannelsBody(self): - """Test ChannelsBody""" + def testNodePeersRes(self): + """Test NodePeersRes""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.channels_body.ChannelsBody() # noqa: E501 + # model = hoprd_sdk.models.node_peers_res.NodePeersRes() # noqa: E501 pass diff --git a/test/test_node_ticket_statistics.py b/test/test_node_ticket_statistics.py new file mode 100644 index 0000000..f6d233f --- /dev/null +++ b/test/test_node_ticket_statistics.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.node_ticket_statistics import NodeTicketStatistics # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestNodeTicketStatistics(unittest.TestCase): + """NodeTicketStatistics unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNodeTicketStatistics(self): + """Test NodeTicketStatistics""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.node_ticket_statistics.NodeTicketStatistics() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_node_topology_channel.py b/test/test_node_topology_channel.py new file mode 100644 index 0000000..13f11a2 --- /dev/null +++ b/test/test_node_topology_channel.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.node_topology_channel import NodeTopologyChannel # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestNodeTopologyChannel(unittest.TestCase): + """NodeTopologyChannel unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNodeTopologyChannel(self): + """Test NodeTopologyChannel""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.node_topology_channel.NodeTopologyChannel() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_aliases_body.py b/test/test_node_version.py similarity index 52% rename from test/test_aliases_body.py rename to test/test_node_version.py index 6672adc..d79920c 100644 --- a/test/test_aliases_body.py +++ b/test/test_node_version.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.aliases_body import AliasesBody # noqa: E501 +from hoprd_sdk.models.node_version import NodeVersion # noqa: E501 from hoprd_sdk.rest import ApiException -class TestAliasesBody(unittest.TestCase): - """AliasesBody unit test stubs""" +class TestNodeVersion(unittest.TestCase): + """NodeVersion unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testAliasesBody(self): - """Test AliasesBody""" + def testNodeVersion(self): + """Test NodeVersion""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.aliases_body.AliasesBody() # noqa: E501 + # model = hoprd_sdk.models.node_version.NodeVersion() # noqa: E501 pass diff --git a/test/test_open_channel_receipt.py b/test/test_open_channel_receipt.py new file mode 100644 index 0000000..56ba7d2 --- /dev/null +++ b/test/test_open_channel_receipt.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.open_channel_receipt import OpenChannelReceipt # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestOpenChannelReceipt(unittest.TestCase): + """OpenChannelReceipt unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOpenChannelReceipt(self): + """Test OpenChannelReceipt""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.open_channel_receipt.OpenChannelReceipt() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_open_channel_request.py b/test/test_open_channel_request.py new file mode 100644 index 0000000..16f419e --- /dev/null +++ b/test/test_open_channel_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.open_channel_request import OpenChannelRequest # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestOpenChannelRequest(unittest.TestCase): + """OpenChannelRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOpenChannelRequest(self): + """Test OpenChannelRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.open_channel_request.OpenChannelRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_ticket.py b/test/test_peer_id_arg.py similarity index 52% rename from test/test_ticket.py rename to test/test_peer_id_arg.py index fae8d48..161a1c3 100644 --- a/test/test_ticket.py +++ b/test/test_peer_id_arg.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.ticket import Ticket # noqa: E501 +from hoprd_sdk.models.peer_id_arg import PeerIdArg # noqa: E501 from hoprd_sdk.rest import ApiException -class TestTicket(unittest.TestCase): - """Ticket unit test stubs""" +class TestPeerIdArg(unittest.TestCase): + """PeerIdArg unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testTicket(self): - """Test Ticket""" + def testPeerIdArg(self): + """Test PeerIdArg""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.ticket.Ticket() # noqa: E501 + # model = hoprd_sdk.models.peer_id_arg.PeerIdArg() # noqa: E501 pass diff --git a/test/test_settings.py b/test/test_peer_info.py similarity index 52% rename from test/test_settings.py rename to test/test_peer_info.py index 882a3e4..d5832a7 100644 --- a/test/test_settings.py +++ b/test/test_peer_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.settings import Settings # noqa: E501 +from hoprd_sdk.models.peer_info import PeerInfo # noqa: E501 from hoprd_sdk.rest import ApiException -class TestSettings(unittest.TestCase): - """Settings unit test stubs""" +class TestPeerInfo(unittest.TestCase): + """PeerInfo unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testSettings(self): - """Test Settings""" + def testPeerInfo(self): + """Test PeerInfo""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.settings.Settings() # noqa: E501 + # model = hoprd_sdk.models.peer_info.PeerInfo() # noqa: E501 pass diff --git a/test/test_peer_info_api.py b/test/test_peer_info_api.py deleted file mode 100644 index 52e75dc..0000000 --- a/test/test_peer_info_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.peer_info_api import PeerInfoApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestPeerInfoApi(unittest.TestCase): - """PeerInfoApi unit test stubs""" - - def setUp(self): - self.api = PeerInfoApi() # noqa: E501 - - def tearDown(self): - pass - - def test_peer_info_get_peer_info(self): - """Test case for peer_info_get_peer_info - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_peers_api.py b/test/test_peers_api.py index 5647e42..bf30930 100644 --- a/test/test_peers_api.py +++ b/test/test_peers_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,8 +28,14 @@ def setUp(self): def tearDown(self): pass - def test_peers_ping_peer(self): - """Test case for peers_ping_peer + def test_ping_peer(self): + """Test case for ping_peer + + """ + pass + + def test_show_peer_info(self): + """Test case for show_peer_info """ pass diff --git a/test/test_currency.py b/test/test_ping_info.py similarity index 52% rename from test/test_currency.py rename to test/test_ping_info.py index caf009e..bc7a339 100644 --- a/test/test_currency.py +++ b/test/test_ping_info.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.currency import Currency # noqa: E501 +from hoprd_sdk.models.ping_info import PingInfo # noqa: E501 from hoprd_sdk.rest import ApiException -class TestCurrency(unittest.TestCase): - """Currency unit test stubs""" +class TestPingInfo(unittest.TestCase): + """PingInfo unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testCurrency(self): - """Test Currency""" + def testPingInfo(self): + """Test PingInfo""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.currency.Currency() # noqa: E501 + # model = hoprd_sdk.models.ping_info.PingInfo() # noqa: E501 pass diff --git a/test/test_received_message.py b/test/test_received_message.py deleted file mode 100644 index d196dfc..0000000 --- a/test/test_received_message.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.received_message import ReceivedMessage # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestReceivedMessage(unittest.TestCase): - """ReceivedMessage unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testReceivedMessage(self): - """Test ReceivedMessage""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.received_message.ReceivedMessage() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_send_message_req.py b/test/test_send_message_req.py new file mode 100644 index 0000000..9f48f48 --- /dev/null +++ b/test/test_send_message_req.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.send_message_req import SendMessageReq # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestSendMessageReq(unittest.TestCase): + """SendMessageReq unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSendMessageReq(self): + """Test SendMessageReq""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.send_message_req.SendMessageReq() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_send_message_res.py b/test/test_send_message_res.py new file mode 100644 index 0000000..1d8d4cb --- /dev/null +++ b/test/test_send_message_res.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.send_message_res import SendMessageRes # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestSendMessageRes(unittest.TestCase): + """SendMessageRes unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSendMessageRes(self): + """Test SendMessageRes""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.send_message_res.SendMessageRes() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_settings_api.py b/test/test_settings_api.py deleted file mode 100644 index 094a725..0000000 --- a/test/test_settings_api.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.settings_api import SettingsApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestSettingsApi(unittest.TestCase): - """SettingsApi unit test stubs""" - - def setUp(self): - self.api = SettingsApi() # noqa: E501 - - def tearDown(self): - pass - - def test_settings_get_settings(self): - """Test case for settings_get_settings - - """ - pass - - def test_settings_set_setting(self): - """Test case for settings_set_setting - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_settings_setting_body.py b/test/test_settings_setting_body.py deleted file mode 100644 index b540499..0000000 --- a/test/test_settings_setting_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.settings_setting_body import SettingsSettingBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestSettingsSettingBody(unittest.TestCase): - """SettingsSettingBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testSettingsSettingBody(self): - """Test SettingsSettingBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.settings_setting_body.SettingsSettingBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_token.py b/test/test_size.py similarity index 54% rename from test/test_token.py rename to test/test_size.py index 7c0060f..2b5da3a 100644 --- a/test/test_token.py +++ b/test/test_size.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.token import Token # noqa: E501 +from hoprd_sdk.models.size import Size # noqa: E501 from hoprd_sdk.rest import ApiException -class TestToken(unittest.TestCase): - """Token unit test stubs""" +class TestSize(unittest.TestCase): + """Size unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testToken(self): - """Test Token""" + def testSize(self): + """Test Size""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.token.Token() # noqa: E501 + # model = hoprd_sdk.models.size.Size() # noqa: E501 pass diff --git a/test/test_error.py b/test/test_tag_query.py similarity index 52% rename from test/test_error.py rename to test/test_tag_query.py index 55d8d06..9a676e5 100644 --- a/test/test_error.py +++ b/test/test_tag_query.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -15,12 +15,12 @@ import unittest import hoprd_sdk -from hoprd_sdk.models.error import Error # noqa: E501 +from hoprd_sdk.models.tag_query import TagQuery # noqa: E501 from hoprd_sdk.rest import ApiException -class TestError(unittest.TestCase): - """Error unit test stubs""" +class TestTagQuery(unittest.TestCase): + """TagQuery unit test stubs""" def setUp(self): pass @@ -28,10 +28,10 @@ def setUp(self): def tearDown(self): pass - def testError(self): - """Test Error""" + def testTagQuery(self): + """Test TagQuery""" # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.error.Error() # noqa: E501 + # model = hoprd_sdk.models.tag_query.TagQuery() # noqa: E501 pass diff --git a/test/test_ticket_price_response.py b/test/test_ticket_price_response.py new file mode 100644 index 0000000..603e350 --- /dev/null +++ b/test/test_ticket_price_response.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.ticket_price_response import TicketPriceResponse # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestTicketPriceResponse(unittest.TestCase): + """TicketPriceResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testTicketPriceResponse(self): + """Test TicketPriceResponse""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.ticket_price_response.TicketPriceResponse() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_tickets_api.py b/test/test_tickets_api.py index 74bd1b0..9360109 100644 --- a/test/test_tickets_api.py +++ b/test/test_tickets_api.py @@ -1,11 +1,11 @@ # coding: utf-8 """ - HOPRd Rest API v3 + hoprd-api - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 - OpenAPI spec version: 3.0.0 + OpenAPI spec version: 0.1.0 Contact: tech@hoprnet.org Generated by: https://github.com/swagger-api/swagger-codegen.git """ @@ -28,26 +28,20 @@ def setUp(self): def tearDown(self): pass - def test_tickets_get_statistics(self): - """Test case for tickets_get_statistics + def test_redeem_all_tickets(self): + """Test case for redeem_all_tickets """ pass - def test_tickets_get_ticket_price(self): - """Test case for tickets_get_ticket_price + def test_show_all_tickets(self): + """Test case for show_all_tickets """ pass - def test_tickets_get_tickets(self): - """Test case for tickets_get_tickets - - """ - pass - - def test_tickets_redeem_tickets(self): - """Test case for tickets_redeem_tickets + def test_show_ticket_statistics(self): + """Test case for show_ticket_statistics """ pass diff --git a/test/test_token_capability.py b/test/test_token_capability.py deleted file mode 100644 index 7edaf75..0000000 --- a/test/test_token_capability.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.token_capability import TokenCapability # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTokenCapability(unittest.TestCase): - """TokenCapability unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTokenCapability(self): - """Test TokenCapability""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.token_capability.TokenCapability() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_token_capability_limit.py b/test/test_token_capability_limit.py deleted file mode 100644 index 3ebd6e3..0000000 --- a/test/test_token_capability_limit.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.token_capability_limit import TokenCapabilityLimit # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTokenCapabilityLimit(unittest.TestCase): - """TokenCapabilityLimit unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTokenCapabilityLimit(self): - """Test TokenCapabilityLimit""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.token_capability_limit.TokenCapabilityLimit() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_token_capability_limit_conditions.py b/test/test_token_capability_limit_conditions.py deleted file mode 100644 index 5fb95ad..0000000 --- a/test/test_token_capability_limit_conditions.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.token_capability_limit_conditions import TokenCapabilityLimitConditions # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTokenCapabilityLimitConditions(unittest.TestCase): - """TokenCapabilityLimitConditions unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTokenCapabilityLimitConditions(self): - """Test TokenCapabilityLimitConditions""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.token_capability_limit_conditions.TokenCapabilityLimitConditions() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tokens_api.py b/test/test_tokens_api.py deleted file mode 100644 index 45637ba..0000000 --- a/test/test_tokens_api.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.api.tokens_api import TokensApi # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTokensApi(unittest.TestCase): - """TokensApi unit test stubs""" - - def setUp(self): - self.api = TokensApi() # noqa: E501 - - def tearDown(self): - pass - - def test_tokens_create(self): - """Test case for tokens_create - - """ - pass - - def test_tokens_delete(self): - """Test case for tokens_delete - - """ - pass - - def test_tokens_get_token(self): - """Test case for tokens_get_token - - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_tokens_body.py b/test/test_tokens_body.py deleted file mode 100644 index 4779900..0000000 --- a/test/test_tokens_body.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.tokens_body import TokensBody # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTokensBody(unittest.TestCase): - """TokensBody unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTokensBody(self): - """Test TokensBody""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.tokens_body.TokensBody() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_transaction_receipt.py b/test/test_transaction_receipt.py deleted file mode 100644 index 550d3e6..0000000 --- a/test/test_transaction_receipt.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - HOPRd Rest API v3 - - This Rest API enables developers to interact with a hoprd node programatically. # noqa: E501 - - OpenAPI spec version: 3.0.0 - Contact: tech@hoprnet.org - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -from __future__ import absolute_import - -import unittest - -import hoprd_sdk -from hoprd_sdk.models.transaction_receipt import TransactionReceipt # noqa: E501 -from hoprd_sdk.rest import ApiException - - -class TestTransactionReceipt(unittest.TestCase): - """TransactionReceipt unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTransactionReceipt(self): - """Test TransactionReceipt""" - # FIXME: construct object with mandatory attributes with example values - # model = hoprd_sdk.models.transaction_receipt.TransactionReceipt() # noqa: E501 - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_withdraw_request.py b/test/test_withdraw_request.py new file mode 100644 index 0000000..57f05c6 --- /dev/null +++ b/test/test_withdraw_request.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + hoprd-api + + API server using the hopr-lib created HOPR node and exposing it using a HTTP REST API # noqa: E501 + + OpenAPI spec version: 0.1.0 + Contact: tech@hoprnet.org + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import hoprd_sdk +from hoprd_sdk.models.withdraw_request import WithdrawRequest # noqa: E501 +from hoprd_sdk.rest import ApiException + + +class TestWithdrawRequest(unittest.TestCase): + """WithdrawRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testWithdrawRequest(self): + """Test WithdrawRequest""" + # FIXME: construct object with mandatory attributes with example values + # model = hoprd_sdk.models.withdraw_request.WithdrawRequest() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main()