Skip to content

Commit 85d5f88

Browse files
Merge pull request #82 from SanduDS/Migration-SLP8-Snapshot
Migration Swan Lake Preview8
2 parents ec7417c + 582b0df commit 85d5f88

File tree

9 files changed

+65
-65
lines changed

9 files changed

+65
-65
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
script:
16-
- wget http://dist-dev.ballerina.io/downloads/swan-lake-preview7/ballerina-linux-installer-x64-swan-lake-preview7.deb
17-
- sudo dpkg -i ballerina-linux-installer-x64-swan-lake-preview7.deb
16+
- wget http://dist-dev.ballerina.io/downloads/swan-lake-preview8/ballerina-linux-installer-x64-swan-lake-preview8.deb
17+
- sudo dpkg -i ballerina-linux-installer-x64-swan-lake-preview8.deb
1818
- sudo apt-get install -f
1919
- ballerina --version
2020
- ballerina build -c --skip-tests

Ballerina.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
org = "ballerinax"
33
name = "googleapis_gmail"
4-
version = "0.99.2"
4+
version = "0.99.3"
55
authors = ["Ballerina"]
66
repository = "https://github.com/ballerina-platform/module-ballerinax-googleapis.gmail"
77
keywords = ["gmail","email"]

Module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gmail:Client gmailClient = new (gmailConfig);
4444

4545
| Ballerina Language Versions | Gmail API Version |
4646
|:----------------------------:|:-----------------:|
47-
| Swan Lake Preview7 | v1 |
47+
| Swan Lake Preview8-SNAPSHOT | v1 |
4848

4949
## Sample
5050

Package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ gmail:Client gmailClient = new (gmailConfig);
4444

4545
| Ballerina Language Versions | Gmail API Version |
4646
|:----------------------------:|:-----------------:|
47-
| Swan Lake Preview7 | v1 |
47+
| Swan Lake Preview8 | v1 |
4848

4949
## Sample
5050

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The following sections provide you with information on how to use the Ballerina
1717

1818
| Ballerina Language Versions | Gmail API Version |
1919
|:----------------------------:|:-----------------:|
20-
| Swan Lake Preview7 | v1 |
20+
| Swan Lake Preview8 | v1 |
2121

2222
## Feature Overview
2323

gmail_endpoint.bal

Lines changed: 27 additions & 27 deletions
Large diffs are not rendered by default.

gmail_utils.bal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ function getDispostionFromPayload(json messagePayload) returns string {
118118
if (dispositionStr is string) {
119119
disposition = dispositionStr;
120120
} else {
121-
log:printInfo("disposition is ()");
121+
log:print("disposition is ()");
122122
}
123123
}
124124
} else {
@@ -240,7 +240,7 @@ function getFileNameFromPath(string filePath) returns string | error {
240240
#
241241
# + httpResponse - Http response or error
242242
# + return - If successful returns `json` response. Else returns error.
243-
isolated function handleResponse(http:Response |http:Payload |error httpResponse) returns @tainted json | error {
243+
isolated function handleResponse(http:Response |http:PayloadType |error httpResponse) returns @tainted json | error {
244244
if (httpResponse is http:Response) {
245245
if (httpResponse.statusCode == http:STATUS_NO_CONTENT) {
246246
//If status 204, then no response body. So returns json boolean true.

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
| Ballerina Language Version | Gmail API Version |
44
|:--------------------------:|:-----------------:|
5-
| Swan Lake Preview5 | v1 |
5+
| Swan Lake Preview8-SNAPSHOT| v1 |
66

77
### Prerequisites
88

tests/main_test.bal

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function testSendTextMessage() {
7777
//---Set Attachments---
7878
AttachmentPath[] attachments = [{attachmentPath: testAttachmentPath, mimeType: attachmentContentType}];
7979
messageRequest.attachmentPaths = attachments;
80-
log:printInfo("testSendTextMessage");
80+
log:print("testSendTextMessage");
8181
//----Send the mail----
8282
var sendMessageResponse = gmailClient->sendMessage(testUserId, messageRequest);
8383

@@ -110,7 +110,7 @@ function testSendHTMLMessage() {
110110
//---Set Attachments---
111111
AttachmentPath[] attachments = [{attachmentPath: testAttachmentPath, mimeType: attachmentContentType}];
112112
messageRequest.attachmentPaths = attachments;
113-
log:printInfo("testSendHTMLMessage");
113+
log:print("testSendHTMLMessage");
114114
//----Send the mail----
115115
var sendMessageResponse = gmailClient->sendMessage(testUserId, messageRequest);
116116
string messageId = "";
@@ -130,7 +130,7 @@ function testSendHTMLMessage() {
130130
}
131131
function testModifyHTMLMessage() {
132132
//Modify labels of the message with message id which was sent in testSendHTMLMessage
133-
log:printInfo("testModifyHTMLMessage");
133+
log:print("testModifyHTMLMessage");
134134
var response = gmailClient->modifyMessage(testUserId, sentHtmlMessageId, ["INBOX"], []);
135135
if (response is Message) {
136136
test:assertTrue(response.id == sentHtmlMessageId, msg = "Modify HTML message by adding new label failed");
@@ -151,7 +151,7 @@ function testModifyHTMLMessage() {
151151
}
152152
function testListMessages() {
153153
//List All Messages with Label INBOX without including Spam and Trash
154-
log:printInfo("testListAllMessages");
154+
log:print("testListAllMessages");
155155
MsgSearchFilter searchFilter = {includeSpamTrash: false, labelIds: ["INBOX"]};
156156
var msgList = gmailClient->listMessages("me", filter = searchFilter);
157157
if msgList is error {
@@ -165,7 +165,7 @@ function testListMessages() {
165165
}
166166
function testReadTextMessage() {
167167
//Read mail with message id which was sent in testSendSimpleMessage
168-
log:printInfo("testReadTextMessage");
168+
log:print("testReadTextMessage");
169169
var response = gmailClient->readMessage(testUserId, sentTextMessageId);
170170
if (response is Message) {
171171
testHistoryId = <@untainted>response.historyId;
@@ -181,7 +181,7 @@ function testReadTextMessage() {
181181
}
182182
function testReadHTMLMessageWithAttachment() {
183183
//Read mail with message id which sent in testSendWithAttachment
184-
log:printInfo("testReadMessageWithAttachment");
184+
log:print("testReadMessageWithAttachment");
185185
var response = gmailClient->readMessage(testUserId, sentHtmlMessageId);
186186
if (response is Message) {
187187
readAttachmentFileId = <@untainted>response.msgAttachments[0].fileId;
@@ -196,7 +196,7 @@ function testReadHTMLMessageWithAttachment() {
196196
groups: ["htmlMessageTestGroup"]
197197
}
198198
function testgetAttachment() {
199-
log:printInfo("testgetAttachment");
199+
log:print("testgetAttachment");
200200
var response = gmailClient->getAttachment(testUserId, sentHtmlMessageId, readAttachmentFileId);
201201
if (response is error) {
202202
test:assertFail(msg = response.message());
@@ -211,7 +211,7 @@ function testgetAttachment() {
211211
groups: ["htmlMessageTestGroup"]
212212
}
213213
function testTrashMessage() {
214-
log:printInfo("testTrashMessage");
214+
log:print("testTrashMessage");
215215
var trash = gmailClient->trashMessage(testUserId, sentHtmlMessageId);
216216
if (trash is error) {
217217
test:assertFail(msg = trash.message());
@@ -225,7 +225,7 @@ function testTrashMessage() {
225225
groups: ["htmlMessageTestGroup"]
226226
}
227227
function testUntrashMessage() {
228-
log:printInfo("testUntrashMessage");
228+
log:print("testUntrashMessage");
229229
var untrash = gmailClient->untrashMessage(testUserId, sentHtmlMessageId);
230230
if (untrash is error) {
231231
test:assertFail(msg = untrash.message());
@@ -239,7 +239,7 @@ function testUntrashMessage() {
239239
groups: ["htmlMessageTestGroup"]
240240
}
241241
function testDeleteMessage() {
242-
log:printInfo("testDeleteMessage");
242+
log:print("testDeleteMessage");
243243
var delete = gmailClient->deleteMessage(testUserId, sentHtmlMessageId);
244244
if (delete is error) {
245245
test:assertFail(msg = delete.message());
@@ -252,7 +252,7 @@ function testDeleteMessage() {
252252

253253
}
254254
function testListThreads() {
255-
log:printInfo("testListThreads");
255+
log:print("testListThreads");
256256
var threadList = gmailClient->listThreads(testUserId, filter = {includeSpamTrash: false, labelIds: ["INBOX"]});
257257
if (threadList is error) {
258258
test:assertFail(msg = threadList.message());
@@ -264,7 +264,7 @@ function testListThreads() {
264264
groups: ["textMessageTestGroup"]
265265
}
266266
function testReadThread() {
267-
log:printInfo("testReadThread");
267+
log:print("testReadThread");
268268
var thread = gmailClient->readThread(testUserId, sentTextMessageThreadId, format = FORMAT_METADATA,
269269
metadataHeaders = ["Subject"]);
270270
if (thread is MailThread) {
@@ -280,7 +280,7 @@ function testReadThread() {
280280
}
281281
function testModifyThread() {
282282
//Modify labels of the thread with thread id which was sent in testSendTextMessage
283-
log:printInfo("testModifyThread");
283+
log:print("testModifyThread");
284284
var response = gmailClient->modifyThread(testUserId, sentTextMessageThreadId, ["INBOX"], []);
285285
if (response is MailThread) {
286286
test:assertTrue(response.id == sentTextMessageThreadId, msg = "Modify thread by adding new label failed");
@@ -301,7 +301,7 @@ function testModifyThread() {
301301
groups: ["textMessageTestGroup"]
302302
}
303303
function testTrashThread() {
304-
log:printInfo("testTrashThread");
304+
log:print("testTrashThread");
305305
var trash = gmailClient->trashThread(testUserId, sentTextMessageThreadId);
306306
if (trash is error) {
307307
test:assertFail(msg = trash.message());
@@ -315,7 +315,7 @@ function testTrashThread() {
315315
groups: ["textMessageTestGroup"]
316316
}
317317
function testUnTrashThread() {
318-
log:printInfo("testUnTrashThread");
318+
log:print("testUnTrashThread");
319319
var untrash = gmailClient->untrashThread(testUserId, sentTextMessageThreadId);
320320
if (untrash is error) {
321321
test:assertFail(msg = untrash.message());
@@ -330,7 +330,7 @@ function testUnTrashThread() {
330330
groups: ["textMessageTestGroup"]
331331
}
332332
function testDeleteThread() {
333-
log:printInfo("testDeleteThread");
333+
log:print("testDeleteThread");
334334
var delete = gmailClient->deleteThread(testUserId, sentTextMessageThreadId);
335335
if (delete is error) {
336336
test:assertFail(msg = delete.message());
@@ -343,7 +343,7 @@ function testDeleteThread() {
343343
groups: ["userTestGroup"]
344344
}
345345
function testgetUserProfile() {
346-
log:printInfo("testgetUserProfile");
346+
log:print("testgetUserProfile");
347347
var profile = gmailClient->getUserProfile(testUserId);
348348
if (profile is UserProfile) {
349349
test:assertTrue(profile.emailAddress != EMPTY_STRING, msg = "Get User Profile failed");
@@ -356,7 +356,7 @@ function testgetUserProfile() {
356356
groups: ["labelTestGroup"]
357357
}
358358
function testGetLabel() {
359-
log:printInfo("testgetLabel");
359+
log:print("testgetLabel");
360360
var response = gmailClient->getLabel(testUserId, createdLabelId);
361361
if (response is Label) {
362362
test:assertTrue(response.id != EMPTY_STRING, msg = "Get Label failed");
@@ -369,7 +369,7 @@ function testGetLabel() {
369369
groups: ["labelTestGroup"]
370370
}
371371
function testCreateLabel() {
372-
log:printInfo("testCreateLabel");
372+
log:print("testCreateLabel");
373373
var createLabelResponse = gmailClient->createLabel(testUserId, "Test", "labelShow", "show");
374374
if (createLabelResponse is string) {
375375
createdLabelId = <@untainted>createLabelResponse;
@@ -383,7 +383,7 @@ function testCreateLabel() {
383383
groups: ["labelTestGroup"]
384384
}
385385
function testListLabels() {
386-
log:printInfo("testListLabels");
386+
log:print("testListLabels");
387387
var listLabelResponse = gmailClient->listLabels(testUserId);
388388
if (listLabelResponse is error) {
389389
test:assertFail(msg = listLabelResponse.message());
@@ -395,7 +395,7 @@ function testListLabels() {
395395
groups: ["labelTestGroup"]
396396
}
397397
function testDeleteLabel() {
398-
log:printInfo("testDeleteLabel");
398+
log:print("testDeleteLabel");
399399
var deleteLabelResponse = gmailClient->deleteLabel(testUserId, createdLabelId);
400400
if (deleteLabelResponse is error) {
401401
test:assertFail(msg = deleteLabelResponse.message());
@@ -409,7 +409,7 @@ function testDeleteLabel() {
409409
groups: ["labelTestGroup"]
410410
}
411411
function testUpdateLabel() {
412-
log:printInfo("testUpdateLabel");
412+
log:print("testUpdateLabel");
413413
string updateName = "updateTest";
414414
string updateBgColor = "#16a766";
415415
string updateTxtColor = "#000000";
@@ -429,7 +429,7 @@ function testUpdateLabel() {
429429
groups: ["textMessageTestGroup"]
430430
}
431431
function testListHistory() {
432-
log:printInfo("testListTheHistory");
432+
log:print("testListTheHistory");
433433
string[] historyTypes = ["labelAdded", "labelRemoved", "messageAdded", "messageDeleted"];
434434
var listHistoryResponse = gmailClient->listHistory(testUserId, testHistoryId, historyTypes = historyTypes);
435435
if (listHistoryResponse is error) {
@@ -444,7 +444,7 @@ function testListHistory() {
444444
}
445445
function testListDrafts() {
446446
//List maximum of ten results for Drafts without including Spam and Trash
447-
log:printInfo("testListDrafts");
447+
log:print("testListDrafts");
448448
DraftSearchFilter searchFilter = {includeSpamTrash: false, maxResults: "10"};
449449
var msgList = gmailClient->listDrafts("me", filter = searchFilter);
450450
if (msgList is error) {
@@ -457,7 +457,7 @@ function testListDrafts() {
457457
groups: ["draftTestGroup"]
458458
}
459459
function testCreateDraft() {
460-
log:printInfo("testCreateDraft");
460+
log:print("testCreateDraft");
461461
string messageBody = "Draft Text Message Body";
462462
MessageRequest messageRequest = {};
463463
messageRequest.recipient = testRecipient;
@@ -479,7 +479,7 @@ function testCreateDraft() {
479479
groups: ["draftTestGroup"]
480480
}
481481
function testUpdateDraft() {
482-
log:printInfo("testUpdateDraft");
482+
log:print("testUpdateDraft");
483483
string messageBody = "Updated Draft Text Message Body";
484484
MessageRequest messageRequest = {};
485485
messageRequest.recipient = testRecipient;
@@ -502,7 +502,7 @@ function testUpdateDraft() {
502502
groups: ["draftTestGroup"]
503503
}
504504
function testReadDraft() {
505-
log:printInfo("testReadDraft");
505+
log:print("testReadDraft");
506506
var draftResponse = gmailClient->readDraft(testUserId, createdDraftId);
507507
if (draftResponse is Draft) {
508508
test:assertTrue(draftResponse.id == createdDraftId, msg = "Read Draft failed");
@@ -516,7 +516,7 @@ function testReadDraft() {
516516
groups: ["draftTestGroup"]
517517
}
518518
function testSendDraft() {
519-
log:printInfo("testSendDraft");
519+
log:print("testSendDraft");
520520
var sendDraftResponse = gmailClient->sendDraft(testUserId, createdDraftId);
521521
if (sendDraftResponse is error) {
522522
test:assertFail(msg = sendDraftResponse.message());
@@ -530,7 +530,7 @@ function testSendDraft() {
530530
groups: ["draftTestGroup"]
531531
}
532532
function testDeleteDraft() {
533-
log:printInfo("testDeleteDraft");
533+
log:print("testDeleteDraft");
534534
//Create a new draft first
535535
MessageRequest messageRequest = {};
536536
messageRequest.recipient = testRecipient;

0 commit comments

Comments
 (0)