From 732f8e5f25b29349ef22e613d05551c525fb27b3 Mon Sep 17 00:00:00 2001 From: ballerina-bot Date: Fri, 11 Apr 2025 15:12:30 +0000 Subject: [PATCH] [AUTOMATED] Client Regeneration --- ballerina/client.bal | 46 +++++++++++++++----------------------------- ballerina/types.bal | 14 +++++++------- 2 files changed, 22 insertions(+), 38 deletions(-) diff --git a/ballerina/client.bal b/ballerina/client.bal index 7c4977c..9d25de5 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -17,6 +17,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/data.jsondata; import ballerina/http; public isolated client class Client { @@ -42,7 +43,7 @@ public isolated client class Client { # # + headers - Headers to be sent with the request # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesBatchWrite(BatchInputPublicStatusRequest payload, map headers = {}) returns BatchResponsePublicStatus|error { + resource isolated function post statuses/batch/write(BatchInputPublicStatusRequest payload, map headers = {}) returns BatchResponsePublicStatus|error { string resourcePath = string `/statuses/batch/write`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -50,18 +51,12 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } - # Retrieve a contact's unsubscribed status - # - # + subscriberIdString - The contact's email address - # + headers - Headers to be sent with the request - # + queries - Queries to be sent with the request - # + return - successful operation - remote isolated function getCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAll(string subscriberIdString, map headers = {}, *GetCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries queries) returns ActionResponseWithResultsPublicWideStatus|error { + resource isolated function get statuses/[string subscriberIdString]/unsubscribe\-all(map headers = {}, *GetCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries queries) returns ActionResponseWithResultsPublicWideStatus|error { string resourcePath = string `/statuses/${getEncodedUri(subscriberIdString)}/unsubscribe-all`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -72,13 +67,7 @@ public isolated client class Client { return self.clientEp->get(resourcePath, httpHeaders); } - # Unsubscribe a contact from all subscriptions - # - # + subscriberIdString - The contact's email address - # + headers - Headers to be sent with the request - # + queries - Queries to be sent with the request - # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAll(string subscriberIdString, map headers = {}, *PostCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries queries) returns ActionResponseWithResultsPublicStatus|error { + resource isolated function post statuses/[string subscriberIdString]/unsubscribe\-all(map headers = {}, *PostCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries queries) returns ActionResponseWithResultsPublicStatus|error { string resourcePath = string `/statuses/${getEncodedUri(subscriberIdString)}/unsubscribe-all`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -95,7 +84,7 @@ public isolated client class Client { # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesBatchRead(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchReadQueries queries) returns BatchResponsePublicStatusBulkResponse|BatchResponsePublicStatusBulkResponseWithErrors|error { + resource isolated function post statuses/batch/read(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchReadQueries queries) returns BatchResponsePublicStatusBulkResponse|BatchResponsePublicStatusBulkResponseWithErrors|error { string resourcePath = string `/statuses/batch/read`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -104,17 +93,12 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } - # Batch unsubscribe contacts from all subscriptions - # - # + headers - Headers to be sent with the request - # + queries - Queries to be sent with the request - # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesBatchUnsubscribeAll(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllQueries queries) returns BatchResponsePublicBulkOptOutFromAllResponse|error { + resource isolated function post statuses/batch/unsubscribe\-all(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllQueries queries) returns BatchResponsePublicBulkOptOutFromAllResponse|error { string resourcePath = string `/statuses/batch/unsubscribe-all`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -123,7 +107,7 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -133,7 +117,7 @@ public isolated client class Client { # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation - remote isolated function getCommunicationPreferencesV4Definitions(map headers = {}, *GetCommunicationPreferencesV4DefinitionsQueries queries) returns ActionResponseWithResultsSubscriptionDefinition|error { + resource isolated function get definitions(map headers = {}, *GetCommunicationPreferencesV4DefinitionsQueries queries) returns ActionResponseWithResultsSubscriptionDefinition|error { string resourcePath = string `/definitions`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -149,7 +133,7 @@ public isolated client class Client { # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesBatchUnsubscribeAllRead(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllReadQueries queries) returns BatchResponsePublicWideStatusBulkResponse|BatchResponsePublicWideStatusBulkResponseWithErrors|error { + resource isolated function post statuses/batch/unsubscribe\-all/read(BatchInputString payload, map headers = {}, *PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllReadQueries queries) returns BatchResponsePublicWideStatusBulkResponse|BatchResponsePublicWideStatusBulkResponseWithErrors|error { string resourcePath = string `/statuses/batch/unsubscribe-all/read`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -158,7 +142,7 @@ public isolated client class Client { resourcePath = resourcePath + check getPathForQueryParam(queries); map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } @@ -169,7 +153,7 @@ public isolated client class Client { # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation - remote isolated function getCommunicationPreferencesV4StatusesSubscriberIdString(string subscriberIdString, map headers = {}, *GetCommunicationPreferencesV4StatusesSubscriberIdStringQueries queries) returns ActionResponseWithResultsPublicStatus|error { + resource isolated function get statuses/[string subscriberIdString](map headers = {}, *GetCommunicationPreferencesV4StatusesSubscriberIdStringQueries queries) returns ActionResponseWithResultsPublicStatus|error { string resourcePath = string `/statuses/${getEncodedUri(subscriberIdString)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -185,7 +169,7 @@ public isolated client class Client { # + subscriberIdString - The contact's email address # + headers - Headers to be sent with the request # + return - successful operation - remote isolated function postCommunicationPreferencesV4StatusesSubscriberIdString(string subscriberIdString, PartialPublicStatusRequest payload, map headers = {}) returns ActionResponseWithResultsPublicStatus|error { + resource isolated function post statuses/[string subscriberIdString](PartialPublicStatusRequest payload, map headers = {}) returns ActionResponseWithResultsPublicStatus|error { string resourcePath = string `/statuses/${getEncodedUri(subscriberIdString)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { @@ -193,7 +177,7 @@ public isolated client class Client { } map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; - json jsonBody = payload.toJson(); + json jsonBody = jsondata:toJson(payload); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } diff --git a/ballerina/types.bal b/ballerina/types.bal index 61e207e..28f3f17 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -112,7 +112,7 @@ public type ActionResponseWithResultsSubscriptionDefinition record { "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; }; -# Represents the Queries record for the operation: postCommunicationPreferencesV4StatusesBatchRead +# Represents the Queries record for the operation: post-/communication-preferences/v4/statuses/batch/read public type PostCommunicationPreferencesV4StatusesBatchReadQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel; @@ -127,7 +127,7 @@ public type OAuth2RefreshTokenGrantConfig record {| string refreshUrl = "https://api.hubapi.com/oauth/v1/token"; |}; -# Represents the Queries record for the operation: postCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAll +# Represents the Queries record for the operation: post-/communication-preferences/v4/statuses/{subscriberIdString}/unsubscribe-all public type PostCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel; @@ -206,7 +206,7 @@ public type PublicSubscriptionTranslation record { int:Signed32 updatedAt; }; -# Represents the Queries record for the operation: getCommunicationPreferencesV4Definitions +# Represents the Queries record for the operation: get-/communication-preferences/v4/definitions public type GetCommunicationPreferencesV4DefinitionsQueries record { # Set to `true` to return subscription translations associated with each definition boolean includeTranslations?; @@ -264,7 +264,7 @@ public type ActionResponseWithResultsPublicStatus record { "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; }; -# Represents the Queries record for the operation: getCommunicationPreferencesV4StatusesSubscriberIdString +# Represents the Queries record for the operation: get-/communication-preferences/v4/statuses/{subscriberIdString} public type GetCommunicationPreferencesV4StatusesSubscriberIdStringQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel; @@ -281,7 +281,7 @@ public type BatchResponsePublicWideStatusBulkResponse record { "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; }; -# Represents the Queries record for the operation: postCommunicationPreferencesV4StatusesBatchUnsubscribeAllRead +# Represents the Queries record for the operation: post-/communication-preferences/v4/statuses/batch/unsubscribe-all/read public type PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllReadQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel; @@ -325,7 +325,7 @@ public type ApiKeysConfig record {| string privateApp; |}; -# Represents the Queries record for the operation: getCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAll +# Represents the Queries record for the operation: get-/communication-preferences/v4/statuses/{subscriberIdString}/unsubscribe-all public type GetCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAllQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel; @@ -335,7 +335,7 @@ public type GetCommunicationPreferencesV4StatusesSubscriberIdStringUnsubscribeAl boolean verbose = false; }; -# Represents the Queries record for the operation: postCommunicationPreferencesV4StatusesBatchUnsubscribeAll +# Represents the Queries record for the operation: post-/communication-preferences/v4/statuses/batch/unsubscribe-all public type PostCommunicationPreferencesV4StatusesBatchUnsubscribeAllQueries record { # The channel type for the subscription type. Currently, the only supported channel type is `EMAIL` "EMAIL"|"WHATSAPP"|"SMS" channel;