Fucking tag
This commit is contained in:
@@ -7,7 +7,7 @@ README.md
|
||||
board_mate/__init__.py
|
||||
board_mate/mail/__init__.py
|
||||
board_mate/mail/api/__init__.py
|
||||
board_mate/mail/api/default_api.py
|
||||
board_mate/mail/api/mail_api.py
|
||||
board_mate/mail/api_client.py
|
||||
board_mate/mail/api_response.py
|
||||
board_mate/mail/configuration.py
|
||||
@@ -15,7 +15,7 @@ board_mate/mail/exceptions.py
|
||||
board_mate/mail/models/__init__.py
|
||||
board_mate/mail/py.typed
|
||||
board_mate/mail/rest.py
|
||||
docs/DefaultApi.md
|
||||
docs/MailApi.md
|
||||
git_push.sh
|
||||
pyproject.toml
|
||||
requirements.txt
|
||||
@@ -23,5 +23,5 @@ setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
test/test_default_api.py
|
||||
test/test_mail_api.py
|
||||
tox.ini
|
||||
|
||||
@@ -66,16 +66,16 @@ configuration = board_mate.mail.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with board_mate.mail.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = board_mate.mail.DefaultApi(api_client)
|
||||
api_instance = board_mate.mail.MailApi(api_client)
|
||||
body = 'body_example' # str |
|
||||
|
||||
try:
|
||||
# POST mail/send
|
||||
api_response = api_instance.send(body)
|
||||
print("The response of DefaultApi->send:\n")
|
||||
print("The response of MailApi->send:\n")
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling DefaultApi->send: %s\n" % e)
|
||||
print("Exception when calling MailApi->send: %s\n" % e)
|
||||
|
||||
```
|
||||
|
||||
@@ -85,7 +85,7 @@ All URIs are relative to *https://boardmate_api*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*DefaultApi* | [**send**](docs/DefaultApi.md#send) | **POST** /mail/send | POST mail/send
|
||||
*MailApi* | [**send**](docs/MailApi.md#send) | **POST** /mail/send | POST mail/send
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from board_mate.mail.api.default_api import DefaultApi
|
||||
from board_mate.mail.api.mail_api import MailApi
|
||||
|
||||
# import ApiClient
|
||||
from board_mate.mail.api_response import ApiResponse
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# flake8: noqa
|
||||
|
||||
# import apis into api package
|
||||
from board_mate.mail.api.default_api import DefaultApi
|
||||
from board_mate.mail.api.mail_api import MailApi
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ from board_mate.mail.exceptions import ( # noqa: F401
|
||||
)
|
||||
|
||||
|
||||
class DefaultApi:
|
||||
class MailApi:
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# board_mate.mail.DefaultApi
|
||||
# board_mate.mail.MailApi
|
||||
|
||||
All URIs are relative to *https://boardmate_api*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**send**](DefaultApi.md#send) | **POST** /mail/send | POST mail/send
|
||||
[**send**](MailApi.md#send) | **POST** /mail/send | POST mail/send
|
||||
|
||||
|
||||
# **send**
|
||||
@@ -31,16 +31,16 @@ configuration = board_mate.mail.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with board_mate.mail.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = board_mate.mail.DefaultApi(api_client)
|
||||
api_instance = board_mate.mail.MailApi(api_client)
|
||||
body = 'body_example' # str |
|
||||
|
||||
try:
|
||||
# POST mail/send
|
||||
api_response = api_instance.send(body)
|
||||
print("The response of DefaultApi->send:\n")
|
||||
print("The response of MailApi->send:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DefaultApi->send: %s\n" % e)
|
||||
print("Exception when calling MailApi->send: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from board_mate.mail.api.default_api import DefaultApi # noqa: E501
|
||||
from board_mate.mail.api.mail_api import MailApi # noqa: E501
|
||||
|
||||
|
||||
class TestDefaultApi(unittest.TestCase):
|
||||
"""DefaultApi unit test stubs"""
|
||||
class TestMailApi(unittest.TestCase):
|
||||
"""MailApi unit test stubs"""
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.api = DefaultApi() # noqa: E501
|
||||
self.api = MailApi() # noqa: E501
|
||||
|
||||
def tearDown(self) -> None:
|
||||
pass
|
||||
@@ -10,6 +10,8 @@ paths:
|
||||
post:
|
||||
summary: "POST mail/send"
|
||||
operationId: "send"
|
||||
tags:
|
||||
- Mail
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
|
||||
@@ -7,7 +7,7 @@ README.md
|
||||
board_mate/__init__.py
|
||||
board_mate/sms/__init__.py
|
||||
board_mate/sms/api/__init__.py
|
||||
board_mate/sms/api/default_api.py
|
||||
board_mate/sms/api/sms_api.py
|
||||
board_mate/sms/api_client.py
|
||||
board_mate/sms/api_response.py
|
||||
board_mate/sms/configuration.py
|
||||
@@ -15,7 +15,7 @@ board_mate/sms/exceptions.py
|
||||
board_mate/sms/models/__init__.py
|
||||
board_mate/sms/py.typed
|
||||
board_mate/sms/rest.py
|
||||
docs/DefaultApi.md
|
||||
docs/SmsApi.md
|
||||
git_push.sh
|
||||
pyproject.toml
|
||||
requirements.txt
|
||||
@@ -23,5 +23,5 @@ setup.cfg
|
||||
setup.py
|
||||
test-requirements.txt
|
||||
test/__init__.py
|
||||
test/test_default_api.py
|
||||
test/test_sms_api.py
|
||||
tox.ini
|
||||
|
||||
@@ -66,16 +66,16 @@ configuration = board_mate.sms.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with board_mate.sms.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = board_mate.sms.DefaultApi(api_client)
|
||||
api_instance = board_mate.sms.SmsApi(api_client)
|
||||
body = 'body_example' # str |
|
||||
|
||||
try:
|
||||
# POST sms/send
|
||||
api_response = api_instance.example(body)
|
||||
print("The response of DefaultApi->example:\n")
|
||||
print("The response of SmsApi->example:\n")
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print("Exception when calling DefaultApi->example: %s\n" % e)
|
||||
print("Exception when calling SmsApi->example: %s\n" % e)
|
||||
|
||||
```
|
||||
|
||||
@@ -85,7 +85,7 @@ All URIs are relative to *https://boardmate_api*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*DefaultApi* | [**example**](docs/DefaultApi.md#example) | **POST** /sms/send | POST sms/send
|
||||
*SmsApi* | [**example**](docs/SmsApi.md#example) | **POST** /sms/send | POST sms/send
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
__version__ = "1.0.0"
|
||||
|
||||
# import apis into sdk package
|
||||
from board_mate.sms.api.default_api import DefaultApi
|
||||
from board_mate.sms.api.sms_api import SmsApi
|
||||
|
||||
# import ApiClient
|
||||
from board_mate.sms.api_response import ApiResponse
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# flake8: noqa
|
||||
|
||||
# import apis into api package
|
||||
from board_mate.sms.api.default_api import DefaultApi
|
||||
from board_mate.sms.api.sms_api import SmsApi
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ from board_mate.sms.exceptions import ( # noqa: F401
|
||||
)
|
||||
|
||||
|
||||
class DefaultApi:
|
||||
class SmsApi:
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||
Ref: https://openapi-generator.tech
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# board_mate.sms.DefaultApi
|
||||
# board_mate.sms.SmsApi
|
||||
|
||||
All URIs are relative to *https://boardmate_api*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**example**](DefaultApi.md#example) | **POST** /sms/send | POST sms/send
|
||||
[**example**](SmsApi.md#example) | **POST** /sms/send | POST sms/send
|
||||
|
||||
|
||||
# **example**
|
||||
@@ -31,16 +31,16 @@ configuration = board_mate.sms.Configuration(
|
||||
# Enter a context with an instance of the API client
|
||||
with board_mate.sms.ApiClient(configuration) as api_client:
|
||||
# Create an instance of the API class
|
||||
api_instance = board_mate.sms.DefaultApi(api_client)
|
||||
api_instance = board_mate.sms.SmsApi(api_client)
|
||||
body = 'body_example' # str |
|
||||
|
||||
try:
|
||||
# POST sms/send
|
||||
api_response = api_instance.example(body)
|
||||
print("The response of DefaultApi->example:\n")
|
||||
print("The response of SmsApi->example:\n")
|
||||
pprint(api_response)
|
||||
except Exception as e:
|
||||
print("Exception when calling DefaultApi->example: %s\n" % e)
|
||||
print("Exception when calling SmsApi->example: %s\n" % e)
|
||||
```
|
||||
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
|
||||
import unittest
|
||||
|
||||
from board_mate.sms.api.default_api import DefaultApi # noqa: E501
|
||||
from board_mate.sms.api.sms_api import SmsApi # noqa: E501
|
||||
|
||||
|
||||
class TestDefaultApi(unittest.TestCase):
|
||||
"""DefaultApi unit test stubs"""
|
||||
class TestSmsApi(unittest.TestCase):
|
||||
"""SmsApi unit test stubs"""
|
||||
|
||||
def setUp(self) -> None:
|
||||
self.api = DefaultApi() # noqa: E501
|
||||
self.api = SmsApi() # noqa: E501
|
||||
|
||||
def tearDown(self) -> None:
|
||||
pass
|
||||
@@ -10,6 +10,8 @@ paths:
|
||||
post:
|
||||
summary: "POST sms/send"
|
||||
operationId: "example"
|
||||
tags:
|
||||
- Sms
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
|
||||
14
api-customer/open-api.md
Normal file
14
api-customer/open-api.md
Normal file
@@ -0,0 +1,14 @@
|
||||
```bash
|
||||
java -jar ./api-resources/openapi-generator-cli.jar \
|
||||
generate -i "./api-resources/endpoint.yaml" \
|
||||
-g python -o "./api-resources/endpoint-components" \
|
||||
--package-name "package.endpoint
|
||||
```
|
||||
|
||||
```bash
|
||||
echo "file:./api-resources/mail-components" > requirements.txt
|
||||
```
|
||||
|
||||
```bash
|
||||
python -m pip install -r requirements.txt
|
||||
```
|
||||
33
api-customer/src/controllers/sms_controller.py
Normal file
33
api-customer/src/controllers/sms_controller.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import json
|
||||
|
||||
from board_mate.sms import ApiClient
|
||||
from flask import request
|
||||
|
||||
|
||||
class SmsController:
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
def send(self):
|
||||
try:
|
||||
with ApiClient(self.config) as api:
|
||||
req = request.get_json()
|
||||
content = req["content"]
|
||||
payload = json.dumps({"content": content})
|
||||
print(payload)
|
||||
|
||||
api.default_headers["Authorization"] = f"Bearer {self._auth_data.get_token()}"
|
||||
message_api = SmsApi(api)
|
||||
|
||||
new_message = MessagePostRequestDto(
|
||||
content=content,
|
||||
timeStamp=timestamp,
|
||||
clientId=StrictStr(self._auth_data.get_client_id())
|
||||
)
|
||||
|
||||
message_api.post_message(new_message)
|
||||
return jsonify({"success": True, "message": None}), 200
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return jsonify({"success": False,
|
||||
"message": f"An error occurred : {self._auth_data.get_token()} {self._auth_data.get_client_id()} \n {e}"}), 500
|
||||
Reference in New Issue
Block a user