Skip to content

Commit

Permalink
Merge pull request #254 from ballerina-platform/dev
Browse files Browse the repository at this point in the history
Regenerate client in 2201.8.3
  • Loading branch information
niveathika authored Nov 23, 2023
2 parents 5680e1a + 86004a3 commit 42c3b79
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 84 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ import ballerinax/googleapis.gmail;
Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initialize the connector with it.

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
auth: {
refreshToken: refreshToken,
clientId: clientId,
clientSecret: clientSecret
}
gmail:Client gmailClient = check new gmail:Client(
config = {
auth: {
refreshToken,
clientId,
clientSecret
}
);
}
);
```

### Step 3: Invoke the connector operation
Expand Down
14 changes: 7 additions & 7 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initiali

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
auth: {
refreshToken: refreshToken,
clientId: clientId,
clientSecret: clientSecret
}
config = {
auth: {
refreshToken,
clientId,
clientSecret
}
);
}
);
```

### Step 3: Invoke the connector operation
Expand Down
14 changes: 7 additions & 7 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Create a `gmail:ConnectionConfig` with the obtained OAuth2.0 tokens and initiali

```ballerina
gmail:Client gmailClient = check new gmail:Client (
config = {
auth: {
refreshToken: refreshToken,
clientId: clientId,
clientSecret: clientSecret
}
config = {
auth: {
refreshToken,
clientId,
clientSecret
}
);
}
);
```

### Step 3: Invoke the connector operation
Expand Down
12 changes: 6 additions & 6 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public isolated client class Client {
string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (),
string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/drafts/[id].delete(xgafv, access_token, alt, callback, fields,
return self.genClient->/users/[userId]/drafts/[id].delete(xgafv, access_token, alt, callback, fields,
'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand Down Expand Up @@ -361,7 +361,7 @@ public isolated client class Client {
string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (),
string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/labels/[id].delete(xgafv, access_token, alt, callback, fields,
return self.genClient->/users/[userId]/labels/[id].delete(xgafv, access_token, alt, callback, fields,
'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand Down Expand Up @@ -479,7 +479,7 @@ public isolated client class Client {
string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (),
boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/messages/batchDelete.post(payload, xgafv, access_token,
return self.genClient->/users/[userId]/messages/batchDelete.post(payload, xgafv, access_token,
alt, callback, fields, 'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand All @@ -505,7 +505,7 @@ public isolated client class Client {
string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (),
boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/messages/batchModify.post(payload, xgafv, access_token,
return self.genClient->/users/[userId]/messages/batchModify.post(payload, xgafv, access_token,
alt, callback, fields, 'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand Down Expand Up @@ -626,7 +626,7 @@ public isolated client class Client {
string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (),
string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/messages/[id].delete(xgafv, access_token, alt, callback, fields,
return self.genClient->/users/[userId]/messages/[id].delete(xgafv, access_token, alt, callback, fields,
'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand Down Expand Up @@ -850,7 +850,7 @@ public isolated client class Client {
string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (),
string? upload_protocol = (), string? uploadType = ())
returns error? {
_ = check self.genClient->/users/[userId]/threads/[id].delete(xgafv, access_token, alt, callback, fields,
return self.genClient->/users/[userId]/threads/[id].delete(xgafv, access_token, alt, callback, fields,
'key, oauth_token, prettyPrint, quotaUser, upload_protocol, uploadType
);
}
Expand Down
38 changes: 16 additions & 22 deletions ballerina/modules/oas/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,11 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + id - The ID of the draft to delete.
# + return - Successful response
resource isolated function delete users/[string userId]/drafts/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function delete users/[string userId]/drafts/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/drafts/${getEncodedUri(id)}`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Response response = check self.clientEp-> delete(resourcePath);
return response;
return self.clientEp->delete(resourcePath);
}
# Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing `historyId`).
#
Expand Down Expand Up @@ -332,12 +331,11 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + id - The ID of the label to delete.
# + return - Successful response
resource isolated function delete users/[string userId]/labels/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function delete users/[string userId]/labels/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/labels/${getEncodedUri(id)}`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Response response = check self.clientEp-> delete(resourcePath);
return response;
return self.clientEp->delete(resourcePath);
}
# Patch the specified label.
#
Expand Down Expand Up @@ -438,15 +436,14 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + payload - The IDs of the messages to delete.
# + return - Successful response
resource isolated function post users/[string userId]/messages/batchDelete(BatchDeleteMessagesRequest payload, Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function post users/[string userId]/messages/batchDelete(BatchDeleteMessagesRequest payload, Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/messages/batchDelete`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
json jsonBody = payload.toJson();
request.setPayload(jsonBody, "application/json");
http:Response response = check self.clientEp->post(resourcePath, request);
return response;
return self.clientEp->post(resourcePath, request);
}
# Modifies the labels on the specified messages.
#
Expand All @@ -464,15 +461,14 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + payload - A list of labels to add/remove in messages.
# + return - Successful response
resource isolated function post users/[string userId]/messages/batchModify(BatchModifyMessagesRequest payload, Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function post users/[string userId]/messages/batchModify(BatchModifyMessagesRequest payload, Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/messages/batchModify`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
json jsonBody = payload.toJson();
request.setPayload(jsonBody, "application/json");
http:Response response = check self.clientEp->post(resourcePath, request);
return response;
return self.clientEp->post(resourcePath, request);
}
# Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message.
#
Expand Down Expand Up @@ -572,12 +568,11 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + id - The ID of the message to delete.
# + return - Successful response
resource isolated function delete users/[string userId]/messages/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function delete users/[string userId]/messages/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/messages/${getEncodedUri(id)}`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Response response = check self.clientEp-> delete(resourcePath);
return response;
return self.clientEp->delete(resourcePath);
}
# Modifies the labels on the specified message.
#
Expand Down Expand Up @@ -627,7 +622,7 @@ public isolated client class Client {
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
Message response = check self.clientEp-> post(resourcePath, request);
Message response = check self.clientEp->post(resourcePath, request);
return response;
}
# Removes the specified message from the trash.
Expand All @@ -651,7 +646,7 @@ public isolated client class Client {
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
Message response = check self.clientEp-> post(resourcePath, request);
Message response = check self.clientEp->post(resourcePath, request);
return response;
}
# Gets the specified message attachment.
Expand Down Expand Up @@ -770,12 +765,11 @@ public isolated client class Client {
# + userId - The user's email address. The special value `me` can be used to indicate the authenticated user.
# + id - ID of the Thread to delete.
# + return - Successful response
resource isolated function delete users/[string userId]/threads/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns http:Response|error {
resource isolated function delete users/[string userId]/threads/[string id](Xgafv? xgafv = (), string? access_token = (), Alt? alt = (), string? callback = (), string? fields = (), string? 'key = (), string? oauth_token = (), boolean? prettyPrint = (), string? quotaUser = (), string? upload_protocol = (), string? uploadType = ()) returns error? {
string resourcePath = string `/users/${getEncodedUri(userId)}/threads/${getEncodedUri(id)}`;
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Response response = check self.clientEp-> delete(resourcePath);
return response;
return self.clientEp->delete(resourcePath);
}
# Modifies the labels applied to the thread. This applies to all messages in the thread.
#
Expand Down Expand Up @@ -825,7 +819,7 @@ public isolated client class Client {
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
MailThread response = check self.clientEp-> post(resourcePath, request);
MailThread response = check self.clientEp->post(resourcePath, request);
return response;
}
# Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.
Expand All @@ -849,7 +843,7 @@ public isolated client class Client {
map<anydata> queryParam = {"$.xgafv": xgafv, "access_token": access_token, "alt": alt, "callback": callback, "fields": fields, "key": 'key, "oauth_token": oauth_token, "prettyPrint": prettyPrint, "quotaUser": quotaUser, "upload_protocol": upload_protocol, "uploadType": uploadType};
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
MailThread response = check self.clientEp-> post(resourcePath, request);
MailThread response = check self.clientEp->post(resourcePath, request);
return response;
}
}
10 changes: 5 additions & 5 deletions ballerina/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ string historyId = "";

ConnectionConfig gmailConfig = {
auth: {
refreshToken: refreshToken,
clientId: clientId,
clientSecret: clientSecret
refreshToken,
clientId,
clientSecret
}
};

Expand Down Expand Up @@ -535,7 +535,7 @@ function testReplyTo() returns error? {
runtime:sleep(10);

// Get the message thread
MailThread mailThread = check gmailClient->/users/me/threads/[message.threadId];
MailThread mailThread = check gmailClient->/users/me/threads/[replyMessage.threadId];

Message[]? threadMessages = mailThread.messages;

Expand All @@ -546,7 +546,7 @@ function testReplyTo() returns error? {
} else {
test:assertFail("Message not found");
}
check gmailClient->/users/me/threads/[threadId].delete();
check gmailClient->/users/me/threads/[replyMessage.threadId].delete();
}

@test:Config {
Expand Down
2 changes: 1 addition & 1 deletion docs/open-api-spec/Sanitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ This file records the sanitation done on top of the OAS from APIs guru. Google u
## OpenAPI cli command

```bash
bal openapi -i docs/open-api-spec/openapi.yaml --mode client -o ballerina/generated/oas
bal openapi -i docs/open-api-spec/openapi.yaml --mode client -o ballerina/modules/oas
```
Loading

0 comments on commit 42c3b79

Please sign in to comment.