Fucking tag
This commit is contained in:
@@ -7,7 +7,7 @@ README.md
|
|||||||
board_mate/__init__.py
|
board_mate/__init__.py
|
||||||
board_mate/mail/__init__.py
|
board_mate/mail/__init__.py
|
||||||
board_mate/mail/api/__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_client.py
|
||||||
board_mate/mail/api_response.py
|
board_mate/mail/api_response.py
|
||||||
board_mate/mail/configuration.py
|
board_mate/mail/configuration.py
|
||||||
@@ -15,7 +15,7 @@ board_mate/mail/exceptions.py
|
|||||||
board_mate/mail/models/__init__.py
|
board_mate/mail/models/__init__.py
|
||||||
board_mate/mail/py.typed
|
board_mate/mail/py.typed
|
||||||
board_mate/mail/rest.py
|
board_mate/mail/rest.py
|
||||||
docs/DefaultApi.md
|
docs/MailApi.md
|
||||||
git_push.sh
|
git_push.sh
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
requirements.txt
|
requirements.txt
|
||||||
@@ -23,5 +23,5 @@ setup.cfg
|
|||||||
setup.py
|
setup.py
|
||||||
test-requirements.txt
|
test-requirements.txt
|
||||||
test/__init__.py
|
test/__init__.py
|
||||||
test/test_default_api.py
|
test/test_mail_api.py
|
||||||
tox.ini
|
tox.ini
|
||||||
|
|||||||
@@ -66,16 +66,16 @@ configuration = board_mate.mail.Configuration(
|
|||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with board_mate.mail.ApiClient(configuration) as api_client:
|
with board_mate.mail.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# 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 |
|
body = 'body_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# POST mail/send
|
# POST mail/send
|
||||||
api_response = api_instance.send(body)
|
api_response = api_instance.send(body)
|
||||||
print("The response of DefaultApi->send:\n")
|
print("The response of MailApi->send:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except ApiException as e:
|
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
|
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
|
## Documentation For Models
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
__version__ = "1.0.0"
|
__version__ = "1.0.0"
|
||||||
|
|
||||||
# import apis into sdk package
|
# 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
|
# import ApiClient
|
||||||
from board_mate.mail.api_response import ApiResponse
|
from board_mate.mail.api_response import ApiResponse
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
|
|
||||||
# import apis into api package
|
# 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
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
Ref: https://openapi-generator.tech
|
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*
|
All URIs are relative to *https://boardmate_api*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
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**
|
# **send**
|
||||||
@@ -31,16 +31,16 @@ configuration = board_mate.mail.Configuration(
|
|||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with board_mate.mail.ApiClient(configuration) as api_client:
|
with board_mate.mail.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# 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 |
|
body = 'body_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# POST mail/send
|
# POST mail/send
|
||||||
api_response = api_instance.send(body)
|
api_response = api_instance.send(body)
|
||||||
print("The response of DefaultApi->send:\n")
|
print("The response of MailApi->send:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
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
|
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):
|
class TestMailApi(unittest.TestCase):
|
||||||
"""DefaultApi unit test stubs"""
|
"""MailApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.api = DefaultApi() # noqa: E501
|
self.api = MailApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self) -> None:
|
||||||
pass
|
pass
|
||||||
@@ -10,6 +10,8 @@ paths:
|
|||||||
post:
|
post:
|
||||||
summary: "POST mail/send"
|
summary: "POST mail/send"
|
||||||
operationId: "send"
|
operationId: "send"
|
||||||
|
tags:
|
||||||
|
- Mail
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ README.md
|
|||||||
board_mate/__init__.py
|
board_mate/__init__.py
|
||||||
board_mate/sms/__init__.py
|
board_mate/sms/__init__.py
|
||||||
board_mate/sms/api/__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_client.py
|
||||||
board_mate/sms/api_response.py
|
board_mate/sms/api_response.py
|
||||||
board_mate/sms/configuration.py
|
board_mate/sms/configuration.py
|
||||||
@@ -15,7 +15,7 @@ board_mate/sms/exceptions.py
|
|||||||
board_mate/sms/models/__init__.py
|
board_mate/sms/models/__init__.py
|
||||||
board_mate/sms/py.typed
|
board_mate/sms/py.typed
|
||||||
board_mate/sms/rest.py
|
board_mate/sms/rest.py
|
||||||
docs/DefaultApi.md
|
docs/SmsApi.md
|
||||||
git_push.sh
|
git_push.sh
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
requirements.txt
|
requirements.txt
|
||||||
@@ -23,5 +23,5 @@ setup.cfg
|
|||||||
setup.py
|
setup.py
|
||||||
test-requirements.txt
|
test-requirements.txt
|
||||||
test/__init__.py
|
test/__init__.py
|
||||||
test/test_default_api.py
|
test/test_sms_api.py
|
||||||
tox.ini
|
tox.ini
|
||||||
|
|||||||
@@ -66,16 +66,16 @@ configuration = board_mate.sms.Configuration(
|
|||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with board_mate.sms.ApiClient(configuration) as api_client:
|
with board_mate.sms.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# 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 |
|
body = 'body_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# POST sms/send
|
# POST sms/send
|
||||||
api_response = api_instance.example(body)
|
api_response = api_instance.example(body)
|
||||||
print("The response of DefaultApi->example:\n")
|
print("The response of SmsApi->example:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except ApiException as e:
|
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
|
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
|
## Documentation For Models
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
__version__ = "1.0.0"
|
__version__ = "1.0.0"
|
||||||
|
|
||||||
# import apis into sdk package
|
# 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
|
# import ApiClient
|
||||||
from board_mate.sms.api_response import ApiResponse
|
from board_mate.sms.api_response import ApiResponse
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
|
|
||||||
# import apis into api package
|
# 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
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
Ref: https://openapi-generator.tech
|
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*
|
All URIs are relative to *https://boardmate_api*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
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**
|
# **example**
|
||||||
@@ -31,16 +31,16 @@ configuration = board_mate.sms.Configuration(
|
|||||||
# Enter a context with an instance of the API client
|
# Enter a context with an instance of the API client
|
||||||
with board_mate.sms.ApiClient(configuration) as api_client:
|
with board_mate.sms.ApiClient(configuration) as api_client:
|
||||||
# Create an instance of the API class
|
# 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 |
|
body = 'body_example' # str |
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# POST sms/send
|
# POST sms/send
|
||||||
api_response = api_instance.example(body)
|
api_response = api_instance.example(body)
|
||||||
print("The response of DefaultApi->example:\n")
|
print("The response of SmsApi->example:\n")
|
||||||
pprint(api_response)
|
pprint(api_response)
|
||||||
except Exception as e:
|
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
|
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):
|
class TestSmsApi(unittest.TestCase):
|
||||||
"""DefaultApi unit test stubs"""
|
"""SmsApi unit test stubs"""
|
||||||
|
|
||||||
def setUp(self) -> None:
|
def setUp(self) -> None:
|
||||||
self.api = DefaultApi() # noqa: E501
|
self.api = SmsApi() # noqa: E501
|
||||||
|
|
||||||
def tearDown(self) -> None:
|
def tearDown(self) -> None:
|
||||||
pass
|
pass
|
||||||
@@ -10,6 +10,8 @@ paths:
|
|||||||
post:
|
post:
|
||||||
summary: "POST sms/send"
|
summary: "POST sms/send"
|
||||||
operationId: "example"
|
operationId: "example"
|
||||||
|
tags:
|
||||||
|
- Sms
|
||||||
requestBody:
|
requestBody:
|
||||||
content:
|
content:
|
||||||
application/json:
|
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