Skip to content

Latest commit

 

History

History
182 lines (114 loc) · 7.68 KB

README.md

File metadata and controls

182 lines (114 loc) · 7.68 KB

Domains

(domains)

Overview

Available Operations

  • create - Create a domain
  • list - Retrieve a list of domains
  • update - Update a domain
  • delete - Delete a domain

create

Create a domain 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::CreateDomainRequestBody.new(
  slug: "acme.com",
  expired_url: "https://acme.com/expired",
  not_found_url: "https://acme.com/not-found",
  archived: false,
  placeholder: "https://dub.co/help/article/what-is-dub",
)
    
res = s.domains.create(req)

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

Parameters

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

Response

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

list

Retrieve a list of domains associated with 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::ListDomainsRequest.new(
  page: 1.0,
  page_size: 50.0,
)
    
res = s.domains.list(req)

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

Parameters

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

Response

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

update

Update a domain 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.domains.update(slug="acme.com", request_body=::OpenApiSDK::Operations::UpdateDomainRequestBody.new(
  slug: "acme.com",
  expired_url: "https://acme.com/expired",
  not_found_url: "https://acme.com/not-found",
  archived: false,
  placeholder: "https://dub.co/help/article/what-is-dub",
))

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

Parameters

Parameter Type Required Description Example
slug ::String ✔️ The domain name. acme.com
request_body T.nilable(::OpenApiSDK::Operations::UpdateDomainRequestBody) N/A

Response

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

delete

Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain.

Example Usage

require 'dub'


s = ::OpenApiSDK::Dub.new
s.config_security(
  ::OpenApiSDK::Shared::Security.new(
    token: "DUB_API_KEY",
  )
)

    
res = s.domains.delete(slug="acme.com")

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

Parameters

Parameter Type Required Description Example
slug ::String ✔️ The domain name. acme.com

Response

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