diff --git a/message/.gitignore b/message/.gitignore new file mode 100755 index 000000000..9072ad43b --- /dev/null +++ b/message/.gitignore @@ -0,0 +1,5 @@ +venv/ +src/*.egg-info/ +__pycache__/ +.pytest_cache/ +.python-version` \ No newline at end of file diff --git a/message/README.md b/message/README.md index 98f91d936..33baf0986 100755 --- a/message/README.md +++ b/message/README.md @@ -12,17 +12,108 @@ pip install git+https://github.com/epilot-dev/sdk-python.git#subdirectory=messag ```python import epilot -from epilot.models import operations, shared +from epilot.models import shared s = epilot.Epilot( security=shared.Security( - epilot_auth="Bearer YOUR_BEARER_TOKEN_HERE", + epilot_auth="", ), ) +req = shared.MessageRequestParams( + bcc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.BOUNCE, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], + cc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], + file=shared.AttachmentsRelation( + dollar_relation=[ + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + ], + ), + from_=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + html='
We at ABC GmbH would like to request a price quote for the solar panel.
', + parent_id='44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2', + reply_to=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + subject='Request for solar panel price', + text='We at ABC GmbH would like to request a price quote for the solar panel.', + thread=shared.MessageRequestParamsThread( + assigned_to=[ + 'iure', + 'magnam', + ], + topic='debitis', + ), + to=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], +) -req = "unde" - res = s.drafts.create_draft(req) if res.create_draft_201_application_json_object is not None: @@ -31,35 +122,35 @@ if res.create_draft_201_application_json_object is not None: -## SDK Available Operations +## Available Resources and Operations -### drafts +### [drafts](docs/sdks/drafts/README.md) -* `create_draft` - createDraft -* `send_draft` - sendDraft +* [create_draft](docs/sdks/drafts/README.md#create_draft) - createDraft +* [send_draft](docs/sdks/drafts/README.md#send_draft) - sendDraft -### messages +### [messages](docs/sdks/messages/README.md) -* `delete_message` - deleteMessage -* `get_message` - getMessage -* `mark_read_message` - markReadMessage -* `mark_unread_message` - markUnreadMessage -* `send_message` - sendMessage -* `trash_message` - trashMessage -* `untrash_message` - untrashMessage -* `update_message` - updateMessage +* [delete_message](docs/sdks/messages/README.md#delete_message) - deleteMessage +* [get_message](docs/sdks/messages/README.md#get_message) - getMessage +* [mark_read_message](docs/sdks/messages/README.md#mark_read_message) - markReadMessage +* [mark_unread_message](docs/sdks/messages/README.md#mark_unread_message) - markUnreadMessage +* [send_message](docs/sdks/messages/README.md#send_message) - sendMessage +* [trash_message](docs/sdks/messages/README.md#trash_message) - trashMessage +* [untrash_message](docs/sdks/messages/README.md#untrash_message) - untrashMessage +* [update_message](docs/sdks/messages/README.md#update_message) - updateMessage -### threads +### [threads](docs/sdks/threads/README.md) -* `assign_thread` - assignThread -* `delete_thread` - deleteThread -* `mark_read_thread` - markReadThread -* `mark_unread_thread` - markUnreadThread -* `search_threads` - searchThreads -* `trash_thread` - trashThread -* `untrash_thread` - untrashThread -* `update_thread` - updateThread +* [assign_thread](docs/sdks/threads/README.md#assign_thread) - assignThread +* [delete_thread](docs/sdks/threads/README.md#delete_thread) - deleteThread +* [mark_read_thread](docs/sdks/threads/README.md#mark_read_thread) - markReadThread +* [mark_unread_thread](docs/sdks/threads/README.md#mark_unread_thread) - markUnreadThread +* [search_threads](docs/sdks/threads/README.md#search_threads) - searchThreads +* [trash_thread](docs/sdks/threads/README.md#trash_thread) - trashThread +* [untrash_thread](docs/sdks/threads/README.md#untrash_thread) - untrashThread +* [update_thread](docs/sdks/threads/README.md#update_thread) - updateThread ### SDK Generated by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/message/RELEASES.md b/message/RELEASES.md index cb372def0..f9e527f3d 100644 --- a/message/RELEASES.md +++ b/message/RELEASES.md @@ -34,4 +34,208 @@ Based on: ### Changes Based on: - OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml -- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy \ No newline at end of file +- Speakeasy CLI 1.19.2 (2.16.5) https://github.com/speakeasy-api/speakeasy + +## 2023-04-01 01:02:01 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.19.3 (2.16.7) https://github.com/speakeasy-api/speakeasy + +## 2023-04-06 00:57:39 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy + +## 2023-04-12 00:59:29 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy + +## 2023-04-14 00:58:46 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.20.0 (2.18.0) https://github.com/speakeasy-api/speakeasy + +## 2023-04-18 00:58:28 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.20.1 (2.18.1) https://github.com/speakeasy-api/speakeasy + +## 2023-04-19 01:01:44 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.20.2 (2.18.2) https://github.com/speakeasy-api/speakeasy + +## 2023-04-21 00:58:50 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.21.4 (2.19.1) https://github.com/speakeasy-api/speakeasy + +## 2023-04-22 01:00:07 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.22.1 (2.20.1) https://github.com/speakeasy-api/speakeasy + +## 2023-04-26 01:00:15 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.23.1 (2.21.1) https://github.com/speakeasy-api/speakeasy + +## 2023-04-27 01:02:00 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.25.1 (2.22.0) https://github.com/speakeasy-api/speakeasy + +## 2023-04-28 01:01:39 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.26.2 (2.23.2) https://github.com/speakeasy-api/speakeasy + +## 2023-04-29 00:58:48 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.26.4 (2.23.4) https://github.com/speakeasy-api/speakeasy + +## 2023-05-02 01:01:26 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.26.5 (2.23.6) https://github.com/speakeasy-api/speakeasy + +## 2023-05-03 01:01:00 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.27.0 (2.24.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-05 00:55:58 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.29.0 (2.26.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-06 00:56:07 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.29.1 (2.26.1) https://github.com/speakeasy-api/speakeasy + +## 2023-05-10 00:59:19 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.29.2 (2.26.2) https://github.com/speakeasy-api/speakeasy + +## 2023-05-11 01:00:45 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.30.0 (2.26.3) https://github.com/speakeasy-api/speakeasy + +## 2023-05-12 01:00:04 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.30.1 (2.26.4) https://github.com/speakeasy-api/speakeasy + +## 2023-05-13 00:58:13 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.31.1 (2.27.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-16 01:01:27 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.32.0 (2.28.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-17 01:02:57 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.33.2 (2.29.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-18 00:59:55 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.34.0 (2.30.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-19 01:01:42 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.35.0 (2.31.0) https://github.com/speakeasy-api/speakeasy + +## 2023-05-23 01:01:06 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.37.5 (2.32.2) https://github.com/speakeasy-api/speakeasy + +## 2023-05-27 01:03:14 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.39.0 (2.32.7) https://github.com/speakeasy-api/speakeasy + +## 2023-06-01 01:23:35 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.40.2 (2.34.2) https://github.com/speakeasy-api/speakeasy + +## 2023-06-02 01:11:14 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.40.3 (2.34.7) https://github.com/speakeasy-api/speakeasy + +## 2023-06-03 01:09:04 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.43.0 (2.35.3) https://github.com/speakeasy-api/speakeasy + +## 2023-06-07 01:13:28 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.44.2 (2.35.9) https://github.com/speakeasy-api/speakeasy + +## 2023-06-08 01:10:56 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.45.0 (2.37.0) https://github.com/speakeasy-api/speakeasy + +## 2023-06-09 01:12:30 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.45.2 (2.37.2) https://github.com/speakeasy-api/speakeasy + +## 2023-06-10 01:05:41 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.47.0 (2.39.0) https://github.com/speakeasy-api/speakeasy + +## 2023-06-11 01:17:09 +### Changes +Based on: +- OpenAPI Doc 1.0.0 https://docs.api.epilot.io/message.yaml +- Speakeasy CLI 1.47.1 (2.39.2) https://github.com/speakeasy-api/speakeasy \ No newline at end of file diff --git a/message/USAGE.md b/message/USAGE.md index 3e30ad7fb..cd69ff494 100755 --- a/message/USAGE.md +++ b/message/USAGE.md @@ -1,17 +1,108 @@ ```python import epilot -from epilot.models import operations, shared +from epilot.models import shared s = epilot.Epilot( security=shared.Security( - epilot_auth="Bearer YOUR_BEARER_TOKEN_HERE", + epilot_auth="", ), ) +req = shared.MessageRequestParams( + bcc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.BOUNCE, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], + cc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], + file=shared.AttachmentsRelation( + dollar_relation=[ + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + ], + ), + from_=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + html='
We at ABC GmbH would like to request a price quote for the solar panel.
', + parent_id='44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2', + reply_to=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + subject='Request for solar panel price', + text='We at ABC GmbH would like to request a price quote for the solar panel.', + thread=shared.MessageRequestParamsThread( + assigned_to=[ + 'iure', + 'magnam', + ], + topic='debitis', + ), + to=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + ], +) -req = "unde" - res = s.drafts.create_draft(req) if res.create_draft_201_application_json_object is not None: diff --git a/message/docs/models/operations/assignthreadrequest.md b/message/docs/models/operations/assignthreadrequest.md new file mode 100755 index 000000000..945ef8c77 --- /dev/null +++ b/message/docs/models/operations/assignthreadrequest.md @@ -0,0 +1,9 @@ +# AssignThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `request_body` | list[[AssignThreadRequestBody](../../models/operations/assignthreadrequestbody.md)] | :heavy_check_mark: | N/A | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/assignthreadrequestbody.md b/message/docs/models/operations/assignthreadrequestbody.md new file mode 100755 index 000000000..472758721 --- /dev/null +++ b/message/docs/models/operations/assignthreadrequestbody.md @@ -0,0 +1,10 @@ +# AssignThreadRequestBody + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `entity_id` | *Optional[str]* | :heavy_minus_sign: | Entity ID | 3f34ce73-089c-4d45-a5ee-c161234e41c3 | +| `is_main_entity` | *Optional[bool]* | :heavy_minus_sign: | To indicate this is main entity | true | +| `slug` | *Optional[str]* | :heavy_minus_sign: | Entity slug | contact | \ No newline at end of file diff --git a/message/docs/models/operations/assignthreadresponse.md b/message/docs/models/operations/assignthreadresponse.md new file mode 100755 index 000000000..30b822ba6 --- /dev/null +++ b/message/docs/models/operations/assignthreadresponse.md @@ -0,0 +1,10 @@ +# AssignThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/createdraft201applicationjson.md b/message/docs/models/operations/createdraft201applicationjson.md new file mode 100755 index 000000000..da9388ff4 --- /dev/null +++ b/message/docs/models/operations/createdraft201applicationjson.md @@ -0,0 +1,33 @@ +# CreateDraft201ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `bcc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[shared.AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [shared.Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[shared.Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[CreateDraft201ApplicationJSONSendStatus](../../models/operations/createdraft201applicationjsonsendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[CreateDraft201ApplicationJSONType]](../../models/operations/createdraft201applicationjsontype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/operations/createdraft201applicationjsonsendstatus.md b/message/docs/models/operations/createdraft201applicationjsonsendstatus.md new file mode 100755 index 000000000..36672b731 --- /dev/null +++ b/message/docs/models/operations/createdraft201applicationjsonsendstatus.md @@ -0,0 +1,13 @@ +# CreateDraft201ApplicationJSONSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/operations/createdraft201applicationjsontype.md b/message/docs/models/operations/createdraft201applicationjsontype.md new file mode 100755 index 000000000..d3f978245 --- /dev/null +++ b/message/docs/models/operations/createdraft201applicationjsontype.md @@ -0,0 +1,11 @@ +# CreateDraft201ApplicationJSONType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/operations/createdraftresponse.md b/message/docs/models/operations/createdraftresponse.md new file mode 100755 index 000000000..d4d3e1ef7 --- /dev/null +++ b/message/docs/models/operations/createdraftresponse.md @@ -0,0 +1,11 @@ +# CreateDraftResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `create_draft_201_application_json_object` | [Optional[CreateDraft201ApplicationJSON]](../../models/operations/createdraft201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/deletemessagerequest.md b/message/docs/models/operations/deletemessagerequest.md new file mode 100755 index 000000000..cb6e818bc --- /dev/null +++ b/message/docs/models/operations/deletemessagerequest.md @@ -0,0 +1,8 @@ +# DeleteMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/deletemessageresponse.md b/message/docs/models/operations/deletemessageresponse.md new file mode 100755 index 000000000..9406a71e7 --- /dev/null +++ b/message/docs/models/operations/deletemessageresponse.md @@ -0,0 +1,10 @@ +# DeleteMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/deletethreadrequest.md b/message/docs/models/operations/deletethreadrequest.md new file mode 100755 index 000000000..b81b61eea --- /dev/null +++ b/message/docs/models/operations/deletethreadrequest.md @@ -0,0 +1,8 @@ +# DeleteThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/deletethreadresponse.md b/message/docs/models/operations/deletethreadresponse.md new file mode 100755 index 000000000..1d7e995be --- /dev/null +++ b/message/docs/models/operations/deletethreadresponse.md @@ -0,0 +1,10 @@ +# DeleteThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/getmessage201applicationjson.md b/message/docs/models/operations/getmessage201applicationjson.md new file mode 100755 index 000000000..16707b3f8 --- /dev/null +++ b/message/docs/models/operations/getmessage201applicationjson.md @@ -0,0 +1,33 @@ +# GetMessage201ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `bcc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[shared.AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [shared.Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[shared.Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[GetMessage201ApplicationJSONSendStatus](../../models/operations/getmessage201applicationjsonsendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[GetMessage201ApplicationJSONType]](../../models/operations/getmessage201applicationjsontype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/operations/getmessage201applicationjsonsendstatus.md b/message/docs/models/operations/getmessage201applicationjsonsendstatus.md new file mode 100755 index 000000000..492009596 --- /dev/null +++ b/message/docs/models/operations/getmessage201applicationjsonsendstatus.md @@ -0,0 +1,13 @@ +# GetMessage201ApplicationJSONSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/operations/getmessage201applicationjsontype.md b/message/docs/models/operations/getmessage201applicationjsontype.md new file mode 100755 index 000000000..7764f97d1 --- /dev/null +++ b/message/docs/models/operations/getmessage201applicationjsontype.md @@ -0,0 +1,11 @@ +# GetMessage201ApplicationJSONType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/operations/getmessagerequest.md b/message/docs/models/operations/getmessagerequest.md new file mode 100755 index 000000000..a1ce59282 --- /dev/null +++ b/message/docs/models/operations/getmessagerequest.md @@ -0,0 +1,8 @@ +# GetMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/getmessageresponse.md b/message/docs/models/operations/getmessageresponse.md new file mode 100755 index 000000000..98327c0c8 --- /dev/null +++ b/message/docs/models/operations/getmessageresponse.md @@ -0,0 +1,11 @@ +# GetMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `get_message_201_application_json_object` | [Optional[GetMessage201ApplicationJSON]](../../models/operations/getmessage201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/markreadmessagerequest.md b/message/docs/models/operations/markreadmessagerequest.md new file mode 100755 index 000000000..590ee37ed --- /dev/null +++ b/message/docs/models/operations/markreadmessagerequest.md @@ -0,0 +1,8 @@ +# MarkReadMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/markreadmessageresponse.md b/message/docs/models/operations/markreadmessageresponse.md new file mode 100755 index 000000000..dce508775 --- /dev/null +++ b/message/docs/models/operations/markreadmessageresponse.md @@ -0,0 +1,10 @@ +# MarkReadMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/markreadthreadrequest.md b/message/docs/models/operations/markreadthreadrequest.md new file mode 100755 index 000000000..2c5fb5a8b --- /dev/null +++ b/message/docs/models/operations/markreadthreadrequest.md @@ -0,0 +1,8 @@ +# MarkReadThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/markreadthreadresponse.md b/message/docs/models/operations/markreadthreadresponse.md new file mode 100755 index 000000000..5da3478b6 --- /dev/null +++ b/message/docs/models/operations/markreadthreadresponse.md @@ -0,0 +1,10 @@ +# MarkReadThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/markunreadmessagerequest.md b/message/docs/models/operations/markunreadmessagerequest.md new file mode 100755 index 000000000..a3c9cc306 --- /dev/null +++ b/message/docs/models/operations/markunreadmessagerequest.md @@ -0,0 +1,8 @@ +# MarkUnreadMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/markunreadmessageresponse.md b/message/docs/models/operations/markunreadmessageresponse.md new file mode 100755 index 000000000..fcc45cf3c --- /dev/null +++ b/message/docs/models/operations/markunreadmessageresponse.md @@ -0,0 +1,10 @@ +# MarkUnreadMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/markunreadthreadrequest.md b/message/docs/models/operations/markunreadthreadrequest.md new file mode 100755 index 000000000..8055e7a0d --- /dev/null +++ b/message/docs/models/operations/markunreadthreadrequest.md @@ -0,0 +1,8 @@ +# MarkUnreadThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/markunreadthreadresponse.md b/message/docs/models/operations/markunreadthreadresponse.md new file mode 100755 index 000000000..0bcf0d4f3 --- /dev/null +++ b/message/docs/models/operations/markunreadthreadresponse.md @@ -0,0 +1,10 @@ +# MarkUnreadThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/searchthreads200applicationjson.md b/message/docs/models/operations/searchthreads200applicationjson.md new file mode 100755 index 000000000..629c370ca --- /dev/null +++ b/message/docs/models/operations/searchthreads200applicationjson.md @@ -0,0 +1,11 @@ +# SearchThreads200ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `hits` | *float* | :heavy_check_mark: | Total of matched threads | 14 | +| `results` | list[[SearchThreads200ApplicationJSONResults](../../models/operations/searchthreads200applicationjsonresults.md)] | :heavy_check_mark: | Matched threads | | \ No newline at end of file diff --git a/message/docs/models/operations/searchthreads200applicationjsonresults.md b/message/docs/models/operations/searchthreads200applicationjsonresults.md new file mode 100755 index 000000000..2f82ad73b --- /dev/null +++ b/message/docs/models/operations/searchthreads200applicationjsonresults.md @@ -0,0 +1,21 @@ +# SearchThreads200ApplicationJSONResults + +Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `assigned_to` | list[*str*] | :heavy_minus_sign: | Ivy User ID of who the message is assigned to. Default is the user who sends message. | | +| `latest_message` | [Optional[shared.Message]](../../models/shared/message.md) | :heavy_minus_sign: | N/A | | +| `latest_trash_message` | [Optional[shared.Message]](../../models/shared/message.md) | :heavy_minus_sign: | N/A | | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `topic` | *str* | :heavy_check_mark: | Message topic (e.g. which service sends the message or message category) | CUSTOMER_MESSAGE | \ No newline at end of file diff --git a/message/docs/models/operations/searchthreadsresponse.md b/message/docs/models/operations/searchthreadsresponse.md new file mode 100755 index 000000000..4552a2274 --- /dev/null +++ b/message/docs/models/operations/searchthreadsresponse.md @@ -0,0 +1,11 @@ +# SearchThreadsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `search_threads_200_application_json_object` | [Optional[SearchThreads200ApplicationJSON]](../../models/operations/searchthreads200applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/senddraft201applicationjson.md b/message/docs/models/operations/senddraft201applicationjson.md new file mode 100755 index 000000000..5b2395801 --- /dev/null +++ b/message/docs/models/operations/senddraft201applicationjson.md @@ -0,0 +1,33 @@ +# SendDraft201ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `bcc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[shared.AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [shared.Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[shared.Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[SendDraft201ApplicationJSONSendStatus](../../models/operations/senddraft201applicationjsonsendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[SendDraft201ApplicationJSONType]](../../models/operations/senddraft201applicationjsontype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/operations/senddraft201applicationjsonsendstatus.md b/message/docs/models/operations/senddraft201applicationjsonsendstatus.md new file mode 100755 index 000000000..7d9c59136 --- /dev/null +++ b/message/docs/models/operations/senddraft201applicationjsonsendstatus.md @@ -0,0 +1,13 @@ +# SendDraft201ApplicationJSONSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/operations/senddraft201applicationjsontype.md b/message/docs/models/operations/senddraft201applicationjsontype.md new file mode 100755 index 000000000..fa44263be --- /dev/null +++ b/message/docs/models/operations/senddraft201applicationjsontype.md @@ -0,0 +1,11 @@ +# SendDraft201ApplicationJSONType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/operations/senddraftresponse.md b/message/docs/models/operations/senddraftresponse.md new file mode 100755 index 000000000..22b5e72e8 --- /dev/null +++ b/message/docs/models/operations/senddraftresponse.md @@ -0,0 +1,11 @@ +# SendDraftResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `send_draft_201_application_json_object` | [Optional[SendDraft201ApplicationJSON]](../../models/operations/senddraft201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/sendmessage201applicationjson.md b/message/docs/models/operations/sendmessage201applicationjson.md new file mode 100755 index 000000000..9a9512bad --- /dev/null +++ b/message/docs/models/operations/sendmessage201applicationjson.md @@ -0,0 +1,33 @@ +# SendMessage201ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `bcc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[shared.AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [shared.Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[shared.Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[SendMessage201ApplicationJSONSendStatus](../../models/operations/sendmessage201applicationjsonsendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[SendMessage201ApplicationJSONType]](../../models/operations/sendmessage201applicationjsontype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/operations/sendmessage201applicationjsonsendstatus.md b/message/docs/models/operations/sendmessage201applicationjsonsendstatus.md new file mode 100755 index 000000000..cb6358526 --- /dev/null +++ b/message/docs/models/operations/sendmessage201applicationjsonsendstatus.md @@ -0,0 +1,13 @@ +# SendMessage201ApplicationJSONSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/operations/sendmessage201applicationjsontype.md b/message/docs/models/operations/sendmessage201applicationjsontype.md new file mode 100755 index 000000000..88d8b49c5 --- /dev/null +++ b/message/docs/models/operations/sendmessage201applicationjsontype.md @@ -0,0 +1,11 @@ +# SendMessage201ApplicationJSONType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/operations/sendmessageresponse.md b/message/docs/models/operations/sendmessageresponse.md new file mode 100755 index 000000000..b969e5381 --- /dev/null +++ b/message/docs/models/operations/sendmessageresponse.md @@ -0,0 +1,11 @@ +# SendMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `send_message_201_application_json_object` | [Optional[SendMessage201ApplicationJSON]](../../models/operations/sendmessage201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/trashmessagerequest.md b/message/docs/models/operations/trashmessagerequest.md new file mode 100755 index 000000000..f31939931 --- /dev/null +++ b/message/docs/models/operations/trashmessagerequest.md @@ -0,0 +1,8 @@ +# TrashMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/trashmessageresponse.md b/message/docs/models/operations/trashmessageresponse.md new file mode 100755 index 000000000..f1f938a7f --- /dev/null +++ b/message/docs/models/operations/trashmessageresponse.md @@ -0,0 +1,10 @@ +# TrashMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/trashthreadrequest.md b/message/docs/models/operations/trashthreadrequest.md new file mode 100755 index 000000000..1e25c549e --- /dev/null +++ b/message/docs/models/operations/trashthreadrequest.md @@ -0,0 +1,8 @@ +# TrashThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/trashthreadresponse.md b/message/docs/models/operations/trashthreadresponse.md new file mode 100755 index 000000000..9bc7396a1 --- /dev/null +++ b/message/docs/models/operations/trashthreadresponse.md @@ -0,0 +1,10 @@ +# TrashThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/untrashmessagerequest.md b/message/docs/models/operations/untrashmessagerequest.md new file mode 100755 index 000000000..f7876c59e --- /dev/null +++ b/message/docs/models/operations/untrashmessagerequest.md @@ -0,0 +1,8 @@ +# UntrashMessageRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Message ID | \ No newline at end of file diff --git a/message/docs/models/operations/untrashmessageresponse.md b/message/docs/models/operations/untrashmessageresponse.md new file mode 100755 index 000000000..ba43f68d2 --- /dev/null +++ b/message/docs/models/operations/untrashmessageresponse.md @@ -0,0 +1,10 @@ +# UntrashMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/untrashthreadrequest.md b/message/docs/models/operations/untrashthreadrequest.md new file mode 100755 index 000000000..fe60842f3 --- /dev/null +++ b/message/docs/models/operations/untrashthreadrequest.md @@ -0,0 +1,8 @@ +# UntrashThreadRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *str* | :heavy_check_mark: | Thread ID | \ No newline at end of file diff --git a/message/docs/models/operations/untrashthreadresponse.md b/message/docs/models/operations/untrashthreadresponse.md new file mode 100755 index 000000000..d96ae6754 --- /dev/null +++ b/message/docs/models/operations/untrashthreadresponse.md @@ -0,0 +1,10 @@ +# UntrashThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/message/docs/models/operations/updatemessage201applicationjson.md b/message/docs/models/operations/updatemessage201applicationjson.md new file mode 100755 index 000000000..25bea3e01 --- /dev/null +++ b/message/docs/models/operations/updatemessage201applicationjson.md @@ -0,0 +1,33 @@ +# UpdateMessage201ApplicationJSON + +Success + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `bcc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[shared.AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [shared.Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[shared.Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[UpdateMessage201ApplicationJSONSendStatus](../../models/operations/updatemessage201applicationjsonsendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[shared.Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[UpdateMessage201ApplicationJSONType]](../../models/operations/updatemessage201applicationjsontype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/operations/updatemessage201applicationjsonsendstatus.md b/message/docs/models/operations/updatemessage201applicationjsonsendstatus.md new file mode 100755 index 000000000..5681dd764 --- /dev/null +++ b/message/docs/models/operations/updatemessage201applicationjsonsendstatus.md @@ -0,0 +1,13 @@ +# UpdateMessage201ApplicationJSONSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/operations/updatemessage201applicationjsontype.md b/message/docs/models/operations/updatemessage201applicationjsontype.md new file mode 100755 index 000000000..84aeed3a3 --- /dev/null +++ b/message/docs/models/operations/updatemessage201applicationjsontype.md @@ -0,0 +1,11 @@ +# UpdateMessage201ApplicationJSONType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/operations/updatemessageresponse.md b/message/docs/models/operations/updatemessageresponse.md new file mode 100755 index 000000000..fc6f16dc7 --- /dev/null +++ b/message/docs/models/operations/updatemessageresponse.md @@ -0,0 +1,11 @@ +# UpdateMessageResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `update_message_201_application_json_object` | [Optional[UpdateMessage201ApplicationJSON]](../../models/operations/updatemessage201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/operations/updatethread201applicationjson.md b/message/docs/models/operations/updatethread201applicationjson.md new file mode 100755 index 000000000..775e6e5a1 --- /dev/null +++ b/message/docs/models/operations/updatethread201applicationjson.md @@ -0,0 +1,21 @@ +# UpdateThread201ApplicationJSON + +Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing. + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Created date | 2021-02-09T12:41:43.662Z | +| `id` | *str* | :heavy_check_mark: | Entity ID | 3fa85f64-5717-4562-b3fc-2c963f66afa6 | +| `org` | *str* | :heavy_check_mark: | Ivy Organization ID the entity belongs to | 206801 | +| `schema` | *str* | :heavy_check_mark: | URL-friendly identifier for the entity schema | message | +| `tags` | list[*str*] | :heavy_minus_sign: | Entity tags | | +| `title` | *str* | :heavy_check_mark: | Entity title | | +| `updated_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_check_mark: | Updated date | 2021-02-10T09:14:31.990Z | +| `assigned_to` | list[*str*] | :heavy_minus_sign: | Ivy User ID of who the message is assigned to. Default is the user who sends message. | | +| `latest_message` | [Optional[shared.Message]](../../models/shared/message.md) | :heavy_minus_sign: | N/A | | +| `latest_trash_message` | [Optional[shared.Message]](../../models/shared/message.md) | :heavy_minus_sign: | N/A | | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `topic` | *str* | :heavy_check_mark: | Message topic (e.g. which service sends the message or message category) | CUSTOMER_MESSAGE | \ No newline at end of file diff --git a/message/docs/models/operations/updatethreadresponse.md b/message/docs/models/operations/updatethreadresponse.md new file mode 100755 index 000000000..6f63771cd --- /dev/null +++ b/message/docs/models/operations/updatethreadresponse.md @@ -0,0 +1,11 @@ +# UpdateThreadResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `content_type` | *str* | :heavy_check_mark: | N/A | +| `status_code` | *int* | :heavy_check_mark: | N/A | +| `raw_response` | [requests.Response](https://requests.readthedocs.io/en/latest/api/#requests.Response) | :heavy_minus_sign: | N/A | +| `update_thread_201_application_json_object` | [Optional[UpdateThread201ApplicationJSON]](../../models/operations/updatethread201applicationjson.md) | :heavy_minus_sign: | Success | \ No newline at end of file diff --git a/message/docs/models/shared/address.md b/message/docs/models/shared/address.md new file mode 100755 index 000000000..e8e42cee3 --- /dev/null +++ b/message/docs/models/shared/address.md @@ -0,0 +1,11 @@ +# Address + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `address` | *str* | :heavy_check_mark: | Email address | messaging@epilot.cloud | +| `name` | *Optional[str]* | :heavy_minus_sign: | Email address alias | epilot | +| `send_error` | [Optional[AddressSendError]](../../models/shared/addresssenderror.md) | :heavy_minus_sign: | Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\
JSON object is defined by AWS SES. Reference at
| | +| `send_status` | [Optional[AddressSendStatus]](../../models/shared/addresssendstatus.md) | :heavy_minus_sign: | Sent message status regarding to this recipient.\
Reference at
| | \ No newline at end of file diff --git a/message/docs/models/shared/addresssenderror.md b/message/docs/models/shared/addresssenderror.md new file mode 100755 index 000000000..2869177c7 --- /dev/null +++ b/message/docs/models/shared/addresssenderror.md @@ -0,0 +1,11 @@ +# AddressSendError + +Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\ +JSON object is defined by AWS SES. Reference at + + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/message/docs/models/shared/addresssendstatus.md b/message/docs/models/shared/addresssendstatus.md new file mode 100755 index 000000000..7c2923592 --- /dev/null +++ b/message/docs/models/shared/addresssendstatus.md @@ -0,0 +1,17 @@ +# AddressSendStatus + +Sent message status regarding to this recipient.\ +Reference at + + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/shared/attachmentsrelation.md b/message/docs/models/shared/attachmentsrelation.md new file mode 100755 index 000000000..83b738fe3 --- /dev/null +++ b/message/docs/models/shared/attachmentsrelation.md @@ -0,0 +1,10 @@ +# AttachmentsRelation + +Message attachments + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `dollar_relation` | list[[File](../../models/shared/file.md)] | :heavy_minus_sign: | It's normal entity relation with some additional properties for sending message attachment. | \ No newline at end of file diff --git a/message/docs/models/shared/file.md b/message/docs/models/shared/file.md new file mode 100755 index 000000000..e83a1f9aa --- /dev/null +++ b/message/docs/models/shared/file.md @@ -0,0 +1,13 @@ +# File + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cid` | *Optional[str]* | :heavy_minus_sign: | Content ID (for inline) | fb222496-a1a5-4639-94f2-07b5e35e4068 | +| `entity_id` | *str* | :heavy_check_mark: | File entity ID | f820ce3b-07b0-45ae-bcc6-babb2f53f79f | +| `filename` | *Optional[str]* | :heavy_minus_sign: | File name | Produktinformationen_epilot360_Double_Opt_in.pdf | +| `inline` | *Optional[bool]* | :heavy_minus_sign: | If true then this attachment should not be offered for download (at least not in the main attachments list).\
The usecase is CID embedded image (aka inline image).
| | +| `is_message_attachment` | *Optional[bool]* | :heavy_minus_sign: | To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation. | | +| `send_as_link` | *Optional[bool]* | :heavy_minus_sign: | If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\
In this case, service doesn't process this attachment.
| | \ No newline at end of file diff --git a/message/docs/models/shared/message.md b/message/docs/models/shared/message.md new file mode 100755 index 000000000..77308c80d --- /dev/null +++ b/message/docs/models/shared/message.md @@ -0,0 +1,24 @@ +# Message + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bcc` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `in_reply_to` | *Optional[str]* | :heavy_minus_sign: | In-Reply-To header. Value is the `message_id` of parent message.
| | +| `message_id` | *Optional[str]* | :heavy_minus_sign: | Message ID which is from email provider. If you provide `message-id`, API overrides by its own value. | <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `org_read_message` | list[*str*] | :heavy_minus_sign: | Ivy Organization ID of organization read the message. | | +| `references` | *Optional[str]* | :heavy_minus_sign: | References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\
The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\
The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.
| <0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> | +| `reply_to` | [Optional[Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `send_status` | list[[MessageSendStatus](../../models/shared/messagesendstatus.md)] | :heavy_minus_sign: | Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\
Reference at
| | +| `sender` | *Optional[str]* | :heavy_minus_sign: | Ivy User ID of user sends the message. | 206801 | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body | We at ABC GmbH would like to request a price quote for the solar panel. | +| `to` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | +| `type` | [Optional[MessageType]](../../models/shared/messagetype.md) | :heavy_minus_sign: | Message type | | +| `user_read_message` | list[*str*] | :heavy_minus_sign: | Ivy User ID of user read the message. | | \ No newline at end of file diff --git a/message/docs/models/shared/messagerequestparams.md b/message/docs/models/shared/messagerequestparams.md new file mode 100755 index 000000000..a364fcac0 --- /dev/null +++ b/message/docs/models/shared/messagerequestparams.md @@ -0,0 +1,18 @@ +# MessageRequestParams + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `bcc` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Bcc email addresses | | +| `cc` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | Cc email addresses | | +| `file` | [Optional[AttachmentsRelation]](../../models/shared/attachmentsrelation.md) | :heavy_minus_sign: | Message attachments | | +| `from_` | [Address](../../models/shared/address.md) | :heavy_check_mark: | N/A | | +| `html` | *Optional[str]* | :heavy_minus_sign: | HTML body |
We at ABC GmbH would like to request a price quote for the solar panel.
| +| `parent_id` | *Optional[str]* | :heavy_minus_sign: | Entity ID of parent message which this message replies to or forwards from.\
If both `parent_id` and `thread` are provided, `thread` is discarded.
| 44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2 | +| `reply_to` | [Optional[Address]](../../models/shared/address.md) | :heavy_minus_sign: | N/A | | +| `subject` | *str* | :heavy_check_mark: | Subject | Request for solar panel price | +| `text` | *Optional[str]* | :heavy_minus_sign: | Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text) | We at ABC GmbH would like to request a price quote for the solar panel. | +| `thread` | [Optional[MessageRequestParamsThread]](../../models/shared/messagerequestparamsthread.md) | :heavy_minus_sign: | Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\
Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\
`thread` or `parent_id` must be provided either.
| | +| `to` | list[[Address](../../models/shared/address.md)] | :heavy_minus_sign: | To email addresses | | \ No newline at end of file diff --git a/message/docs/models/shared/messagerequestparamsthread.md b/message/docs/models/shared/messagerequestparamsthread.md new file mode 100755 index 000000000..c50fcd2c8 --- /dev/null +++ b/message/docs/models/shared/messagerequestparamsthread.md @@ -0,0 +1,14 @@ +# MessageRequestParamsThread + +Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\ +Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\ +`thread` or `parent_id` must be provided either. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `assigned_to` | list[*str*] | :heavy_minus_sign: | Ivy User ID of who the message is assigned to. Default is the user who sends message. | +| `topic` | *str* | :heavy_check_mark: | Message topic (e.g. which service sends the message or message category) | \ No newline at end of file diff --git a/message/docs/models/shared/messagesendstatus.md b/message/docs/models/shared/messagesendstatus.md new file mode 100755 index 000000000..086fcf8d4 --- /dev/null +++ b/message/docs/models/shared/messagesendstatus.md @@ -0,0 +1,13 @@ +# MessageSendStatus + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SEND` | SEND | +| `DELIVERY` | DELIVERY | +| `REJECT` | REJECT | +| `COMPLAINT` | COMPLAINT | +| `BOUNCE` | BOUNCE | +| `ERROR` | ERROR | \ No newline at end of file diff --git a/message/docs/models/shared/messagetype.md b/message/docs/models/shared/messagetype.md new file mode 100755 index 000000000..121db8408 --- /dev/null +++ b/message/docs/models/shared/messagetype.md @@ -0,0 +1,11 @@ +# MessageType + +Message type + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SENT` | SENT | +| `RECEIVED` | RECEIVED | \ No newline at end of file diff --git a/message/docs/models/shared/searchparams.md b/message/docs/models/shared/searchparams.md new file mode 100755 index 000000000..c564b44c1 --- /dev/null +++ b/message/docs/models/shared/searchparams.md @@ -0,0 +1,10 @@ +# SearchParams + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `from_` | *Optional[int]* | :heavy_minus_sign: | N/A | | +| `q` | *str* | :heavy_check_mark: | Lucene query syntax supported with ElasticSearch | subject:"Request for solar panel price" AND _tags:INBOX | +| `size` | *Optional[int]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/message/docs/models/shared/security.md b/message/docs/models/shared/security.md new file mode 100755 index 000000000..7e7da0ee3 --- /dev/null +++ b/message/docs/models/shared/security.md @@ -0,0 +1,9 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `epilot_auth` | *Optional[str]* | :heavy_minus_sign: | N/A | | +| `epilot_org` | *Optional[str]* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/message/docs/sdks/drafts/README.md b/message/docs/sdks/drafts/README.md new file mode 100755 index 000000000..5cf223431 --- /dev/null +++ b/message/docs/sdks/drafts/README.md @@ -0,0 +1,174 @@ +# drafts + +### Available Operations + +* [create_draft](#create_draft) - createDraft +* [send_draft](#send_draft) - sendDraft + +## create_draft + +Create a new draft + +### Example Usage + +```python +import epilot +from epilot.models import shared + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = shared.MessageRequestParams( + bcc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.REJECT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.REJECT, + ), + ], + cc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.BOUNCE, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.REJECT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + ], + file=shared.AttachmentsRelation( + dollar_relation=[ + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + ], + ), + from_=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + html='
We at ABC GmbH would like to request a price quote for the solar panel.
', + parent_id='44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2', + reply_to=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + subject='Request for solar panel price', + text='We at ABC GmbH would like to request a price quote for the solar panel.', + thread=shared.MessageRequestParamsThread( + assigned_to=[ + 'quis', + ], + topic='veritatis', + ), + to=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.SEND, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.REJECT, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.BOUNCE, + ), + ], +) + +res = s.drafts.create_draft(req) + +if res.create_draft_201_application_json_object is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `request` | [shared.MessageRequestParams](../../models/shared/messagerequestparams.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.CreateDraftResponse](../../models/operations/createdraftresponse.md)** + + +## send_draft + +Send the existing draft to the recipients + +### Example Usage + +```python +import epilot + + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + + +res = s.drafts.send_draft() + +if res.send_draft_201_application_json_object is not None: + # handle response +``` + + +### Response + +**[operations.SendDraftResponse](../../models/operations/senddraftresponse.md)** + diff --git a/message/docs/sdks/epilot/README.md b/message/docs/sdks/epilot/README.md new file mode 100755 index 000000000..61cf53e4c --- /dev/null +++ b/message/docs/sdks/epilot/README.md @@ -0,0 +1,9 @@ +# Epilot SDK + +## Overview + +Message API: Send and receive email messages via your epilot organization + + +### Available Operations + diff --git a/message/docs/sdks/messages/README.md b/message/docs/sdks/messages/README.md new file mode 100755 index 000000000..9233affbe --- /dev/null +++ b/message/docs/sdks/messages/README.md @@ -0,0 +1,424 @@ +# messages + +### Available Operations + +* [delete_message](#delete_message) - deleteMessage +* [get_message](#get_message) - getMessage +* [mark_read_message](#mark_read_message) - markReadMessage +* [mark_unread_message](#mark_unread_message) - markUnreadMessage +* [send_message](#send_message) - sendMessage +* [trash_message](#trash_message) - trashMessage +* [untrash_message](#untrash_message) - untrashMessage +* [update_message](#update_message) - updateMessage + +## delete_message + +Immediately and permanently delete a message. This operation cannot be undone. + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.DeleteMessageRequest( + id='fc2ddf7c-c78c-4a1b-a928-fc816742cb73', +) + +res = s.messages.delete_message(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.DeleteMessageRequest](../../models/operations/deletemessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.DeleteMessageResponse](../../models/operations/deletemessageresponse.md)** + + +## get_message + +Get an email message by id + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.GetMessageRequest( + id='92059293-96fe-4a75-96eb-10faaa2352c5', +) + +res = s.messages.get_message(req) + +if res.get_message_201_application_json_object is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `request` | [operations.GetMessageRequest](../../models/operations/getmessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.GetMessageResponse](../../models/operations/getmessageresponse.md)** + + +## mark_read_message + +Mark message as read + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.MarkReadMessageRequest( + id='955907af-f1a3-4a2f-a946-7739251aa52c', +) + +res = s.messages.mark_read_message(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `request` | [operations.MarkReadMessageRequest](../../models/operations/markreadmessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.MarkReadMessageResponse](../../models/operations/markreadmessageresponse.md)** + + +## mark_unread_message + +Mark message as unread + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.MarkUnreadMessageRequest( + id='3f5ad019-da1f-4fe7-8f09-7b0074f15471', +) + +res = s.messages.mark_unread_message(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `request` | [operations.MarkUnreadMessageRequest](../../models/operations/markunreadmessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.MarkUnreadMessageResponse](../../models/operations/markunreadmessageresponse.md)** + + +## send_message + +Send an email message + +### Example Usage + +```python +import epilot +from epilot.models import shared + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = shared.MessageRequestParams( + bcc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.DELIVERY, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.REJECT, + ), + ], + cc=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.SEND, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.DELIVERY, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.BOUNCE, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.COMPLAINT, + ), + ], + file=shared.AttachmentsRelation( + dollar_relation=[ + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + shared.File( + cid='fb222496-a1a5-4639-94f2-07b5e35e4068', + entity_id='f820ce3b-07b0-45ae-bcc6-babb2f53f79f', + filename='Produktinformationen_epilot360_Double_Opt_in.pdf', + inline=False, + is_message_attachment=False, + send_as_link=False, + ), + ], + ), + from_=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + html='
We at ABC GmbH would like to request a price quote for the solar panel.
', + parent_id='44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2', + reply_to=shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.DELIVERY, + ), + subject='Request for solar panel price', + text='We at ABC GmbH would like to request a price quote for the solar panel.', + thread=shared.MessageRequestParamsThread( + assigned_to=[ + 'rem', + 'voluptates', + 'quasi', + ], + topic='repudiandae', + ), + to=[ + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.SEND, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.ERROR, + ), + shared.Address( + address='messaging@epilot.cloud', + name='epilot', + send_error=shared.AddressSendError(), + send_status=shared.AddressSendStatus.DELIVERY, + ), + ], +) + +res = s.messages.send_message(req) + +if res.send_message_201_application_json_object is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `request` | [shared.MessageRequestParams](../../models/shared/messagerequestparams.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.SendMessageResponse](../../models/operations/sendmessageresponse.md)** + + +## trash_message + +Move a message to the trash + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.TrashMessageRequest( + id='50ad2abd-4426-4980-ad50-2a94bb4f63c9', +) + +res = s.messages.trash_message(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.TrashMessageRequest](../../models/operations/trashmessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.TrashMessageResponse](../../models/operations/trashmessageresponse.md)** + + +## untrash_message + +Restore a trashed message + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.UntrashMessageRequest( + id='69e9a3ef-a77d-4fb1-8cd6-6ae395efb9ba', +) + +res = s.messages.untrash_message(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.UntrashMessageRequest](../../models/operations/untrashmessagerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.UntrashMessageResponse](../../models/operations/untrashmessageresponse.md)** + + +## update_message + +Update message metadata + +### Example Usage + +```python +import epilot + + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + + +res = s.messages.update_message() + +if res.update_message_201_application_json_object is not None: + # handle response +``` + + +### Response + +**[operations.UpdateMessageResponse](../../models/operations/updatemessageresponse.md)** + diff --git a/message/docs/sdks/threads/README.md b/message/docs/sdks/threads/README.md new file mode 100755 index 000000000..2b0325d93 --- /dev/null +++ b/message/docs/sdks/threads/README.md @@ -0,0 +1,331 @@ +# threads + +### Available Operations + +* [assign_thread](#assign_thread) - assignThread +* [delete_thread](#delete_thread) - deleteThread +* [mark_read_thread](#mark_read_thread) - markReadThread +* [mark_unread_thread](#mark_unread_thread) - markUnreadThread +* [search_threads](#search_threads) - searchThreads +* [trash_thread](#trash_thread) - trashThread +* [untrash_thread](#untrash_thread) - untrashThread +* [update_thread](#update_thread) - updateThread + +## assign_thread + +Assign thread to entities + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.AssignThreadRequest( + request_body=[ + operations.AssignThreadRequestBody( + entity_id='3f34ce73-089c-4d45-a5ee-c161234e41c3', + is_main_entity=True, + slug='contact', + ), + operations.AssignThreadRequestBody( + entity_id='3f34ce73-089c-4d45-a5ee-c161234e41c3', + is_main_entity=True, + slug='contact', + ), + operations.AssignThreadRequestBody( + entity_id='3f34ce73-089c-4d45-a5ee-c161234e41c3', + is_main_entity=True, + slug='contact', + ), + ], + id='8f3a6699-7074-4ba4-869b-6e2141959890', +) + +res = s.threads.assign_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.AssignThreadRequest](../../models/operations/assignthreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.AssignThreadResponse](../../models/operations/assignthreadresponse.md)** + + +## delete_thread + +Immediately and permanently delete a thread. This operation cannot be undone. + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.DeleteThreadRequest( + id='afa563e2-516f-4e4c-8b71-1e5b7fd2ed02', +) + +res = s.threads.delete_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `request` | [operations.DeleteThreadRequest](../../models/operations/deletethreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.DeleteThreadResponse](../../models/operations/deletethreadresponse.md)** + + +## mark_read_thread + +Mark thread as read + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.MarkReadThreadRequest( + id='8921cddc-6926-401f-b576-b0d5f0d30c5f', +) + +res = s.threads.mark_read_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `request` | [operations.MarkReadThreadRequest](../../models/operations/markreadthreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.MarkReadThreadResponse](../../models/operations/markreadthreadresponse.md)** + + +## mark_unread_thread + +Mark thread as unread + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.MarkUnreadThreadRequest( + id='bb258705-3202-4c73-95fe-9b90c28909b3', +) + +res = s.threads.mark_unread_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `request` | [operations.MarkUnreadThreadRequest](../../models/operations/markunreadthreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.MarkUnreadThreadResponse](../../models/operations/markunreadthreadresponse.md)** + + +## search_threads + +Search for threads of email messages. + +Messages with no replies yet are treated as threads with single message. + +Lucene syntax supported. + + +### Example Usage + +```python +import epilot +from epilot.models import shared + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = shared.SearchParams( + from_=992397, + q='subject:"Request for solar panel price" AND _tags:INBOX', + size=934214, +) + +res = s.threads.search_threads(req) + +if res.search_threads_200_application_json_object is not None: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `request` | [shared.SearchParams](../../models/shared/searchparams.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.SearchThreadsResponse](../../models/operations/searchthreadsresponse.md)** + + +## trash_thread + +Move a thread to trash + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.TrashThreadRequest( + id='49a8d9cb-f486-4333-a3f9-b77f3a410067', +) + +res = s.threads.trash_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `request` | [operations.TrashThreadRequest](../../models/operations/trashthreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.TrashThreadResponse](../../models/operations/trashthreadresponse.md)** + + +## untrash_thread + +Restore a trashed thread + +### Example Usage + +```python +import epilot +from epilot.models import operations + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + +req = operations.UntrashThreadRequest( + id='4ebf6928-0d1b-4a77-a89e-bf737ae4203c', +) + +res = s.threads.untrash_thread(req) + +if res.status_code == 200: + # handle response +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `request` | [operations.UntrashThreadRequest](../../models/operations/untrashthreadrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[operations.UntrashThreadResponse](../../models/operations/untrashthreadresponse.md)** + + +## update_thread + +Modify thread metadata + +### Example Usage + +```python +import epilot + + +s = epilot.Epilot( + security=shared.Security( + epilot_auth="", + ), +) + + +res = s.threads.update_thread() + +if res.update_thread_201_application_json_object is not None: + # handle response +``` + + +### Response + +**[operations.UpdateThreadResponse](../../models/operations/updatethreadresponse.md)** + diff --git a/message/files.gen b/message/files.gen index 897a1dbb8..4fb0a868a 100755 --- a/message/files.gen +++ b/message/files.gen @@ -1,7 +1,9 @@ +src/epilot/sdkconfiguration.py src/epilot/drafts.py src/epilot/messages.py src/epilot/threads.py src/epilot/sdk.py +.gitignore pylintrc setup.py src/epilot/__init__.py @@ -31,8 +33,74 @@ src/epilot/models/operations/__init__.py src/epilot/models/shared/address.py src/epilot/models/shared/attachmentsrelation.py src/epilot/models/shared/file.py +src/epilot/models/shared/messagerequestparams.py src/epilot/models/shared/message.py src/epilot/models/shared/searchparams.py src/epilot/models/shared/security.py src/epilot/models/shared/__init__.py -USAGE.md \ No newline at end of file +docs/sdks/epilot/README.md +docs/sdks/drafts/README.md +docs/sdks/messages/README.md +docs/sdks/threads/README.md +USAGE.md +docs/models/operations/createdraft201applicationjsonsendstatus.md +docs/models/operations/createdraft201applicationjsontype.md +docs/models/operations/createdraft201applicationjson.md +docs/models/operations/createdraftresponse.md +docs/models/operations/senddraft201applicationjsonsendstatus.md +docs/models/operations/senddraft201applicationjsontype.md +docs/models/operations/senddraft201applicationjson.md +docs/models/operations/senddraftresponse.md +docs/models/operations/deletemessagerequest.md +docs/models/operations/deletemessageresponse.md +docs/models/operations/getmessagerequest.md +docs/models/operations/getmessage201applicationjsonsendstatus.md +docs/models/operations/getmessage201applicationjsontype.md +docs/models/operations/getmessage201applicationjson.md +docs/models/operations/getmessageresponse.md +docs/models/operations/markreadmessagerequest.md +docs/models/operations/markreadmessageresponse.md +docs/models/operations/markunreadmessagerequest.md +docs/models/operations/markunreadmessageresponse.md +docs/models/operations/sendmessage201applicationjsonsendstatus.md +docs/models/operations/sendmessage201applicationjsontype.md +docs/models/operations/sendmessage201applicationjson.md +docs/models/operations/sendmessageresponse.md +docs/models/operations/trashmessagerequest.md +docs/models/operations/trashmessageresponse.md +docs/models/operations/untrashmessagerequest.md +docs/models/operations/untrashmessageresponse.md +docs/models/operations/updatemessage201applicationjsonsendstatus.md +docs/models/operations/updatemessage201applicationjsontype.md +docs/models/operations/updatemessage201applicationjson.md +docs/models/operations/updatemessageresponse.md +docs/models/operations/assignthreadrequestbody.md +docs/models/operations/assignthreadrequest.md +docs/models/operations/assignthreadresponse.md +docs/models/operations/deletethreadrequest.md +docs/models/operations/deletethreadresponse.md +docs/models/operations/markreadthreadrequest.md +docs/models/operations/markreadthreadresponse.md +docs/models/operations/markunreadthreadrequest.md +docs/models/operations/markunreadthreadresponse.md +docs/models/operations/searchthreads200applicationjsonresults.md +docs/models/operations/searchthreads200applicationjson.md +docs/models/operations/searchthreadsresponse.md +docs/models/operations/trashthreadrequest.md +docs/models/operations/trashthreadresponse.md +docs/models/operations/untrashthreadrequest.md +docs/models/operations/untrashthreadresponse.md +docs/models/operations/updatethread201applicationjson.md +docs/models/operations/updatethreadresponse.md +docs/models/shared/addresssenderror.md +docs/models/shared/addresssendstatus.md +docs/models/shared/address.md +docs/models/shared/attachmentsrelation.md +docs/models/shared/file.md +docs/models/shared/messagerequestparamsthread.md +docs/models/shared/messagerequestparams.md +docs/models/shared/messagesendstatus.md +docs/models/shared/messagetype.md +docs/models/shared/message.md +docs/models/shared/searchparams.md +docs/models/shared/security.md \ No newline at end of file diff --git a/message/gen.yaml b/message/gen.yaml index 5c31381b3..ab9db3301 100644 --- a/message/gen.yaml +++ b/message/gen.yaml @@ -2,15 +2,15 @@ configVersion: 1.0.0 management: docChecksum: 007d70cb5b2af152bc8b6492cdc0171c docVersion: 1.0.0 - speakeasyVersion: 1.19.2 - generationVersion: 2.16.5 + speakeasyVersion: 1.47.1 + generationVersion: 2.39.2 generation: - telemetryEnabled: false sdkClassName: epilot - sdkFlattening: true singleTagPerOp: false + telemetryEnabled: false python: - version: 1.2.2 + version: 1.21.1 author: epilot description: Python Client SDK for Epilot + maxMethodParams: 0 packageName: epilot-message diff --git a/message/pylintrc b/message/pylintrc index 8f07ddd14..62e180533 100755 --- a/message/pylintrc +++ b/message/pylintrc @@ -124,12 +124,7 @@ attr-naming-style=snake_case #attr-rgx= # Bad variable names which should always be refused, separated by a comma. -bad-names=foo, - bar, - baz, - toto, - tutu, - tata +bad-names= # Bad variable names regexes, separated by a comma. If names match any regex, # they will always be refused @@ -185,9 +180,9 @@ good-names=i, ex, Run, _, + id, cc, to, - id, q # Good variable names regexes, separated by a comma. If names match any regex, @@ -442,7 +437,11 @@ disable=raw-checker-failed, trailing-newlines, too-many-public-methods, too-many-locals, - too-many-lines + too-many-lines, + using-constant-test, + too-many-statements, + cyclic-import, + too-many-nested-blocks # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/message/setup.py b/message/setup.py index 4bdff85a9..f1e2e3d20 100755 --- a/message/setup.py +++ b/message/setup.py @@ -10,30 +10,33 @@ setuptools.setup( name="epilot-message", - version="1.2.2", + version="1.21.1", author="epilot", description="Python Client SDK for Epilot", long_description=long_description, long_description_content_type="text/markdown", packages=setuptools.find_packages(where="src"), install_requires=[ - "certifi==2022.12.07", - "charset-normalizer==2.1.1", - "dataclasses-json-speakeasy==0.5.8", - "idna==3.3", - "marshmallow==3.17.1", - "marshmallow-enum==1.5.1", - "mypy-extensions==0.4.3", - "packaging==21.3", - "pyparsing==3.0.9", - "python-dateutil==2.8.2", - "requests==2.28.1", - "six==1.16.0", - "typing-inspect==0.8.0", - "typing_extensions==4.3.0", - "urllib3==1.26.12", - "pylint==2.16.2", + "certifi>=2022.12.7", + "charset-normalizer>=2.1.1", + "dataclasses-json-speakeasy>=0.5.8", + "idna>=3.3", + "jsonpath-python>=1.0.6 ", + "marshmallow>=3.17.1", + "marshmallow-enum>=1.5.1", + "mypy-extensions>=0.4.3", + "packaging>=21.3", + "pyparsing>=3.0.9", + "python-dateutil>=2.8.2", + "requests>=2.28.1", + "six>=1.16.0", + "typing-inspect>=0.8.0", + "typing_extensions>=4.3.0", + "urllib3>=1.26.12", ], + extras_require={ + "dev":["pylint==2.16.2"] + }, package_dir={'': 'src'}, python_requires='>=3.9' ) diff --git a/message/src/epilot/__init__.py b/message/src/epilot/__init__.py index b9e232018..e6c0deeb6 100755 --- a/message/src/epilot/__init__.py +++ b/message/src/epilot/__init__.py @@ -1,3 +1,4 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" from .sdk import * +from .sdkconfiguration import * diff --git a/message/src/epilot/drafts.py b/message/src/epilot/drafts.py index 4d0bdb57a..8e038f413 100755 --- a/message/src/epilot/drafts.py +++ b/message/src/epilot/drafts.py @@ -1,40 +1,32 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" -import requests as requests_http -from . import utils -from epilot.models import operations -from typing import Any, Optional +from .sdkconfiguration import SDKConfiguration +from epilot import utils +from epilot.models import operations, shared +from typing import Optional class Drafts: - _client: requests_http.Session - _security_client: requests_http.Session - _server_url: str - _language: str - _sdk_version: str - _gen_version: str + sdk_configuration: SDKConfiguration - def __init__(self, client: requests_http.Session, security_client: requests_http.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None: - self._client = client - self._security_client = security_client - self._server_url = server_url - self._language = language - self._sdk_version = sdk_version - self._gen_version = gen_version + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config - def create_draft(self, request: Any) -> operations.CreateDraftResponse: + + def create_draft(self, request: shared.MessageRequestParams) -> operations.CreateDraftResponse: r"""createDraft Create a new draft """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/drafts' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/drafts' headers = {} req_content_type, data, form = utils.serialize_request_body(request, "request", 'json') if req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client http_res = client.request('POST', url, data=data, files=form, headers=headers) content_type = http_res.headers.get('Content-Type') @@ -50,18 +42,21 @@ def create_draft(self, request: Any) -> operations.CreateDraftResponse: return res + def send_draft(self) -> operations.SendDraftResponse: r"""sendDraft Send the existing draft to the recipients """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/drafts:send' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/drafts:send' + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.SendDraftResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/message/src/epilot/messages.py b/message/src/epilot/messages.py index 79d8a2dd8..f1feea643 100755 --- a/message/src/epilot/messages.py +++ b/message/src/epilot/messages.py @@ -1,59 +1,53 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" -import requests as requests_http -from . import utils -from epilot.models import operations -from typing import Any, Optional +from .sdkconfiguration import SDKConfiguration +from epilot import utils +from epilot.models import operations, shared +from typing import Optional class Messages: - _client: requests_http.Session - _security_client: requests_http.Session - _server_url: str - _language: str - _sdk_version: str - _gen_version: str - - def __init__(self, client: requests_http.Session, security_client: requests_http.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None: - self._client = client - self._security_client = security_client - self._server_url = server_url - self._language = language - self._sdk_version = sdk_version - self._gen_version = gen_version + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + def delete_message(self, request: operations.DeleteMessageRequest) -> operations.DeleteMessageResponse: r"""deleteMessage Immediately and permanently delete a message. This operation cannot be undone. """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.DeleteMessageRequest, base_url, '/v1/message/messages/{id}', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('DELETE', url) + http_res = client.request('DELETE', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.DeleteMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def get_message(self, request: operations.GetMessageRequest) -> operations.GetMessageResponse: r"""getMessage Get an email message by id """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.GetMessageRequest, base_url, '/v1/message/messages/{id}', request) + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('GET', url) + http_res = client.request('GET', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.GetMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) @@ -67,62 +61,66 @@ def get_message(self, request: operations.GetMessageRequest) -> operations.GetMe return res + def mark_read_message(self, request: operations.MarkReadMessageRequest) -> operations.MarkReadMessageResponse: r"""markReadMessage Mark message as read """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.MarkReadMessageRequest, base_url, '/v1/message/messages/{id}/read', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.MarkReadMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def mark_unread_message(self, request: operations.MarkUnreadMessageRequest) -> operations.MarkUnreadMessageResponse: r"""markUnreadMessage Mark message as unread """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.MarkUnreadMessageRequest, base_url, '/v1/message/messages/{id}/unread', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.MarkUnreadMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res - def send_message(self, request: Any) -> operations.SendMessageResponse: + + def send_message(self, request: shared.MessageRequestParams) -> operations.SendMessageResponse: r"""sendMessage Send an email message """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/messages' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/messages' headers = {} req_content_type, data, form = utils.serialize_request_body(request, "request", 'json') if req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client http_res = client.request('POST', url, data=data, files=form, headers=headers) content_type = http_res.headers.get('Content-Type') @@ -138,60 +136,65 @@ def send_message(self, request: Any) -> operations.SendMessageResponse: return res + def trash_message(self, request: operations.TrashMessageRequest) -> operations.TrashMessageResponse: r"""trashMessage Move a message to the trash """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.TrashMessageRequest, base_url, '/v1/message/messages/{id}/trash', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.TrashMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def untrash_message(self, request: operations.UntrashMessageRequest) -> operations.UntrashMessageResponse: r"""untrashMessage Restore a trashed message """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.UntrashMessageRequest, base_url, '/v1/message/messages/{id}/untrash', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.UntrashMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def update_message(self) -> operations.UpdateMessageResponse: r"""updateMessage Update message metadata """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/messages' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/messages' + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client - http_res = client.request('PUT', url) + http_res = client.request('PUT', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.UpdateMessageResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/message/src/epilot/models/operations/__init__.py b/message/src/epilot/models/operations/__init__.py index 7f5afbc54..64a4e83ef 100755 --- a/message/src/epilot/models/operations/__init__.py +++ b/message/src/epilot/models/operations/__init__.py @@ -19,4 +19,4 @@ from .updatemessage import * from .updatethread import * -__all__ = ["AssignThreadRequest","AssignThreadRequestBody","AssignThreadResponse","CreateDraft201ApplicationJSON","CreateDraft201ApplicationJSONSendStatusEnum","CreateDraft201ApplicationJSONTypeEnum","CreateDraftResponse","DeleteMessageRequest","DeleteMessageResponse","DeleteThreadRequest","DeleteThreadResponse","GetMessage201ApplicationJSON","GetMessage201ApplicationJSONSendStatusEnum","GetMessage201ApplicationJSONTypeEnum","GetMessageRequest","GetMessageResponse","MarkReadMessageRequest","MarkReadMessageResponse","MarkReadThreadRequest","MarkReadThreadResponse","MarkUnreadMessageRequest","MarkUnreadMessageResponse","MarkUnreadThreadRequest","MarkUnreadThreadResponse","SearchThreads200ApplicationJSON","SearchThreads200ApplicationJSONResults","SearchThreadsResponse","SendDraft201ApplicationJSON","SendDraft201ApplicationJSONSendStatusEnum","SendDraft201ApplicationJSONTypeEnum","SendDraftResponse","SendMessage201ApplicationJSON","SendMessage201ApplicationJSONSendStatusEnum","SendMessage201ApplicationJSONTypeEnum","SendMessageResponse","TrashMessageRequest","TrashMessageResponse","TrashThreadRequest","TrashThreadResponse","UntrashMessageRequest","UntrashMessageResponse","UntrashThreadRequest","UntrashThreadResponse","UpdateMessage201ApplicationJSON","UpdateMessage201ApplicationJSONSendStatusEnum","UpdateMessage201ApplicationJSONTypeEnum","UpdateMessageResponse","UpdateThread201ApplicationJSON","UpdateThreadResponse"] +__all__ = ["AssignThreadRequest","AssignThreadRequestBody","AssignThreadResponse","CreateDraft201ApplicationJSON","CreateDraft201ApplicationJSONSendStatus","CreateDraft201ApplicationJSONType","CreateDraftResponse","DeleteMessageRequest","DeleteMessageResponse","DeleteThreadRequest","DeleteThreadResponse","GetMessage201ApplicationJSON","GetMessage201ApplicationJSONSendStatus","GetMessage201ApplicationJSONType","GetMessageRequest","GetMessageResponse","MarkReadMessageRequest","MarkReadMessageResponse","MarkReadThreadRequest","MarkReadThreadResponse","MarkUnreadMessageRequest","MarkUnreadMessageResponse","MarkUnreadThreadRequest","MarkUnreadThreadResponse","SearchThreads200ApplicationJSON","SearchThreads200ApplicationJSONResults","SearchThreadsResponse","SendDraft201ApplicationJSON","SendDraft201ApplicationJSONSendStatus","SendDraft201ApplicationJSONType","SendDraftResponse","SendMessage201ApplicationJSON","SendMessage201ApplicationJSONSendStatus","SendMessage201ApplicationJSONType","SendMessageResponse","TrashMessageRequest","TrashMessageResponse","TrashThreadRequest","TrashThreadResponse","UntrashMessageRequest","UntrashMessageResponse","UntrashThreadRequest","UntrashThreadResponse","UpdateMessage201ApplicationJSON","UpdateMessage201ApplicationJSONSendStatus","UpdateMessage201ApplicationJSONType","UpdateMessageResponse","UpdateThread201ApplicationJSON","UpdateThreadResponse"] diff --git a/message/src/epilot/models/operations/assignthread.py b/message/src/epilot/models/operations/assignthread.py index 30ad5de3b..b888e17e1 100755 --- a/message/src/epilot/models/operations/assignthread.py +++ b/message/src/epilot/models/operations/assignthread.py @@ -9,29 +9,34 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class AssignThreadRequestBody: - entity_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entity_id'), 'exclude': lambda f: f is None }}) - r"""Entity ID""" + r"""Entity ID""" is_main_entity: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('is_main_entity'), 'exclude': lambda f: f is None }}) - r"""To indicate this is main entity""" + r"""To indicate this is main entity""" slug: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('slug'), 'exclude': lambda f: f is None }}) - r"""Entity slug""" + r"""Entity slug""" + + + @dataclasses.dataclass class AssignThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" - request_body: list[AssignThreadRequestBody] = dataclasses.field(metadata={'request': { 'media_type': 'application/json' }}) + r"""Thread ID""" + request_body: list[AssignThreadRequestBody] = dataclasses.field(metadata={'request': { 'media_type': 'application/json' }}) + + + @dataclasses.dataclass class AssignThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/createdraft.py b/message/src/epilot/models/operations/createdraft.py index 31cfcf4f6..dc3916828 100755 --- a/message/src/epilot/models/operations/createdraft.py +++ b/message/src/epilot/models/operations/createdraft.py @@ -13,88 +13,87 @@ from marshmallow import fields from typing import Optional -class CreateDraft201ApplicationJSONSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" +class CreateDraft201ApplicationJSONSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' -class CreateDraft201ApplicationJSONTypeEnum(str, Enum): +class CreateDraft201ApplicationJSONType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class CreateDraft201ApplicationJSON: r"""Success""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + r"""Updated date""" + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[CreateDraft201ApplicationJSONSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[CreateDraft201ApplicationJSONSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[CreateDraft201ApplicationJSONTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[CreateDraft201ApplicationJSONType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" + r"""Ivy User ID of user read the message.""" + + + @dataclasses.dataclass class CreateDraftResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() create_draft_201_application_json_object: Optional[CreateDraft201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/message/src/epilot/models/operations/deletemessage.py b/message/src/epilot/models/operations/deletemessage.py index f48e52d41..cf09b9737 100755 --- a/message/src/epilot/models/operations/deletemessage.py +++ b/message/src/epilot/models/operations/deletemessage.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class DeleteMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" + + + @dataclasses.dataclass class DeleteMessageResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/deletethread.py b/message/src/epilot/models/operations/deletethread.py index 293953919..da5b404f2 100755 --- a/message/src/epilot/models/operations/deletethread.py +++ b/message/src/epilot/models/operations/deletethread.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class DeleteThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" + r"""Thread ID""" + + + @dataclasses.dataclass class DeleteThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/getmessage.py b/message/src/epilot/models/operations/getmessage.py index b3297fdd8..8021a3950 100755 --- a/message/src/epilot/models/operations/getmessage.py +++ b/message/src/epilot/models/operations/getmessage.py @@ -14,94 +14,95 @@ from typing import Optional + @dataclasses.dataclass class GetMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" -class GetMessage201ApplicationJSONSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" -class GetMessage201ApplicationJSONTypeEnum(str, Enum): + +class GetMessage201ApplicationJSONSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' + +class GetMessage201ApplicationJSONType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class GetMessage201ApplicationJSON: r"""Success""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + r"""Updated date""" + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[GetMessage201ApplicationJSONSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[GetMessage201ApplicationJSONSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[GetMessage201ApplicationJSONTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[GetMessage201ApplicationJSONType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" + r"""Ivy User ID of user read the message.""" + + + @dataclasses.dataclass class GetMessageResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() get_message_201_application_json_object: Optional[GetMessage201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + r"""Success""" + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + + diff --git a/message/src/epilot/models/operations/markreadmessage.py b/message/src/epilot/models/operations/markreadmessage.py index d9ac93aa5..d6aa475e9 100755 --- a/message/src/epilot/models/operations/markreadmessage.py +++ b/message/src/epilot/models/operations/markreadmessage.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class MarkReadMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" + + + @dataclasses.dataclass class MarkReadMessageResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/markreadthread.py b/message/src/epilot/models/operations/markreadthread.py index 4acbd11af..0b4ae6d88 100755 --- a/message/src/epilot/models/operations/markreadthread.py +++ b/message/src/epilot/models/operations/markreadthread.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class MarkReadThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" + r"""Thread ID""" + + + @dataclasses.dataclass class MarkReadThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/markunreadmessage.py b/message/src/epilot/models/operations/markunreadmessage.py index 4218b6f7e..e6dc5ce1b 100755 --- a/message/src/epilot/models/operations/markunreadmessage.py +++ b/message/src/epilot/models/operations/markunreadmessage.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class MarkUnreadMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" + + + @dataclasses.dataclass class MarkUnreadMessageResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/markunreadthread.py b/message/src/epilot/models/operations/markunreadthread.py index 9011f98e8..6df327fbd 100755 --- a/message/src/epilot/models/operations/markunreadthread.py +++ b/message/src/epilot/models/operations/markunreadthread.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class MarkUnreadThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" + r"""Thread ID""" + + + @dataclasses.dataclass class MarkUnreadThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/searchthreads.py b/message/src/epilot/models/operations/searchthreads.py index 450b7e884..3d66b8513 100755 --- a/message/src/epilot/models/operations/searchthreads.py +++ b/message/src/epilot/models/operations/searchthreads.py @@ -13,51 +13,56 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class SearchThreads200ApplicationJSONResults: r"""Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" + r"""Updated date""" topic: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('topic') }}) - r"""Message topic (e.g. which service sends the message or message category)""" + r"""Message topic (e.g. which service sends the message or message category)""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" assigned_to: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('assigned_to'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of who the message is assigned to. Default is the user who sends message.""" - latest_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_message'), 'exclude': lambda f: f is None }}) - latest_trash_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_trash_message'), 'exclude': lambda f: f is None }}) + r"""Ivy User ID of who the message is assigned to. Default is the user who sends message.""" + latest_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_message'), 'exclude': lambda f: f is None }}) + latest_trash_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_trash_message'), 'exclude': lambda f: f is None }}) org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" + + @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class SearchThreads200ApplicationJSON: r"""Success""" - hits: float = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('hits') }}) - r"""Total of matched threads""" + r"""Total of matched threads""" results: list[SearchThreads200ApplicationJSONResults] = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('results') }}) - r"""Matched threads""" + r"""Matched threads""" + + + @dataclasses.dataclass class SearchThreadsResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) search_threads_200_application_json_object: Optional[SearchThreads200ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - \ No newline at end of file + r"""Success""" + + diff --git a/message/src/epilot/models/operations/senddraft.py b/message/src/epilot/models/operations/senddraft.py index b9549949a..2ba27838e 100755 --- a/message/src/epilot/models/operations/senddraft.py +++ b/message/src/epilot/models/operations/senddraft.py @@ -13,88 +13,87 @@ from marshmallow import fields from typing import Optional -class SendDraft201ApplicationJSONSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" +class SendDraft201ApplicationJSONSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' -class SendDraft201ApplicationJSONTypeEnum(str, Enum): +class SendDraft201ApplicationJSONType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class SendDraft201ApplicationJSON: r"""Success""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + r"""Updated date""" + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[SendDraft201ApplicationJSONSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[SendDraft201ApplicationJSONSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[SendDraft201ApplicationJSONTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[SendDraft201ApplicationJSONType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" + r"""Ivy User ID of user read the message.""" + + + @dataclasses.dataclass class SendDraftResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) send_draft_201_application_json_object: Optional[SendDraft201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - \ No newline at end of file + r"""Success""" + + diff --git a/message/src/epilot/models/operations/sendmessage.py b/message/src/epilot/models/operations/sendmessage.py index f648f31ca..9aa396eee 100755 --- a/message/src/epilot/models/operations/sendmessage.py +++ b/message/src/epilot/models/operations/sendmessage.py @@ -13,88 +13,87 @@ from marshmallow import fields from typing import Optional -class SendMessage201ApplicationJSONSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" +class SendMessage201ApplicationJSONSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' -class SendMessage201ApplicationJSONTypeEnum(str, Enum): +class SendMessage201ApplicationJSONType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class SendMessage201ApplicationJSON: r"""Success""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + r"""Updated date""" + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[SendMessage201ApplicationJSONSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[SendMessage201ApplicationJSONSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[SendMessage201ApplicationJSONTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[SendMessage201ApplicationJSONType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" + r"""Ivy User ID of user read the message.""" + + + @dataclasses.dataclass class SendMessageResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) send_message_201_application_json_object: Optional[SendMessage201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - \ No newline at end of file + r"""Success""" + + diff --git a/message/src/epilot/models/operations/trashmessage.py b/message/src/epilot/models/operations/trashmessage.py index bd3b2ab36..a448d2a01 100755 --- a/message/src/epilot/models/operations/trashmessage.py +++ b/message/src/epilot/models/operations/trashmessage.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class TrashMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" + + + @dataclasses.dataclass class TrashMessageResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/trashthread.py b/message/src/epilot/models/operations/trashthread.py index f49bc16f2..4ac1fb406 100755 --- a/message/src/epilot/models/operations/trashthread.py +++ b/message/src/epilot/models/operations/trashthread.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class TrashThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" + r"""Thread ID""" + + + @dataclasses.dataclass class TrashThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/untrashmessage.py b/message/src/epilot/models/operations/untrashmessage.py index 912df9d61..d0dc97424 100755 --- a/message/src/epilot/models/operations/untrashmessage.py +++ b/message/src/epilot/models/operations/untrashmessage.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class UntrashMessageRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Message ID""" + r"""Message ID""" + + + @dataclasses.dataclass class UntrashMessageResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/untrashthread.py b/message/src/epilot/models/operations/untrashthread.py index 38e982e6c..0474cbf75 100755 --- a/message/src/epilot/models/operations/untrashthread.py +++ b/message/src/epilot/models/operations/untrashthread.py @@ -6,17 +6,20 @@ from typing import Optional + @dataclasses.dataclass class UntrashThreadRequest: - id: str = dataclasses.field(metadata={'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': False }}) - r"""Thread ID""" + r"""Thread ID""" + + + @dataclasses.dataclass class UntrashThreadResponse: + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) - \ No newline at end of file + diff --git a/message/src/epilot/models/operations/updatemessage.py b/message/src/epilot/models/operations/updatemessage.py index 98d0ccb0c..c2a17a572 100755 --- a/message/src/epilot/models/operations/updatemessage.py +++ b/message/src/epilot/models/operations/updatemessage.py @@ -13,88 +13,87 @@ from marshmallow import fields from typing import Optional -class UpdateMessage201ApplicationJSONSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" +class UpdateMessage201ApplicationJSONSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' -class UpdateMessage201ApplicationJSONTypeEnum(str, Enum): +class UpdateMessage201ApplicationJSONType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class UpdateMessage201ApplicationJSON: r"""Success""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + r"""Updated date""" + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[UpdateMessage201ApplicationJSONSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[UpdateMessage201ApplicationJSONSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[UpdateMessage201ApplicationJSONTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[UpdateMessage201ApplicationJSONType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" + r"""Ivy User ID of user read the message.""" + + + @dataclasses.dataclass class UpdateMessageResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) update_message_201_application_json_object: Optional[UpdateMessage201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - \ No newline at end of file + r"""Success""" + + diff --git a/message/src/epilot/models/operations/updatethread.py b/message/src/epilot/models/operations/updatethread.py index 27e74fd87..52cc9110b 100755 --- a/message/src/epilot/models/operations/updatethread.py +++ b/message/src/epilot/models/operations/updatethread.py @@ -13,40 +13,43 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class UpdateThread201ApplicationJSON: r"""Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.""" - created_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_created_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Created date""" + r"""Created date""" id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_id') }}) - r"""Entity ID""" + r"""Entity ID""" org: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_org') }}) - r"""Ivy Organization ID the entity belongs to""" + r"""Ivy Organization ID the entity belongs to""" schema: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_schema') }}) - r"""URL-friendly identifier for the entity schema""" + r"""URL-friendly identifier for the entity schema""" title: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_title') }}) - r"""Entity title""" + r"""Entity title""" updated_at: datetime = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_updated_at'), 'encoder': utils.datetimeisoformat(False), 'decoder': dateutil.parser.isoparse, 'mm_field': fields.DateTime(format='iso') }}) - r"""Updated date""" + r"""Updated date""" topic: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('topic') }}) - r"""Message topic (e.g. which service sends the message or message category)""" + r"""Message topic (e.g. which service sends the message or message category)""" tags: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('_tags'), 'exclude': lambda f: f is None }}) - r"""Entity tags""" + r"""Entity tags""" assigned_to: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('assigned_to'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of who the message is assigned to. Default is the user who sends message.""" - latest_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_message'), 'exclude': lambda f: f is None }}) - latest_trash_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_trash_message'), 'exclude': lambda f: f is None }}) + r"""Ivy User ID of who the message is assigned to. Default is the user who sends message.""" + latest_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_message'), 'exclude': lambda f: f is None }}) + latest_trash_message: Optional[shared_message.Message] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('latest_trash_message'), 'exclude': lambda f: f is None }}) org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" + + + @dataclasses.dataclass class UpdateThreadResponse: - - content_type: str = dataclasses.field() - status_code: int = dataclasses.field() - raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) + content_type: str = dataclasses.field() + status_code: int = dataclasses.field() + raw_response: Optional[requests_http.Response] = dataclasses.field(default=None) update_thread_201_application_json_object: Optional[UpdateThread201ApplicationJSON] = dataclasses.field(default=None) - r"""Success""" - \ No newline at end of file + r"""Success""" + + diff --git a/message/src/epilot/models/shared/__init__.py b/message/src/epilot/models/shared/__init__.py index 6c3e6be02..6aea8e22a 100755 --- a/message/src/epilot/models/shared/__init__.py +++ b/message/src/epilot/models/shared/__init__.py @@ -4,7 +4,8 @@ from .attachmentsrelation import * from .file import * from .message import * +from .messagerequestparams import * from .searchparams import * from .security import * -__all__ = ["Address","AddressSendStatusEnum","AttachmentsRelation","File","Message","MessageSendStatusEnum","MessageTypeEnum","SearchParams","Security"] +__all__ = ["Address","AddressSendError","AddressSendStatus","AttachmentsRelation","File","Message","MessageRequestParams","MessageRequestParamsThread","MessageSendStatus","MessageType","SearchParams","Security"] diff --git a/message/src/epilot/models/shared/address.py b/message/src/epilot/models/shared/address.py index 42eb5f325..f0262b917 100755 --- a/message/src/epilot/models/shared/address.py +++ b/message/src/epilot/models/shared/address.py @@ -5,37 +5,45 @@ from dataclasses_json import Undefined, dataclass_json from enum import Enum from epilot import utils -from typing import Any, Optional +from typing import Optional -class AddressSendStatusEnum(str, Enum): - r"""Sent message status regarding to this recipient.\ - Reference at + + +@dataclasses.dataclass +class AddressSendError: + r"""Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\ + JSON object is defined by AWS SES. Reference at + """ + + +class AddressSendStatus(str, Enum): + r"""Sent message status regarding to this recipient.\ + Reference at """ - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class Address: - address: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('address') }}) - r"""Email address""" + r"""Email address""" name: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('name'), 'exclude': lambda f: f is None }}) - r"""Email address alias""" - send_error: Optional[dict[str, Any]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_error'), 'exclude': lambda f: f is None }}) - r"""Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\ + r"""Email address alias""" + send_error: Optional[AddressSendError] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_error'), 'exclude': lambda f: f is None }}) + r"""Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\ JSON object is defined by AWS SES. Reference at - - """ - send_status: Optional[AddressSendStatusEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status regarding to this recipient.\ + """ + send_status: Optional[AddressSendStatus] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status regarding to this recipient.\ Reference at + """ - """ - \ No newline at end of file + diff --git a/message/src/epilot/models/shared/attachmentsrelation.py b/message/src/epilot/models/shared/attachmentsrelation.py index fb2a6329d..1a56d27c1 100755 --- a/message/src/epilot/models/shared/attachmentsrelation.py +++ b/message/src/epilot/models/shared/attachmentsrelation.py @@ -9,10 +9,11 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class AttachmentsRelation: r"""Message attachments""" - dollar_relation: Optional[list[shared_file.File]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('$relation'), 'exclude': lambda f: f is None }}) - r"""It's normal entity relation with some additional properties for sending message attachment.""" - \ No newline at end of file + r"""It's normal entity relation with some additional properties for sending message attachment.""" + + diff --git a/message/src/epilot/models/shared/file.py b/message/src/epilot/models/shared/file.py index 94f00e058..5e1cba53a 100755 --- a/message/src/epilot/models/shared/file.py +++ b/message/src/epilot/models/shared/file.py @@ -8,25 +8,24 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class File: - entity_id: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('entity_id') }}) - r"""File entity ID""" + r"""File entity ID""" cid: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cid'), 'exclude': lambda f: f is None }}) - r"""Content ID (for inline)""" + r"""Content ID (for inline)""" filename: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('filename'), 'exclude': lambda f: f is None }}) - r"""File name""" + r"""File name""" inline: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('inline'), 'exclude': lambda f: f is None }}) - r"""If true then this attachment should not be offered for download (at least not in the main attachments list).\ + r"""If true then this attachment should not be offered for download (at least not in the main attachments list).\ The usecase is CID embedded image (aka inline image). - - """ + """ is_message_attachment: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('is_message_attachment'), 'exclude': lambda f: f is None }}) - r"""To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation.""" + r"""To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation.""" send_as_link: Optional[bool] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_as_link'), 'exclude': lambda f: f is None }}) - r"""If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\ + r"""If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\ In this case, service doesn't process this attachment. + """ - """ - \ No newline at end of file + diff --git a/message/src/epilot/models/shared/message.py b/message/src/epilot/models/shared/message.py index 904bf79cf..3cddefd8c 100755 --- a/message/src/epilot/models/shared/message.py +++ b/message/src/epilot/models/shared/message.py @@ -9,63 +9,60 @@ from epilot import utils from typing import Optional -class MessageSendStatusEnum(str, Enum): - SEND = "SEND" - DELIVERY = "DELIVERY" - REJECT = "REJECT" - COMPLAINT = "COMPLAINT" - BOUNCE = "BOUNCE" - ERROR = "ERROR" +class MessageSendStatus(str, Enum): + SEND = 'SEND' + DELIVERY = 'DELIVERY' + REJECT = 'REJECT' + COMPLAINT = 'COMPLAINT' + BOUNCE = 'BOUNCE' + ERROR = 'ERROR' -class MessageTypeEnum(str, Enum): +class MessageType(str, Enum): r"""Message type""" - SENT = "SENT" - RECEIVED = "RECEIVED" + SENT = 'SENT' + RECEIVED = 'RECEIVED' @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class Message: - - from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) - r"""Subject""" + r"""Subject""" bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) - r"""Bcc email addresses""" + r"""Bcc email addresses""" cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) - r"""Cc email addresses""" + r"""Cc email addresses""" file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) - r"""Message attachments""" + r"""Message attachments""" html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) - r"""HTML body""" + r"""HTML body""" in_reply_to: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('in_reply_to'), 'exclude': lambda f: f is None }}) - r"""In-Reply-To header. Value is the `message_id` of parent message. - - """ + r"""In-Reply-To header. Value is the `message_id` of parent message.""" message_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('message_id'), 'exclude': lambda f: f is None }}) - r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" + r"""Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.""" org_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('org_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy Organization ID of organization read the message.""" + r"""Ivy Organization ID of organization read the message.""" references: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('references'), 'exclude': lambda f: f is None }}) - r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ + r"""References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\ The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\ The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying. - - """ - reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) - send_status: Optional[list[MessageSendStatusEnum]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) - r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + send_status: Optional[list[MessageSendStatus]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('send_status'), 'exclude': lambda f: f is None }}) + r"""Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc`\ Reference at - - """ + """ sender: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('sender'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user sends the message.""" + r"""Ivy User ID of user sends the message.""" text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) - r"""Text body""" + r"""Text body""" to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) - r"""To email addresses""" - type: Optional[MessageTypeEnum] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) - r"""Message type""" + r"""To email addresses""" + type: Optional[MessageType] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('type'), 'exclude': lambda f: f is None }}) + r"""Message type""" user_read_message: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('user_read_message'), 'exclude': lambda f: f is None }}) - r"""Ivy User ID of user read the message.""" - \ No newline at end of file + r"""Ivy User ID of user read the message.""" + + diff --git a/message/src/epilot/models/shared/messagerequestparams.py b/message/src/epilot/models/shared/messagerequestparams.py new file mode 100755 index 000000000..29f498524 --- /dev/null +++ b/message/src/epilot/models/shared/messagerequestparams.py @@ -0,0 +1,58 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ..shared import address as shared_address +from ..shared import attachmentsrelation as shared_attachmentsrelation +from dataclasses_json import Undefined, dataclass_json +from epilot import utils +from typing import Optional + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class MessageRequestParamsThread: + r"""Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\ + Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\ + `thread` or `parent_id` must be provided either. + """ + topic: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('topic') }}) + r"""Message topic (e.g. which service sends the message or message category)""" + assigned_to: Optional[list[str]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('assigned_to'), 'exclude': lambda f: f is None }}) + r"""Ivy User ID of who the message is assigned to. Default is the user who sends message.""" + + + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class MessageRequestParams: + from_: shared_address.Address = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from') }}) + subject: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('subject') }}) + r"""Subject""" + bcc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('bcc'), 'exclude': lambda f: f is None }}) + r"""Bcc email addresses""" + cc: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('cc'), 'exclude': lambda f: f is None }}) + r"""Cc email addresses""" + file: Optional[shared_attachmentsrelation.AttachmentsRelation] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('file'), 'exclude': lambda f: f is None }}) + r"""Message attachments""" + html: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('html'), 'exclude': lambda f: f is None }}) + r"""HTML body""" + parent_id: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('parent_id'), 'exclude': lambda f: f is None }}) + r"""Entity ID of parent message which this message replies to or forwards from.\ + If both `parent_id` and `thread` are provided, `thread` is discarded. + """ + reply_to: Optional[shared_address.Address] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('reply_to'), 'exclude': lambda f: f is None }}) + text: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('text'), 'exclude': lambda f: f is None }}) + r"""Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text)""" + thread: Optional[MessageRequestParamsThread] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('thread'), 'exclude': lambda f: f is None }}) + r"""Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...).\ + Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\ + `thread` or `parent_id` must be provided either. + """ + to: Optional[list[shared_address.Address]] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('to'), 'exclude': lambda f: f is None }}) + r"""To email addresses""" + + diff --git a/message/src/epilot/models/shared/searchparams.py b/message/src/epilot/models/shared/searchparams.py index 56c5a5bf7..6eaa97a2a 100755 --- a/message/src/epilot/models/shared/searchparams.py +++ b/message/src/epilot/models/shared/searchparams.py @@ -8,11 +8,12 @@ @dataclass_json(undefined=Undefined.EXCLUDE) + @dataclasses.dataclass class SearchParams: - q: str = dataclasses.field(metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('q') }}) - r"""Lucene query syntax supported with ElasticSearch""" - from_: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from'), 'exclude': lambda f: f is None }}) - size: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('size'), 'exclude': lambda f: f is None }}) - \ No newline at end of file + r"""Lucene query syntax supported with ElasticSearch""" + from_: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('from'), 'exclude': lambda f: f is None }}) + size: Optional[int] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('size'), 'exclude': lambda f: f is None }}) + + diff --git a/message/src/epilot/models/shared/security.py b/message/src/epilot/models/shared/security.py index 0dedc5e9a..864a0d4a5 100755 --- a/message/src/epilot/models/shared/security.py +++ b/message/src/epilot/models/shared/security.py @@ -5,9 +5,10 @@ from typing import Optional + @dataclasses.dataclass class Security: + epilot_auth: Optional[str] = dataclasses.field(default=None, metadata={'security': { 'scheme': True, 'type': 'http', 'sub_type': 'bearer', 'field_name': 'Authorization' }}) + epilot_org: Optional[str] = dataclasses.field(default=None, metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'x-epilot-org-id' }}) - epilot_auth: Optional[str] = dataclasses.field(default=None, metadata={'security': { 'scheme': True, 'type': 'http', 'sub_type': 'bearer', 'field_name': 'Authorization' }}) - epilot_org: Optional[str] = dataclasses.field(default=None, metadata={'security': { 'scheme': True, 'type': 'apiKey', 'sub_type': 'header', 'field_name': 'x-epilot-org-id' }}) - \ No newline at end of file + diff --git a/message/src/epilot/sdk.py b/message/src/epilot/sdk.py index 9dde9dd58..7dd486840 100755 --- a/message/src/epilot/sdk.py +++ b/message/src/epilot/sdk.py @@ -1,34 +1,24 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" import requests as requests_http -from . import utils from .drafts import Drafts from .messages import Messages +from .sdkconfiguration import SDKConfiguration from .threads import Threads +from epilot import utils from epilot.models import shared -SERVERS = [ - "https://message.sls.epilot.io", -] -"""Contains the list of servers available to the SDK""" - class Epilot: - r"""Send and receive email messages via your epilot organization - - """ + r"""Message API: Send and receive email messages via your epilot organization""" drafts: Drafts messages: Messages threads: Threads - _client: requests_http.Session - _security_client: requests_http.Session - _server_url: str = SERVERS[0] - _language: str = "python" - _sdk_version: str = "1.2.2" - _gen_version: str = "2.16.5" + sdk_configuration: SDKConfiguration def __init__(self, security: shared.Security = None, + server_idx: int = None, server_url: str = None, url_params: dict[str, str] = None, client: requests_http.Session = None @@ -37,6 +27,8 @@ def __init__(self, :param security: The security details required for authentication :type security: shared.Security + :param server_idx: The index of the server to use for all operations + :type server_idx: int :param server_url: The server URL to use for all operations :type server_url: str :param url_params: Parameters to optionally template the server URL with @@ -44,49 +36,21 @@ def __init__(self, :param client: The requests.Session HTTP client to use for all operations :type client: requests_http.Session """ - self._client = requests_http.Session() + if client is None: + client = requests_http.Session() + security_client = utils.configure_security_client(client, security) if server_url is not None: if url_params is not None: - self._server_url = utils.template_url(server_url, url_params) - else: - self._server_url = server_url - - if client is not None: - self._client = client - - self._security_client = utils.configure_security_client(self._client, security) - + server_url = utils.template_url(server_url, url_params) + self.sdk_configuration = SDKConfiguration(client, security_client, server_url, server_idx) + self._init_sdks() def _init_sdks(self): - self.drafts = Drafts( - self._client, - self._security_client, - self._server_url, - self._language, - self._sdk_version, - self._gen_version - ) - - self.messages = Messages( - self._client, - self._security_client, - self._server_url, - self._language, - self._sdk_version, - self._gen_version - ) - - self.threads = Threads( - self._client, - self._security_client, - self._server_url, - self._language, - self._sdk_version, - self._gen_version - ) - + self.drafts = Drafts(self.sdk_configuration) + self.messages = Messages(self.sdk_configuration) + self.threads = Threads(self.sdk_configuration) \ No newline at end of file diff --git a/message/src/epilot/sdkconfiguration.py b/message/src/epilot/sdkconfiguration.py new file mode 100755 index 000000000..6789fcc00 --- /dev/null +++ b/message/src/epilot/sdkconfiguration.py @@ -0,0 +1,29 @@ +"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" + +import requests +from dataclasses import dataclass + + +SERVERS = [ + 'https://message.sls.epilot.io', +] +"""Contains the list of servers available to the SDK""" + +@dataclass +class SDKConfiguration: + client: requests.Session + security_client: requests.Session + server_url: str = '' + server_idx: int = 0 + language: str = 'python' + openapi_doc_version: str = '1.0.0' + sdk_version: str = '1.21.1' + gen_version: str = '2.39.2' + + def get_server_details(self) -> tuple[str, dict[str, str]]: + if self.server_url: + return self.server_url.removesuffix('/'), {} + if self.server_idx is None: + self.server_idx = 0 + + return SERVERS[self.server_idx], {} diff --git a/message/src/epilot/threads.py b/message/src/epilot/threads.py index 5d2af4509..4467db78a 100755 --- a/message/src/epilot/threads.py +++ b/message/src/epilot/threads.py @@ -1,116 +1,110 @@ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.""" -import requests as requests_http -from . import utils +from .sdkconfiguration import SDKConfiguration +from epilot import utils from epilot.models import operations, shared from typing import Optional class Threads: - _client: requests_http.Session - _security_client: requests_http.Session - _server_url: str - _language: str - _sdk_version: str - _gen_version: str - - def __init__(self, client: requests_http.Session, security_client: requests_http.Session, server_url: str, language: str, sdk_version: str, gen_version: str) -> None: - self._client = client - self._security_client = security_client - self._server_url = server_url - self._language = language - self._sdk_version = sdk_version - self._gen_version = gen_version + sdk_configuration: SDKConfiguration + + def __init__(self, sdk_config: SDKConfiguration) -> None: + self.sdk_configuration = sdk_config + def assign_thread(self, request: operations.AssignThreadRequest) -> operations.AssignThreadResponse: r"""assignThread Assign thread to entities """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.AssignThreadRequest, base_url, '/v1/message/threads/{id}/assign', request) - headers = {} req_content_type, data, form = utils.serialize_request_body(request, "request_body", 'json') if req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type if data is None and form is None: raise Exception('request body is required') + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client http_res = client.request('POST', url, data=data, files=form, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.AssignThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def delete_thread(self, request: operations.DeleteThreadRequest) -> operations.DeleteThreadResponse: r"""deleteThread Immediately and permanently delete a thread. This operation cannot be undone. """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.DeleteThreadRequest, base_url, '/v1/message/threads/{id}', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('DELETE', url) + http_res = client.request('DELETE', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.DeleteThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def mark_read_thread(self, request: operations.MarkReadThreadRequest) -> operations.MarkReadThreadResponse: r"""markReadThread Mark thread as read """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.MarkReadThreadRequest, base_url, '/v1/message/threads/{id}/read', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.MarkReadThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def mark_unread_thread(self, request: operations.MarkUnreadThreadRequest) -> operations.MarkUnreadThreadResponse: r"""markUnreadThread Mark thread as unread """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.MarkUnreadThreadRequest, base_url, '/v1/message/threads/{id}/unread', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.MarkUnreadThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def search_threads(self, request: shared.SearchParams) -> operations.SearchThreadsResponse: r"""searchThreads Search for threads of email messages. @@ -118,18 +112,18 @@ def search_threads(self, request: shared.SearchParams) -> operations.SearchThrea Messages with no replies yet are treated as threads with single message. Lucene syntax supported. - """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/threads:search' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/threads:search' headers = {} req_content_type, data, form = utils.serialize_request_body(request, "request", 'json') if req_content_type not in ('multipart/form-data', 'multipart/mixed'): headers['content-type'] = req_content_type + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client http_res = client.request('POST', url, data=data, files=form, headers=headers) content_type = http_res.headers.get('Content-Type') @@ -145,60 +139,65 @@ def search_threads(self, request: shared.SearchParams) -> operations.SearchThrea return res + def trash_thread(self, request: operations.TrashThreadRequest) -> operations.TrashThreadResponse: r"""trashThread Move a thread to trash """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.TrashThreadRequest, base_url, '/v1/message/threads/{id}/trash', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.TrashThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def untrash_thread(self, request: operations.UntrashThreadRequest) -> operations.UntrashThreadResponse: r"""untrashThread Restore a trashed thread """ - base_url = self._server_url + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) url = utils.generate_url(operations.UntrashThreadRequest, base_url, '/v1/message/threads/{id}/untrash', request) + headers = {} + headers['Accept'] = '*/*' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' + client = self.sdk_configuration.security_client - client = self._security_client - - http_res = client.request('POST', url) + http_res = client.request('POST', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.UntrashThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) - if http_res.status_code in [204, 403]: - pass return res + def update_thread(self) -> operations.UpdateThreadResponse: r"""updateThread Modify thread metadata """ - base_url = self._server_url - - url = base_url.removesuffix('/') + '/v1/message/threads' + base_url = utils.template_url(*self.sdk_configuration.get_server_details()) + url = base_url + '/v1/message/threads' + headers = {} + headers['Accept'] = 'application/json' + headers['user-agent'] = f'speakeasy-sdk/{self.sdk_configuration.language} {self.sdk_configuration.sdk_version} {self.sdk_configuration.gen_version} {self.sdk_configuration.openapi_doc_version}' - client = self._security_client + client = self.sdk_configuration.security_client - http_res = client.request('PUT', url) + http_res = client.request('PUT', url, headers=headers) content_type = http_res.headers.get('Content-Type') res = operations.UpdateThreadResponse(status_code=http_res.status_code, content_type=content_type, raw_response=http_res) diff --git a/message/src/epilot/utils/utils.py b/message/src/epilot/utils/utils.py index 9d4fba324..6b39ecf74 100755 --- a/message/src/epilot/utils/utils.py +++ b/message/src/epilot/utils/utils.py @@ -112,7 +112,7 @@ def _parse_security_scheme_value(client: SecurityClient, scheme_metadata: dict, client.client.headers[header_name] = value elif scheme_type == 'http': if sub_type == 'bearer': - client.client.headers[header_name] = value + client.client.headers[header_name] = value.lower().startswith('bearer ') and value or f'Bearer {value}' else: raise Exception('not supported') else: @@ -141,7 +141,8 @@ def _parse_basic_auth_scheme(client: SecurityClient, scheme: dataclass): client.client.headers['Authorization'] = f'Basic {base64.b64encode(data).decode()}' -def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> str: +def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass, + gbls: dict[str, dict[str, dict[str, Any]]] = None) -> str: path_param_fields: Tuple[Field, ...] = fields(clazz) for field in path_param_fields: request_metadata = field.metadata.get('request') @@ -152,62 +153,71 @@ def generate_url(clazz: type, server_url: str, path: str, path_params: dataclass if param_metadata is None: continue - if param_metadata.get('style', 'simple') == 'simple': - param = getattr( - path_params, field.name) if path_params is not None else None - param = _populate_from_globals( - field.name, param, 'pathParam', gbls) - - if param is None: - continue - - if isinstance(param, list): - pp_vals: list[str] = [] - for pp_val in param: - if pp_val is None: - continue - pp_vals.append(_val_to_string(pp_val)) - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif isinstance(param, dict): - pp_vals: list[str] = [] - for pp_key in param: - if param[pp_key] is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{pp_key}={_val_to_string(param[pp_key])}") - else: - pp_vals.append( - f"{pp_key},{_val_to_string(param[pp_key])}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - elif not isinstance(param, (str, int, float, complex, bool)): - pp_vals: list[str] = [] - param_fields: Tuple[Field, ...] = fields(param) - for param_field in param_fields: - param_value_metadata = param_field.metadata.get( - 'path_param') - if not param_value_metadata: - continue + param = getattr( + path_params, field.name) if path_params is not None else None + param = _populate_from_globals( + field.name, param, 'pathParam', gbls) - parm_name = param_value_metadata.get( - 'field_name', field.name) + if param is None: + continue - param_field_val = getattr(param, param_field.name) - if param_field_val is None: - continue - if param_metadata.get('explode'): - pp_vals.append( - f"{parm_name}={_val_to_string(param_field_val)}") - else: - pp_vals.append( - f"{parm_name},{_val_to_string(param_field_val)}") - path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) - else: + f_name = param_metadata.get("field_name", field.name) + serialization = param_metadata.get('serialization', '') + if serialization != '': + serialized_params = _get_serialized_params( + param_metadata, f_name, param) + for key, value in serialized_params.items(): path = path.replace( - '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) + '{' + key + '}', value, 1) + else: + if param_metadata.get('style', 'simple') == 'simple': + if isinstance(param, list): + pp_vals: list[str] = [] + for pp_val in param: + if pp_val is None: + continue + pp_vals.append(_val_to_string(pp_val)) + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + elif isinstance(param, dict): + pp_vals: list[str] = [] + for pp_key in param: + if param[pp_key] is None: + continue + if param_metadata.get('explode'): + pp_vals.append( + f"{pp_key}={_val_to_string(param[pp_key])}") + else: + pp_vals.append( + f"{pp_key},{_val_to_string(param[pp_key])}") + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + elif not isinstance(param, (str, int, float, complex, bool)): + pp_vals: list[str] = [] + param_fields: Tuple[Field, ...] = fields(param) + for param_field in param_fields: + param_value_metadata = param_field.metadata.get( + 'path_param') + if not param_value_metadata: + continue + + parm_name = param_value_metadata.get( + 'field_name', field.name) + + param_field_val = getattr(param, param_field.name) + if param_field_val is None: + continue + if param_metadata.get('explode'): + pp_vals.append( + f"{parm_name}={_val_to_string(param_field_val)}") + else: + pp_vals.append( + f"{parm_name},{_val_to_string(param_field_val)}") + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', ",".join(pp_vals), 1) + else: + path = path.replace( + '{' + param_metadata.get('field_name', field.name) + '}', _val_to_string(param), 1) return server_url.removesuffix("/") + path @@ -224,7 +234,8 @@ def template_url(url_with_params: str, params: dict[str, str]) -> str: return url_with_params -def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[str, list[str]]: +def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[str, dict[str, Any]]] = None) -> dict[ + str, list[str]]: params: dict[str, list[str]] = {} param_fields: Tuple[Field, ...] = fields(clazz) @@ -246,16 +257,23 @@ def get_query_params(clazz: type, query_params: dataclass, gbls: dict[str, dict[ f_name = metadata.get("field_name") serialization = metadata.get('serialization', '') if serialization != '': - params = params | _get_serialized_query_params( - metadata, f_name, value) + serialized_parms = _get_serialized_params(metadata, f_name, value) + for key, value in serialized_parms.items(): + if key in params: + params[key].extend(value) + else: + params[key] = [value] else: style = metadata.get('style', 'form') if style == 'deepObject': params = params | _get_deep_object_query_params( metadata, f_name, value) elif style == 'form': - params = params | _get_form_query_params( - metadata, f_name, value) + params = params | _get_delimited_query_params( + metadata, f_name, value, ",") + elif style == 'pipeDelimited': + params = params | _get_delimited_query_params( + metadata, f_name, value, "|") else: raise Exception('not yet implemented') return params @@ -282,8 +300,8 @@ def get_headers(headers_params: dataclass) -> dict[str, str]: return headers -def _get_serialized_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]: - params: dict[str, list[str]] = {} +def _get_serialized_params(metadata: dict, field_name: str, obj: any) -> dict[str, str]: + params: dict[str, str] = {} serialization = metadata.get('serialization', '') if serialization == 'json': @@ -314,12 +332,15 @@ def _get_deep_object_query_params(metadata: dict, field_name: str, obj: any) -> if val is None: continue - if params.get(f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]') is None: - params[f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ + if params.get( + f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]') is None: + params[ + f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ ] params[ - f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'].append(_val_to_string(val)) + f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'].append( + _val_to_string(val)) else: params[ f'{metadata.get("field_name", field_name)}[{obj_param_metadata.get("field_name", obj_field.name)}]'] = [ @@ -355,25 +376,28 @@ def _get_query_param_field_name(obj_field: Field) -> str: return obj_param_metadata.get("field_name", obj_field.name) -def _get_form_query_params(metadata: dict, field_name: str, obj: any) -> dict[str, list[str]]: - return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name) +def _get_delimited_query_params(metadata: dict, field_name: str, obj: any, delimiter: str) -> dict[ + str, list[str]]: + return _populate_form(field_name, metadata.get("explode", True), obj, _get_query_param_field_name, delimiter) SERIALIZATION_METHOD_TO_CONTENT_TYPE = { - 'json': 'application/json', - 'form': 'application/x-www-form-urlencoded', + 'json': 'application/json', + 'form': 'application/x-www-form-urlencoded', 'multipart': 'multipart/form-data', - 'raw': 'application/octet-stream', - 'string': 'text/plain', + 'raw': 'application/octet-stream', + 'string': 'text/plain', } -def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[str, any, any]: +def serialize_request_body(request: dataclass, request_field_name: str, serialization_method: str) -> Tuple[ + str, any, any]: if request is None: return None, None, None, None if not is_dataclass(request) or not hasattr(request, request_field_name): - return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], request) + return serialize_content_type(request_field_name, SERIALIZATION_METHOD_TO_CONTENT_TYPE[serialization_method], + request) request_val = getattr(request, request_field_name) @@ -388,7 +412,8 @@ def serialize_request_body(request: dataclass, request_field_name: str, serializ if request_metadata is None: raise Exception('invalid request type') - return serialize_content_type(request_field_name, request_metadata.get('media_type', 'application/octet-stream'), request_val) + return serialize_content_type(request_field_name, request_metadata.get('media_type', 'application/octet-stream'), + request_val) def serialize_content_type(field_name: str, media_type: str, request: dataclass) -> Tuple[str, any, list[list[any]]]: @@ -461,7 +486,7 @@ def serialize_multipart_form(media_type: str, request: dataclass) -> Tuple[str, def serialize_dict(original: dict, explode: bool, field_name, existing: Optional[dict[str, list[str]]]) -> dict[ - str, list[str]]: + str, list[str]]: if existing is None: existing = [] @@ -501,7 +526,7 @@ def serialize_form_data(field_name: str, data: dataclass) -> dict[str, any]: else: if metadata.get('style', 'form') == 'form': form = form | _populate_form( - field_name, metadata.get('explode', True), val, _get_form_field_name) + field_name, metadata.get('explode', True), val, _get_form_field_name, ",") else: raise Exception( f'Invalid form style for field {field.name}') @@ -523,7 +548,8 @@ def _get_form_field_name(obj_field: Field) -> str: return obj_param_metadata.get("field_name", obj_field.name) -def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable) -> dict[str, list[str]]: +def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_func: Callable, delimiter: str) -> \ + dict[str, list[str]]: params: dict[str, list[str]] = {} if obj is None: @@ -546,10 +572,10 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f params[obj_field_name] = [_val_to_string(val)] else: items.append( - f'{obj_field_name},{_val_to_string(val)}') + f'{obj_field_name}{delimiter}{_val_to_string(val)}') if len(items) > 0: - params[field_name] = [','.join(items)] + params[field_name] = [delimiter.join(items)] elif isinstance(obj, dict): items = [] for key, value in obj.items(): @@ -559,10 +585,10 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f if explode: params[key] = _val_to_string(value) else: - items.append(f'{key},{_val_to_string(value)}') + items.append(f'{key}{delimiter}{_val_to_string(value)}') if len(items) > 0: - params[field_name] = [','.join(items)] + params[field_name] = [delimiter.join(items)] elif isinstance(obj, list): items = [] @@ -578,7 +604,7 @@ def _populate_form(field_name: str, explode: boolean, obj: any, get_field_name_f items.append(_val_to_string(value)) if len(items) > 0: - params[field_name] = [','.join([str(item) for item in items])] + params[field_name] = [delimiter.join([str(item) for item in items])] else: params[field_name] = [_val_to_string(obj)] @@ -718,7 +744,7 @@ def _val_to_string(val): if isinstance(val, datetime): return val.isoformat().replace('+00:00', 'Z') if isinstance(val, Enum): - return val.value + return str(val.value) return str(val)