Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions ballerina/client.bal
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// 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,
Expand All @@ -13,3 +16,87 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.

import ballerina/http;

# These APIs allow you to specify URLs that can be used to interact with a video conferencing application, to allow HubSpot to add video conference links to meeting requests with contacts.
public isolated client class Client {
final http:Client clientEp;
final readonly & ApiKeysConfig apiKeyConfig;
# Gets invoked to initialize the `connector`.
#
# + apiKeyConfig - API keys for authorization
# + 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(ApiKeysConfig apiKeyConfig, ConnectionConfig config = {}, string serviceUrl = "https://api.hubapi.com/crm/v3/extensions/videoconferencing/settings") 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:Client httpEp = check new (serviceUrl, httpClientConfig);
self.clientEp = httpEp;
self.apiKeyConfig = apiKeyConfig.cloneReadOnly();
return;
}

# Delete settings
#
# + appId - The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
# + headers - Headers to be sent with the request
# + return - No content
resource isolated function delete [int:Signed32 appId](map<string|string[]> headers = {}) returns http:Response|error {
string resourcePath = string `/${getEncodedUri(appId)}`;
map<anydata> queryParam = {};
queryParam["hapikey"] = self.apiKeyConfig.hapikey;
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
return self.clientEp->delete(resourcePath, headers = headers);
}

# Get settings
#
# + appId - The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
# + headers - Headers to be sent with the request
# + return - successful operation
resource isolated function get [int:Signed32 appId](map<string|string[]> headers = {}) returns ExternalSettings|error {
string resourcePath = string `/${getEncodedUri(appId)}`;
map<anydata> queryParam = {};
queryParam["hapikey"] = self.apiKeyConfig.hapikey;
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
return self.clientEp->get(resourcePath, headers);
}

# Update settings
#
# + appId - The ID of the video conference application. This is the identifier of the application created in your HubSpot developer portal.
# + headers - Headers to be sent with the request
# + return - successful operation
resource isolated function put [int:Signed32 appId](ExternalSettings payload, map<string|string[]> headers = {}) returns ExternalSettings|error {
string resourcePath = string `/${getEncodedUri(appId)}`;
map<anydata> queryParam = {};
queryParam["hapikey"] = self.apiKeyConfig.hapikey;
resourcePath = resourcePath + check getPathForQueryParam(queryParam);
http:Request request = new;
json jsonBody = payload.toJson();
request.setPayload(jsonBody, "application/json");
return self.clientEp->put(resourcePath, request, headers);
}
}
97 changes: 97 additions & 0 deletions ballerina/types.bal
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
// 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;

# The URLs of the various actions provided by the video conferencing application. All URLs must use the `https` protocol.
public type ExternalSettings record {
# The URL that HubSpot will use to verify that a user exists in the video conference application.
string userVerifyUrl?;
string fetchAccountsUri?;
# The URL that HubSpot will send requests to create a new video conference.
string createMeetingUrl;
# The URL that HubSpot will send updates to existing meetings. Typically called when the user changes the topic or times of a meeting.
string updateMeetingUrl?;
# The URL that HubSpot will send notifications of meetings that have been deleted in HubSpot.
string deleteMeetingUrl?;
};

# 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?;
|};

# 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 = "";
|};

# Provides API key configurations needed when communicating with a remote HTTP endpoint.
public type ApiKeysConfig record {|
string hapikey;
|};

# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
@display {label: "Connection Config"}
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?;
# Configurations related to HTTP/2 protocol
http:ClientHttp2Settings http2Settings?;
# The maximum time to wait (in seconds) for a response before closing the connection
decimal timeout = 60;
# The choice of setting `forwarded`/`x-forwarded` header
string forwarded = "disable";
# Configurations associated with request pooling
http:PoolConfiguration poolConfig?;
# HTTP caching related configurations
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 inbound response size limits
http:ResponseLimitConfigs responseLimits?;
# SSL/TLS-related options
http:ClientSecureSocket secureSocket?;
# Proxy server related options
http:ProxyConfig proxy?;
# 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;
|};
Loading
Loading