-
Notifications
You must be signed in to change notification settings - Fork 2
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
Generated Hubspot CRM object products connector for Ballerina #2
Conversation
@DinithiLiyanage please sign the contributor license agreement. |
ballerina/tests/test.bal
Outdated
configurable string serviceUrl = ?; | ||
final string final_serviceUrl = isLiveServer ? serviceUrl : "http://localhost:9091"; | ||
|
||
Client hubSpotProducts = test:mock(Client); |
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.
Can you restructure the client initialization by following the below structure ?
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.
Done:8074f65
ballerina/tests/test.bal
Outdated
string newId = ""; | ||
string[] batchIds = []; | ||
SimplePublicObjectId[] inputs = []; | ||
|
||
@test:BeforeSuite | ||
function initClient() returns Client|error { | ||
if isLiveServer { | ||
OAuth2RefreshTokenGrantConfig auth = { | ||
clientId: clientId, | ||
clientSecret: clientSecret, | ||
refreshToken: refreshToken, | ||
credentialBearer: oauth2:POST_BODY_BEARER | ||
}; | ||
return check new ({auth}, serviceUrl); | ||
} | ||
return check new ({ | ||
auth: { | ||
token: "test-token" | ||
} | ||
}, serviceUrl); | ||
} |
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.
string newId = ""; | |
string[] batchIds = []; | |
SimplePublicObjectId[] inputs = []; | |
@test:BeforeSuite | |
function initClient() returns Client|error { | |
if isLiveServer { | |
OAuth2RefreshTokenGrantConfig auth = { | |
clientId: clientId, | |
clientSecret: clientSecret, | |
refreshToken: refreshToken, | |
credentialBearer: oauth2:POST_BODY_BEARER | |
}; | |
return check new ({auth}, serviceUrl); | |
} | |
return check new ({ | |
auth: { | |
token: "test-token" | |
} | |
}, serviceUrl); | |
} | |
function initClient() returns Client|error { | |
if isLiveServer { | |
OAuth2RefreshTokenGrantConfig auth = { | |
clientId: clientId, | |
clientSecret: clientSecret, | |
refreshToken: refreshToken, | |
credentialBearer: oauth2:POST_BODY_BEARER | |
}; | |
return check new ({auth}, serviceUrl); | |
} | |
return check new ({ | |
auth: { | |
token: "test-token" | |
} | |
}, serviceUrl); | |
} | |
string newId = ""; | |
string[] batchIds = []; | |
SimplePublicObjectId[] inputs = []; |
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.
Done:45005d9
README.md
Outdated
|
||
```ballerina | ||
import ballerina/oauth2; | ||
mport ballerinax/hubspot.crm.obj.products as hsproducts; |
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.
mport ballerinax/hubspot.crm.obj.products as hsproducts; | |
import ballerinax/hubspot.crm.obj.products as hsproducts; |
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.
Done:3c1fff3
ballerina/tests/test.bal
Outdated
|
||
final Client hubSpotProducts = check initClient(); | ||
|
||
@test:BeforeSuite |
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 of the annotation.
@test:BeforeSuite |
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.
Done:0514e52
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.
LGTM
The Hubspot CRM object products connector was generated using the OpenAPI spec and the package.md file was updated.
Checklist