Skip to content

Latest commit

 

History

History
456 lines (286 loc) · 19.3 KB

README.md

File metadata and controls

456 lines (286 loc) · 19.3 KB

Links

Overview

Available Operations

create

Create a new link for the authenticated workspace.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::CreateLinkRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::CreateLinkResponse)

list

Retrieve a paginated list of links for the authenticated workspace.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::GetLinksRequest ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::GetLinksResponse)

count

Retrieve the number of links for the authenticated workspace.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::GetLinksCountRequest ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::GetLinksCountResponse)

get

Retrieve the info for a link.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::GetLinkInfoRequest ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::GetLinkInfoResponse)

update

Update a link for the authenticated workspace. If there's no change, returns it as it is.

Example Usage

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

Parameters

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

Response

T.nilable(::OpenApiSDK::Operations::UpdateLinkResponse)

delete

Delete a link for the authenticated workspace.

Example Usage

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

Parameters

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_.

Response

T.nilable(::OpenApiSDK::Operations::DeleteLinkResponse)

create_many

Bulk create up to 100 links for the authenticated workspace.

Example Usage

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.link_schemas.nil?
  # handle response
end

Parameters

Parameter Type Required Description
request T::Array[::OpenApiSDK::Operations::RequestBody] ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::BulkCreateLinksResponse)

update_many

Bulk update up to 100 links with the same data for the authenticated workspace.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::BulkUpdateLinksRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::BulkUpdateLinksResponse)

delete_many

Bulk delete up to 100 links for the authenticated workspace.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::BulkDeleteLinksRequest ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::BulkDeleteLinksResponse)

upsert

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.

Example Usage

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

Parameters

Parameter Type Required Description
request ::OpenApiSDK::Operations::UpsertLinkRequestBody ✔️ The request object to use for the request.

Response

T.nilable(::OpenApiSDK::Operations::UpsertLinkResponse)