Skip to content

Commit

Permalink
Merge pull request #1 from Pasindu599/dev1
Browse files Browse the repository at this point in the history
Added regenerated files
  • Loading branch information
Pasindu599 authored Jan 3, 2025
2 parents 5a8a8c8 + 4909cf2 commit 37319f2
Show file tree
Hide file tree
Showing 4 changed files with 239 additions and 279 deletions.
12 changes: 8 additions & 4 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "http"
version = "2.12.0"
version = "2.12.4"
dependencies = [
{org = "ballerina", name = "auth"},
{org = "ballerina", name = "cache"},
Expand Down Expand Up @@ -93,7 +93,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand Down Expand Up @@ -219,7 +219,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.10.0"
version = "2.10.1"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -286,10 +286,13 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "time", moduleName = "time"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -323,6 +326,7 @@ dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "oauth2"},
{org = "ballerina", name = "test"},
{org = "ballerina", name = "time"},
{org = "ballerina", name = "url"},
{org = "ballerinai", name = "observe"}
]
Expand Down
35 changes: 22 additions & 13 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public isolated client class Client {
# + config - The configurations to be used when initializing the `connector`
# + serviceUrl - URL of the target service
# + return - An error if connector initialization failed
public isolated function init(ConnectionConfig config, string serviceUrl = "https://api.hubapi.com") returns error? {
public isolated function init(ConnectionConfig config, string serviceUrl = "https://api.hubapi.com/marketing/v3/forms") returns error? {
http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation};
do {
if config.http1Settings is ClientHttp1Settings {
Expand Down Expand Up @@ -50,8 +50,8 @@ public isolated client class Client {
# + formId - The ID of the form to archive.
# + headers - Headers to be sent with the request
# + return - No content
resource isolated function delete marketing/v3/forms/[string formId](map<string|string[]> headers = {}) returns json|error {
string resourcePath = string `/marketing/v3/forms/${getEncodedUri(formId)}`;
resource isolated function delete [string formId](map<string|string[]> headers = {}) returns json|error {
string resourcePath = string `/${getEncodedUri(formId)}`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand All @@ -60,8 +60,13 @@ public isolated client class Client {
return self.clientEp->delete(resourcePath, headers = httpHeaders);
}

resource isolated function get marketing/v3/forms(map<string|string[]> headers = {}, *GetMarketingV3Forms_getpageQueries queries) returns CollectionResponseFormDefinitionBaseForwardPaging|error {
string resourcePath = string `/marketing/v3/forms/`;
# Get a list of forms
#
# + headers - Headers to be sent with the request
# + queries - Queries to be sent with the request
# + return - successful operation
resource isolated function get .(map<string|string[]> headers = {}, *GetMarketingV3Forms_getpageQueries queries) returns CollectionResponseFormDefinitionBaseForwardPaging|error {
string resourcePath = string `/`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand All @@ -78,8 +83,8 @@ public isolated client class Client {
# + headers - Headers to be sent with the request
# + queries - Queries to be sent with the request
# + return - successful operation
resource isolated function get marketing/v3/forms/[string formId](map<string|string[]> headers = {}, *GetMarketingV3FormsFormid_getbyidQueries queries) returns FormDefinitionBase|error {
string resourcePath = string `/marketing/v3/forms/${getEncodedUri(formId)}`;
resource isolated function get [string formId](map<string|string[]> headers = {}, *GetMarketingV3FormsFormid_getbyidQueries queries) returns FormDefinitionBase|error {
string resourcePath = string `/${getEncodedUri(formId)}`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand All @@ -94,8 +99,8 @@ public isolated client class Client {
# + formId - The ID of the form to update.
# + headers - Headers to be sent with the request
# + return - successful operation
resource isolated function patch marketing/v3/forms/[string formId](HubSpotFormDefinitionPatchRequest payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/marketing/v3/forms/${getEncodedUri(formId)}`;
resource isolated function patch [string formId](HubSpotFormDefinitionPatchRequest payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/${getEncodedUri(formId)}`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand All @@ -107,8 +112,12 @@ public isolated client class Client {
return self.clientEp->patch(resourcePath, request, httpHeaders);
}

resource isolated function post marketing/v3/forms(FormDefinitionCreateRequestBase payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/marketing/v3/forms/`;
# Create a form
#
# + headers - Headers to be sent with the request
# + return - successful operation
resource isolated function post .(FormDefinitionCreateRequestBase payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand All @@ -124,8 +133,8 @@ public isolated client class Client {
#
# + headers - Headers to be sent with the request
# + return - successful operation
resource isolated function put marketing/v3/forms/[string formId](HubSpotFormDefinition payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/marketing/v3/forms/${getEncodedUri(formId)}`;
resource isolated function put [string formId](HubSpotFormDefinition payload, map<string|string[]> headers = {}) returns FormDefinitionBase|error {
string resourcePath = string `/${getEncodedUri(formId)}`;
map<anydata> headerValues = {...headers};
if self.apiKeyConfig is ApiKeysConfig {
headerValues["private-app-legacy"] = self.apiKeyConfig?.private\-app\-legacy;
Expand Down
Loading

0 comments on commit 37319f2

Please sign in to comment.