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

2.1.0 rc.3 updates for the candidate release #37

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Class | Method | HTTP request | Description
- [AccountAddressesResponse](docs/AccountAddressesResponse.md)
- [AccountBalancesResponse](docs/AccountBalancesResponse.md)
- [AliasPeerIdBodyRequest](docs/AliasPeerIdBodyRequest.md)
- [AnnouncedPeer](docs/AnnouncedPeer.md)
- [ApiError](docs/ApiError.md)
- [ChannelInfoResponse](docs/ChannelInfoResponse.md)
- [ChannelTicket](docs/ChannelTicket.md)
Expand Down
10 changes: 10 additions & 0 deletions docs/AnnouncedPeer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AnnouncedPeer

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**peer_address** | **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)

8 changes: 4 additions & 4 deletions docs/MessagesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'

# create an instance of the API class
api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration))
body = hoprd_sdk.GetMessageBodyRequest() # GetMessageBodyRequest | Tag of message queue and optionally a timestamp since from to start peeking
body = hoprd_sdk.GetMessageBodyRequest() # GetMessageBodyRequest | Tag of message queue and optionally a timestamp since from to start peeking. When an empty object or an object with a `tag: 0` is provided, it fetches all the messages.

try:
# Peek the list of messages currently present in the nodes message inbox, filtered by tag,
Expand All @@ -156,7 +156,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**GetMessageBodyRequest**](GetMessageBodyRequest.md)| Tag of message queue and optionally a timestamp since from to start peeking |
**body** | [**GetMessageBodyRequest**](GetMessageBodyRequest.md)| Tag of message queue and optionally a timestamp since from to start peeking. When an empty object or an object with a `tag: 0` is provided, it fetches all the messages. |

### Return type

Expand Down Expand Up @@ -250,7 +250,7 @@ configuration.api_key['X-Auth-Token'] = 'YOUR_API_KEY'

# create an instance of the API class
api_instance = hoprd_sdk.MessagesApi(hoprd_sdk.ApiClient(configuration))
body = hoprd_sdk.TagQueryRequest() # TagQueryRequest | Tag of message queue to pop from
body = hoprd_sdk.TagQueryRequest() # TagQueryRequest | Tag of message queue to pop from. When an empty object or an object with a `tag: 0` is provided, it lists and removes all the messages.

try:
# Get the list of messages currently present in the nodes message inbox.
Expand All @@ -264,7 +264,7 @@ except ApiException as e:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**TagQueryRequest**](TagQueryRequest.md)| Tag of message queue to pop from |
**body** | [**TagQueryRequest**](TagQueryRequest.md)| Tag of message queue to pop from. When an empty object or an object with a `tag: 0` is provided, it lists and removes all the messages. |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/NodePeersResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**announced** | [**list[PeerInfo]**](PeerInfo.md) | |
**announced** | [**list[AnnouncedPeer]**](AnnouncedPeer.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)
Expand Down
1 change: 1 addition & 0 deletions hoprd_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from hoprd_sdk.models.account_addresses_response import AccountAddressesResponse
from hoprd_sdk.models.account_balances_response import AccountBalancesResponse
from hoprd_sdk.models.alias_peer_id_body_request import AliasPeerIdBodyRequest
from hoprd_sdk.models.announced_peer import AnnouncedPeer
from hoprd_sdk.models.api_error import ApiError
from hoprd_sdk.models.channel_info_response import ChannelInfoResponse
from hoprd_sdk.models.channel_ticket import ChannelTicket
Expand Down
8 changes: 4 additions & 4 deletions hoprd_sdk/api/messages_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def peek_all(self, body, **kwargs): # noqa: E501
>>> result = thread.get()

:param async_req bool
:param GetMessageBodyRequest body: Tag of message queue and optionally a timestamp since from to start peeking (required)
:param GetMessageBodyRequest body: Tag of message queue and optionally a timestamp since from to start peeking. When an empty object or an object with a `tag: 0` is provided, it fetches all the messages. (required)
:return: MessagePopAllResponse
If the method is called asynchronously,
returns the request thread.
Expand All @@ -254,7 +254,7 @@ def peek_all_with_http_info(self, body, **kwargs): # noqa: E501
>>> result = thread.get()

:param async_req bool
:param GetMessageBodyRequest body: Tag of message queue and optionally a timestamp since from to start peeking (required)
:param GetMessageBodyRequest body: Tag of message queue and optionally a timestamp since from to start peeking. When an empty object or an object with a `tag: 0` is provided, it fetches all the messages. (required)
:return: MessagePopAllResponse
If the method is called asynchronously,
returns the request thread.
Expand Down Expand Up @@ -430,7 +430,7 @@ def pop_all(self, body, **kwargs): # noqa: E501
>>> result = thread.get()

:param async_req bool
:param TagQueryRequest body: Tag of message queue to pop from (required)
:param TagQueryRequest body: Tag of message queue to pop from. When an empty object or an object with a `tag: 0` is provided, it lists and removes all the messages. (required)
:return: MessagePopAllResponse
If the method is called asynchronously,
returns the request thread.
Expand All @@ -452,7 +452,7 @@ def pop_all_with_http_info(self, body, **kwargs): # noqa: E501
>>> result = thread.get()

:param async_req bool
:param TagQueryRequest body: Tag of message queue to pop from (required)
:param TagQueryRequest body: Tag of message queue to pop from. When an empty object or an object with a `tag: 0` is provided, it lists and removes all the messages. (required)
:return: MessagePopAllResponse
If the method is called asynchronously,
returns the request thread.
Expand Down
1 change: 1 addition & 0 deletions hoprd_sdk/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from hoprd_sdk.models.account_addresses_response import AccountAddressesResponse
from hoprd_sdk.models.account_balances_response import AccountBalancesResponse
from hoprd_sdk.models.alias_peer_id_body_request import AliasPeerIdBodyRequest
from hoprd_sdk.models.announced_peer import AnnouncedPeer
from hoprd_sdk.models.api_error import ApiError
from hoprd_sdk.models.channel_info_response import ChannelInfoResponse
from hoprd_sdk.models.channel_ticket import ChannelTicket
Expand Down
138 changes: 138 additions & 0 deletions hoprd_sdk/models/announced_peer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# 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.2.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

import pprint
import re # noqa: F401

import six

class AnnouncedPeer(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_address': 'str',
'peer_id': 'str'
}

attribute_map = {
'peer_address': 'peerAddress',
'peer_id': 'peerId'
}

def __init__(self, peer_address=None, peer_id=None): # noqa: E501
"""AnnouncedPeer - a model defined in Swagger""" # noqa: E501
self._peer_address = None
self._peer_id = None
self.discriminator = None
self.peer_address = peer_address
self.peer_id = peer_id

@property
def peer_address(self):
"""Gets the peer_address of this AnnouncedPeer. # noqa: E501


:return: The peer_address of this AnnouncedPeer. # noqa: E501
:rtype: str
"""
return self._peer_address

@peer_address.setter
def peer_address(self, peer_address):
"""Sets the peer_address of this AnnouncedPeer.


:param peer_address: The peer_address of this AnnouncedPeer. # 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 peer_id(self):
"""Gets the peer_id of this AnnouncedPeer. # noqa: E501


:return: The peer_id of this AnnouncedPeer. # noqa: E501
:rtype: str
"""
return self._peer_id

@peer_id.setter
def peer_id(self, peer_id):
"""Sets the peer_id of this AnnouncedPeer.


:param peer_id: The peer_id of this AnnouncedPeer. # 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

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(AnnouncedPeer, 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, AnnouncedPeer):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other
6 changes: 3 additions & 3 deletions hoprd_sdk/models/node_peers_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class NodePeersResponse(object):
and the value is json key in definition.
"""
swagger_types = {
'announced': 'list[PeerInfo]',
'announced': 'list[AnnouncedPeer]',
'connected': 'list[PeerInfo]'
}

Expand All @@ -51,7 +51,7 @@ def announced(self):


:return: The announced of this NodePeersResponse. # noqa: E501
:rtype: list[PeerInfo]
:rtype: list[AnnouncedPeer]
"""
return self._announced

Expand All @@ -61,7 +61,7 @@ def announced(self, announced):


:param announced: The announced of this NodePeersResponse. # noqa: E501
:type: list[PeerInfo]
:type: list[AnnouncedPeer]
"""
if announced is None:
raise ValueError("Invalid value for `announced`, must not be `None`") # noqa: E501
Expand Down
39 changes: 39 additions & 0 deletions test/test_announced_peer.py
Original file line number Diff line number Diff line change
@@ -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.2.1
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import unittest

import hoprd_sdk

Check failure on line 17 in test/test_announced_peer.py

View workflow job for this annotation

GitHub Actions / Lint

[*] `hoprd_sdk` imported but unused
from hoprd_sdk.models.announced_peer import AnnouncedPeer # noqa: E501

Check failure on line 18 in test/test_announced_peer.py

View workflow job for this annotation

GitHub Actions / Lint

[*] `hoprd_sdk.models.announced_peer.AnnouncedPeer` imported but unused
from hoprd_sdk.rest import ApiException

Check failure on line 19 in test/test_announced_peer.py

View workflow job for this annotation

GitHub Actions / Lint

[*] `hoprd_sdk.rest.ApiException` imported but unused


class TestAnnouncedPeer(unittest.TestCase):
"""AnnouncedPeer unit test stubs"""

def setUp(self):
pass

def tearDown(self):
pass

def testAnnouncedPeer(self):
"""Test AnnouncedPeer"""
# FIXME: construct object with mandatory attributes with example values
# model = hoprd_sdk.models.announced_peer.AnnouncedPeer() # noqa: E501
pass


if __name__ == '__main__':
unittest.main()
Loading