Update message endpoint
This commit is contained in:
@@ -16,12 +16,14 @@ board_mate/message/models/__init__.py
|
||||
board_mate/message/models/message_dto.py
|
||||
board_mate/message/models/message_post_request_dto.py
|
||||
board_mate/message/models/response_body_list_message_dto.py
|
||||
board_mate/message/models/response_body_string.py
|
||||
board_mate/message/py.typed
|
||||
board_mate/message/rest.py
|
||||
docs/MessageApi.md
|
||||
docs/MessageDto.md
|
||||
docs/MessagePostRequestDto.md
|
||||
docs/ResponseBodyListMessageDto.md
|
||||
docs/ResponseBodyString.md
|
||||
git_push.sh
|
||||
pyproject.toml
|
||||
requirements.txt
|
||||
@@ -33,4 +35,5 @@ test/test_message_api.py
|
||||
test/test_message_dto.py
|
||||
test/test_message_post_request_dto.py
|
||||
test/test_response_body_list_message_dto.py
|
||||
test/test_response_body_string.py
|
||||
tox.ini
|
||||
|
||||
@@ -95,6 +95,7 @@ Class | Method | HTTP request | Description
|
||||
- [MessageDto](docs/MessageDto.md)
|
||||
- [MessagePostRequestDto](docs/MessagePostRequestDto.md)
|
||||
- [ResponseBodyListMessageDto](docs/ResponseBodyListMessageDto.md)
|
||||
- [ResponseBodyString](docs/ResponseBodyString.md)
|
||||
|
||||
|
||||
<a id="documentation-for-authorization"></a>
|
||||
|
||||
@@ -34,3 +34,4 @@ from board_mate.message.exceptions import ApiException
|
||||
from board_mate.message.models.message_dto import MessageDto
|
||||
from board_mate.message.models.message_post_request_dto import MessagePostRequestDto
|
||||
from board_mate.message.models.response_body_list_message_dto import ResponseBodyListMessageDto
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
|
||||
@@ -20,10 +20,10 @@ from pydantic import validate_arguments, ValidationError
|
||||
|
||||
from pydantic import StrictInt, StrictStr
|
||||
|
||||
from typing import List, Optional
|
||||
from typing import Optional
|
||||
|
||||
from board_mate.message.models.message_post_request_dto import MessagePostRequestDto
|
||||
from board_mate.message.models.response_body_list_message_dto import ResponseBodyListMessageDto
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
|
||||
from board_mate.message.api_client import ApiClient
|
||||
from board_mate.message.api_response import ApiResponse
|
||||
@@ -46,7 +46,7 @@ class MessageApi:
|
||||
self.api_client = api_client
|
||||
|
||||
@validate_arguments
|
||||
def history(self, client_id : StrictStr, top : Optional[StrictInt] = None, **kwargs) -> List[ResponseBodyListMessageDto]: # noqa: E501
|
||||
def history(self, client_id : StrictStr, top : Optional[StrictInt] = None, **kwargs) -> ResponseBodyString: # noqa: E501
|
||||
"""GET message/history/{clientId} # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -68,7 +68,7 @@ class MessageApi:
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: List[ResponseBodyListMessageDto]
|
||||
:rtype: ResponseBodyString
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if '_preload_content' in kwargs:
|
||||
@@ -112,7 +112,7 @@ class MessageApi:
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(List[ResponseBodyListMessageDto], status_code(int), headers(HTTPHeaderDict))
|
||||
:rtype: tuple(ResponseBodyString, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
_params = locals()
|
||||
@@ -171,7 +171,7 @@ class MessageApi:
|
||||
_auth_settings = [] # noqa: E501
|
||||
|
||||
_response_types_map = {
|
||||
'200': "List[ResponseBodyListMessageDto]",
|
||||
'200': "ResponseBodyString",
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
@@ -192,7 +192,7 @@ class MessageApi:
|
||||
_request_auth=_params.get('_request_auth'))
|
||||
|
||||
@validate_arguments
|
||||
def post_message(self, message_post_request_dto : MessagePostRequestDto, **kwargs) -> str: # noqa: E501
|
||||
def post_message(self, message_post_request_dto : MessagePostRequestDto, **kwargs) -> ResponseBodyString: # noqa: E501
|
||||
"""POST message/send # noqa: E501
|
||||
|
||||
This method makes a synchronous HTTP request by default. To make an
|
||||
@@ -212,7 +212,7 @@ class MessageApi:
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: str
|
||||
:rtype: ResponseBodyString
|
||||
"""
|
||||
kwargs['_return_http_data_only'] = True
|
||||
if '_preload_content' in kwargs:
|
||||
@@ -254,7 +254,7 @@ class MessageApi:
|
||||
:return: Returns the result object.
|
||||
If the method is called asynchronously,
|
||||
returns the request thread.
|
||||
:rtype: tuple(str, status_code(int), headers(HTTPHeaderDict))
|
||||
:rtype: tuple(ResponseBodyString, status_code(int), headers(HTTPHeaderDict))
|
||||
"""
|
||||
|
||||
_params = locals()
|
||||
@@ -316,7 +316,7 @@ class MessageApi:
|
||||
_auth_settings = [] # noqa: E501
|
||||
|
||||
_response_types_map = {
|
||||
'200': "str",
|
||||
'200': "ResponseBodyString",
|
||||
}
|
||||
|
||||
return self.api_client.call_api(
|
||||
|
||||
@@ -17,3 +17,4 @@
|
||||
from board_mate.message.models.message_dto import MessageDto
|
||||
from board_mate.message.models.message_post_request_dto import MessagePostRequestDto
|
||||
from board_mate.message.models.response_body_list_message_dto import ResponseBodyListMessageDto
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
boardmate_api API
|
||||
|
||||
boardmate_api API
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
|
||||
from typing import Optional
|
||||
from pydantic import BaseModel, StrictBool, StrictStr
|
||||
|
||||
class ResponseBodyString(BaseModel):
|
||||
"""
|
||||
ResponseBodyString
|
||||
"""
|
||||
data: Optional[StrictStr] = None
|
||||
message: Optional[StrictStr] = None
|
||||
success: Optional[StrictBool] = None
|
||||
__properties = ["data", "message", "success"]
|
||||
|
||||
class Config:
|
||||
"""Pydantic configuration"""
|
||||
allow_population_by_field_name = True
|
||||
validate_assignment = True
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.dict(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> ResponseBodyString:
|
||||
"""Create an instance of ResponseBodyString from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the dictionary representation of the model using alias"""
|
||||
_dict = self.dict(by_alias=True,
|
||||
exclude={
|
||||
},
|
||||
exclude_none=True)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: dict) -> ResponseBodyString:
|
||||
"""Create an instance of ResponseBodyString from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return ResponseBodyString.parse_obj(obj)
|
||||
|
||||
_obj = ResponseBodyString.parse_obj({
|
||||
"data": obj.get("data"),
|
||||
"message": obj.get("message"),
|
||||
"success": obj.get("success")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **history**
|
||||
> List[ResponseBodyListMessageDto] history(client_id, top=top)
|
||||
> ResponseBodyString history(client_id, top=top)
|
||||
|
||||
GET message/history/{clientId}
|
||||
|
||||
@@ -19,7 +19,7 @@ GET message/history/{clientId}
|
||||
import time
|
||||
import os
|
||||
import board_mate.message
|
||||
from board_mate.message.models.response_body_list_message_dto import ResponseBodyListMessageDto
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
from board_mate.message.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
@@ -57,7 +57,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
[**List[ResponseBodyListMessageDto]**](ResponseBodyListMessageDto.md)
|
||||
[**ResponseBodyString**](ResponseBodyString.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -76,7 +76,7 @@ No authorization required
|
||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||
|
||||
# **post_message**
|
||||
> str post_message(message_post_request_dto)
|
||||
> ResponseBodyString post_message(message_post_request_dto)
|
||||
|
||||
POST message/send
|
||||
|
||||
@@ -87,6 +87,7 @@ import time
|
||||
import os
|
||||
import board_mate.message
|
||||
from board_mate.message.models.message_post_request_dto import MessagePostRequestDto
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
from board_mate.message.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
@@ -122,7 +123,7 @@ Name | Type | Description | Notes
|
||||
|
||||
### Return type
|
||||
|
||||
**str**
|
||||
[**ResponseBodyString**](ResponseBodyString.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
# ResponseBodyString
|
||||
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**data** | **str** | | [optional]
|
||||
**message** | **str** | | [optional]
|
||||
**success** | **bool** | | [optional]
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of ResponseBodyString from a JSON string
|
||||
response_body_string_instance = ResponseBodyString.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print ResponseBodyString.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
response_body_string_dict = response_body_string_instance.to_dict()
|
||||
# create an instance of ResponseBodyString from a dict
|
||||
response_body_string_form_dict = response_body_string.from_dict(response_body_string_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
boardmate_api API
|
||||
|
||||
boardmate_api API
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
import unittest
|
||||
import datetime
|
||||
|
||||
from board_mate.message.models.response_body_string import ResponseBodyString # noqa: E501
|
||||
|
||||
class TestResponseBodyString(unittest.TestCase):
|
||||
"""ResponseBodyString unit test stubs"""
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
|
||||
def tearDown(self):
|
||||
pass
|
||||
|
||||
def make_instance(self, include_optional) -> ResponseBodyString:
|
||||
"""Test ResponseBodyString
|
||||
include_option is a boolean, when False only required
|
||||
params are included, when True both required and
|
||||
optional params are included """
|
||||
# uncomment below to create an instance of `ResponseBodyString`
|
||||
"""
|
||||
model = ResponseBodyString() # noqa: E501
|
||||
if include_optional:
|
||||
return ResponseBodyString(
|
||||
data = '',
|
||||
message = '',
|
||||
success = True
|
||||
)
|
||||
else:
|
||||
return ResponseBodyString(
|
||||
)
|
||||
"""
|
||||
|
||||
def testResponseBodyString(self):
|
||||
"""Test ResponseBodyString"""
|
||||
# inst_req_only = self.make_instance(include_optional=False)
|
||||
# inst_req_and_optional = self.make_instance(include_optional=True)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user