Project

dub

0.0
The project is in a healthy, maintained state
Ruby Client SDK Generated by Speakeasy
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme
Dub.co Ruby SDK to interact with APIs.

Dub.co Ruby SDK


Learn more about the Dub.co Ruby SDK in the official documentation.

SDK Installation

gem install dub

SDK Example Usage

Example 1

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: [
  "<value>",
],
)
    
res = s.links.create(req)

if ! res.link_schema.nil?
  # handle response
end

Example 2

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: [
  "<value>",
],
)
    
res = s.links.upsert(req)

if ! res.link_schema.nil?
  # handle response
end

Available Resources and Operations

  • get - Retrieve a QR code
  • retrieve - Retrieve analytics for a link, a domain, or the authenticated workspace.
  • get - Retrieve a workspace
  • update - Update a workspace
  • list - Retrieve a list of tags
  • create - Create a new tag
  • update - Update a tag
  • list - Retrieve a list of domains
  • create - Create a domain
  • delete - Delete a domain
  • update - Update a domain
  • get - Retrieve the metatags for a URL

Server Selection

Server Selection

Select Server by Index

You can override the default server globally by passing a server index to the server_idx: int optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables
0 https://api.dub.co None

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the server_url: str optional parameter when initializing the SDK client instance. For example:

Development

Contributions

While we value open-source contributions to this SDK, this library is generated programmatically. Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release!

SDK Created by Speakeasy