Skip to content

Commit 1e7ed2f

Browse files
Merge pull request #11 from aspose-email-cloud/develop
Develop
2 parents 810e7fc + 2da37ca commit 1e7ed2f

File tree

174 files changed

+19645
-774
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+19645
-774
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
with:
1515
java-version: 1.8
1616
- name: Run tests
17-
run: mvn test -Dgroups=pipeline --batch-mode
17+
run: mvn test -Dgroups=pipeline --batch-mode -q
1818
env:
1919
appSid: ${{secrets.appSid}}
2020
appKey: ${{secrets.appKey}}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ build
3636
*.ctxt
3737

3838
.vscode
39-
.idea
39+
.idea
40+
*.iml

README.md

Lines changed: 44 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,49 @@
1-
# Aspose.Email Cloud SDK for Java [![Maven](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepository.aspose.cloud%2Frepo%2Fcom%2Faspose%2Faspose-email-cloud%2Fmaven-metadata.xml)](https://repository.aspose.cloud/repo/com/aspose/aspose-email-cloud/) [![License](https://img.shields.io/github/license/aspose-email-cloud/aspose-email-cloud-java)](https://repository.aspose.cloud/repo/com/aspose/aspose-email-cloud/) ![tests](https://github.com/aspose-email-cloud/aspose-email-cloud-java/workflows/tests/badge.svg)
1+
# Aspose.Email Cloud SDK for Java
2+
[![Maven](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepository.aspose.cloud%2Frepo%2Fcom%2Faspose%2Faspose-email-cloud%2Fmaven-metadata.xml)](https://repository.aspose.cloud/repo/com/aspose/aspose-email-cloud/) [![License](https://img.shields.io/github/license/aspose-email-cloud/aspose-email-cloud-java)](https://repository.aspose.cloud/repo/com/aspose/aspose-email-cloud/) ![tests](https://github.com/aspose-email-cloud/aspose-email-cloud-java/workflows/tests/badge.svg)
3+
24
This repository contains Aspose.Email Cloud SDK for Java source code. This SDK allows you to work with Aspose.Email Cloud REST APIs in your Java applications quickly and easily, with zero initial cost.
35

46
[Aspose.Email Cloud home](https://products.aspose.cloud/email/family "Aspose.Email Cloud")
57
[API Reference](https://apireference.aspose.cloud/email/)
68

7-
8-
9+
# Key features
10+
Aspose.Email Cloud is a REST API for creating email applications that work with standard email file formats. This SDK:
11+
- Lets developers manipulate different emails’ formats such as Outlook MSG, EML, VCard, and iCalendar files
12+
- Lets developers manipulate different emails' formats such as Outlook MSG, EML, VCard, and iCalendar files
13+
- Supports AI functions:
14+
- The Business card recognition
15+
- The Name API for parsing and handling personal names
16+
- Has a built-in email client. This client provides:
17+
- Unified REST API for different email protocols: IMAP, POP3, SMTP, EWS, WebDav
18+
- Virtual multi-account
19+
- Message threads (POP3 accounts are also supported)
20+
- Email configuration discovery
21+
- Disposable email address detection
22+
23+
## New features in version 20.7
24+
- New MAPI message files API with models:
25+
- `MapiMessageDto` - represents the Microsoft Outlook message.
26+
- `MapiCalendarDto` - represents the Microsoft Outlook calendar object.
27+
- `MapiContactDto` - represents the Microsoft Outlook contact information.
28+
- Improved Recurrence pattern support for CalendarDto.
29+
30+
See [Release notes](https://docs.aspose.cloud/display/emailcloud/Aspose.Email+Cloud+20.7+Release+Notes)
931

1032
## How to use the SDK?
1133
The complete source code is available in the GIT repository.
1234

13-
Use [SDK tutorials](https://docs.aspose.cloud/display/emailcloud/SDK+Tutorials), [reference documentation](https://github.com/aspose-email-cloud/aspose-email-cloud-java/blob/master/docs/README.md) and [examples from this document](#usage-examples)
35+
Use [SDK tutorials](https://docs.aspose.cloud/display/emailcloud/SDK+Tutorials):
36+
- [SDK setup](https://docs.aspose.cloud/display/emailcloud/SDK+setup) - installation, account setup, first API calls
37+
- [Business Cards Recognition API](https://docs.aspose.cloud/display/emailcloud/Business+Cards+Recognition+API) - convert captured business cards and name card images, into a vCard format
38+
- [Working with Name API](https://docs.aspose.cloud/display/emailcloud/Working+with+Name+API) - format, genderize, compare, parse, autocomplete names
39+
- [Email Message Files](https://docs.aspose.cloud/display/emailcloud/Email+Message+Files) - Convert EML to MSG and back, edit EML files, etc.
40+
- [Quick Start With iCalendar API](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+iCalendar+API) - Crate and edit iCalendar files
41+
- [Quick Start With VCard API](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+VCard+API) - Create and edit VCard files, business card recognition
42+
- [Quick Start With Email Client](https://docs.aspose.cloud/display/emailcloud/Quick+Start+With+Email+Client) - Setup builtin email client, search/fetch/send/move/delete messages
43+
- [Email Client Threads](https://docs.aspose.cloud/display/emailcloud/Email+Client+Threads) - Fetch/Move/Delete email message threads using builtin email client
44+
- [File converters](https://docs.aspose.cloud/display/emailcloud/Convert+Email%2C+Calendar+and+Contact+Files)
45+
46+
SDK reference documentation is available in [this README](https://github.com/aspose-email-cloud/aspose-email-cloud-java/blob/master/docs/README.md)
1447

1548
### Prerequisites
1649
To use these 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).
@@ -34,187 +67,26 @@ Then, add a dependency:
3467
</dependency>
3568
```
3669

70+
See more details about SDK installation in this tutorial: [SDK setup](https://docs.aspose.cloud/display/emailcloud/SDK+setup)
71+
3772
### Usage examples
3873
To use the API, you should create an EmailApi object:
3974
```java
4075
EmailApi api = new EmailApi("Your App Key", "Your App SID");
4176
```
4277

4378
#### Business cards recognition API
44-
See examples below:
45-
46-
<details open>
47-
<summary>Parse business card images to VCard contact files</summary>
48-
49-
```java
50-
// Upload business card image to storage
51-
String storage = "First Storage"; //Your storage name
52-
String fileName = "someFileName.png"; //Supports different image formats: PNG, JPEG, BMP, TIFF, GIF, etc.
53-
String folder = "some/folder/path/on/storage";
54-
String filePath = folder + "/" + fileName;
55-
byte[] fileBytes = IOUtils.toByteArray(
56-
new FileInputStream("some/business/card/image/on/disk.png"));
57-
api.uploadFile(new UploadFileRequestData(
58-
filePath,
59-
fileBytes,
60-
storage));
61-
String outFolderPath = "some/other/folder/path/on/storage"; //Business card recognition results will be saved here
62-
api.createFolder(new CreateFolderRequestData(outFolderPath, storage));
63-
// Call business card recognition action
64-
ListResponseOfStorageFileLocation result = api.aiBcrParseStorage(new AiBcrParseStorageRequestData(
65-
new AiBcrParseStorageRq(
66-
null,
67-
//We can process multiple images in one request
68-
Arrays.asList(new AiBcrImageStorageFile(
69-
true, //Flag isSingle determines that image contains single VCard or more.
70-
//Only single VCard on image variant is supported in current version.
71-
new StorageFileLocation(storage, folder, fileName))),
72-
new StorageFolderLocation(storage, outFolderPath))));
73-
// Get file name from recognition result
74-
StorageFileLocation contactFile = result.getValue().get(0); //result.getValue() can contain multiple files, if we sent multicard images or multiple images
75-
// You can download the VCard file, which produced by the recognition method ...
76-
byte[] contactBytes = api.downloadFile(new DownloadFileRequestData(
77-
contactFile.getFolderPath() + "/" + contactFile.getFileName(),
78-
contactFile.getStorage(),
79-
null));
80-
String contactFileContent = new String(contactBytes, StandardCharsets.UTF_8);
81-
//... and print it
82-
System.out.println(contactFileContent);
83-
// Also, you can get VCard object properties’ list using Contact API
84-
HierarchicalObject contactProperties = api.getContactProperties(
85-
new GetContactPropertiesRequestData(
86-
"VCard",
87-
contactFile.getFileName(),
88-
contactFile.getFolderPath(),
89-
contactFile.getStorage()));
90-
//All VCard’s properties are available as a list. Complex properties are represented as hierarchical structures.
91-
//Let's print all primitive properties’ values:
92-
for (BaseObject property: contactProperties.getInternalProperties()) {
93-
if (property.getType().equals("PrimitiveObject")) {
94-
PrimitiveObject primitive = (PrimitiveObject)property;
95-
System.out.println("Property name: " +
96-
primitive.getName() +
97-
" value: " +
98-
primitive.getValue());
99-
}
100-
}
101-
```
102-
</details>
103-
104-
105-
<details>
106-
<summary>Parse images directly, without the using of a storage</summary>
79+
Use `AiBcrParseModel` method to parse business card image to VCard DTO:
10780

10881
```java
109-
//Read image from file and convert it to Base64 string
110-
byte[] fileBytes = IOUtils.toByteArray(
111-
new FileInputStream("some/business/card/image/on/disk.png"));
82+
byte[] fileBytes = IOUtils.toByteArray(new FileInputStream("/tmp/alex.png"));
11283
String fileBase64 = Base64.encodeToString(fileBytes, false);
113-
ListResponseOfHierarchicalObject result = api.aiBcrParse(new AiBcrParseRequestData(
84+
ListResponseOfContactDto result = api.aiBcrParseModel(new AiBcrParseModelRequestData(
11485
new AiBcrBase64Rq(null, Arrays.asList(new AiBcrBase64Image(true, fileBase64)))));
115-
//Result contains all recognized VCard objects (only the one in our case)
116-
HierarchicalObject contactProperties = result.getValue().get(0);
117-
//VCard object is available as a list of properties, without any external calls:
118-
for (BaseObject property: contactProperties.getInternalProperties()) {
119-
if (property.getType().equals("PrimitiveObject")) {
120-
PrimitiveObject primitive = (PrimitiveObject)property;
121-
System.out.println("Property name: " +
122-
primitive.getName() +
123-
" value: " +
124-
primitive.getValue());
125-
}
126-
}
127-
```
128-
</details>
129-
130-
131-
#### Name API
132-
See examples below:
133-
<details open>
134-
<summary>Detect a person's gender by name</summary>
135-
136-
```java
137-
ListResponseOfAiNameGenderHypothesis result = api
138-
.aiNameGenderize(new AiNameGenderizeRequestData("John Cane", null, null, null, null, null));
139-
// the result contains a list of hypothesis about a person's gender.
140-
// all hypothesis include score, so you can use the most scored version,
141-
// which will be the first in a list:
142-
System.out.println(result.getValue().get(0).getGender()); //prints "Male"
143-
```
144-
</details>
145-
146-
<details>
147-
<summary>Format person's name using defined format</summary>
148-
149-
```java
150-
AiNameFormatted result = api.aiNameFormat(
151-
new AiNameFormatRequestData("Mr. John Michael Cane", null, null, null, null, "%t%L%f%m", null));
152-
System.out.println(result.getName()) // prints "Mr. Cane J. M."
153-
```
154-
</details>
155-
156-
<details>
157-
<summary>Compare the names to find out if they belong to the same person or not</summary>
158-
159-
```java
160-
final String first = "John Michael Cane";
161-
final String second = "Cane J.";
162-
AiNameMatchResult result = api
163-
.aiNameMatch(new AiNameMatchRequestData(first, second, null, null, null, null, null));
164-
System.out.println(result.getSimilarity() >= 0.5); //prints "true", names look similar
165-
```
166-
</details>
167-
168-
<details>
169-
<summary>Expand a person's name into a list of possible alternatives</summary>
170-
171-
172-
```java
173-
String name = "Smith Bobby";
174-
AiNameWeightedVariants result = api
175-
.aiNameExpand(new AiNameExpandRequestData(name, null, null, null, null, null));
176-
for (AiNameWeighted weighted : result.getNames()) {
177-
System.out.println(weighted.getName()); //prints "Mr. Smith", "B. Smith", etc.
178-
}
86+
ContactDto contact = result.getValue().get(0);
17987
```
180-
</details>
181-
182-
<details>
183-
<summary>Get k most probable names for given starting characters</summary>
18488

185-
```java
186-
String prefix = "Dav";
187-
AiNameWeightedVariants result = api
188-
.aiNameComplete(new AiNameCompleteRequestData(prefix, null, null, null, null, null));
189-
for (AiNameWeighted weighted : result.getNames()) {
190-
System.out.println(prefix + weighted.getName()); //prints "David", "Dave", "Davis", etc.
191-
}
192-
```
193-
</details>
194-
195-
<details>
196-
<summary>Parse out a person's name from an email address.</summary>
197-
198-
```java
199-
String address = "john-cane@gmail.com";
200-
ListResponseOfAiNameExtracted result = api
201-
.aiNameParseEmailAddress(new AiNameParseEmailAddressRequestData(address, null, null, null, null, null));
202-
String givenName = null;
203-
String surname = null;
204-
for(AiNameExtracted extracted: result.getValue()) {
205-
for(AiNameExtractedComponent component: extracted.getName()) {
206-
if (component.getCategory().equals("GivenName")) {
207-
givenName = component.getValue();
208-
}
209-
if (component.getCategory().equals("Surname")) {
210-
surname = component.getValue();
211-
}
212-
}
213-
}
214-
System.out.println("Given name is " + givenName); // "John"
215-
System.out.println("Surname is " + surname); // "Cane"
216-
```
217-
</details>
89+
See more details [here](https://docs.aspose.cloud/display/emailcloud/Parse+Image+To+VCard+File) and [here](https://docs.aspose.cloud/display/emailcloud/Business+Cards+Recognition+API)
21890

21991
# Licensing
22092
All Aspose.Email for Cloud SDKs, helper scripts and templates are licensed under [MIT License](LICENSE).

docs/AiBcrImageStorageFile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**file** | **Object** | Image location | [optional]
7+
**file** | [**StorageFileLocation**](StorageFileLocation.md) | Image location | [optional]
88

99

1010
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)

docs/AiBcrParseStorageRq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**outFolder** | **Object** | Parse output folder location on storage |
7+
**outFolder** | [**StorageFolderLocation**](StorageFolderLocation.md) | Parse output folder location on storage |
88

99

1010
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)

docs/AppendEmailBaseRequest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**emailFile** | **Object** | Email document file location in storage |
7+
**emailFile** | [**StorageFileLocation**](StorageFileLocation.md) | Email document file location in storage |
88

99

1010
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)

docs/AppendEmailModelRq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**message** | **Object** | Email document |
7+
**message** | [**EmailDto**](EmailDto.md) | Email document |
88

99

1010
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)

docs/CalendarDto.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ Name | Type | Description | Notes
1717
**microsoftIntendedStatus** | **String** | Specifies the INTENDED status. Enum, available values: NotDefined, Free, Tentative, Busy, Oof |
1818
**optionalAttendees** | [**List&lt;MailAddress&gt;**](MailAddress.md) | Optional attendees. | [optional]
1919
**organizer** | [**MailAddress**](MailAddress.md) | Event organizer. |
20-
**recurrenceString** | **String** | String representation of recurrence pattern (See iCalendar RFC, \&quot;Recurrence rule\&quot; section). For example: For daily recurrence: \&quot;FREQ&#x3D;DAILY;COUNT&#x3D;10;WKST&#x3D;MO\&quot; For monthly recurrence: \&quot;BYSETPOS&#x3D;1;BYDAY&#x3D;MO,TU,WE,TH,FR;FREQ&#x3D;MONTHLY;INTERVAL&#x3D;10;WKST&#x3D;MO\&quot; For yearly recurrence: \&quot;BYMONTHDAY&#x3D;30;BYMONTH&#x3D;1;FREQ&#x3D;YEARLY;WKST&#x3D;MO\&quot; | [optional]
20+
**recurrenceString** | **String** | Deprecated, use &#39;Recurrence&#39; property. String representation of recurrence pattern (See iCalendar RFC, \&quot;Recurrence rule\&quot; section). For example: For daily recurrence: \&quot;FREQ&#x3D;DAILY;COUNT&#x3D;10;WKST&#x3D;MO\&quot; For monthly recurrence: \&quot;BYSETPOS&#x3D;1;BYDAY&#x3D;MO,TU,WE,TH,FR;FREQ&#x3D;MONTHLY;INTERVAL&#x3D;10;WKST&#x3D;MO\&quot; For yearly recurrence: \&quot;BYMONTHDAY&#x3D;30;BYMONTH&#x3D;1;FREQ&#x3D;YEARLY;WKST&#x3D;MO\&quot; | [optional]
21+
**recurrence** | [**RecurrencePatternDto**](RecurrencePatternDto.md) | Recurrence pattern | [optional]
2122
**reminders** | [**List&lt;CalendarReminder&gt;**](CalendarReminder.md) | Reminders. | [optional]
2223
**sequenceId** | **String** | The sequence id. Read only. | [optional]
2324
**startDate** | [**Date**](Date.md) | Start date. |

docs/ContactPhoto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
77
**photoImageFormat** | **String** | MapiContact photo image format. Enum, available values: Undefined, Jpeg, Gif, Wmf, Bmp, Tiff |
88
**base64Data** | **String** | Photo serialized as base64 string. | [optional]
9+
**discriminator** | **String** | |
910

1011

1112
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)

docs/DailyRecurrencePatternDto.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
# com.aspose.email.cloud.sdk.model.DailyRecurrencePatternDto
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
8+
9+
[[Back to Model list]](README.md#documentation-for-models) [[Back to API list]](README.md#documentation-for-api-endpoints) [[Back to API README]](README.md)
10+

0 commit comments

Comments
 (0)