Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
python -m pip install -r tests/requirements.txt
- name: Test with pytest
env:
appSid: ${{secrets.appSid}}
appKey: ${{secrets.appKey}}
clientId: ${{secrets.appSid}}
clientSecret: ${{secrets.appKey}}
apiBaseUrl: "https://api-qa.aspose.cloud"
run: |
python -m pytest --verbose --color=yes -m pipeline tests
4 changes: 2 additions & 2 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
pip install -r tests/requirements.txt
- name : Run Tests
env:
appSid: ${{secrets.appSidProd}}
appKey: ${{secrets.appKeyProd}}
clientId: ${{secrets.appSidProd}}
clientSecret: ${{secrets.appKeyProd}}
apiBaseUrl: "https://api.aspose.cloud"
run: |
python -m pytest -m pipeline tests
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ target/
.idea/
.vscode/
.pytest_cache/
.venv/
.venv/
.run/
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,15 @@ Aspose.Email Cloud is a REST API for creating email applications that work with
- Email configuration discovery.
- Disposable email address detection.

## New features in version 20.10
## What's new in version 20.12

Aspose.Email Cloud 20.10.0 comes with SDK improvements:
Aspose.Email Cloud 20.12.0 comes with SDK breaking changes:
- AppKey renamed to ClientSecret.
- AppSID renamed to ClientId.

- Typescript, PHP, Java SDKs now have model builders to simplify their initialization.
- All SDK methods now have code examples with parameters initialization.
- Some models now have initialization examples for all SDKs.
- SDK reference documentation with examples now available at url [docs.aspose.cloud/email/reference-api](https://docs.aspose.cloud/email/reference-api/)
Some [SDK reference documentation](https://docs.aspose.cloud/email/reference-api/) improvements were made.

See [Release notes](https://docs.aspose.cloud/email/aspose-email-cloud-20-10-release-notes/).
See [Release notes](https://docs.aspose.cloud/email/aspose-email-cloud-20-12-release-notes/).

## How to use the SDK?
The complete source code is available in the [GIT repository](https://github.com/aspose-email-cloud/aspose-email-cloud-python/tree/master/sdk/AsposeEmailCloudSdk).
Expand All @@ -40,7 +39,7 @@ Use [SDK tutorials](https://docs.aspose.cloud/email/sdk-tutorials/) and [SDK ref

### Prerequisites

To use this SDK, you need an App SID and an App Key; they can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (it requires free registration in Aspose Cloud for this).
To use this SDK, you need a Client id and a Client secret; they can be looked up at [Aspose Cloud Dashboard](https://dashboard.aspose.cloud/#/apps) (it requires free registration in Aspose Cloud for this).

### Installation

Expand All @@ -58,9 +57,10 @@ from AsposeEmailCloudSdk import api #EmailApi class is here
from AsposeEmailCloudSdk import models #REST API models are here

#...
app_sid = 'Your App SID'
app_key = 'Your App Key'
email_cloud = api.EmailCloud(app_key, app_sid)
client_secret = 'Your Client secret'
client_id = 'Your Client id'

email_cloud = api.EmailCloud(client_secret, client_id)
```

#### Business cards recognition API
Expand Down
4 changes: 2 additions & 2 deletions sdk/AsposeEmailCloudSdk/api/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def call_api():
def _request_token(self):
config = self.api_client.configuration
request_url = "/connect/token"
form_params = [('grant_type', 'client_credentials'), ('client_id', config.api_key['app_sid']),
('client_secret', config.api_key['api_key'])]
form_params = [('grant_type', 'client_credentials'), ('client_id', config.api_key['client_id']),
('client_secret', config.api_key['client_secret'])]

header_params = {'Accept': 'application/json', 'Content-Type': 'application/x-www-form-urlencoded'}

Expand Down
2 changes: 1 addition & 1 deletion sdk/AsposeEmailCloudSdk/api/email_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, api_client):
super(EmailApi, self).__init__(api_client)

def as_file(self, request: EmailAsFileRequest) -> str:
"""Converts Email model to specified format and returns as file.
"""Converts Email model to a specified format and returns as a file.

:param request: Email model and format to convert.
:type request: EmailAsFileRequest
Expand Down
16 changes: 8 additions & 8 deletions sdk/AsposeEmailCloudSdk/api/email_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ class EmailCloud(object):
Aspose.Email Cloud API.
"""

def __init__(self, app_key=None, app_sid=None, base_url=None,
def __init__(self, client_secret=None, client_id=None, base_url=None,
api_version=None, debug=False):
"""
Initializes a new instance of the EmailCloud class.

:param app_key: The app key.
:type app_key: str
:param app_sid: The app sid.
:type app_sid: str
:param client_secret: The client secret.
:type client_secret: str
:param client_id: The client id.
:type client_id: str
:param base_url: The base URL.
:type base_url: str
:param api_version: API version.
:type api_version: str
:param debug: If debug mode is enabled. False by default.
:type debug: bool
"""
configuration = Configuration(app_key=app_key,
app_sid=app_sid,
configuration = Configuration(client_secret=client_secret,
client_id=client_id,
base_url=base_url,
api_version=api_version,
debug=debug)
Expand Down Expand Up @@ -106,7 +106,7 @@ def email(self) -> EmailApi:
@property
def disposable_email(self) -> DisposableEmailApi:
"""
Check email address is disposable operations
Checks if an email is a disposable one
"""
return self._disposable_email

Expand Down
8 changes: 4 additions & 4 deletions sdk/AsposeEmailCloudSdk/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Configuration(object):

default_api_version = 'v4.0'

def __init__(self, app_key=None, app_sid=None, base_url=None,
def __init__(self, client_secret=None, client_id=None, base_url=None,
api_version=None, debug=False):
"""Constructor"""
# Base url
Expand Down Expand Up @@ -72,8 +72,8 @@ def __init__(self, app_key=None, app_sid=None, base_url=None,

# Authentication Settings
# dict to store API key(s)
self.api_key = {'api_key': app_key if app_key else "",
'app_sid': app_sid if app_sid else ""}
self.api_key = {'client_secret': client_secret if client_secret else "",
'client_id': client_id if client_id else ""}
# dict to store API prefix (e.g. Bearer)
self.api_key_prefix = {}

Expand Down Expand Up @@ -101,7 +101,7 @@ def __init__(self, app_key=None, app_sid=None, base_url=None,
self.__debug = debug

# On-premise switch
self.on_premise = not (app_key or app_sid) and base_url
self.on_premise = not (client_secret or client_id) and base_url

# SSL/TLS verification
# Set this to false to skip verifying SSL certificate when calling API
Expand Down
4 changes: 2 additions & 2 deletions sdk/docs/AiBcrApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ result = models.ContactList(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiBcrParseRequest(
Expand Down Expand Up @@ -196,7 +196,7 @@ result = models.StorageFileLocationList(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiBcrParseStorageRequest(
Expand Down
22 changes: 11 additions & 11 deletions sdk/docs/AiNameApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ result = models.AiNameWeightedVariants(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameCompleteRequest(
Expand Down Expand Up @@ -135,7 +135,7 @@ result = models.AiNameWeightedVariants(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameExpandRequest(
Expand Down Expand Up @@ -229,7 +229,7 @@ result = models.AiNameWeightedVariants(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameParsedRequest(
Expand Down Expand Up @@ -319,7 +319,7 @@ result = models.AiNameFormatted(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameFormatRequest(
Expand Down Expand Up @@ -404,7 +404,7 @@ result = models.AiNameFormatted(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameParsedRequest(
Expand Down Expand Up @@ -486,7 +486,7 @@ result =
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameGenderizeRequest(
Expand Down Expand Up @@ -566,7 +566,7 @@ result =
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameParsedRequest(
Expand Down Expand Up @@ -652,7 +652,7 @@ result = models.AiNameMatchResult(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameMatchRequest(
Expand Down Expand Up @@ -760,7 +760,7 @@ result = models.AiNameMatchResult(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameMatchParsedRequest(
Expand Down Expand Up @@ -881,7 +881,7 @@ result = models.AiNameComponentList(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameParseRequest(
Expand Down Expand Up @@ -964,7 +964,7 @@ result =
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.AiNameParseEmailAddressRequest(
Expand Down
20 changes: 10 additions & 10 deletions sdk/docs/CalendarApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ result = models.AlternateView(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarAsAlternateRequest(
Expand Down Expand Up @@ -191,7 +191,7 @@ Return type: **Stream**
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarAsFileRequest(
Expand Down Expand Up @@ -312,7 +312,7 @@ result = models.MapiCalendarDto(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
calendar_dto = models.CalendarDto(
Expand Down Expand Up @@ -412,7 +412,7 @@ Return type: **Stream**
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarConvertRequest(
Expand Down Expand Up @@ -491,7 +491,7 @@ result = models.CalendarDto(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarFromFileRequest(
Expand Down Expand Up @@ -591,7 +591,7 @@ result = models.CalendarDto(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarGetRequest(
Expand Down Expand Up @@ -693,7 +693,7 @@ result = models.AlternateView(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarGetAsAlternateRequest(
Expand Down Expand Up @@ -771,7 +771,7 @@ Return type: **Stream**
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarGetAsFileRequest(
Expand Down Expand Up @@ -862,7 +862,7 @@ result = models.CalendarStorageList(
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarGetListRequest(
Expand Down Expand Up @@ -962,7 +962,7 @@ Return type: void (empty response body)
<summary>Method call example:</summary>

```python
api = EmailCloud(app_key, app_sid)
api = EmailCloud(client_secret, client_id)

// Prepare parameters:
request = models.CalendarSaveRequest(
Expand Down
Loading