Class: WorkOS::OrganizationDomains
- Inherits:
-
Object
- Object
- WorkOS::OrganizationDomains
- Defined in:
- lib/workos/organization_domains.rb
Instance Method Summary collapse
-
#create_organization_domain(domain:, organization_id:, request_options: {}) ⇒ WorkOS::OrganizationDomain
Create an Organization Domain.
-
#delete_organization_domain(id:, request_options: {}) ⇒ void
Delete an Organization Domain.
-
#get_organization_domain(id:, request_options: {}) ⇒ WorkOS::OrganizationDomainStandAlone
Get an Organization Domain.
-
#initialize(client) ⇒ OrganizationDomains
constructor
A new instance of OrganizationDomains.
-
#verify_organization_domain(id:, request_options: {}) ⇒ WorkOS::OrganizationDomainStandAlone
Verify an Organization Domain.
Constructor Details
#initialize(client) ⇒ OrganizationDomains
Returns a new instance of OrganizationDomains.
9 10 11 |
# File 'lib/workos/organization_domains.rb', line 9 def initialize(client) @client = client end |
Instance Method Details
#create_organization_domain(domain:, organization_id:, request_options: {}) ⇒ WorkOS::OrganizationDomain
Create an Organization Domain
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/workos/organization_domains.rb', line 18 def create_organization_domain( domain:, organization_id:, request_options: {} ) body = { "domain" => domain, "organization_id" => organization_id }.compact response = @client.request( method: :post, path: "/organization_domains", auth: true, body: body, request_options: ) result = WorkOS::OrganizationDomain.new(response.body) result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#delete_organization_domain(id:, request_options: {}) ⇒ void
This method returns an undefined value.
Delete an Organization Domain
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/workos/organization_domains.rb', line 62 def delete_organization_domain( id:, request_options: {} ) @client.request( method: :delete, path: "/organization_domains/#{WorkOS::Util.encode_path(id)}", auth: true, request_options: ) nil end |
#get_organization_domain(id:, request_options: {}) ⇒ WorkOS::OrganizationDomainStandAlone
Get an Organization Domain
43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/workos/organization_domains.rb', line 43 def get_organization_domain( id:, request_options: {} ) response = @client.request( method: :get, path: "/organization_domains/#{WorkOS::Util.encode_path(id)}", auth: true, request_options: ) result = WorkOS::OrganizationDomainStandAlone.new(response.body) result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |
#verify_organization_domain(id:, request_options: {}) ⇒ WorkOS::OrganizationDomainStandAlone
Verify an Organization Domain
79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/workos/organization_domains.rb', line 79 def verify_organization_domain( id:, request_options: {} ) response = @client.request( method: :post, path: "/organization_domains/#{WorkOS::Util.encode_path(id)}/verify", auth: true, request_options: ) result = WorkOS::OrganizationDomainStandAlone.new(response.body) result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) result end |