(domains)
- create - Create a domain
- list - Retrieve a list of domains
- update - Update a domain
- delete - Delete a domain
Create a domain for the authenticated workspace.
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
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::CreateDomainRequestBody | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::CreateDomainResponse)
Retrieve a list of domains associated with the authenticated workspace.
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
Parameter | Type | Required | Description |
---|---|---|---|
request |
::OpenApiSDK::Operations::ListDomainsRequest | ✔️ | The request object to use for the request. |
T.nilable(::OpenApiSDK::Operations::ListDomainsResponse)
Update a domain for the authenticated workspace.
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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
slug |
::String | ✔️ | The domain name. | acme.com |
request_body |
T.nilable(::OpenApiSDK::Operations::UpdateDomainRequestBody) | ➖ | N/A |
T.nilable(::OpenApiSDK::Operations::UpdateDomainResponse)
Delete a domain from a workspace. It cannot be undone. This will also delete all the links associated with the domain.
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
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
slug |
::String | ✔️ | The domain name. | acme.com |