(links)
- create - Create a new link
- list - Retrieve a list of links
- count - Retrieve links count
- get - Retrieve a link
- update - Update a link
- delete - Delete a link
- create_many - Bulk create links
- update_many - Bulk update links
- delete_many - Bulk delete links
- upsert - Upsert a link
Create a new link for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::CreateLinkRequestBody.new(
url: "https://google.com",
external_id: "123456",
tag_ids: [
"clux0rgak00011...",
],
)
res = s.links.create(req)
if ! res.link_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::CreateLinkRequestBody | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::CreateLinkResponse)
Retrieve a paginated list of links for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::GetLinksRequest.new(
page: 1.0,
page_size: 50.0,
)
res = s.links.list(req)
if ! res.link_schemas.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::GetLinksRequest | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::GetLinksResponse)
Retrieve the number of links for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::GetLinksCountRequest.new()
res = s.links.count(req)
if ! res.number.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::GetLinksCountRequest | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::GetLinksCountResponse)
Retrieve the info for a link.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::GetLinkInfoRequest.new(
link_id: "clux0rgak00011...",
external_id: "123456",
)
res = s.links.get(req)
if ! res.link_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::GetLinkInfoRequest | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::GetLinkInfoResponse)
Update a link for the authenticated workspace. If there's no change, returns it as it is.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
res = s.links.update(link_id="<id>", request_body=::OpenApiSDK::Operations::UpdateLinkRequestBody.new(
url: "https://google.com",
external_id: "123456",
tag_ids: [
"clux0rgak00011...",
],
))
if ! res.link_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
link_id |
::String | ✔️ | The id of the link to update. You may use either linkId (obtained via /links/info endpoint) or externalId prefixed with ext_ . |
request_body |
T.nilable(::OpenApiSDK::Operations::UpdateLinkRequestBody) | ➖ | N/A |
T.nilable(::OpenApiSDK::Operations::UpdateLinkResponse)
Delete a link for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
res = s.links.delete(link_id="<id>")
if ! res.object.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
link_id |
::String | ✔️ | The id of the link to delete. You may use either linkId (obtained via /links/info endpoint) or externalId prefixed with ext_ . |
T.nilable(::OpenApiSDK::Operations::DeleteLinkResponse)
Bulk create up to 100 links for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = [
::OpenApiSDK::Operations::RequestBody.new(
url: "https://google.com",
external_id: "123456",
tag_ids: [
"clux0rgak00011...",
],
),
]
res = s.links.create_many(req)
if ! res.anies.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
T::Array[::OpenApiSDK::Operations::RequestBody] | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::BulkCreateLinksResponse)
Bulk update up to 100 links with the same data for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::BulkUpdateLinksRequestBody.new(
data: ::OpenApiSDK::Operations::Data.new(
url: "https://google.com",
tag_ids: [
"clux0rgak00011...",
],
),
)
res = s.links.update_many(req)
if ! res.link_schemas.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::BulkUpdateLinksRequestBody | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::BulkUpdateLinksResponse)
Bulk delete up to 100 links for the authenticated workspace.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::BulkDeleteLinksRequest.new(
link_ids: [
"clux0rgak00011...",
"clux0rgak00022...",
],
)
res = s.links.delete_many(req)
if ! res.object.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::BulkDeleteLinksRequest | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::BulkDeleteLinksResponse)
Upsert a link for the authenticated workspace by its URL. If a link with the same URL already exists, return it (or update it if there are any changes). Otherwise, a new link will be created.
require 'dub'
s = ::OpenApiSDK::Dub.new
s.config_security(
::OpenApiSDK::Shared::Security.new(
token: "DUB_API_KEY",
)
)
req = ::OpenApiSDK::Operations::UpsertLinkRequestBody.new(
url: "https://google.com",
external_id: "123456",
tag_ids: [
"clux0rgak00011...",
],
)
res = s.links.upsert(req)
if ! res.link_schema.nil?
# handle response
end
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::UpsertLinkRequestBody | ✔️ | The request object to use for the request. |