-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add company survey example #158
Add company survey example #158
Conversation
@@ -0,0 +1,5 @@ | |||
[package] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename is file to Ballerina.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the changes. Thanks
examples/companySurvey/main.bal
Outdated
import ballerinax/slack; | ||
|
||
public function companySurvey() returns error? { | ||
slack:Client cl = check new ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this as a final module variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved. Thank you.
examples/companySurvey/main.bal
Outdated
public function companySurvey() returns error? { | ||
slack:Client cl = check new ({ | ||
auth: { | ||
token: value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The token should be defined as configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved Thanks
examples/companySurvey/main.bal
Outdated
@@ -0,0 +1,24 @@ | |||
import ballerina/io; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing license header
examples/companySurvey/main.bal
Outdated
|
||
configurable string value = ?; | ||
|
||
final slack:Client cl = check new ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
final slack:Client cl = check new ({ | |
final slack:Client slack = check new ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to keep the Config.toml
file
@@ -0,0 +1,5 @@ | |||
[package] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[package] |
org = "wso2" | ||
name = "company_survey" | ||
version = "0.1.0" | ||
distribution = "2201.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing newline
examples/companySurvey/main.bal
Outdated
import ballerinax/slack; //importing the slack connector module | ||
|
||
configurable string value = ?; //initializing of the configurable token value variable | ||
|
||
final slack:Client slack = check new ({ //the initialization of the slack client at module variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to comment on self-explanatory code
examples/companySurvey/main.bal
Outdated
import ballerina/io; //importing the io module | ||
import ballerinax/slack; //importing the slack connector module | ||
|
||
configurable string value = ?; //initializing of the configurable token value variable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configurable string value = ?; //initializing of the configurable token value variable | |
configurable string token = ?; |
examples/companySurvey/main.bal
Outdated
|
||
final slack:Client slack = check new ({ //the initialization of the slack client at module variable | ||
auth: { | ||
token: value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
token: value | |
token |
examples/companySurvey/main.bal
Outdated
} | ||
}); | ||
|
||
public function companySurvey() returns error? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public function companySurvey() returns error? { | |
public function main() returns error? { |
examples/companySurvey/main.bal
Outdated
public function companySurvey() returns error? { | ||
|
||
json conversationsResponse = check slack->/conversations\.create.post({name: "survey-coordination"}); | ||
io:println(conversationsResponse); //creation of a channel to coordinate surveys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to print these intermediate reponses
Improve the example and fix various issues
Purpose
Add company survey example
Examples
Checklist