Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Update the tag to sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
Teebor-Choka committed Jul 19, 2024
1 parent c5c8e8d commit 3431d45
Show file tree
Hide file tree
Showing 9 changed files with 237 additions and 162 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ Class | Method | HTTP request | Description
*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.
*ConfigurationApi* | [**configuration**](docs/ConfigurationApi.md#configuration) | **GET** /api/v3/node/configuration | Get the configuration of the running node.
*MessagesApi* | [**create_client**](docs/MessagesApi.md#create_client) | **POST** /api/v3/session | Creates a new client session returing a dedicated session listening port.
*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,
Expand All @@ -142,6 +141,7 @@ Class | Method | HTTP request | Description
*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 | Directly pings the given peer.
*PeersApi* | [**show_peer_info**](docs/PeersApi.md#show_peer_info) | **GET** /api/v3/peers/{peerId} | Returns transport-related information about the given peer.
*SessionApi* | [**create_client**](docs/SessionApi.md#create_client) | **POST** /api/v3/session | Creates a new client session returing a dedicated session listening port.
*TicketsApi* | [**redeem_all_tickets**](docs/TicketsApi.md#redeem_all_tickets) | **POST** /api/v3/tickets/redeem | Starts redeeming of all tickets in all channels.
*TicketsApi* | [**show_all_tickets**](docs/TicketsApi.md#show_all_tickets) | **GET** /api/v3/tickets | Endpoint is deprecated and will be removed in the future. Returns an empty array.
*TicketsApi* | [**show_ticket_statistics**](docs/TicketsApi.md#show_ticket_statistics) | **GET** /api/v3/tickets/statistics | Returns current complete statistics on tickets.
Expand Down
55 changes: 0 additions & 55 deletions docs/MessagesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ All URIs are relative to */*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_client**](MessagesApi.md#create_client) | **POST** /api/v3/session | Creates a new client session returing a dedicated session listening port.
[**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,
Expand All @@ -13,60 +12,6 @@ Method | HTTP request | Description
[**send_message**](MessagesApi.md#send_message) | **POST** /api/v3/messages | Send a message to another peer using the given path.
[**size**](MessagesApi.md#size) | **GET** /api/v3/messages/size | Get size of filtered message inbox for a specific tag

# **create_client**
> SessionClientResponse create_client(body)
Creates a new client session returing a dedicated session listening port.

Once the port is bound, it is possible to use the socket for bidirectional read and write communication.

### 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.MessagesApi(hoprd_sdk.ApiClient(configuration))
body = hoprd_sdk.SessionClientRequest() # SessionClientRequest | Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication.

try:
# Creates a new client session returing a dedicated session listening port.
api_response = api_instance.create_client(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling MessagesApi->create_client: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SessionClientRequest**](SessionClientRequest.md)| Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication. |

### Return type

[**SessionClientResponse**](SessionClientResponse.md)

### Authorization

[api_token](../README.md#api_token), [bearer_token](../README.md#bearer_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)

# **delete_messages**
> delete_messages(tag=tag)
Expand Down
62 changes: 62 additions & 0 deletions docs/SessionApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# hoprd_sdk.SessionApi

All URIs are relative to */*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_client**](SessionApi.md#create_client) | **POST** /api/v3/session | Creates a new client session returing a dedicated session listening port.

# **create_client**
> SessionClientResponse create_client(body)
Creates a new client session returing a dedicated session listening port.

Once the port is bound, it is possible to use the socket for bidirectional read and write communication.

### 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.SessionApi(hoprd_sdk.ApiClient(configuration))
body = hoprd_sdk.SessionClientRequest() # SessionClientRequest | Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication.

try:
# Creates a new client session returing a dedicated session listening port.
api_response = api_instance.create_client(body)
pprint(api_response)
except ApiException as e:
print("Exception when calling SessionApi->create_client: %s\n" % e)
```

### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SessionClientRequest**](SessionClientRequest.md)| Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication. |

### Return type

[**SessionClientResponse**](SessionClientResponse.md)

### Authorization

[api_token](../README.md#api_token), [bearer_token](../README.md#bearer_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)

1 change: 1 addition & 0 deletions hoprd_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from hoprd_sdk.api.network_api import NetworkApi
from hoprd_sdk.api.node_api import NodeApi
from hoprd_sdk.api.peers_api import PeersApi
from hoprd_sdk.api.session_api import SessionApi
from hoprd_sdk.api.tickets_api import TicketsApi
# import ApiClient
from hoprd_sdk.api_client import ApiClient
Expand Down
1 change: 1 addition & 0 deletions hoprd_sdk/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
from hoprd_sdk.api.network_api import NetworkApi
from hoprd_sdk.api.node_api import NodeApi
from hoprd_sdk.api.peers_api import PeersApi
from hoprd_sdk.api.session_api import SessionApi
from hoprd_sdk.api.tickets_api import TicketsApi
99 changes: 0 additions & 99 deletions hoprd_sdk/api/messages_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,105 +32,6 @@ def __init__(self, api_client=None):
api_client = ApiClient()
self.api_client = api_client

def create_client(self, body, **kwargs): # noqa: E501
"""Creates a new client session returing a dedicated session listening port. # noqa: E501
Once the port is bound, it is possible to use the socket for bidirectional read and write communication. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_client(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param SessionClientRequest body: Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication. (required)
:return: SessionClientResponse
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.create_client_with_http_info(body, **kwargs) # noqa: E501
else:
(data) = self.create_client_with_http_info(body, **kwargs) # noqa: E501
return data

def create_client_with_http_info(self, body, **kwargs): # noqa: E501
"""Creates a new client session returing a dedicated session listening port. # noqa: E501
Once the port is bound, it is possible to use the socket for bidirectional read and write communication. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_client_with_http_info(body, async_req=True)
>>> result = thread.get()
:param async_req bool
:param SessionClientRequest body: Creates a new client HOPR session that will start listening on a dedicated port. Once the port is bound, it is possible to use the socketfor bidirectional read and write communication. (required)
:return: SessionClientResponse
If the method is called asynchronously,
returns the request thread.
"""

all_params = ['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 create_client" % 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 `create_client`") # noqa: E501

collection_formats = {}

path_params = {}

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 = ['api_token', 'bearer_token'] # noqa: E501

return self.api_client.call_api(
'/api/v3/session', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='SessionClientResponse', # 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 delete_messages(self, **kwargs): # noqa: E501
"""Delete messages from nodes message inbox. # noqa: E501
Expand Down
Loading

0 comments on commit 3431d45

Please sign in to comment.