Skip to content

Latest commit

 

History

History
133 lines (90 loc) · 8.2 KB

File metadata and controls

133 lines (90 loc) · 8.2 KB

AllowlistIdentifiers

Overview

Available Operations

  • list - List all identifiers on the allow-list
  • create - Add identifier to the allow-list
  • delete - Delete identifier from allow-list

list

Get a list of all identifiers allowed to sign up to an instance

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.allowlist_identifiers.list(limit: 10, offset: 0)

unless res.allowlist_identifier_list.nil?
  # handle response
end

Parameters

Parameter Type Required Description
paginated Crystalline::Nilable.new(Crystalline::Boolean.new) Whether to paginate the results.
If true, the results will be paginated.
If false, the results will not be paginated.
limit Crystalline::Nilable.new(::Integer) Applies a limit to the number of results returned.
Can be used for paginating the results together with offset.
offset Crystalline::Nilable.new(::Integer) Skip the first offset results when paginating.
Needs to be an integer greater or equal to zero.
To be used in conjunction with limit.

Response

Crystalline::Nilable.new(Models::Operations::ListAllowlistIdentifiersResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 401, 402 application/json
Errors::APIError 4XX, 5XX */*

create

Create an identifier allowed to sign up to an instance

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)

req = Models::Operations::CreateAllowlistIdentifierRequest.new(
  identifier: 'user@example.com',
  notify: true
)
res = s.allowlist_identifiers.create(request: req)

unless res.allowlist_identifier.nil?
  # handle response
end

Parameters

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

Response

Crystalline::Nilable.new(Models::Operations::CreateAllowlistIdentifierResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 400, 402, 422 application/json
Errors::APIError 4XX, 5XX */*

delete

Delete an identifier from the instance allow-list

Example Usage

require 'clerk_sdk_ruby'

Models = ::Clerk::Models
s = ::Clerk::OpenAPIClient.new(
  bearer_auth: '<YOUR_BEARER_TOKEN_HERE>'
)
res = s.allowlist_identifiers.delete(identifier_id: 'example_identifier_id')

unless res.deleted_object.nil?
  # handle response
end

Parameters

Parameter Type Required Description
identifier_id ::String ✔️ The ID of the identifier to delete from the allow-list

Response

Crystalline::Nilable.new(Models::Operations::DeleteAllowlistIdentifierResponse)

Errors

Error Type Status Code Content Type
Models::Errors::ClerkErrors 402, 404 application/json
Errors::APIError 4XX, 5XX */*