diff --git a/ballerina/client.bal b/ballerina/client.bal index 5f6f5a4..7604063 100644 --- a/ballerina/client.bal +++ b/ballerina/client.bal @@ -22,92 +22,70 @@ import ballerina/http; public isolated client class Client { final http:Client clientEp; final readonly & ApiKeysConfig? apiKeyConfig; - # Gets invoked to initialize the `connector`. # # + 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/crm/v3/objects/leads") 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 { - ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); - httpClientConfig.http1Settings = {...settings}; - } - if config.http2Settings is http:ClientHttp2Settings { - httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); - } - if config.cache is http:CacheConfig { - httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); - } - if config.responseLimits is http:ResponseLimitConfigs { - httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); - } - if config.secureSocket is http:ClientSecureSocket { - httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); - } - if config.proxy is http:ProxyConfig { - httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); - } - } + http:ClientConfiguration httpClientConfig = {httpVersion: config.httpVersion, http1Settings: config.http1Settings, http2Settings: config.http2Settings, timeout: config.timeout, forwarded: config.forwarded, followRedirects: config.followRedirects, poolConfig: config.poolConfig, cache: config.cache, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, cookieConfig: config.cookieConfig, responseLimits: config.responseLimits, secureSocket: config.secureSocket, proxy: config.proxy, socketConfig: config.socketConfig, validation: config.validation, laxDataBinding: config.laxDataBinding}; if config.auth is ApiKeysConfig { self.apiKeyConfig = (config.auth).cloneReadOnly(); } else { httpClientConfig.auth = config.auth; self.apiKeyConfig = (); } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; + self.clientEp = check new (serviceUrl, httpClientConfig); } - # Archive + # Read a batch of leads by internal ID, or unique property values # # + headers - Headers to be sent with the request - # + return - No content - resource isolated function delete [string leadsId](map headers = {}) returns http:Response|error { - string resourcePath = string `/${getEncodedUri(leadsId)}`; + # + queries - Queries to be sent with the request + # + return - successful operation + resource isolated function post batch/read(BatchReadInputSimplePublicObjectId payload, map headers = {}, *PostCrmV3ObjectsLeadsBatchReadReadQueries queries) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/read`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); - return self.clientEp->delete(resourcePath, headers = httpHeaders); + resourcePath = resourcePath + check getPathForQueryParam(queries); + map httpHeaders = http:getHeaderMap(headerValues); + http:Request request = new; + json jsonBody = payload.toJson(); + request.setPayload(jsonBody, "application/json"); + return self.clientEp->post(resourcePath, request, httpHeaders); } - # List + # Read # # + 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 = {}, *GetCrmV3ObjectsLeads_getpageQueries queries) returns CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error { - string resourcePath = string `/`; + resource isolated function get [string leadsId](map headers = {}, *GetCrmV3ObjectsLeadsLeadsIdGetByIdQueries queries) returns SimplePublicObjectWithAssociations|error { + string resourcePath = string `/${getEncodedUri(leadsId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } map queryParamEncoding = {"properties": {style: FORM, explode: true}, "propertiesWithHistory": {style: FORM, explode: true}, "associations": {style: FORM, explode: true}}; resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); return self.clientEp->get(resourcePath, httpHeaders); } - # Read + # Archive # # + headers - Headers to be sent with the request - # + queries - Queries to be sent with the request - # + return - successful operation - resource isolated function get [string leadsId](map headers = {}, *GetCrmV3ObjectsLeadsLeadsid_getbyidQueries queries) returns SimplePublicObjectWithAssociations|error { + # + return - No content + resource isolated function delete [string leadsId](map headers = {}) returns error? { string resourcePath = string `/${getEncodedUri(leadsId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map queryParamEncoding = {"properties": {style: FORM, explode: true}, "propertiesWithHistory": {style: FORM, explode: true}, "associations": {style: FORM, explode: true}}; - resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); - map httpHeaders = getMapForHeaders(headerValues); - return self.clientEp->get(resourcePath, httpHeaders); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->delete(resourcePath, headers = httpHeaders); } # Update @@ -115,101 +93,99 @@ 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 patch [string leadsId](SimplePublicObjectInput payload, map headers = {}, *PatchCrmV3ObjectsLeadsLeadsid_updateQueries queries) returns SimplePublicObject|error { + resource isolated function patch [string leadsId](SimplePublicObjectInput payload, map headers = {}, *PatchCrmV3ObjectsLeadsLeadsIdUpdateQueries queries) returns SimplePublicObject|error { string resourcePath = string `/${getEncodedUri(leadsId)}`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } resourcePath = resourcePath + check getPathForQueryParam(queries); - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); return self.clientEp->patch(resourcePath, request, httpHeaders); } - # Create + # Archive a batch of leads by ID # # + headers - Headers to be sent with the request - # + return - successful operation - resource isolated function post .(SimplePublicObjectInputForCreate payload, map headers = {}) returns SimplePublicObject|error { - string resourcePath = string `/`; + # + return - No content + resource isolated function post batch/archive(BatchInputSimplePublicObjectId payload, map headers = {}) returns error? { + string resourcePath = string `/batch/archive`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } - # Archive a batch of leads by ID + # Create a batch of leads # # + headers - Headers to be sent with the request - # + return - No content - resource isolated function post batch/archive(BatchInputSimplePublicObjectId payload, map headers = {}) returns http:Response|error { - string resourcePath = string `/batch/archive`; + # + return - successful operation + resource isolated function post batch/create(BatchInputSimplePublicObjectInputForCreate payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/create`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } - # Create a batch of leads + # Update a batch of leads by internal ID, or unique property values # # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function post batch/create(BatchInputSimplePublicObjectInputForCreate payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { - string resourcePath = string `/batch/create`; + resource isolated function post batch/update(BatchInputSimplePublicObjectBatchInput payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { + string resourcePath = string `/batch/update`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); return self.clientEp->post(resourcePath, request, httpHeaders); } - # Read a batch of leads by internal ID, or unique property values + # List # # + headers - Headers to be sent with the request # + queries - Queries to be sent with the request # + return - successful operation - resource isolated function post batch/read(BatchReadInputSimplePublicObjectId payload, map headers = {}, *PostCrmV3ObjectsLeadsBatchRead_readQueries queries) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { - string resourcePath = string `/batch/read`; + resource isolated function get .(map headers = {}, *GetCrmV3ObjectsLeadsGetPageQueries queries) returns CollectionResponseSimplePublicObjectWithAssociationsForwardPaging|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - resourcePath = resourcePath + check getPathForQueryParam(queries); - map httpHeaders = getMapForHeaders(headerValues); - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - return self.clientEp->post(resourcePath, request, httpHeaders); + map queryParamEncoding = {"properties": {style: FORM, explode: true}, "propertiesWithHistory": {style: FORM, explode: true}, "associations": {style: FORM, explode: true}}; + resourcePath = resourcePath + check getPathForQueryParam(queries, queryParamEncoding); + map httpHeaders = http:getHeaderMap(headerValues); + return self.clientEp->get(resourcePath, httpHeaders); } - # Update a batch of leads by internal ID, or unique property values + # Create # # + headers - Headers to be sent with the request # + return - successful operation - resource isolated function post batch/update(BatchInputSimplePublicObjectBatchInput payload, map headers = {}) returns BatchResponseSimplePublicObject|BatchResponseSimplePublicObjectWithErrors|error { - string resourcePath = string `/batch/update`; + resource isolated function post .(SimplePublicObjectInputForCreate payload, map headers = {}) returns SimplePublicObject|error { + string resourcePath = string `/`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); @@ -224,9 +200,9 @@ public isolated client class Client { string resourcePath = string `/batch/upsert`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); @@ -239,9 +215,9 @@ public isolated client class Client { string resourcePath = string `/search`; map headerValues = {...headers}; if self.apiKeyConfig is ApiKeysConfig { - headerValues["private-app"] = self.apiKeyConfig?.private\-app; + headerValues["private-app"] = self.apiKeyConfig?.privateApp; } - map httpHeaders = getMapForHeaders(headerValues); + map httpHeaders = http:getHeaderMap(headerValues); http:Request request = new; json jsonBody = payload.toJson(); request.setPayload(jsonBody, "application/json"); diff --git a/ballerina/types.bal b/ballerina/types.bal index 136078d..075db53 100644 --- a/ballerina/types.bal +++ b/ballerina/types.bal @@ -19,6 +19,12 @@ import ballerina/http; +# Represents the Queries record for the operation: post-/crm/v3/objects/leads/batch/read_read +public type PostCrmV3ObjectsLeadsBatchReadReadQueries record { + # Whether to return only results that have been archived + boolean archived = false; +}; + public type StandardError record { record {} subCategory?; record {|string[]...;|} context; @@ -35,6 +41,22 @@ public type CollectionResponseAssociatedId record { AssociatedId[] results; }; +# Represents the Queries record for the operation: get-/crm/v3/objects/leads_getPage +public type GetCrmV3ObjectsLeadsGetPageQueries record { + # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored + string[] associations?; + # Whether to return only results that have been archived + boolean archived = false; + # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request + string[] propertiesWithHistory?; + # The maximum number of results to display per page + int:Signed32 'limit = 10; + # The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results + string after?; + # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored + string[] properties?; +}; + public type PublicAssociationsForObject record { AssociationSpec[] types; PublicObjectId to; @@ -58,7 +80,7 @@ public type ErrorDetail record { string subCategory?; # The status code associated with the error detail string code?; - # The name of the field or parameter in which the error was found. + # The name of the field or parameter in which the error was found string 'in?; # Context about the error condition record {|string[]...;|} context?; @@ -149,49 +171,50 @@ public type ConnectionConfig record {| # The HTTP version understood by the client http:HttpVersion httpVersion = http:HTTP_2_0; # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; + http:ClientHttp1Settings http1Settings = {}; # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; + http:ClientHttp2Settings http2Settings = {}; # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; + decimal timeout = 30; # The choice of setting `forwarded`/`x-forwarded` header string forwarded = "disable"; + # Configurations associated with Redirection + http:FollowRedirects followRedirects?; # Configurations associated with request pooling http:PoolConfiguration poolConfig?; # HTTP caching related configurations - http:CacheConfig cache?; + http:CacheConfig cache = {}; # Specifies the way of handling compression (`accept-encoding`) header http:Compression compression = http:COMPRESSION_AUTO; # Configurations associated with the behaviour of the Circuit Breaker http:CircuitBreakerConfig circuitBreaker?; # Configurations associated with retrying http:RetryConfig retryConfig?; + # Configurations associated with cookies + http:CookieConfig cookieConfig?; # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; + http:ResponseLimitConfigs responseLimits = {}; # SSL/TLS-related options http:ClientSecureSocket secureSocket?; # Proxy server related options http:ProxyConfig proxy?; + # Provides settings related to client socket configuration + http:ClientSocketConfig socketConfig = {}; # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default boolean validation = true; + # Enables relaxed data binding on the client side. When enabled, `nil` values are treated as optional, + # and absent fields are handled as `nilable` types. Enabled by default. + boolean laxDataBinding = true; |}; -public type PublicObjectId record { - string id; -}; - -# Represents the Queries record for the operation: get-/crm/v3/objects/leads/{leadsId}_getById -public type GetCrmV3ObjectsLeadsLeadsid_getbyidQueries record { - # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. - string[] associations?; - # Whether to return only results that have been archived. - boolean archived = false; - # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. - string[] propertiesWithHistory?; +# Represents the Queries record for the operation: patch-/crm/v3/objects/leads/{leadsId}_update +public type PatchCrmV3ObjectsLeadsLeadsIdUpdateQueries record { # The name of a property whose values are unique for this object string idProperty?; - # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. - string[] properties?; +}; + +public type PublicObjectId record { + string id; }; public type Paging record { @@ -226,30 +249,11 @@ public type BatchResponseSimplePublicObjectWithErrors record { "PENDING"|"PROCESSING"|"CANCELED"|"COMPLETE" status; }; -# Proxy server configurations to be used with the HTTP client endpoint. -public type ProxyConfig record {| - # Host name of the proxy server - string host = ""; - # Proxy server port - int port = 0; - # Proxy server username - string userName = ""; - # Proxy server password - @display {label: "", kind: "password"} - string password = ""; -|}; - public type SimplePublicObjectInput record { string objectWriteTraceId?; record {|string...;|} properties; }; -# Represents the Queries record for the operation: patch-/crm/v3/objects/leads/{leadsId}_update -public type PatchCrmV3ObjectsLeadsLeadsid_updateQueries record { - # The name of a property whose values are unique for this object - string idProperty?; -}; - public type CollectionResponseSimplePublicObjectWithAssociationsForwardPaging record { ForwardPaging paging?; SimplePublicObjectWithAssociations[] results; @@ -271,22 +275,6 @@ public type SimplePublicObjectWithAssociations record { string updatedAt; }; -# Represents the Queries record for the operation: get-/crm/v3/objects/leads_getPage -public type GetCrmV3ObjectsLeads_getpageQueries record { - # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored. - string[] associations?; - # Whether to return only results that have been archived. - boolean archived = false; - # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request. - string[] propertiesWithHistory?; - # The maximum number of results to display per page. - int:Signed32 'limit = 10; - # The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. - string after?; - # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored. - string[] properties?; -}; - public type Filter record { string highValue?; string propertyName; @@ -296,29 +284,19 @@ public type Filter record { "EQ"|"NEQ"|"LT"|"LTE"|"GT"|"GTE"|"BETWEEN"|"IN"|"NOT_IN"|"HAS_PROPERTY"|"NOT_HAS_PROPERTY"|"CONTAINS_TOKEN"|"NOT_CONTAINS_TOKEN" operator; }; -# Provides settings related to HTTP/1.x protocol. -public type ClientHttp1Settings record {| - # Specifies whether to reuse a connection for multiple requests - http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; - # The chunking behaviour of the request - http:Chunking chunking = http:CHUNKING_AUTO; - # Proxy server related options - ProxyConfig proxy?; -|}; - public type PreviousPage record { string before; string link?; }; -public type BatchInputSimplePublicObjectBatchInput record { - SimplePublicObjectBatchInput[] inputs; -}; - public type BatchInputSimplePublicObjectInputForCreate record { SimplePublicObjectInputForCreate[] inputs; }; +public type BatchInputSimplePublicObjectBatchInput record { + SimplePublicObjectBatchInput[] inputs; +}; + public type SimplePublicUpsertObject record { string createdAt; boolean archived?; @@ -330,6 +308,20 @@ public type SimplePublicUpsertObject record { string updatedAt; }; +# Represents the Queries record for the operation: get-/crm/v3/objects/leads/{leadsId}_getById +public type GetCrmV3ObjectsLeadsLeadsIdGetByIdQueries record { + # A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored + string[] associations?; + # Whether to return only results that have been archived + boolean archived = false; + # A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored + string[] propertiesWithHistory?; + # The name of a property whose values are unique for this object + string idProperty?; + # A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored + string[] properties?; +}; + public type SimplePublicObjectBatchInput record { string idProperty?; string objectWriteTraceId?; @@ -349,16 +341,10 @@ public type AssociatedId record { # Provides API key configurations needed when communicating with a remote HTTP endpoint. public type ApiKeysConfig record {| - string private\-app\-legacy; - string private\-app; + string privateAppLegacy; + string privateApp; |}; -# Represents the Queries record for the operation: post-/crm/v3/objects/leads/batch/read_read -public type PostCrmV3ObjectsLeadsBatchRead_readQueries record { - # Whether to return only results that have been archived. - boolean archived = false; -}; - public type SimplePublicObjectInputForCreate record { PublicAssociationsForObject[] associations; string objectWriteTraceId?; diff --git a/ballerina/utils.bal b/ballerina/utils.bal index 5d8e591..8269f00 100644 --- a/ballerina/utils.bal +++ b/ballerina/utils.bal @@ -17,6 +17,7 @@ // specific language governing permissions and limitations // under the License. +import ballerina/http; import ballerina/url; type SimpleBasicType string|boolean|int|float|decimal; @@ -186,12 +187,13 @@ isolated function getEncodedUri(anydata value) returns string { # + encodingMap - Details on serialization mechanism # + return - Returns generated Path or error at failure of client initialization isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { + map queriesMap = http:getQueryMap(queryParam); string[] param = []; - if queryParam.length() > 0 { + if queriesMap.length() > 0 { param.push("?"); - foreach var [key, value] in queryParam.entries() { + foreach var [key, value] in queriesMap.entries() { if value is () { - _ = queryParam.remove(key); + _ = queriesMap.remove(key); continue; } Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; @@ -215,20 +217,3 @@ isolated function getPathForQueryParam(map queryParam, map en string restOfPath = string:'join("", ...param); return restOfPath; } - -# Generate header map for given header values. -# -# + headerParam - Headers map -# + return - Returns generated map or error at failure of client initialization -isolated function getMapForHeaders(map headerParam) returns map { - map headerMap = {}; - foreach var [key, value] in headerParam.entries() { - if value is SimpleBasicType[] { - headerMap[key] = from SimpleBasicType data in value - select data.toString(); - } else { - headerMap[key] = value.toString(); - } - } - return headerMap; -} diff --git a/docs/spec/openapi.json b/docs/spec/openapi.json index 5e0acee..40325f1 100644 --- a/docs/spec/openapi.json +++ b/docs/spec/openapi.json @@ -37,7 +37,7 @@ "parameters" : [ { "name" : "archived", "in" : "query", - "description" : "Whether to return only results that have been archived.", + "description" : "Whether to return only results that have been archived", "required" : false, "style" : "form", "explode" : true, @@ -106,7 +106,7 @@ }, { "name" : "properties", "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored", "required" : false, "style" : "form", "explode" : true, @@ -119,7 +119,7 @@ }, { "name" : "propertiesWithHistory", "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored", "required" : false, "style" : "form", "explode" : true, @@ -132,7 +132,7 @@ }, { "name" : "associations", "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored", "required" : false, "style" : "form", "explode" : true, @@ -145,7 +145,7 @@ }, { "name" : "archived", "in" : "query", - "description" : "Whether to return only results that have been archived.", + "description" : "Whether to return only results that have been archived", "required" : false, "style" : "form", "explode" : true, @@ -409,7 +409,7 @@ "parameters" : [ { "name" : "limit", "in" : "query", - "description" : "The maximum number of results to display per page.", + "description" : "The maximum number of results to display per page", "required" : false, "style" : "form", "explode" : true, @@ -421,7 +421,7 @@ }, { "name" : "after", "in" : "query", - "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", + "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results", "required" : false, "style" : "form", "explode" : true, @@ -431,7 +431,7 @@ }, { "name" : "properties", "in" : "query", - "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "description" : "A comma separated list of the properties to be returned in the response. If any of the specified properties are not present on the requested object(s), they will be ignored", "required" : false, "style" : "form", "explode" : true, @@ -444,7 +444,7 @@ }, { "name" : "propertiesWithHistory", "in" : "query", - "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request", "required" : false, "style" : "form", "explode" : true, @@ -457,7 +457,7 @@ }, { "name" : "associations", "in" : "query", - "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored", "required" : false, "style" : "form", "explode" : true, @@ -470,7 +470,7 @@ }, { "name" : "archived", "in" : "query", - "description" : "Whether to return only results that have been archived.", + "description" : "Whether to return only results that have been archived", "required" : false, "style" : "form", "explode" : true, @@ -761,7 +761,7 @@ }, "in" : { "type" : "string", - "description" : "The name of the field or parameter in which the error was found." + "description" : "The name of the field or parameter in which the error was found" }, "context" : { "type" : "object", @@ -1585,12 +1585,14 @@ "private_apps_legacy" : { "type" : "apiKey", "name" : "private-app-legacy", - "in" : "header" + "in" : "header", + "x-ballerina-name" : "privateAppLegacy" }, "private_apps" : { "type" : "apiKey", "name" : "private-app", - "in" : "header" + "in" : "header", + "x-ballerina-name" : "privateApp" } } }, diff --git a/docs/spec/openapi_old.json b/docs/spec/openapi_old.json new file mode 100644 index 0000000..5e0acee --- /dev/null +++ b/docs/spec/openapi_old.json @@ -0,0 +1,1605 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Leads", + "description" : "", + "version" : "v3", + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "PROFESSIONAL", + "service" : "FREE", + "cms" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE", + "x-hubspot-api-use-case" : "When an existing contact shows an interest in purchasing a product or service, create a lead record to track the sales prospecting journey.", + "x-hubspot-related-documentation" : [ { + "name" : "Leads Guide", + "url" : "https://developers.hubspot.com/beta-docs/guides/api/crm/objects/leads" + } ], + "x-hubspot-introduction" : "In HubSpot, leads are contacts or companies that are potential customers who have shown interest in your products or services. Use the leads API to create and manage lead records in your HubSpot account, as well as sync lead data between HubSpot and other systems." + }, + "servers" : [ { + "url" : "https://api.hubapi.com/crm/v3/objects/leads" + } ], + "tags" : [ { + "name" : "Batch" + }, { + "name" : "Basic" + }, { + "name" : "Search" + } ], + "paths" : { + "/batch/read" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Read a batch of leads by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/leads/batch/read_read", + "parameters" : [ { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchReadInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.read" ] + }, { + "private_apps" : [ "crm.objects.leads.read" ] + } ] + } + }, + "/{leadsId}" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "Read", + "description" : "Read an Object identified by `{leadsId}`. `{leadsId}` refers to the internal object ID by default, or optionally any unique property value as specified by the `idProperty` query param. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/leads/{leadsId}_getById", + "parameters" : [ { + "name" : "leadsId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "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 are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.read" ] + }, { + "private_apps" : [ "crm.objects.leads.read" ] + } ] + }, + "delete" : { + "tags" : [ "Basic" ], + "summary" : "Archive", + "description" : "Move an Object identified by `{leadsId}` to the recycling bin.", + "operationId" : "delete-/crm/v3/objects/leads/{leadsId}_archive", + "parameters" : [ { + "name" : "leadsId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + } ], + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + }, + "patch" : { + "tags" : [ "Basic" ], + "summary" : "Update", + "description" : "Perform a partial update of an Object identified by `{leadsId}`or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object. Provided property values will be overwritten. Read-only and non-existent properties will result in an error. Properties values can be cleared by passing an empty string.", + "operationId" : "patch-/crm/v3/objects/leads/{leadsId}_update", + "parameters" : [ { + "name" : "leadsId", + "in" : "path", + "required" : true, + "style" : "simple", + "explode" : false, + "schema" : { + "type" : "string" + } + }, { + "name" : "idProperty", + "in" : "query", + "description" : "The name of a property whose values are unique for this object", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "string" + } + } ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/batch/archive" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Archive a batch of leads by ID", + "operationId" : "post-/crm/v3/objects/leads/batch/archive_archive", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectId" + } + } + }, + "required" : true + }, + "responses" : { + "204" : { + "description" : "No content", + "content" : { } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/batch/create" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create a batch of leads", + "operationId" : "post-/crm/v3/objects/leads/batch/create_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/batch/update" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Update a batch of leads by internal ID, or unique property values", + "operationId" : "post-/crm/v3/objects/leads/batch/update_update", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInput" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/" : { + "get" : { + "tags" : [ "Basic" ], + "summary" : "List", + "description" : "Read a page of leads. Control what is returned via the `properties` query param.", + "operationId" : "get-/crm/v3/objects/leads_getPage", + "parameters" : [ { + "name" : "limit", + "in" : "query", + "description" : "The maximum number of results to display per page.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "integer", + "format" : "int32", + "default" : 10 + } + }, { + "name" : "after", + "in" : "query", + "description" : "The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.", + "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 are not present on the requested object(s), they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "propertiesWithHistory", + "in" : "query", + "description" : "A comma separated list of the properties to be returned along with their history of previous values. If any of the specified properties are not present on the requested object(s), they will be ignored. Usage of this parameter will reduce the maximum number of objects that can be read by a single request.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "associations", + "in" : "query", + "description" : "A comma separated list of object types to retrieve associated IDs for. If any of the specified associations do not exist, they will be ignored.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + }, { + "name" : "archived", + "in" : "query", + "description" : "Whether to return only results that have been archived.", + "required" : false, + "style" : "form", + "explode" : true, + "schema" : { + "type" : "boolean", + "default" : false + } + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.read" ] + }, { + "private_apps" : [ "crm.objects.leads.read" ] + } ] + }, + "post" : { + "tags" : [ "Basic" ], + "summary" : "Create", + "description" : "Create a lead with the given properties and return a copy of the object, including the ID. Documentation and examples for creating standard leads is provided.", + "operationId" : "post-/crm/v3/objects/leads_create", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + }, + "required" : true + }, + "responses" : { + "201" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/batch/upsert" : { + "post" : { + "tags" : [ "Batch" ], + "summary" : "Create or update a batch of leads by unique property values", + "description" : "Create or update records identified by `{leadsId}` or optionally a unique property value as specified by the `idProperty` query param. `{leadsId}` refers to the internal object ID by default, and the `idProperty` query param refers to a property whose values are unique for the object.", + "operationId" : "post-/crm/v3/objects/leads/batch/upsert_upsert", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchInputSimplePublicObjectBatchInputUpsert" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObject" + } + } + } + }, + "207" : { + "description" : "multiple statuses", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/BatchResponseSimplePublicUpsertObjectWithErrors" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.write" ] + }, { + "private_apps" : [ "crm.objects.leads.write" ] + } ] + } + }, + "/search" : { + "post" : { + "tags" : [ "Search" ], + "operationId" : "post-/crm/v3/objects/leads/search_doSearch", + "parameters" : [ ], + "requestBody" : { + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/PublicObjectSearchRequest" + } + } + }, + "required" : true + }, + "responses" : { + "200" : { + "description" : "successful operation", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/CollectionResponseWithTotalSimplePublicObjectForwardPaging" + } + } + } + }, + "default" : { + "$ref" : "#/components/responses/Error" + } + }, + "security" : [ { + "oauth2" : [ "crm.objects.leads.read" ] + }, { + "private_apps" : [ "crm.objects.leads.read" ] + } ], + "x-hubspot-rate-limit-exemptions" : [ "ten-secondly" ] + } + } + }, + "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" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" + } + }, + "status" : { + "type" : "string" + } + } + }, + "CollectionResponseAssociatedId" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/Paging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociatedId" + } + } + } + }, + "PublicAssociationsForObject" : { + "required" : [ "to", "types" ], + "type" : "object", + "properties" : { + "types" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/AssociationSpec" + } + }, + "to" : { + "$ref" : "#/components/schemas/PublicObjectId" + } + } + }, + "BatchResponseSimplePublicObject" : { + "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/SimplePublicObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "FilterGroup" : { + "required" : [ "filters" ], + "type" : "object", + "properties" : { + "filters" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/Filter" + } + } + } + }, + "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" + } + } + }, + "SimplePublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "BatchResponseSimplePublicUpsertObjectWithErrors" : { + "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/SimplePublicUpsertObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchReadInputSimplePublicObjectId" : { + "required" : [ "inputs", "properties", "propertiesWithHistory" ], + "type" : "object", + "properties" : { + "propertiesWithHistory" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "idProperty" : { + "type" : "string" + }, + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicUpsertObject" : { + "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/SimplePublicUpsertObject" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "BatchInputSimplePublicObjectId" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectId" + } + } + } + }, + "ValueWithTimestamp" : { + "required" : [ "sourceType", "timestamp", "value" ], + "type" : "object", + "properties" : { + "sourceId" : { + "type" : "string" + }, + "sourceType" : { + "type" : "string" + }, + "sourceLabel" : { + "type" : "string" + }, + "updatedByUserId" : { + "type" : "integer", + "format" : "int32" + }, + "value" : { + "type" : "string" + }, + "timestamp" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "BatchInputSimplePublicObjectBatchInputUpsert" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInputUpsert" + } + } + } + }, + "CollectionResponseWithTotalSimplePublicObjectForwardPaging" : { + "required" : [ "results", "total" ], + "type" : "object", + "properties" : { + "total" : { + "type" : "integer", + "format" : "int32" + }, + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObject" + } + } + } + }, + "SimplePublicObject" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean", + "example" : false + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string", + "example" : "512" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + }, + "example" : { + "id" : "512", + "properties" : { + "property_string" : "value", + "property_number" : "17", + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_dropdown" : "choice_b", + "property_checkbox" : "false", + "property_multiple_checkboxes" : "chocolate;strawberry" + }, + "createdAt" : "2019-10-30T03:30:17.883Z", + "updatedAt" : "2019-12-07T16:50:06.678Z", + "archived" : false + } + }, + "PublicObjectId" : { + "required" : [ "id" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + } + } + }, + "Paging" : { + "type" : "object", + "properties" : { + "next" : { + "$ref" : "#/components/schemas/NextPage" + }, + "prev" : { + "$ref" : "#/components/schemas/PreviousPage" + } + } + }, + "PublicObjectSearchRequest" : { + "type" : "object", + "properties" : { + "query" : { + "type" : "string" + }, + "limit" : { + "type" : "integer", + "format" : "int32" + }, + "after" : { + "type" : "string" + }, + "sorts" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "properties" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "filterGroups" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/FilterGroup" + } + } + } + }, + "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", + "example" : { + "knowledge-base" : "https://www.hubspot.com/products/service/knowledge-base" + } + }, + "message" : { + "type" : "string", + "description" : "A human readable message describing the error along with remediation steps where appropriate", + "example" : "Invalid input (details will vary based on the error)" + }, + "category" : { + "type" : "string", + "description" : "The error category", + "example" : "VALIDATION_ERROR" + }, + "errors" : { + "type" : "array", + "description" : "further information about the error", + "items" : { + "$ref" : "#/components/schemas/ErrorDetail" + } + } + }, + "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" + } + } + }, + "SimplePublicObjectBatchInputUpsert" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "BatchResponseSimplePublicObjectWithErrors" : { + "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/SimplePublicObject" + } + }, + "errors" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/StandardError" + } + }, + "status" : { + "type" : "string", + "enum" : [ "PENDING", "PROCESSING", "CANCELED", "COMPLETE" ] + } + } + }, + "SimplePublicObjectInput" : { + "required" : [ "properties" ], + "type" : "object", + "properties" : { + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + }, + "example" : { + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_number" : "17", + "property_string" : "value", + "property_checkbox" : "false", + "property_dropdown" : "choice_b", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + } + }, + "example" : { + "properties" : { + "property_string" : "value", + "property_number" : "17", + "property_date" : "1572480000000", + "property_radio" : "option_1", + "property_dropdown" : "choice_b", + "property_checkbox" : "false", + "property_multiple_checkboxes" : "chocolate;strawberry" + } + } + }, + "CollectionResponseSimplePublicObjectWithAssociationsForwardPaging" : { + "required" : [ "results" ], + "type" : "object", + "properties" : { + "paging" : { + "$ref" : "#/components/schemas/ForwardPaging" + }, + "results" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectWithAssociations" + } + } + } + }, + "AssociationSpec" : { + "required" : [ "associationCategory", "associationTypeId" ], + "type" : "object", + "properties" : { + "associationCategory" : { + "type" : "string", + "enum" : [ "HUBSPOT_DEFINED", "USER_DEFINED", "INTEGRATOR_DEFINED" ] + }, + "associationTypeId" : { + "type" : "integer", + "format" : "int32" + } + } + }, + "SimplePublicObjectWithAssociations" : { + "required" : [ "createdAt", "id", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "object", + "additionalProperties" : { + "$ref" : "#/components/schemas/CollectionResponseAssociatedId" + } + }, + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string", + "nullable" : true + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "Filter" : { + "required" : [ "operator", "propertyName" ], + "type" : "object", + "properties" : { + "highValue" : { + "type" : "string" + }, + "propertyName" : { + "type" : "string" + }, + "values" : { + "type" : "array", + "items" : { + "type" : "string" + } + }, + "value" : { + "type" : "string" + }, + "operator" : { + "type" : "string", + "description" : "null", + "enum" : [ "EQ", "NEQ", "LT", "LTE", "GT", "GTE", "BETWEEN", "IN", "NOT_IN", "HAS_PROPERTY", "NOT_HAS_PROPERTY", "CONTAINS_TOKEN", "NOT_CONTAINS_TOKEN" ] + } + } + }, + "BatchInputSimplePublicObjectBatchInput" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectBatchInput" + } + } + } + }, + "BatchInputSimplePublicObjectInputForCreate" : { + "required" : [ "inputs" ], + "type" : "object", + "properties" : { + "inputs" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/SimplePublicObjectInputForCreate" + } + } + } + }, + "PreviousPage" : { + "required" : [ "before" ], + "type" : "object", + "properties" : { + "before" : { + "type" : "string" + }, + "link" : { + "type" : "string" + } + } + }, + "SimplePublicUpsertObject" : { + "required" : [ "createdAt", "id", "new", "properties", "updatedAt" ], + "type" : "object", + "properties" : { + "createdAt" : { + "type" : "string", + "format" : "date-time" + }, + "archived" : { + "type" : "boolean" + }, + "archivedAt" : { + "type" : "string", + "format" : "date-time" + }, + "new" : { + "type" : "boolean" + }, + "propertiesWithHistory" : { + "type" : "object", + "additionalProperties" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/ValueWithTimestamp" + } + } + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + }, + "updatedAt" : { + "type" : "string", + "format" : "date-time" + } + } + }, + "SimplePublicObjectBatchInput" : { + "required" : [ "id", "properties" ], + "type" : "object", + "properties" : { + "idProperty" : { + "type" : "string", + "example" : "my_unique_property_name" + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "id" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + }, + "AssociatedId" : { + "required" : [ "id", "type" ], + "type" : "object", + "properties" : { + "id" : { + "type" : "string" + }, + "type" : { + "type" : "string" + } + } + }, + "NextPage" : { + "required" : [ "after" ], + "type" : "object", + "properties" : { + "link" : { + "type" : "string", + "example" : "?after=NTI1Cg%3D%3D" + }, + "after" : { + "type" : "string", + "example" : "NTI1Cg%3D%3D" + } + }, + "example" : { + "after" : "NTI1Cg%3D%3D", + "link" : "?after=NTI1Cg%3D%3D" + } + }, + "SimplePublicObjectInputForCreate" : { + "required" : [ "associations", "properties" ], + "type" : "object", + "properties" : { + "associations" : { + "type" : "array", + "items" : { + "$ref" : "#/components/schemas/PublicAssociationsForObject" + } + }, + "objectWriteTraceId" : { + "type" : "string" + }, + "properties" : { + "type" : "object", + "additionalProperties" : { + "type" : "string" + } + } + } + } + }, + "responses" : { + "Error" : { + "description" : "An error occurred.", + "content" : { + "*/*" : { + "schema" : { + "$ref" : "#/components/schemas/Error" + } + } + } + } + }, + "securitySchemes" : { + "oauth2_legacy" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.goals.read" : "Read goals", + "tickets" : "Read and write tickets", + "crm.objects.custom.read" : "View custom object records", + "e-commerce" : "e-commerce", + "crm.objects.custom.write" : "Change custom object records", + "media_bridge.read" : "Read media and media events" + } + } + } + }, + "oauth2" : { + "type" : "oauth2", + "flows" : { + "authorizationCode" : { + "authorizationUrl" : "https://app.hubspot.com/oauth/authorize", + "tokenUrl" : "https://api.hubapi.com/oauth/v1/token", + "scopes" : { + "crm.objects.companies.write" : " ", + "crm.objects.contacts.write" : " ", + "crm.objects.users.write" : "Write User CRM objects", + "crm.objects.commercepayments.read" : "Read the COMMERCE_PAYMENT object.", + "crm.objects.leads.write" : "Modify lead objects", + "crm.objects.subscriptions.read" : "Read Commerce Subscriptions", + "crm.objects.carts.read" : "Read carts", + "crm.objects.orders.write" : "Write orders", + "crm.objects.quotes.read" : "Quotes", + "crm.objects.services.read" : "Read services", + "crm.objects.orders.read" : "Read Orders", + "crm.objects.contacts.read" : " ", + "crm.objects.listings.read" : "Read listings", + "crm.objects.carts.write" : "Write cart", + "crm.objects.courses.write" : "Write courses", + "crm.objects.quotes.write" : "Quotes", + "crm.objects.users.read" : "Read User CRM objects", + "crm.objects.companies.read" : " ", + "crm.objects.appointments.read" : "Read appointments", + "crm.objects.partner-clients.write" : "Modify Partner Client CRM objects", + "crm.objects.leads.read" : "Read lead objects", + "crm.objects.appointments.write" : "Write appointments", + "crm.objects.services.write" : "Write services", + "crm.objects.line_items.read" : "Line Items", + "crm.objects.courses.read" : "Read courses", + "crm.objects.deals.read" : " ", + "crm.objects.invoices.read" : "Read invoices objects", + "crm.objects.partner-clients.read" : "View Partner Client CRM objects", + "crm.objects.deals.write" : " ", + "crm.objects.line_items.write" : "Line Items", + "crm.objects.listings.write" : "Write listings" + } + } + } + }, + "private_apps_legacy" : { + "type" : "apiKey", + "name" : "private-app-legacy", + "in" : "header" + }, + "private_apps" : { + "type" : "apiKey", + "name" : "private-app", + "in" : "header" + } + } + }, + "x-hubspot-available-client-libraries" : [ "PHP" ], + "x-hubspot-product-tier-requirements" : { + "marketing" : "FREE", + "sales" : "PROFESSIONAL", + "service" : "FREE", + "cms" : "FREE" + }, + "x-hubspot-documentation-banner" : "NONE" +} \ No newline at end of file diff --git a/docs/spec/report.html b/docs/spec/report.html new file mode 100755 index 0000000..5877ede --- /dev/null +++ b/docs/spec/report.html @@ -0,0 +1,146 @@ + + + + OpenAPI Changes Report + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ OpenAPI Changes report is loading... +
+
+
+ + \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 5ed08cb..0763da3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,4 +4,4 @@ version=0.1.0-SNAPSHOT releasePluginVersion=2.8.0 ballerinaGradlePluginVersion=2.2.4 -ballerinaLangVersion=2201.10.0 +ballerinaLangVersion=2201.12.2