From 807b586e0a4c37d065c2acf4f266ff11aeaad6fb Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Thu, 19 Dec 2024 17:49:42 +0530 Subject: [PATCH 01/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 8d193ad..165cd6a 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -288,7 +288,7 @@ modules = [ [[package]] org = "ballerinax" name = "hubspot.marketing.campaigns" -version = "0.1.0" +version = "1.0.0" dependencies = [ {org = "ballerina", name = "http"}, {org = "ballerina", name = "url"}, From 6920c4b4a39177a520df1e9ddf0f0a59c0928b73 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Fri, 20 Dec 2024 09:55:37 +0530 Subject: [PATCH 02/15] Adding tests folder --- ballerina/tests/README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 ballerina/tests/README.md diff --git a/ballerina/tests/README.md b/ballerina/tests/README.md new file mode 100644 index 0000000..e69de29 From c5ab7bd7dcf8e11289bd6f1de8f869b04a19a277 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Fri, 20 Dec 2024 16:16:17 +0530 Subject: [PATCH 03/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 165cd6a..cea8c16 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -145,6 +145,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -227,6 +236,9 @@ dependencies = [ {org = "ballerina", name = "time"}, {org = "ballerina", name = "url"} ] +modules = [ + {org = "ballerina", packageName = "oauth2", moduleName = "oauth2"} +] [[package]] org = "ballerina" @@ -254,6 +266,20 @@ dependencies = [ {org = "ballerina", name = "time"} ] +[[package]] +org = "ballerina" +name = "test" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.error"} +] +modules = [ + {org = "ballerina", packageName = "test", moduleName = "test"} +] + [[package]] org = "ballerina" name = "time" @@ -291,6 +317,8 @@ name = "hubspot.marketing.campaigns" version = "1.0.0" dependencies = [ {org = "ballerina", name = "http"}, + {org = "ballerina", name = "oauth2"}, + {org = "ballerina", name = "test"}, {org = "ballerina", name = "url"}, {org = "ballerinai", name = "observe"} ] From 0ed478137836f05e88063c502ab11b6602752aa1 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 10:49:26 +0530 Subject: [PATCH 04/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index cea8c16..a88ed4c 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -98,6 +98,9 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] +modules = [ + {org = "ballerina", packageName = "io", moduleName = "io"} +] [[package]] org = "ballerina" @@ -317,6 +320,7 @@ name = "hubspot.marketing.campaigns" version = "1.0.0" dependencies = [ {org = "ballerina", name = "http"}, + {org = "ballerina", name = "io"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "url"}, From 1b87f37150ed2e3e6b02421e70e1060e20c49c53 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 10:52:59 +0530 Subject: [PATCH 05/15] Re-generate Client with Sanitation for baseURL --- ballerina/client.bal | 91 +- ballerina/tests/test.bal | 164 ++ ballerina/types.bal | 10 +- docs/spec/campaignsPublicApi.json | 3056 ++++++++++++++--------------- 4 files changed, 1738 insertions(+), 1583 deletions(-) create mode 100644 ballerina/tests/test.bal diff --git a/ballerina/client.bal b/ballerina/client.bal index a07f252..b014a36 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -1,19 +1,3 @@ -// Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). -// -// WSO2 LLC. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - // AUTO-GENERATED FILE. DO NOT MODIFY. // This file is auto-generated by the Ballerina OpenAPI tool. @@ -27,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/campaigns") 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 { @@ -66,8 +50,8 @@ public isolated client class Client { # + campaignGuid - Unique identifier for the campaign, formatted as a UUID. # + headers - Headers to be sent with the request # + return - No content - resource isolated function delete marketing/v3/campaigns/[string campaignGuid](map headers = {}) returns http:Response|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}`; + resource isolated function delete [string campaignGuid](map headers = {}) returns http:Response|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -84,8 +68,8 @@ public isolated client class Client { # + assetId - Id of the asset # + headers - Headers to be sent with the request # + return - No content - resource isolated function delete marketing/v3/campaigns/[string campaignGuid]/assets/[string assetType]/[string assetId](map headers = {}) returns http:Response|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}/${getEncodedUri(assetId)}`; + resource isolated function delete [string campaignGuid]/assets/[string assetType]/[string assetId](map headers = {}) returns http:Response|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}/${getEncodedUri(assetId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -94,8 +78,13 @@ public isolated client class Client { return self.clientEp->delete(resourcePath, headers = httpHeaders); } - resource isolated function get marketing/v3/campaigns(map headers = {}, *GetMarketingV3CampaignsQueries queries) returns CollectionResponseWithTotalPublicCampaignForwardPaging|error { - string resourcePath = string `/marketing/v3/campaigns/`; + # Campaign search + # + # + headers - Headers to be sent with the request + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function get .(map headers = {}, *GetMarketingV3CampaignsQueries queries) returns CollectionResponseWithTotalPublicCampaignForwardPaging|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -112,8 +101,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/campaigns/[string campaignGuid](map headers = {}, *GetMarketingV3CampaignsCampaignguidQueries queries) returns PublicCampaignWithAssets|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}`; + resource isolated function get [string campaignGuid](map headers = {}, *GetMarketingV3CampaignsCampaignguidQueries queries) returns PublicCampaignWithAssets|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -131,8 +120,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/campaigns/[string campaignGuid]/assets/[string assetType](map headers = {}, *GetMarketingV3CampaignsCampaignguidAssetsAssettypeQueries queries) returns CollectionResponsePublicCampaignAssetForwardPaging|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}`; + resource isolated function get [string campaignGuid]/assets/[string assetType](map headers = {}, *GetMarketingV3CampaignsCampaignguidAssetsAssettypeQueries queries) returns CollectionResponsePublicCampaignAssetForwardPaging|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -147,8 +136,8 @@ public isolated client class Client { # + campaignGuid - Unique identifier for the campaign, formatted as a UUID. # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function get marketing/v3/campaigns/[string campaignGuid]/budget/totals(map headers = {}) returns PublicBudgetTotals|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/budget/totals`; + resource isolated function get [string campaignGuid]/budget/totals(map headers = {}) returns PublicBudgetTotals|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/budget/totals`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -164,8 +153,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/campaigns/[string campaignGuid]/reports/contacts/[string contactType](map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsContactsContacttypeQueries queries) returns CollectionResponseContactReferenceForwardPaging|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/reports/contacts/${getEncodedUri(contactType)}`; + resource isolated function get [string campaignGuid]/reports/contacts/[string contactType](map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsContactsContacttypeQueries queries) returns CollectionResponseContactReferenceForwardPaging|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/reports/contacts/${getEncodedUri(contactType)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -181,8 +170,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/campaigns/[string campaignGuid]/reports/metrics(map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsMetricsQueries queries) returns MetricsCounters|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/reports/metrics`; + resource isolated function get [string campaignGuid]/reports/metrics(map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsMetricsQueries queries) returns MetricsCounters|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/reports/metrics`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -198,8 +187,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/campaigns/[string campaignGuid]/reports/revenue(map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsRevenueQueries queries) returns RevenueAttributionAggregate|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/reports/revenue`; + resource isolated function get [string campaignGuid]/reports/revenue(map headers = {}, *GetMarketingV3CampaignsCampaignguidReportsRevenueQueries queries) returns RevenueAttributionAggregate|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/reports/revenue`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -214,8 +203,8 @@ public isolated client class Client { # + campaignGuid - Unique identifier for the campaign, formatted as a UUID. # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function patch marketing/v3/campaigns/[string campaignGuid](PublicCampaignInput payload, map headers = {}) returns PublicCampaign|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}`; + resource isolated function patch [string campaignGuid](PublicCampaignInput payload, map headers = {}) returns PublicCampaign|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -227,8 +216,12 @@ public isolated client class Client { return self.clientEp->patch(resourcePath, request, httpHeaders); } - resource isolated function post marketing/v3/campaigns(PublicCampaignInput payload, map headers = {}) returns PublicCampaign|error { - string resourcePath = string `/marketing/v3/campaigns/`; + # Create a campaign + # + # + headers - Headers to be sent with the request + # + return - successful operation + resource isolated function post .(PublicCampaignInput payload, map headers = {}) returns PublicCampaign|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -244,8 +237,8 @@ public isolated client class Client { # # + headers - Headers to be sent with the request # + return - No content - resource isolated function post marketing/v3/campaigns/batch/archive(BatchInputPublicCampaignDeleteInput payload, map headers = {}) returns http:Response|error { - string resourcePath = string `/marketing/v3/campaigns/batch/archive`; + resource isolated function post batch/archive(BatchInputPublicCampaignDeleteInput payload, map headers = {}) returns http:Response|error { + string resourcePath = string `/batch/archive`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -261,8 +254,8 @@ public isolated client class Client { # # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function post marketing/v3/campaigns/batch/create(BatchInputPublicCampaignInput payload, map headers = {}) returns BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors|error { - string resourcePath = string `/marketing/v3/campaigns/batch/create`; + resource isolated function post batch/create(BatchInputPublicCampaignInput payload, map headers = {}) returns BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors|error { + string resourcePath = string `/batch/create`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -279,8 +272,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 post marketing/v3/campaigns/batch/read(BatchInputPublicCampaignReadInput payload, map headers = {}, *PostMarketingV3CampaignsBatchReadQueries queries) returns BatchResponsePublicCampaignWithAssets|BatchResponsePublicCampaignWithAssetsWithErrors|error { - string resourcePath = string `/marketing/v3/campaigns/batch/read`; + resource isolated function post batch/read(BatchInputPublicCampaignReadInput payload, map headers = {}, *PostMarketingV3CampaignsBatchReadQueries queries) returns BatchResponsePublicCampaignWithAssets|BatchResponsePublicCampaignWithAssetsWithErrors|error { + string resourcePath = string `/batch/read`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -298,8 +291,8 @@ public isolated client class Client { # # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function post marketing/v3/campaigns/batch/update(BatchInputPublicCampaignBatchUpdateItem payload, map headers = {}) returns BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors|error { - string resourcePath = string `/marketing/v3/campaigns/batch/update`; + resource isolated function post batch/update(BatchInputPublicCampaignBatchUpdateItem payload, map headers = {}) returns BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors|error { + string resourcePath = string `/batch/update`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; @@ -319,8 +312,8 @@ public isolated client class Client { # + assetId - Id of the asset # + headers - Headers to be sent with the request # + return - No content - resource isolated function put marketing/v3/campaigns/[string campaignGuid]/assets/[string assetType]/[string assetId](map headers = {}) returns http:Response|error { - string resourcePath = string `/marketing/v3/campaigns/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}/${getEncodedUri(assetId)}`; + resource isolated function put [string campaignGuid]/assets/[string assetType]/[string assetId](map headers = {}) returns http:Response|error { + string resourcePath = string `/${getEncodedUri(campaignGuid)}/assets/${getEncodedUri(assetType)}/${getEncodedUri(assetId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { headerValues["private-app"] = self.apiKeyConfig?.private\-app; diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal new file mode 100644 index 0000000..e840cab --- /dev/null +++ b/ballerina/tests/test.bal @@ -0,0 +1,164 @@ +// AUTO-GENERATED FILE. DO NOT MODIFY. +// This file is auto-generated by the Ballerina OpenAPI tool. + +import ballerina/io; +import ballerina/oauth2; +import ballerina/test; + +//import ballerina/time; + +configurable string clientId = ?; +configurable string clientSecret = ?; +configurable string refreshToken = ?; + +configurable string serviceUrl = "https://api.hubapi.com/marketing/v3/campaigns"; + +OAuth2RefreshTokenGrantConfig authConfig = { + clientId, + clientSecret, + refreshToken, + credentialBearer: oauth2:POST_BODY_BEARER +}; + +ConnectionConfig config = {auth: authConfig}; + +final Client baseClient = check new Client(config, serviceUrl = serviceUrl); + +//Variables +//final string campaignGuid = "637caea9-ff27-40a6-93f0-852383aef453"; //Deleted in testing +final string campaignGuid = "7c5b58c0-094a-4302-b75f-6fb94d8a3708"; + +@test:Config {} +isolated function testGetSearchMarketingCampaigns() returns error? { + CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); + test:assertTrue(response?.results.length() > 0); + io:println(response); +} + +// @test:Config {} +// isolated function testPostCreateMarketingCampaigns() returns error? { +// PublicCampaign response = check baseClient->/.post( +// payload = {properties: { +// "hs_name": "campaign" + time:utcNow().toString() , +// "hs_goal": "string", +// "hs_notes": "string" +// }} +// ); + +// test:assertTrue(response?.id != ""); +// } + +// @test:Config {} +// isolated function testGetReadACampaign() returns error? { +// PublicCampaignWithAssets response = check baseClient->/[campaignGuid]; +// test:assertTrue(response?.id == campaignGuid); +// io:println(response); +// } + +// @test:Config {} +// isolated function testPatchUpdateCampaigns() returns error? { +// PublicCampaign response = check baseClient->/[campaignGuid].patch( +// payload = {properties: { +// "hs_goal": "updated", +// "hs_notes": "string" +// }} +// ); + +// test:assertTrue(response?.id == campaignGuid); +// io:println(response); +// } + +// @test:Config {} +// isolated function testDeleteCampaign() returns error? { +// var response = check baseClient->/[campaignGuid].delete(); +// test:assertTrue(response.statusCode == 204); +// io:println(response); +// } + +// @test:Config {} +// isolated function testPostBatchCreate() returns error? { +// BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors response = check baseClient->/batch/create.post( +// payload = { +// "inputs": [ +// { +// "properties": { +// "hs_name": "batch3", +// "hs_goal": "stringval" +// } +// }, +// { +// "properties": { +// "hs_name": "batch4", +// "hs_goal": "stringval" +// } +// } +// ] +// } +// ); +// test:assertTrue(response?.status == "COMPLETE"); +// io:println(response); +// } + +// @test:Config {} +// isolated function testPostBatchRead() returns error? { +// BatchResponsePublicCampaignWithAssets|BatchResponsePublicCampaignWithAssetsWithErrors response = check baseClient->/batch/read.post( +// payload = { +// "inputs": [ +// { +// "id": campaignGuid +// } +// ] +// } +// ); +// test:assertTrue(response?.status == "COMPLETE"); +// io:println(response); +// } + +// @test:Config {} +// isolated function testPostDeleteABatchOfCampaigns() returns error? { +// var response = check baseClient->/batch/archive.post( +// payload = { +// "inputs": [ +// { +// "id": "99765286-2c49-443f-b2be-e80b06cf4798" +// }, +// { +// "id": "73861515-0252-4c78-aeac-c93d6df06c97" +// } +// ] +// } +// ); +// test:assertTrue(response.statusCode == 204); +// io:println(response); +// } + +// @test:Config {} +// isolated function testGetReportsRevenue() returns error? { +// RevenueAttributionAggregate response = check baseClient->/[campaignGuid]/reports/revenue; +// test:assertTrue(response?.revenueAmount is decimal); +// io:println(response); +// } + +// @test:Config {} +// isolated function testGetReportsMetrics() returns error? { +// MetricsCounters response = check baseClient->/[campaignGuid]/reports/metrics; +// test:assertTrue(response?.sessions == 0); +// io:println(response); +// } + +///////////////////////////////////////////////// +// @test:Config {} +// isolated function testGetListAssets() returns error? { +// CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/FORM; +// test:assertTrue(response?.results.length() > 0); +// io:println(response); +// } +//////////////////////////////////////////////// + +// @test:Config {} +// isolated function testPut-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}() { +// } + +// @test:Config {} +// isolated function testDelete-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}() { +// } diff --git a/ballerina/types.bal b/ballerina/types.bal index 48bf85c..2b749c3 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -227,16 +227,16 @@ public type GetMarketingV3CampaignsCampaignguidQueries record { string[] properties?; }; +public type BatchInputPublicCampaignInput record { + PublicCampaignInput[] inputs; +}; + public type CollectionResponseWithTotalPublicCampaignForwardPaging record { int:Signed32 total; ForwardPaging paging?; PublicCampaign[] results; }; -public type BatchInputPublicCampaignInput record { - PublicCampaignInput[] inputs; -}; - public type Paging record { NextPage next?; PreviousPage prev?; @@ -362,8 +362,6 @@ public type NextPage record { }; # Provides API key configurations needed when communicating with a remote HTTP endpoint. -# -# + private\-app - field description public type ApiKeysConfig record {| string private\-app; |}; diff --git a/docs/spec/campaignsPublicApi.json b/docs/spec/campaignsPublicApi.json index 1a2478b..3717176 100644 --- a/docs/spec/campaignsPublicApi.json +++ b/docs/spec/campaignsPublicApi.json @@ -1,1713 +1,1713 @@ { - "openapi" : "3.0.1", - "info" : { - "title" : "Marketing Campaigns Public Api", - "version" : "v3", - "x-hubspot-product-tier-requirements" : { - "marketing" : "PROFESSIONAL" - }, - "x-hubspot-documentation-banner" : "NONE", - "x-hubspot-related-documentation" : [ { - "name" : "Campaigns", - "url" : "https://developers.hubspot.com/beta-docs/guides/api/marketing/campaigns" - } ], - "x-hubspot-introduction" : "You can use campaign endpoints to create, read, update, and delete marketing campaign data. For example, you can use these endpoints to create and manage HubSpot campaigns from your external applications. You can also transfer campaign data to external data warehouses for analytics." + "openapi" : "3.0.1", + "info" : { + "title" : "Marketing Campaigns Public Api", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "PROFESSIONAL" }, - "servers" : [ { - "url" : "https://api.hubapi.com" - } ], - "tags" : [ { - "name" : "Basic" - }, { - "name" : "Search" - }, { - "name" : "Batch" - }, { - "name" : "Reports" - }, { - "name" : "Asset" - }, { - "name" : "Budget" + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-related-documentation" : [ { + "name" : "Campaigns", + "url" : "https://developers.hubspot.com/beta-docs/guides/api/marketing/campaigns" } ], - "paths" : { - "/marketing/v3/campaigns/" : { - "get" : { - "tags" : [ "Search" ], - "summary" : "Campaign search", - "description" : "This endpoint allows users to search for and return a page of campaigns based on various query parameters. Users can filter by name, sort, and paginate through the campaigns, as well as control which properties are returned in the response.", - "operationId" : "get-/marketing/v3/campaigns/", - "parameters" : [ { - "name" : "sort", - "in" : "query", - "description" : "The field by which to sort the results. Allowed values are hs_name, createdAt, updatedAt. An optional '-' before the property name can denote descending order\nDefault: hs_name", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "after", - "in" : "query", - "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "description" : "The maximum number of results to return. Allowed values range from 1 to 100\nDefault: 50", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "name", - "in" : "query", - "description" : "A filter to return campaigns whose names contain the specified substring. This allows partial matching of campaign names, returning all campaigns that include the given substring in their name. If this parameter is not provided, the search will return all campaigns", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { + "x-hubspot-introduction" : "You can use campaign endpoints to create, read, update, and delete marketing campaign data. For example, you can use these endpoints to create and manage HubSpot campaigns from your external applications. You can also transfer campaign data to external data warehouses for analytics." + }, + "servers" : [ { + "url" : "https://api.hubapi.com/marketing/v3/campaigns" + } ], + "tags" : [ { + "name" : "Basic" + }, { + "name" : "Search" + }, { + "name" : "Batch" + }, { + "name" : "Reports" + }, { + "name" : "Asset" + }, { + "name" : "Budget" + } ], + "paths" : { + "/" : { + "get" : { + "tags" : [ "Search" ], + "summary" : "Campaign search", + "description" : "This endpoint allows users to search for and return a page of campaigns based on various query parameters. Users can filter by name, sort, and paginate through the campaigns, as well as control which properties are returned in the response.", + "operationId" : "get-/marketing/v3/campaigns/", + "parameters" : [ { + "name" : "sort", + "in" : "query", + "description" : "The field by which to sort the results. Allowed values are hs_name, createdAt, updatedAt. An optional '-' before the property name can denote descending order\nDefault: hs_name", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "after", + "in" : "query", + "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to return. Allowed values range from 1 to 100\nDefault: 50", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "name", + "in" : "query", + "description" : "A filter to return campaigns whose names contain the specified substring. This allows partial matching of campaign names, returning all campaigns that include the given substring in their name. If this parameter is not provided, the search will return all campaigns", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object(s), they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { "type" : "string" } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object(s), they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseWithTotalPublicCampaignForwardPaging" + } } } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseWithTotalPublicCampaignForwardPaging" - } - } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + }, + "post" : { + "tags" : [ "Basic" ], + "summary" : "Create a campaign", + "description" : "Create a campaign with the given properties and return the campaign object, including the campaignGuid and created properties. ", + "operationId" : "post-/marketing/v3/campaigns/", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicCampaignInput" } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] + "required" : true }, - "post" : { - "tags" : [ "Basic" ], - "summary" : "Create a campaign", - "description" : "Create a campaign with the given properties and return the campaign object, including the campaignGuid and created properties. ", - "operationId" : "post-/marketing/v3/campaigns/", - "parameters" : [ ], - "requestBody" : { + "responses" : { + "201" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PublicCampaignInput" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicCampaign" - } + "$ref" : "#/components/schemas/PublicCampaign" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/batch/read" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Read a batch of campaigns", - "description" : "This endpoint reads a batch of campaigns based on the provided input data and returns the campaigns along with their associated assets. \nThe maximum number of items in a batch request is 50.\nThe campaigns in the response are not guaranteed to be in the same order as they were provided in the request.\nIf duplicate campaign IDs are provided in the request, duplicates will be ignored. The response will include only unique IDs and will be returned without duplicates.\n", - "operationId" : "post-/marketing/v3/campaigns/batch/read", - "parameters" : [ { - "name" : "startDate", - "in" : "query", - "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period. If not provided, no asset metrics will be fetched.\n", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : "End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period. If not provided, no asset metrics will be fetched.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/batch/read" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Read a batch of campaigns", + "description" : "This endpoint reads a batch of campaigns based on the provided input data and returns the campaigns along with their associated assets. \nThe maximum number of items in a batch request is 50.\nThe campaigns in the response are not guaranteed to be in the same order as they were provided in the request.\nIf duplicate campaign IDs are provided in the request, duplicates will be ignored. The response will include only unique IDs and will be returned without duplicates.\n", + "operationId" : "post-/marketing/v3/campaigns/batch/read", + "parameters" : [ { + "name" : "startDate", + "in" : "query", + "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period. If not provided, no asset metrics will be fetched.\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : "End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period. If not provided, no asset metrics will be fetched.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object(s), they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { "type" : "string" } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object(s), they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputPublicCampaignReadInput" } } - } ], - "requestBody" : { + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/BatchInputPublicCampaignReadInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithAssets" - } - } - } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithAssetsWithErrors" - } + "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithAssets" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/batch/update" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Update a batch of campaigns", - "description" : "This endpoint updates a batch of campaigns based on the provided input data.\nThe maximum number of items in a batch request is 50.\nIf an empty string (\"\") is passed for any property in the Batch Update, it will reset that property's value.", - "operationId" : "post-/marketing/v3/campaigns/batch/update", - "parameters" : [ ], - "requestBody" : { + "207" : { + "description" : "multiple statuses", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/BatchInputPublicCampaignBatchUpdateItem" + "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithAssetsWithErrors" } } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaign" - } - } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/batch/update" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Update a batch of campaigns", + "description" : "This endpoint updates a batch of campaigns based on the provided input data.\nThe maximum number of items in a batch request is 50.\nIf an empty string (\"\") is passed for any property in the Batch Update, it will reset that property's value.", + "operationId" : "post-/marketing/v3/campaigns/batch/update", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputPublicCampaignBatchUpdateItem" } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithErrors" - } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponsePublicCampaign" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}/reports/metrics" : { - "get" : { - "tags" : [ "Reports" ], - "summary" : "Get Campaign Metrics\n", - "description" : "This endpoint retrieves key attribution metrics for a specified campaign, such as sessions, new contacts, and influenced contacts.", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/metrics", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "startDate", - "in" : "query", - "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/MetricsCounters" - } + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithErrors" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}" : { - "get" : { - "tags" : [ "Asset" ], - "summary" : "List assets", - "description" : "This endpoint lists all assets of the campaign by asset type. The assetType parameter is required, and each request can only fetch assets of a single type.\nAsset metrics can also be fetched along with the assets; they are available only if start and end dates are provided.", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "assetType", - "in" : "path", - "description" : "The type of asset to fetch.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "after", - "in" : "query", - "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "description" : "The maximum number of results to return.\nDefault: 10", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "startDate", - "in" : "query", - "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.\n", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : "End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponsePublicCampaignAssetForwardPaging" - } + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/reports/metrics" : { + "get" : { + "tags" : [ "Reports" ], + "summary" : "Get Campaign Metrics\n", + "description" : "This endpoint retrieves key attribution metrics for a specified campaign, such as sessions, new contacts, and influenced contacts.", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/metrics", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "startDate", + "in" : "query", + "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/MetricsCounters" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/batch/archive" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Delete a batch of campaigns", - "description" : "This endpoint deletes a batch of campaigns. \nThe maximum number of items in a batch request is 50.\nThe response will always be 204 No Content, regardless of whether the campaigns exist or not, whether they were successfully deleted or not, or if only some of the campaigns in the batch were deleted.", - "operationId" : "post-/marketing/v3/campaigns/batch/archive", - "parameters" : [ ], - "requestBody" : { + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/assets/{assetType}" : { + "get" : { + "tags" : [ "Asset" ], + "summary" : "List assets", + "description" : "This endpoint lists all assets of the campaign by asset type. The assetType parameter is required, and each request can only fetch assets of a single type.\nAsset metrics can also be fetched along with the assets; they are available only if start and end dates are provided.", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "assetType", + "in" : "path", + "description" : "The type of asset to fetch.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "after", + "in" : "query", + "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to return.\nDefault: 10", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "startDate", + "in" : "query", + "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.\n", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : "End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/BatchInputPublicCampaignDeleteInput" + "$ref" : "#/components/schemas/CollectionResponsePublicCampaignAssetForwardPaging" } } - }, - "required" : true - }, - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}" : { - "put" : { - "tags" : [ "Asset" ], - "summary" : "Add asset association", - "description" : "Associate a specified asset with a campaign.\nImportant: Currently, only the following asset types can be associated and disassociated via the API: Forms, Static lists, External website pages", - "operationId" : "put-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "assetType", - "in" : "path", - "description" : "The type of asset\nImportant: Currently, only the following asset types are available for association via the API: FORM, OBJECT_LIST, EXTERNAL_WEB_URL", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "assetId", - "in" : "path", - "description" : "Id of the asset", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/batch/archive" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Delete a batch of campaigns", + "description" : "This endpoint deletes a batch of campaigns. \nThe maximum number of items in a batch request is 50.\nThe response will always be 204 No Content, regardless of whether the campaigns exist or not, whether they were successfully deleted or not, or if only some of the campaigns in the batch were deleted.", + "operationId" : "post-/marketing/v3/campaigns/batch/archive", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputPublicCampaignDeleteInput" + } } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] + "required" : true }, - "delete" : { - "tags" : [ "Asset" ], - "summary" : "Remove asset association", - "description" : "Disassociate a specified asset from a campaign.\nImportant: Currently, only the following asset types can be associated and disassociated via the API: Forms, Static lists, External website pages", - "operationId" : "delete-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "assetType", - "in" : "path", - "description" : "The type of asset\nImportant: Currently, only the following asset types are available for disassociation via the API: FORM, OBJECT_LIST, EXTERNAL_WEB_URL", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "assetId", - "in" : "path", - "description" : "Id of the asset", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } + "responses" : { + "204" : { + "description" : "No content", + "content" : { } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/assets/{assetType}/{assetId}" : { + "put" : { + "tags" : [ "Asset" ], + "summary" : "Add asset association", + "description" : "Associate a specified asset with a campaign.\nImportant: Currently, only the following asset types can be associated and disassociated via the API: Forms, Static lists, External website pages", + "operationId" : "put-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "assetType", + "in" : "path", + "description" : "The type of asset\nImportant: Currently, only the following asset types are available for association via the API: FORM, OBJECT_LIST, EXTERNAL_WEB_URL", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "assetId", + "in" : "path", + "description" : "Id of the asset", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] }, - "/marketing/v3/campaigns/{campaignGuid}/reports/revenue" : { - "get" : { - "tags" : [ "Reports" ], - "summary" : "Fetch revenue", - "description" : "Fetch revenue attribution report data for a specified campaign\n", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/revenue", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "attributionModel", - "in" : "query", - "description" : "Allowed values: LINEAR, FIRST_INTERACTION, LAST_INTERACTION, FULL_PATH, U_SHAPED, W_SHAPED, TIME_DECAY, J_SHAPED, INVERSE_J_SHAPED\nDefault value: LINEAR", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "startDate", - "in" : "query", - "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/RevenueAttributionAggregate" - } + "delete" : { + "tags" : [ "Asset" ], + "summary" : "Remove asset association", + "description" : "Disassociate a specified asset from a campaign.\nImportant: Currently, only the following asset types can be associated and disassociated via the API: Forms, Static lists, External website pages", + "operationId" : "delete-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "assetType", + "in" : "path", + "description" : "The type of asset\nImportant: Currently, only the following asset types are available for disassociation via the API: FORM, OBJECT_LIST, EXTERNAL_WEB_URL", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "assetId", + "in" : "path", + "description" : "Id of the asset", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/reports/revenue" : { + "get" : { + "tags" : [ "Reports" ], + "summary" : "Fetch revenue", + "description" : "Fetch revenue attribution report data for a specified campaign\n", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/revenue", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "attributionModel", + "in" : "query", + "description" : "Allowed values: LINEAR, FIRST_INTERACTION, LAST_INTERACTION, FULL_PATH, U_SHAPED, W_SHAPED, TIME_DECAY, J_SHAPED, INVERSE_J_SHAPED\nDefault value: LINEAR", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "startDate", + "in" : "query", + "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/RevenueAttributionAggregate" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "private_apps" : [ "marketing.campaigns.revenue.read" ] - }, { - "oauth2" : [ "marketing.campaigns.revenue.read" ] - } ] - } - }, - "/marketing/v3/campaigns/batch/create" : { - "post" : { - "tags" : [ "Batch" ], - "summary" : "Create a batch of campaigns", - "description" : "This endpoint creates a batch of campaigns. The maximum number of items in a batch request is 50.\nThe campaigns in the response are not guaranteed to be in the same order as they were provided in the request.", - "operationId" : "post-/marketing/v3/campaigns/batch/create", - "parameters" : [ ], - "requestBody" : { + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "private_apps" : [ "marketing.campaigns.revenue.read" ] + }, { + "oauth2" : [ "marketing.campaigns.revenue.read" ] + } ] + } + }, + "/batch/create" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create a batch of campaigns", + "description" : "This endpoint creates a batch of campaigns. The maximum number of items in a batch request is 50.\nThe campaigns in the response are not guaranteed to be in the same order as they were provided in the request.", + "operationId" : "post-/marketing/v3/campaigns/batch/create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputPublicCampaignInput" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/BatchInputPublicCampaignInput" - } - } - }, - "required" : true - }, - "responses" : { - "201" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaign" - } + "$ref" : "#/components/schemas/BatchResponsePublicCampaign" } } - }, - "207" : { - "description" : "multiple statuses", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithErrors" - } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponsePublicCampaignWithErrors" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}/budget/totals" : { - "get" : { - "tags" : [ "Budget" ], - "summary" : "Read budget", - "description" : "Retrieve detailed information about the budget and spend items for a specified campaign, including the total budget, total spend, and remaining budget.\nBudget and Spend items may be returned in any order, but the order field specifies their sequence based on the creation date. The item with order 0 is the oldest, and items with higher order values are newer", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/budget/totals", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicBudgetTotals" - } + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/budget/totals" : { + "get" : { + "tags" : [ "Budget" ], + "summary" : "Read budget", + "description" : "Retrieve detailed information about the budget and spend items for a specified campaign, including the total budget, total spend, and remaining budget.\nBudget and Spend items may be returned in any order, but the order field specifies their sequence based on the creation date. The item with order 0 is the oldest, and items with higher order values are newer", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/budget/totals", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicBudgetTotals" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}" : { - "get" : { - "tags" : [ "Basic" ], - "summary" : "Read a campaign", - "description" : "Get a campaign identified by a specific campaignGuid with the given properties. Along with the campaign information, it also returns information about assets. Depending on the query parameters used, this can also be used to return information about the corresponding assets' metrics. Metrics are available only if startDate and endDate are provided.", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "startDate", - "in" : "query", - "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : " End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "Read a campaign", + "description" : "Get a campaign identified by a specific campaignGuid with the given properties. Along with the campaign information, it also returns information about assets. Depending on the query parameters used, this can also be used to return information about the corresponding assets' metrics. Metrics are available only if startDate and endDate are provided.", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "startDate", + "in" : "query", + "description" : "Start date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : " End date to fetch asset metrics, formatted as YYYY-MM-DD. This date is used to fetch the metrics associated with the assets for a specified period.\nIf not provided, no asset metrics will be fetched.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "properties", + "in" : "query", + "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object, they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { "type" : "string" } - }, { - "name" : "properties", - "in" : "query", - "description" : "A comma-separated list of the properties to be returned in the response. If any of the specified properties has empty value on the requested object, they will be ignored and not returned in response. If this parameter is empty, the response will include an empty properties map.", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicCampaignWithAssets" - } + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicCampaignWithAssets" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] + "default" : { + "$ref" : "#/components/responses/Error" + } }, - "delete" : { - "tags" : [ "Basic" ], - "summary" : "Delete campaign ", - "description" : "Delete a specified campaign from the system.\nThis call will return a 204 No Content response regardless of whether the campaignGuid provided corresponds to an existing campaign or not.", - "operationId" : "delete-/marketing/v3/campaigns/{campaignGuid}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "204" : { - "description" : "No content", - "content" : { } - }, - "default" : { - "$ref" : "#/components/responses/Error" - } + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + }, + "delete" : { + "tags" : [ "Basic" ], + "summary" : "Delete campaign ", + "description" : "Delete a specified campaign from the system.\nThis call will return a 204 No Content response regardless of whether the campaignGuid provided corresponds to an existing campaign or not.", + "operationId" : "delete-/marketing/v3/campaigns/{campaignGuid}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] + "default" : { + "$ref" : "#/components/responses/Error" + } }, - "patch" : { - "tags" : [ "Basic" ], - "summary" : "Update campaign", - "description" : "Perform a partial update of a campaign identified by the specified campaignGuid. Provided property values will be overwritten. Read-only and non-existent properties will cause 400 error.\nIf an empty string is passed for any property in the Batch Update, it will reset that property's value.\n", - "operationId" : "patch-/marketing/v3/campaigns/{campaignGuid}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.\n", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + }, + "patch" : { + "tags" : [ "Basic" ], + "summary" : "Update campaign", + "description" : "Perform a partial update of a campaign identified by the specified campaignGuid. Provided property values will be overwritten. Read-only and non-existent properties will cause 400 error.\nIf an empty string is passed for any property in the Batch Update, it will reset that property's value.\n", + "operationId" : "patch-/marketing/v3/campaigns/{campaignGuid}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.\n", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicCampaignInput" + } } - } ], - "requestBody" : { + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/PublicCampaignInput" - } - } - }, - "required" : true - }, - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/PublicCampaign" - } + "$ref" : "#/components/schemas/PublicCampaign" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } - }, - "/marketing/v3/campaigns/{campaignGuid}/reports/contacts/{contactType}" : { - "get" : { - "tags" : [ "Reports" ], - "summary" : "Fetch contact IDs", - "description" : "Fetch the list of contact IDs for the specified campaign and contact type", - "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/contacts/{contactType}", - "parameters" : [ { - "name" : "campaignGuid", - "in" : "path", - "description" : "Unique identifier for the campaign, formatted as a UUID.", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "contactType", - "in" : "path", - "description" : "The type of metric to filter the influenced contacts. Allowed values: contactFirstTouch, contactLastTouch, influencedContacts", - "required" : true, - "style" : "simple", - "explode" : false, - "schema" : { - "type" : "string" - } - }, { - "name" : "startDate", - "in" : "query", - "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "endDate", - "in" : "query", - "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - }, { - "name" : "limit", - "in" : "query", - "description" : "Limit for the number of contacts to fetch\nDefault: 100", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "integer", - "format" : "int32" - } - }, { - "name" : "after", - "in" : "query", - "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", - "required" : false, - "style" : "form", - "explode" : true, - "schema" : { - "type" : "string" - } - } ], - "responses" : { - "200" : { - "description" : "successful operation", - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/CollectionResponseContactReferenceForwardPaging" - } + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] + } + }, + "/{campaignGuid}/reports/contacts/{contactType}" : { + "get" : { + "tags" : [ "Reports" ], + "summary" : "Fetch contact IDs", + "description" : "Fetch the list of contact IDs for the specified campaign and contact type", + "operationId" : "get-/marketing/v3/campaigns/{campaignGuid}/reports/contacts/{contactType}", + "parameters" : [ { + "name" : "campaignGuid", + "in" : "path", + "description" : "Unique identifier for the campaign, formatted as a UUID.", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "contactType", + "in" : "path", + "description" : "The type of metric to filter the influenced contacts. Allowed values: contactFirstTouch, contactLastTouch, influencedContacts", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "startDate", + "in" : "query", + "description" : "The start date for the report data, formatted as YYYY-MM-DD.\nDefault value: 2006-01-01", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "endDate", + "in" : "query", + "description" : "End date for the report data, formatted as YYYY-MM-DD.\nDefault value: Current date", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + }, { + "name" : "limit", + "in" : "query", + "description" : "Limit for the number of contacts to fetch\nDefault: 100", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32" + } + }, { + "name" : "after", + "in" : "query", + "description" : "A cursor for pagination. If provided, the results will start after the given cursor.\nExample: NTI1Cg%3D%3D", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseContactReferenceForwardPaging" } } - }, - "default" : { - "$ref" : "#/components/responses/Error" } }, - "security" : [ { - "oauth2" : [ "marketing.campaigns.read" ] - }, { - "private_apps" : [ "marketing.campaigns.read" ] - } ] - } + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "marketing.campaigns.read" ] + }, { + "private_apps" : [ "marketing.campaigns.read" ] + } ] } - }, - "components" : { - "schemas" : { - "StandardError" : { - "required" : [ "category", "context", "errors", "links", "message", "status" ], - "type" : "object", - "properties" : { - "subCategory" : { - "type" : "object", - "properties" : { } - }, - "context" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "type" : "string" - } - } - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "id" : { - "type" : "string" - }, - "category" : { - "type" : "string" - }, - "message" : { - "type" : "string" - }, - "errors" : { + } + }, + "components" : { + "schemas" : { + "StandardError" : { + "required" : [ "category", "context", "errors", "links", "message", "status" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "object", + "properties" : { } + }, + "context" : { + "type" : "object", + "additionalProperties" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/ErrorDetail" + "type" : "string" } - }, - "status" : { + } + }, + "links" : { + "type" : "object", + "additionalProperties" : { "type" : "string" } + }, + "id" : { + "type" : "string" + }, + "category" : { + "type" : "string" + }, + "message" : { + "type" : "string" + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" + } + }, + "status" : { + "type" : "string" } - }, - "PublicCampaignBatchUpdateItem" : { - "required" : [ "id", "properties" ], - "type" : "object", + } + }, + "PublicCampaignBatchUpdateItem" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, "properties" : { - "id" : { + "type" : "object", + "additionalProperties" : { "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } } } - }, - "CollectionResponsePublicCampaignAssetForwardPaging" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignAsset" - } + } + }, + "CollectionResponsePublicCampaignAssetForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignAsset" } } - }, - "PublicCampaignReadInput" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { + } + }, + "PublicCampaignReadInput" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "BatchResponsePublicCampaignWithAssetsWithErrors" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "numErrors" : { + "type" : "integer", + "format" : "int32" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { "type" : "string" } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignWithAssets" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] } - }, - "BatchResponsePublicCampaignWithAssetsWithErrors" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "date-time" - }, - "numErrors" : { - "type" : "integer", - "format" : "int32" - }, - "requestedAt" : { - "type" : "string", - "format" : "date-time" - }, - "startedAt" : { - "type" : "string", - "format" : "date-time" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignWithAssets" - } - }, - "errors" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/StandardError" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + }, + "BatchInputPublicCampaignReadInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignReadInput" } } - }, - "BatchInputPublicCampaignReadInput" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignReadInput" - } + } + }, + "BatchResponsePublicCampaignWithAssets" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignWithAssets" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] } - }, - "BatchResponsePublicCampaignWithAssets" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "date-time" - }, - "requestedAt" : { - "type" : "string", - "format" : "date-time" - }, - "startedAt" : { - "type" : "string", - "format" : "date-time" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignWithAssets" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + }, + "BatchResponsePublicCampaignWithErrors" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "numErrors" : { + "type" : "integer", + "format" : "int32" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaign" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] } - }, - "BatchResponsePublicCampaignWithErrors" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "date-time" - }, - "numErrors" : { - "type" : "integer", - "format" : "int32" - }, - "requestedAt" : { - "type" : "string", - "format" : "date-time" - }, - "startedAt" : { - "type" : "string", - "format" : "date-time" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaign" - } - }, - "errors" : { + } + }, + "ErrorDetail" : { + "required" : [ "message" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "string", + "description" : "A specific category that contains more specific detail about the error" + }, + "code" : { + "type" : "string", + "description" : "The status code associated with the error detail" + }, + "in" : { + "type" : "string", + "description" : "The name of the field or parameter in which the error was found." + }, + "context" : { + "type" : "object", + "additionalProperties" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/StandardError" + "type" : "string" } }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + "description" : "Context about the error condition", + "example" : { + "missingScopes" : [ "scope1", "scope2" ] } + }, + "message" : { + "type" : "string", + "description" : "A human readable message describing the error along with remediation steps where appropriate" } - }, - "ErrorDetail" : { - "required" : [ "message" ], - "type" : "object", - "properties" : { - "subCategory" : { - "type" : "string", - "description" : "A specific category that contains more specific detail about the error" - }, - "code" : { - "type" : "string", - "description" : "The status code associated with the error detail" - }, - "in" : { - "type" : "string", - "description" : "The name of the field or parameter in which the error was found." - }, - "context" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "description" : "Context about the error condition", - "example" : { - "missingScopes" : [ "scope1", "scope2" ] - } - }, - "message" : { - "type" : "string", - "description" : "A human readable message describing the error along with remediation steps where appropriate" - } + } + }, + "ForwardPaging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" } - }, - "ForwardPaging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" - } + } + }, + "PublicSpendItem" : { + "required" : [ "amount", "createdAt", "id", "name", "order", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "integer", + "format" : "int32" + }, + "amount" : { + "type" : "number" + }, + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "order" : { + "type" : "integer", + "format" : "int32" + }, + "updatedAt" : { + "type" : "integer", + "format" : "int32" } - }, - "PublicSpendItem" : { - "required" : [ "amount", "createdAt", "id", "name", "order", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "integer", - "format" : "int32" - }, - "amount" : { - "type" : "number" - }, - "name" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "id" : { + } + }, + "BatchResponsePublicCampaign" : { + "required" : [ "completedAt", "results", "startedAt", "status" ], + "type" : "object", + "properties" : { + "completedAt" : { + "type" : "string", + "format" : "date-time" + }, + "requestedAt" : { + "type" : "string", + "format" : "date-time" + }, + "startedAt" : { + "type" : "string", + "format" : "date-time" + }, + "links" : { + "type" : "object", + "additionalProperties" : { "type" : "string" - }, - "order" : { - "type" : "integer", - "format" : "int32" - }, - "updatedAt" : { - "type" : "integer", - "format" : "int32" } - } - }, - "BatchResponsePublicCampaign" : { - "required" : [ "completedAt", "results", "startedAt", "status" ], - "type" : "object", - "properties" : { - "completedAt" : { - "type" : "string", - "format" : "date-time" - }, - "requestedAt" : { - "type" : "string", - "format" : "date-time" - }, - "startedAt" : { - "type" : "string", - "format" : "date-time" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaign" - } - }, - "status" : { - "type" : "string", - "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaign" } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] } - }, - "PublicCampaignWithAssets" : { - "required" : [ "assets", "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", + } + }, + "PublicCampaignWithAssets" : { + "required" : [ "assets", "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "assets" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionResponsePublicCampaignAsset" + } + }, + "id" : { + "type" : "string" + }, "properties" : { - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "assets" : { - "type" : "object", - "additionalProperties" : { - "$ref" : "#/components/schemas/CollectionResponsePublicCampaignAsset" - } - }, - "id" : { + "type" : "object", + "additionalProperties" : { "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" } - }, - "PublicBudgetTotals" : { - "required" : [ "budgetItems", "currencyCode", "spendItems" ], - "type" : "object", - "properties" : { - "spendItems" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicSpendItem" - } - }, - "budgetTotal" : { - "type" : "number" - }, - "remainingBudget" : { - "type" : "number" - }, - "spendTotal" : { - "type" : "number" - }, - "currencyCode" : { - "type" : "string", - "enum" : [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XUA", "YER", "ZAR", "ZMW", "ZWL" ] - }, - "budgetItems" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicBudgetItem" - } + } + }, + "PublicBudgetTotals" : { + "required" : [ "budgetItems", "currencyCode", "spendItems" ], + "type" : "object", + "properties" : { + "spendItems" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicSpendItem" + } + }, + "budgetTotal" : { + "type" : "number" + }, + "remainingBudget" : { + "type" : "number" + }, + "spendTotal" : { + "type" : "number" + }, + "currencyCode" : { + "type" : "string", + "enum" : [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XUA", "YER", "ZAR", "ZMW", "ZWL" ] + }, + "budgetItems" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicBudgetItem" } } - }, - "BatchInputPublicCampaignDeleteInput" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignDeleteInput" - } + } + }, + "BatchInputPublicCampaignDeleteInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignDeleteInput" } } - }, - "CollectionResponsePublicCampaignAsset" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/Paging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignAsset" - } + } + }, + "CollectionResponsePublicCampaignAsset" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/Paging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignAsset" } } - }, - "PublicCampaignDeleteInput" : { - "required" : [ "id" ], - "type" : "object", + } + }, + "PublicCampaignDeleteInput" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "PublicCampaignInput" : { + "required" : [ "properties" ], + "type" : "object", + "properties" : { "properties" : { - "id" : { + "type" : "object", + "additionalProperties" : { "type" : "string" } } - }, - "PublicCampaignInput" : { - "required" : [ "properties" ], - "type" : "object", - "properties" : { - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - } + } + }, + "MetricsCounters" : { + "required" : [ "influencedContacts", "newContactsFirstTouch", "newContactsLastTouch", "sessions" ], + "type" : "object", + "properties" : { + "sessions" : { + "type" : "integer", + "format" : "int32" + }, + "newContactsFirstTouch" : { + "type" : "integer", + "format" : "int32" + }, + "influencedContacts" : { + "type" : "integer", + "format" : "int32" + }, + "newContactsLastTouch" : { + "type" : "integer", + "format" : "int32" } - }, - "MetricsCounters" : { - "required" : [ "influencedContacts", "newContactsFirstTouch", "newContactsLastTouch", "sessions" ], - "type" : "object", - "properties" : { - "sessions" : { - "type" : "integer", - "format" : "int32" - }, - "newContactsFirstTouch" : { - "type" : "integer", - "format" : "int32" - }, - "influencedContacts" : { - "type" : "integer", - "format" : "int32" - }, - "newContactsLastTouch" : { - "type" : "integer", - "format" : "int32" - } + } + }, + "PublicBudgetItem" : { + "required" : [ "amount", "createdAt", "id", "name", "order", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "integer", + "format" : "int32" + }, + "amount" : { + "type" : "number" + }, + "name" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "order" : { + "type" : "integer", + "format" : "int32" + }, + "updatedAt" : { + "type" : "integer", + "format" : "int32" } - }, - "PublicBudgetItem" : { - "required" : [ "amount", "createdAt", "id", "name", "order", "updatedAt" ], - "type" : "object", - "properties" : { - "createdAt" : { - "type" : "integer", - "format" : "int32" - }, - "amount" : { - "type" : "number" - }, - "name" : { - "type" : "string" - }, - "description" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "order" : { - "type" : "integer", - "format" : "int32" - }, - "updatedAt" : { - "type" : "integer", - "format" : "int32" + } + }, + "BatchInputPublicCampaignInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignInput" } } - }, - "BatchInputPublicCampaignInput" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignInput" - } + } + }, + "CollectionResponseWithTotalPublicCampaignForwardPaging" : { + "required" : [ "results", "total" ], + "type" : "object", + "properties" : { + "total" : { + "type" : "integer", + "format" : "int32" + }, + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaign" } } - }, - "CollectionResponseWithTotalPublicCampaignForwardPaging" : { - "required" : [ "results", "total" ], - "type" : "object", - "properties" : { - "total" : { - "type" : "integer", - "format" : "int32" - }, - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { + } + }, + "Paging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + }, + "prev" : { + "$ref" : "#/components/schemas/PreviousPage" + } + } + }, + "Error" : { + "required" : [ "category", "correlationId", "message" ], + "type" : "object", + "properties" : { + "subCategory" : { + "type" : "string", + "description" : "A specific category that contains more specific detail about the error" + }, + "context" : { + "type" : "object", + "additionalProperties" : { "type" : "array", "items" : { - "$ref" : "#/components/schemas/PublicCampaign" + "type" : "string" } - } - } - }, - "Paging" : { - "type" : "object", - "properties" : { - "next" : { - "$ref" : "#/components/schemas/NextPage" }, - "prev" : { - "$ref" : "#/components/schemas/PreviousPage" + "description" : "Context about the error condition", + "example" : { + "missingScopes" : [ "scope1", "scope2" ], + "invalidPropertyName" : [ "propertyValue" ] } - } - }, - "Error" : { - "required" : [ "category", "correlationId", "message" ], - "type" : "object", - "properties" : { - "subCategory" : { - "type" : "string", - "description" : "A specific category that contains more specific detail about the error" - }, - "context" : { - "type" : "object", - "additionalProperties" : { - "type" : "array", - "items" : { - "type" : "string" - } - }, - "description" : "Context about the error condition", - "example" : { - "missingScopes" : [ "scope1", "scope2" ], - "invalidPropertyName" : [ "propertyValue" ] - } - }, - "correlationId" : { - "type" : "string", - "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", - "format" : "uuid", - "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" - }, - "links" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - }, - "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps" - }, - "message" : { - "type" : "string", - "description" : "A human readable message describing the error along with remediation steps where appropriate", - "example" : "An error occurred" - }, - "category" : { - "type" : "string", - "description" : "The error category" + }, + "correlationId" : { + "type" : "string", + "description" : "A unique identifier for the request. Include this value with any error reports or support tickets", + "format" : "uuid", + "example" : "aeb5f871-7f07-4993-9211-075dc63e7cbf" + }, + "links" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" }, - "errors" : { - "type" : "array", - "description" : "further information about the error", - "items" : { - "$ref" : "#/components/schemas/ErrorDetail" - } - } + "description" : "A map of link names to associated URIs containing documentation about the error or recommended remediation steps" + }, + "message" : { + "type" : "string", + "description" : "A human readable message describing the error along with remediation steps where appropriate", + "example" : "An error occurred" }, - "example" : { - "message" : "Invalid input (details will vary based on the error)", - "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", - "category" : "VALIDATION_ERROR", - "links" : { - "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" + "category" : { + "type" : "string", + "description" : "The error category" + }, + "errors" : { + "type" : "array", + "description" : "further information about the error", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" } } }, - "CollectionResponseContactReferenceForwardPaging" : { - "required" : [ "results" ], - "type" : "object", - "properties" : { - "paging" : { - "$ref" : "#/components/schemas/ForwardPaging" - }, - "results" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/ContactReference" - } - } + "example" : { + "message" : "Invalid input (details will vary based on the error)", + "correlationId" : "aeb5f871-7f07-4993-9211-075dc63e7cbf", + "category" : "VALIDATION_ERROR", + "links" : { + "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" } - }, - "PublicCampaignAsset" : { - "required" : [ "id", "metrics" ], - "type" : "object", - "properties" : { - "name" : { - "type" : "string" - }, - "id" : { - "type" : "string" - }, - "metrics" : { - "type" : "object", - "additionalProperties" : { - "type" : "number" - } + } + }, + "CollectionResponseContactReferenceForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ContactReference" } } - }, - "RevenueAttributionAggregate" : { - "type" : "object", - "properties" : { - "contactsNumber" : { - "type" : "integer", - "format" : "int32" - }, - "dealAmount" : { - "type" : "number" - }, - "dealsNumber" : { - "type" : "integer", - "format" : "int32" - }, - "revenueAmount" : { + } + }, + "PublicCampaignAsset" : { + "required" : [ "id", "metrics" ], + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "metrics" : { + "type" : "object", + "additionalProperties" : { "type" : "number" - }, - "currencyCode" : { - "type" : "string", - "enum" : [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XUA", "YER", "ZAR", "ZMW", "ZWL" ] } } - }, - "BatchInputPublicCampaignBatchUpdateItem" : { - "required" : [ "inputs" ], - "type" : "object", - "properties" : { - "inputs" : { - "type" : "array", - "items" : { - "$ref" : "#/components/schemas/PublicCampaignBatchUpdateItem" - } - } + } + }, + "RevenueAttributionAggregate" : { + "type" : "object", + "properties" : { + "contactsNumber" : { + "type" : "integer", + "format" : "int32" + }, + "dealAmount" : { + "type" : "number" + }, + "dealsNumber" : { + "type" : "integer", + "format" : "int32" + }, + "revenueAmount" : { + "type" : "number" + }, + "currencyCode" : { + "type" : "string", + "enum" : [ "AED", "AFN", "ALL", "AMD", "ANG", "AOA", "ARS", "AUD", "AWG", "AZN", "BAM", "BBD", "BDT", "BGN", "BHD", "BIF", "BMD", "BND", "BOB", "BOV", "BRL", "BSD", "BTN", "BWP", "BYN", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLF", "CLP", "CNY", "COP", "COU", "CRC", "CUC", "CUP", "CVE", "CZK", "DJF", "DKK", "DOP", "DZD", "EGP", "ERN", "ETB", "EUR", "FJD", "FKP", "GBP", "GEL", "GHS", "GIP", "GMD", "GNF", "GTQ", "GYD", "HKD", "HNL", "HRK", "HTG", "HUF", "IDR", "ILS", "INR", "IQD", "IRR", "ISK", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LYD", "MAD", "MDL", "MGA", "MKD", "MMK", "MNT", "MOP", "MRU", "MUR", "MVR", "MWK", "MXN", "MXV", "MYR", "MZN", "NAD", "NGN", "NIO", "NOK", "NPR", "NZD", "OMR", "PAB", "PEN", "PGK", "PHP", "PKR", "PLN", "PYG", "QAR", "RON", "RSD", "RUB", "RWF", "SAR", "SBD", "SCR", "SDG", "SEK", "SGD", "SHP", "SLL", "SOS", "SRD", "SSP", "STN", "SVC", "SYP", "SZL", "THB", "TJS", "TMT", "TND", "TOP", "TRY", "TTD", "TWD", "TZS", "UAH", "UGX", "USD", "USN", "UYI", "UYU", "UZS", "VEF", "VND", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XOF", "XPD", "XPF", "XPT", "XSU", "XUA", "YER", "ZAR", "ZMW", "ZWL" ] } - }, - "PreviousPage" : { - "required" : [ "before" ], - "type" : "object", - "properties" : { - "before" : { - "type" : "string" - }, - "link" : { - "type" : "string" + } + }, + "BatchInputPublicCampaignBatchUpdateItem" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicCampaignBatchUpdateItem" } } - }, - "ContactReference" : { - "required" : [ "id" ], - "type" : "object", - "properties" : { - "id" : { - "type" : "string" - } + } + }, + "PreviousPage" : { + "required" : [ "before" ], + "type" : "object", + "properties" : { + "before" : { + "type" : "string" + }, + "link" : { + "type" : "string" } - }, - "NextPage" : { - "required" : [ "after" ], - "type" : "object", - "properties" : { - "link" : { - "type" : "string" - }, - "after" : { - "type" : "string" - } + } + }, + "ContactReference" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" } - }, - "PublicCampaign" : { - "required" : [ "createdAt", "id", "properties", "updatedAt" ], - "type" : "object", + } + }, + "NextPage" : { + "required" : [ "after" ], + "type" : "object", + "properties" : { + "link" : { + "type" : "string" + }, + "after" : { + "type" : "string" + } + } + }, + "PublicCampaign" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "id" : { + "type" : "string" + }, "properties" : { - "createdAt" : { - "type" : "string", - "format" : "date-time" - }, - "id" : { + "type" : "object", + "additionalProperties" : { "type" : "string" - }, - "properties" : { - "type" : "object", - "additionalProperties" : { - "type" : "string" - } - }, - "updatedAt" : { - "type" : "string", - "format" : "date-time" } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" } } - }, - "responses" : { - "Error" : { - "description" : "An error occurred.", - "content" : { - "*/*" : { - "schema" : { - "$ref" : "#/components/schemas/Error" - } + } + }, + "responses" : { + "Error" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" } } } - }, - "securitySchemes" : { - "oauth2" : { - "type" : "oauth2", - "flows" : { - "authorizationCode" : { - "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", - "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", - "scopes" : { - "marketing.campaigns.read" : "Read marketing campaigns", - "marketing.campaigns.revenue.read" : "Read campaigns attribution revenue" - } + } + }, + "securitySchemes" : { + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "marketing.campaigns.read" : "Read marketing campaigns", + "marketing.campaigns.revenue.read" : "Read campaigns attribution revenue" } } - }, - "private_apps" : { - "type" : "apiKey", - "name" : "private-app", - "in" : "header" } + }, + "private_apps" : { + "type" : "apiKey", + "name" : "private-app", + "in" : "header" } } - } \ No newline at end of file + } +} \ No newline at end of file From 69a309c7d20c1ab2d9ca2925d6941759e2ba7c85 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 11:47:32 +0530 Subject: [PATCH 06/15] Re-generate Client with Sanitation for PublicCampaignAsset --- ballerina/tests/test.bal | 25 +++++++++++++------------ ballerina/types.bal | 2 +- docs/spec/campaignsPublicApi.json | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index e840cab..7dbd940 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -28,12 +28,12 @@ final Client baseClient = check new Client(config, serviceUrl = serviceUrl); //final string campaignGuid = "637caea9-ff27-40a6-93f0-852383aef453"; //Deleted in testing final string campaignGuid = "7c5b58c0-094a-4302-b75f-6fb94d8a3708"; -@test:Config {} -isolated function testGetSearchMarketingCampaigns() returns error? { - CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); - test:assertTrue(response?.results.length() > 0); - io:println(response); -} +// @test:Config {} +// isolated function testGetSearchMarketingCampaigns() returns error? { +// CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); +// test:assertTrue(response?.results.length() > 0); +// io:println(response); +// } // @test:Config {} // isolated function testPostCreateMarketingCampaigns() returns error? { @@ -147,12 +147,13 @@ isolated function testGetSearchMarketingCampaigns() returns error? { // } ///////////////////////////////////////////////// -// @test:Config {} -// isolated function testGetListAssets() returns error? { -// CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/FORM; -// test:assertTrue(response?.results.length() > 0); -// io:println(response); -// } +@test:Config {} +isolated function testGetListAssets() returns error? { + CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/FORM; + io:println(response,"response"); + test:assertTrue(response?.results.length() > 0); + +} //////////////////////////////////////////////// // @test:Config {} diff --git a/ballerina/types.bal b/ballerina/types.bal index 2b749c3..2a9dba2 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -289,7 +289,7 @@ public type GetMarketingV3CampaignsCampaignguidAssetsAssettypeQueries record { public type PublicCampaignAsset record { string name?; string id; - record {||} metrics; + record {||} metrics?; }; public type RevenueAttributionAggregate record { diff --git a/docs/spec/campaignsPublicApi.json b/docs/spec/campaignsPublicApi.json index 3717176..8dc37bb 100644 --- a/docs/spec/campaignsPublicApi.json +++ b/docs/spec/campaignsPublicApi.json @@ -1568,7 +1568,7 @@ } }, "PublicCampaignAsset" : { - "required" : [ "id", "metrics" ], + "required" : [ "id"], "type" : "object", "properties" : { "name" : { From a3245b4b0dbd0dead25a5981bd21ac5da10deb7f Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 12:16:55 +0530 Subject: [PATCH 07/15] Update Documentation for private\-app --- ballerina/tests/test.bal | 28 ++++++++++++++++++---------- ballerina/types.bal | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 7dbd940..76a6da1 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -27,6 +27,8 @@ final Client baseClient = check new Client(config, serviceUrl = serviceUrl); //Variables //final string campaignGuid = "637caea9-ff27-40a6-93f0-852383aef453"; //Deleted in testing final string campaignGuid = "7c5b58c0-094a-4302-b75f-6fb94d8a3708"; +final string assetType = "FORM"; +final string assetID = "88047023-7777-40a1-b74b-4b1139e8d45b"; // @test:Config {} // isolated function testGetSearchMarketingCampaigns() returns error? { @@ -147,19 +149,25 @@ final string campaignGuid = "7c5b58c0-094a-4302-b75f-6fb94d8a3708"; // } ///////////////////////////////////////////////// -@test:Config {} -isolated function testGetListAssets() returns error? { - CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/FORM; - io:println(response,"response"); - test:assertTrue(response?.results.length() > 0); +// @test:Config {} +// isolated function testGetListAssets() returns error? { +// CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/[assetType]; +// io:println(response,"response"); +// test:assertTrue(response?.results.length() > 0); -} +// } //////////////////////////////////////////////// // @test:Config {} -// isolated function testPut-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}() { +// isolated function testPutAddAssetAssociation() returns error? { +// var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].put(); +// test:assertTrue(response.statusCode == 204); +// io:println(response); // } -// @test:Config {} -// isolated function testDelete-/marketing/v3/campaigns/{campaignGuid}/assets/{assetType}/{assetId}() { -// } +@test:Config {} +isolated function testDeleteRemoveAssetAssociation() returns error? { + var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].delete(); + test:assertTrue(response.statusCode == 204); + io:println(response); +} diff --git a/ballerina/types.bal b/ballerina/types.bal index 2a9dba2..259eb7f 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -362,6 +362,8 @@ public type NextPage record { }; # Provides API key configurations needed when communicating with a remote HTTP endpoint. +# +# + private\-app - field description public type ApiKeysConfig record {| string private\-app; |}; From 94e2b5efdefb381c8cd76b66ffa720782908f940 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 12:37:37 +0530 Subject: [PATCH 08/15] Update sanitations.md --- docs/spec/sanitations.md | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index 7036be3..3eb5365 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,6 +1,6 @@ -_Author_: \ -_Created_: \ -_Updated_: \ +_Author_: Samudra Uduwaka \ +_Created_: 2025-01-02 \ +_Updated_: 2025-01-06 \ _Edition_: Swan Lake # Sanitation for OpenAPI specification @@ -10,8 +10,25 @@ The OpenAPI specification is obtained from (TODO: Add source link). These changes are done in order to improve the overall usability, and as workarounds for some known language limitations. [//]: # (TODO: Add sanitation details) -1. -2. +1. Change the url property of the servers object: + + Original: https://api.hubapi.com + + Updated: https://api.hubapi.com/marketing/v3/campaigns + + Reason: This change is made to ensure that all API paths are relative to the versioned base URL (/marketing/v3/campaigns), which improves the consistency and usability of the APIs. + +2. Update API Paths: + + Original: Paths included the version prefix in each endpoint (e.g., /marketing/v3/campaigns/batch/read ). + + Updated: Paths are modified to remove the version prefix from the endpoints, as it is now included in the base URL. For example: + + - Original: /marketing/v3/campaigns/batch/read + + - Updated: /batch/read + + Reason: This modification simplifies the API paths, making them shorter and more readable. It also centralizes the versioning to the base URL, which is a common best practice. 3. ## OpenAPI cli command @@ -19,6 +36,6 @@ These changes are done in order to improve the overall usability, and as workaro The following command was used to generate the Ballerina client from the OpenAPI specification. The command should be executed from the repository root directory. ```bash -# TODO: Add OpenAPI CLI command used to generate the client +bal openapi -i docs/spec/openapi.json --mode client --license docs/license.txt -o ballerina ``` Note: The license year is hardcoded to 2024, change if necessary. From 02d8ae2c81824ff3c2665df3731b150f60d42188 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 23:10:03 +0530 Subject: [PATCH 09/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a88ed4c..dfc60af 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -290,6 +290,9 @@ version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "time", moduleName = "time"} +] [[package]] org = "ballerina" @@ -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"} ] From 14aba20b2128cd2ab8b1f5999d1f1c599af6c52c Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Mon, 6 Jan 2025 23:17:28 +0530 Subject: [PATCH 10/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index dfc60af..a88ed4c 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -290,9 +290,6 @@ version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] -modules = [ - {org = "ballerina", packageName = "time", moduleName = "time"} -] [[package]] org = "ballerina" @@ -326,7 +323,6 @@ 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"} ] From 5ff822192736212301ee2dd35d4984eb0ee42718 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Tue, 7 Jan 2025 10:15:59 +0530 Subject: [PATCH 11/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index a88ed4c..dfc60af 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -290,6 +290,9 @@ version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +modules = [ + {org = "ballerina", packageName = "time", moduleName = "time"} +] [[package]] org = "ballerina" @@ -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"} ] From c5c31b1ac47ed087a6947dfcd60e5c146c85c0a9 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Tue, 7 Jan 2025 12:22:42 +0530 Subject: [PATCH 12/15] Add Test Cases for End-points --- ballerina/tests/test.bal | 270 +++++++++++++++++++-------------------- 1 file changed, 133 insertions(+), 137 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 76a6da1..38ef64c 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -4,8 +4,7 @@ import ballerina/io; import ballerina/oauth2; import ballerina/test; - -//import ballerina/time; +import ballerina/time; configurable string clientId = ?; configurable string clientSecret = ?; @@ -25,149 +24,146 @@ ConnectionConfig config = {auth: authConfig}; final Client baseClient = check new Client(config, serviceUrl = serviceUrl); //Variables -//final string campaignGuid = "637caea9-ff27-40a6-93f0-852383aef453"; //Deleted in testing -final string campaignGuid = "7c5b58c0-094a-4302-b75f-6fb94d8a3708"; +final string campaignGuid = "c4573779-0830-4eb3-bfa3-0916bda9c1a4"; +string campaignGuid2 = "" ; final string assetType = "FORM"; final string assetID = "88047023-7777-40a1-b74b-4b1139e8d45b"; -// @test:Config {} -// isolated function testGetSearchMarketingCampaigns() returns error? { -// CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); -// test:assertTrue(response?.results.length() > 0); -// io:println(response); -// } - -// @test:Config {} -// isolated function testPostCreateMarketingCampaigns() returns error? { -// PublicCampaign response = check baseClient->/.post( -// payload = {properties: { -// "hs_name": "campaign" + time:utcNow().toString() , -// "hs_goal": "string", -// "hs_notes": "string" -// }} -// ); - -// test:assertTrue(response?.id != ""); -// } - -// @test:Config {} -// isolated function testGetReadACampaign() returns error? { -// PublicCampaignWithAssets response = check baseClient->/[campaignGuid]; -// test:assertTrue(response?.id == campaignGuid); -// io:println(response); -// } - -// @test:Config {} -// isolated function testPatchUpdateCampaigns() returns error? { -// PublicCampaign response = check baseClient->/[campaignGuid].patch( -// payload = {properties: { -// "hs_goal": "updated", -// "hs_notes": "string" -// }} -// ); - -// test:assertTrue(response?.id == campaignGuid); -// io:println(response); -// } - -// @test:Config {} -// isolated function testDeleteCampaign() returns error? { -// var response = check baseClient->/[campaignGuid].delete(); -// test:assertTrue(response.statusCode == 204); -// io:println(response); -// } - -// @test:Config {} -// isolated function testPostBatchCreate() returns error? { -// BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors response = check baseClient->/batch/create.post( -// payload = { -// "inputs": [ -// { -// "properties": { -// "hs_name": "batch3", -// "hs_goal": "stringval" -// } -// }, -// { -// "properties": { -// "hs_name": "batch4", -// "hs_goal": "stringval" -// } -// } -// ] -// } -// ); -// test:assertTrue(response?.status == "COMPLETE"); -// io:println(response); -// } - -// @test:Config {} -// isolated function testPostBatchRead() returns error? { -// BatchResponsePublicCampaignWithAssets|BatchResponsePublicCampaignWithAssetsWithErrors response = check baseClient->/batch/read.post( -// payload = { -// "inputs": [ -// { -// "id": campaignGuid -// } -// ] -// } -// ); -// test:assertTrue(response?.status == "COMPLETE"); -// io:println(response); -// } - -// @test:Config {} -// isolated function testPostDeleteABatchOfCampaigns() returns error? { -// var response = check baseClient->/batch/archive.post( -// payload = { -// "inputs": [ -// { -// "id": "99765286-2c49-443f-b2be-e80b06cf4798" -// }, -// { -// "id": "73861515-0252-4c78-aeac-c93d6df06c97" -// } -// ] -// } -// ); -// test:assertTrue(response.statusCode == 204); -// io:println(response); -// } - -// @test:Config {} -// isolated function testGetReportsRevenue() returns error? { -// RevenueAttributionAggregate response = check baseClient->/[campaignGuid]/reports/revenue; -// test:assertTrue(response?.revenueAmount is decimal); -// io:println(response); -// } - -// @test:Config {} -// isolated function testGetReportsMetrics() returns error? { -// MetricsCounters response = check baseClient->/[campaignGuid]/reports/metrics; -// test:assertTrue(response?.sessions == 0); -// io:println(response); -// } - -///////////////////////////////////////////////// -// @test:Config {} -// isolated function testGetListAssets() returns error? { -// CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/[assetType]; -// io:println(response,"response"); -// test:assertTrue(response?.results.length() > 0); - -// } -//////////////////////////////////////////////// +@test:Config {} +isolated function testGetSearchMarketingCampaigns() returns error? { + CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); + test:assertTrue(response?.results.length() > 0); + io:println(response); +} -// @test:Config {} -// isolated function testPutAddAssetAssociation() returns error? { -// var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].put(); -// test:assertTrue(response.statusCode == 204); -// io:println(response); -// } +@test:Config {} +function testPostCreateMarketingCampaigns() returns error? { + PublicCampaign response = check baseClient->/.post( + payload = {properties: { + "hs_name": "campaign" + time:utcNow().toString() , + "hs_goal": "string", + "hs_notes": "string" + }} + ); + + test:assertTrue(response?.id != ""); + campaignGuid2 = response?.id; + + //io:println(response?.id); +} @test:Config {} +isolated function testGetReadACampaign() returns error? { + PublicCampaignWithAssets response = check baseClient->/[campaignGuid]; + test:assertTrue(response?.id == campaignGuid); + io:println(response); +} + +@test:Config {} +isolated function testPatchUpdateCampaigns() returns error? { + PublicCampaign response = check baseClient->/[campaignGuid].patch( + payload = {properties: { + "hs_goal": "updated2", + "hs_notes": "string" + }} + ); + + test:assertTrue(response?.id == campaignGuid); + io:println(response); +} + +@test:Config {} +isolated function testPostBatchCreate() returns error? { + BatchResponsePublicCampaign|BatchResponsePublicCampaignWithErrors response = check baseClient->/batch/create.post( + payload = { + "inputs": [ + { + "properties": { + "hs_name": "batchCampaign" + time:utcToString(time:utcNow()), + "hs_goal": "stringval" + } + } + ] + } + ); + test:assertTrue(response?.status == "COMPLETE"); + io:println(response); +} + +@test:Config {} +isolated function testPostBatchRead() returns error? { + BatchResponsePublicCampaignWithAssets|BatchResponsePublicCampaignWithAssetsWithErrors response = check baseClient->/batch/read.post( + payload = { + "inputs": [ + { + "id": "ef46bced-1a75-42b5-9f5f-ebdd39cbfd3b" + } + ] + } + ); + test:assertTrue(response?.status == "COMPLETE"); + io:println(response); +} + +@test:Config {} +isolated function testGetReportsRevenue() returns error? { + RevenueAttributionAggregate response = check baseClient->/[campaignGuid]/reports/revenue; + test:assertTrue(response?.revenueAmount is decimal); + io:println(response); +} + +@test:Config {} +isolated function testGetReportsMetrics() returns error? { + MetricsCounters response = check baseClient->/[campaignGuid]/reports/metrics; + test:assertTrue(response?.sessions == 0); + io:println(response); +} + +@test:Config {} +isolated function testGetListAssets() returns error? { + CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/[assetType]; + io:println(response,"response"); + test:assertTrue(response?.results.length() > 0); + +} + +@test:Config {} +isolated function testPutAddAssetAssociation() returns error? { + var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].put(); + test:assertTrue(response.statusCode == 204); + io:println(response); +} + +@test:Config { + dependsOn: [testPutAddAssetAssociation, testGetListAssets] +} isolated function testDeleteRemoveAssetAssociation() returns error? { var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].delete(); test:assertTrue(response.statusCode == 204); io:println(response); } + +@test:Config {dependsOn: [testPostCreateMarketingCampaigns]} +function testDeleteCampaign() returns error? { + var response = check baseClient->/[campaignGuid2].delete(); + test:assertTrue(response.statusCode == 204); + io:println(response); +} + +@test:Config {} +isolated function testPostDeleteABatchOfCampaigns() returns error? { + var response = check baseClient->/batch/archive.post( + payload = { + "inputs": [ + { + "id": "b3e493b0-9d5a-4b3e-a362-f4e0f015345d" + }, + { + "id": "96a87dab-554a-474c-853b-c78193a8b889" + } + ] + } + ); + test:assertTrue(response.statusCode == 204); + io:println(response); +} From cf7bced6b372294ff9f0c24f3e107e81bd642461 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Tue, 7 Jan 2025 14:39:46 +0530 Subject: [PATCH 13/15] Updated sanitations.md --- docs/spec/sanitations.md | 63 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 4 deletions(-) diff --git a/docs/spec/sanitations.md b/docs/spec/sanitations.md index 3eb5365..6fea9bd 100644 --- a/docs/spec/sanitations.md +++ b/docs/spec/sanitations.md @@ -1,13 +1,13 @@ _Author_: Samudra Uduwaka \ _Created_: 2025-01-02 \ -_Updated_: 2025-01-06 \ +_Updated_: 2025-01-07 \ _Edition_: Swan Lake # Sanitation for OpenAPI specification This document records the sanitation done on top of the official OpenAPI specification from HubSpot Marketing Campaigns . -The OpenAPI specification is obtained from (TODO: Add source link). -These changes are done in order to improve the overall usability, and as workarounds for some known language limitations. +The OpenAPI specification is obtained from [Hubspot Marketing Campaings API](https://developers.hubspot.com/docs/reference/api/marketing/campaigns). + [//]: # (TODO: Add sanitation details) 1. Change the url property of the servers object: @@ -29,7 +29,62 @@ These changes are done in order to improve the overall usability, and as workaro - Updated: /batch/read Reason: This modification simplifies the API paths, making them shorter and more readable. It also centralizes the versioning to the base URL, which is a common best practice. -3. + +3. Updated `PublicCampaignAsset` Object: + + Removed `metrics` property from the required properties. + + Definitions: + + - Previous Definition: + + ```json + "PublicCampaignAsset" : { + "required" : [ "id", "metrics"], + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "metrics" : { + "type" : "object", + "additionalProperties" : { + "type" : "number" + } + } + } + } + ``` + + - After + + ```json + "PublicCampaignAsset" : { + "required" : [ "id"], + "type" : "object", + "properties" : { + "name" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "metrics" : { + "type" : "object", + "additionalProperties" : { + "type" : "number" + } + } + } + } + ``` + + Reason: `metrics` property is not required when creating and retrieving. + + ## OpenAPI cli command From f0396b6c08f92faf3bdca348b1570a05f07d01c4 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Tue, 7 Jan 2025 14:54:50 +0530 Subject: [PATCH 14/15] [Automated] Update the toml files --- ballerina/Dependencies.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index dfc60af..b385d49 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -98,9 +98,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] [[package]] org = "ballerina" @@ -323,7 +320,6 @@ name = "hubspot.marketing.campaigns" version = "1.0.0" dependencies = [ {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "time"}, From 0d70592c5e427d5c26a20ade88f777f3e1d97c50 Mon Sep 17 00:00:00 2001 From: samudrauduwaka Date: Tue, 7 Jan 2025 15:05:49 +0530 Subject: [PATCH 15/15] Added WSO2 licensing header --- ballerina/client.bal | 17 +++++++++++-- ballerina/tests/test.bal | 54 +++++++++++++++++++--------------------- ballerina/types.bal | 17 +++++++++++-- ballerina/utils.bal | 17 +++++++++++-- 4 files changed, 71 insertions(+), 34 deletions(-) diff --git a/ballerina/client.bal b/ballerina/client.bal index b014a36..7086fa6 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -1,5 +1,18 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. import ballerina/http; diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 38ef64c..5869f04 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -1,7 +1,19 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. -import ballerina/io; import ballerina/oauth2; import ballerina/test; import ballerina/time; @@ -24,16 +36,15 @@ ConnectionConfig config = {auth: authConfig}; final Client baseClient = check new Client(config, serviceUrl = serviceUrl); //Variables -final string campaignGuid = "c4573779-0830-4eb3-bfa3-0916bda9c1a4"; string campaignGuid2 = "" ; -final string assetType = "FORM"; -final string assetID = "88047023-7777-40a1-b74b-4b1139e8d45b"; +configurable string campaignGuid = ?; +configurable string assetType = ?; +configurable string assetID = ?; @test:Config {} isolated function testGetSearchMarketingCampaigns() returns error? { CollectionResponseWithTotalPublicCampaignForwardPaging response = check baseClient->/.get(); test:assertTrue(response?.results.length() > 0); - io:println(response); } @test:Config {} @@ -41,35 +52,29 @@ function testPostCreateMarketingCampaigns() returns error? { PublicCampaign response = check baseClient->/.post( payload = {properties: { "hs_name": "campaign" + time:utcNow().toString() , - "hs_goal": "string", - "hs_notes": "string" + "hs_goal": "campaignGoalSpecified", + "hs_notes": "someNotesForTheCampaign" }} ); - test:assertTrue(response?.id != ""); campaignGuid2 = response?.id; - - //io:println(response?.id); } @test:Config {} isolated function testGetReadACampaign() returns error? { PublicCampaignWithAssets response = check baseClient->/[campaignGuid]; test:assertTrue(response?.id == campaignGuid); - io:println(response); } @test:Config {} isolated function testPatchUpdateCampaigns() returns error? { PublicCampaign response = check baseClient->/[campaignGuid].patch( payload = {properties: { - "hs_goal": "updated2", - "hs_notes": "string" + "hs_goal": "updatedCampaignGoal", + "hs_notes": "updatedNotesForTheCampaign" }} ); - test:assertTrue(response?.id == campaignGuid); - io:println(response); } @test:Config {} @@ -80,14 +85,13 @@ isolated function testPostBatchCreate() returns error? { { "properties": { "hs_name": "batchCampaign" + time:utcToString(time:utcNow()), - "hs_goal": "stringval" + "hs_goal": "batchCampaignGoalSpecified" } } ] } ); test:assertTrue(response?.status == "COMPLETE"); - io:println(response); } @test:Config {} @@ -102,27 +106,23 @@ isolated function testPostBatchRead() returns error? { } ); test:assertTrue(response?.status == "COMPLETE"); - io:println(response); } @test:Config {} isolated function testGetReportsRevenue() returns error? { RevenueAttributionAggregate response = check baseClient->/[campaignGuid]/reports/revenue; test:assertTrue(response?.revenueAmount is decimal); - io:println(response); } @test:Config {} isolated function testGetReportsMetrics() returns error? { MetricsCounters response = check baseClient->/[campaignGuid]/reports/metrics; test:assertTrue(response?.sessions == 0); - io:println(response); } @test:Config {} isolated function testGetListAssets() returns error? { CollectionResponsePublicCampaignAssetForwardPaging response = check baseClient->/[campaignGuid]/assets/[assetType]; - io:println(response,"response"); test:assertTrue(response?.results.length() > 0); } @@ -131,7 +131,6 @@ isolated function testGetListAssets() returns error? { isolated function testPutAddAssetAssociation() returns error? { var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].put(); test:assertTrue(response.statusCode == 204); - io:println(response); } @test:Config { @@ -140,14 +139,14 @@ isolated function testPutAddAssetAssociation() returns error? { isolated function testDeleteRemoveAssetAssociation() returns error? { var response = check baseClient->/[campaignGuid]/assets/[assetType]/[assetID].delete(); test:assertTrue(response.statusCode == 204); - io:println(response); } -@test:Config {dependsOn: [testPostCreateMarketingCampaigns]} +@test:Config { + dependsOn: [testPostCreateMarketingCampaigns] +} function testDeleteCampaign() returns error? { var response = check baseClient->/[campaignGuid2].delete(); test:assertTrue(response.statusCode == 204); - io:println(response); } @test:Config {} @@ -165,5 +164,4 @@ isolated function testPostDeleteABatchOfCampaigns() returns error? { } ); test:assertTrue(response.statusCode == 204); - io:println(response); } diff --git a/ballerina/types.bal b/ballerina/types.bal index 259eb7f..b8f4a60 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -1,5 +1,18 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. import ballerina/http; diff --git a/ballerina/utils.bal b/ballerina/utils.bal index 1b492b2..b2aff1f 100644 --- a/ballerina/utils.bal +++ b/ballerina/utils.bal @@ -1,5 +1,18 @@ -// AUTO-GENERATED FILE. DO NOT MODIFY. -// This file is auto-generated by the Ballerina OpenAPI tool. +// Copyright (c) 2025, WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. import ballerina/url;