Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"offsetSemantics": "page-index",
"useDefaultRequestParameterValues": true
},
"originGitCommit": "116b6ea19a35544baa3e3cf608e45d3990d7cc6e",
"originGitCommit": "7f24c4964990643851db215c3e2f6ff220fca35b",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"sdkVersion": "6.0.1"
"sdkVersion": "6.1.1"
}
8 changes: 7 additions & 1 deletion .fern/replay.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

618 changes: 618 additions & 0 deletions lib/auth0.rb

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/auth0/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ def network_acls
@network_acls ||= Auth0::NetworkACLs::Client.new(client: @raw_client)
end

# @return [Auth0::OrganizationTemplates::Client]
def organization_templates
@organization_templates ||= Auth0::OrganizationTemplates::Client.new(client: @raw_client)
end

# @return [Auth0::Organizations::Client]
def organizations
@organizations ||= Auth0::Organizations::Client.new(client: @raw_client)
Expand Down
2 changes: 2 additions & 0 deletions lib/auth0/clients/types/create_client_request_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class CreateClientRequestContent < Internal::Types::Model

field :express_configuration, -> { Auth0::Types::ExpressConfiguration }, optional: true, nullable: false

field :b2b_integration_configuration, -> { Auth0::Types::B2BIntegrationConfiguration }, optional: true, nullable: false

field :my_organization_configuration, -> { Auth0::Types::ClientMyOrganizationPostConfiguration }, optional: true, nullable: false

field :async_approval_notification_channels, -> { Internal::Types::Array[Auth0::Types::AsyncApprovalNotificationsChannelsEnum] }, optional: true, nullable: false
Expand Down
2 changes: 2 additions & 0 deletions lib/auth0/clients/types/update_client_request_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ class UpdateClientRequestContent < Internal::Types::Model

field :express_configuration, -> { Auth0::Types::ExpressConfigurationOrNull }, optional: true, nullable: false

field :b2b_integration_configuration, -> { Auth0::Types::B2BIntegrationConfiguration }, optional: true, nullable: false

field :my_organization_configuration, -> { Auth0::Types::ClientMyOrganizationPatchConfiguration }, optional: true, nullable: false

field :async_approval_notification_channels, -> { Internal::Types::Array[Auth0::Types::AsyncApprovalNotificationsChannelsEnum] }, optional: true, nullable: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class CreateConnectionProfileRequestContent < Internal::Types::Model

field :strategy_overrides, -> { Auth0::Types::ConnectionProfileStrategyOverrides }, optional: true, nullable: false

field :provisioning, -> { Auth0::Types::ConnectionProfileProvisioning }, optional: true, nullable: false

field :cross_app_access_resource_app, -> { Auth0::Types::ConnectionProfileCrossAppAccessResourceApp }, optional: true, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class UpdateConnectionProfileRequestContent < Internal::Types::Model

field :strategy_overrides, -> { Auth0::Types::ConnectionProfileStrategyOverrides }, optional: true, nullable: false

field :provisioning, -> { Auth0::Types::ConnectionProfileProvisioning }, optional: true, nullable: false

field :cross_app_access_resource_app, -> { Auth0::Types::ConnectionProfileCrossAppAccessResourceApp }, optional: true, nullable: false
end
end
Expand Down
220 changes: 220 additions & 0 deletions lib/auth0/organization_templates/client.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
# frozen_string_literal: true

module Auth0
module OrganizationTemplates
class Client
# @param client [Auth0::Internal::Http::RawClient]
#
# @return [void]
def initialize(client:)
@client = client
end

# Retrieve a list of Organization Templates. This endpoint supports Checkpoint pagination. Results are returned in
# a stable order, sorted by their identifier (`id`) in ascending order.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String, nil] :from
# @option params [Integer, nil] :take
#
# @return [Auth0::Types::ListOrganizationTemplatesPaginatedResponseContent]
def list(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_params = {}
query_params["from"] = params[:from] if params.key?(:from)
query_params["take"] = params.fetch(:take, 5)

Auth0::Internal::CursorItemIterator.new(
cursor_field: :next_,
item_field: :organization_templates,
initial_cursor: query_params["from"]
) do |next_cursor|
query_params["from"] = next_cursor
request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "organization-templates",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
parsed_response = Auth0::Types::ListOrganizationTemplatesPaginatedResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end

# Create an Organization Template.
#
# @param request_options [Hash]
# @param params [Auth0::OrganizationTemplates::Types::CreateOrganizationTemplateRequestContent]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
#
# @return [Auth0::Types::OrganizationTemplate]
def create(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "POST",
path: "organization-templates",
body: Auth0::OrganizationTemplates::Types::CreateOrganizationTemplateRequestContent.new(params).to_h,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::OrganizationTemplate.load(response.body)
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# Retrieve details about a single Organization Template specified by ID.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :id
#
# @return [Auth0::Types::OrganizationTemplate]
def get(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "organization-templates/#{URI.encode_uri_component(params[:id].to_s)}",
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::OrganizationTemplate.load(response.body)
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# Update the details of a specific Organization Template.
#
# @param request_options [Hash]
# @param params [Auth0::OrganizationTemplates::Types::UpdateOrganizationTemplateRequestContent]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :id
#
# @return [Auth0::Types::OrganizationTemplate]
def update(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request_data = Auth0::OrganizationTemplates::Types::UpdateOrganizationTemplateRequestContent.new(params).to_h
non_body_param_names = %w[id]
body = request_data.except(*non_body_param_names)

request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "PATCH",
path: "organization-templates/#{URI.encode_uri_component(params[:id].to_s)}",
body: body,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::OrganizationTemplate.load(response.body)
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end

# Retrieve a list of organizations assigned to an Organization Template. This endpoint supports Checkpoint
# pagination. Results are returned in a stable order, sorted by their identifier (`id`) in ascending order.
#
# @param request_options [Hash]
# @param params [Hash]
# @option request_options [String] :base_url
# @option request_options [Hash{String => Object}] :additional_headers
# @option request_options [Hash{String => Object}] :additional_query_parameters
# @option request_options [Hash{String => Object}] :additional_body_parameters
# @option request_options [Integer] :timeout_in_seconds
# @option params [String] :id
# @option params [String, nil] :from
# @option params [Integer, nil] :take
#
# @return [Auth0::Types::ListTemplateOrganizationsPaginatedResponseContent]
def list_organizations(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_params = {}
query_params["from"] = params[:from] if params.key?(:from)
query_params["take"] = params.fetch(:take, 5)

Auth0::Internal::CursorItemIterator.new(
cursor_field: :next_,
item_field: :organizations,
initial_cursor: query_params["from"]
) do |next_cursor|
query_params["from"] = next_cursor
request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
method: "GET",
path: "organization-templates/#{URI.encode_uri_component(params[:id].to_s)}/organizations",
query: query_params,
request_options: request_options
)
begin
response = @client.send(request)
rescue Net::HTTPRequestTimeout
raise Auth0::Errors::TimeoutError
end
code = response.code.to_i
if code.between?(200, 299)
parsed_response = Auth0::Types::ListTemplateOrganizationsPaginatedResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
end
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# frozen_string_literal: true

module Auth0
module OrganizationTemplates
module Types
class CreateOrganizationTemplateRequestContent < Internal::Types::Model
field :name, -> { String }, optional: false, nullable: false

field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :organization_deletion_behavior, -> { Auth0::Types::OrganizationDeletionBehaviorEnum }, optional: false, nullable: false

field :connection_deletion_behavior, -> { Auth0::Types::ConnectionDeletionBehaviorEnum }, optional: true, nullable: false

field :enforce_permission_ceiling, -> { Internal::Types::Boolean }, optional: false, nullable: false

field :enforce_self_assignment_restriction, -> { Internal::Types::Boolean }, optional: false, nullable: false

field :connection_profile_id, -> { String }, optional: true, nullable: false

field :user_attribute_profile_id, -> { String }, optional: true, nullable: false

field :allowed_strategies, -> { Internal::Types::Array[Auth0::Types::OrganizationTemplateAllowedStrategyEnum] }, optional: true, nullable: false

field :invitation_landing_client_id, -> { String }, optional: true, nullable: false

field :admin_roles_assignment, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :use_for_organization_discovery, -> { Auth0::Types::OrganizationTemplateUseForOrganizationDiscovery }, optional: true, nullable: false

field :role_visibility_policy, -> { Auth0::Types::OrganizationTemplateRoleVisibilityPolicy }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# frozen_string_literal: true

module Auth0
module OrganizationTemplates
module Types
class ListOrganizationTemplatesRequestParameters < Internal::Types::Model
field :from, -> { String }, optional: true, nullable: false

field :take, -> { Integer }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Auth0
module OrganizationTemplates
module Types
class ListTemplateOrganizationsRequestParameters < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :from, -> { String }, optional: true, nullable: false

field :take, -> { Integer }, optional: true, nullable: false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# frozen_string_literal: true

module Auth0
module OrganizationTemplates
module Types
class UpdateOrganizationTemplateRequestContent < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :name, -> { String }, optional: true, nullable: false

field :is_default, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :organization_deletion_behavior, -> { Auth0::Types::OrganizationDeletionBehaviorEnum }, optional: true, nullable: false

field :connection_deletion_behavior, -> { Auth0::Types::ConnectionDeletionBehaviorEnum }, optional: true, nullable: false

field :enforce_permission_ceiling, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :enforce_self_assignment_restriction, -> { Internal::Types::Boolean }, optional: true, nullable: false

field :connection_profile_id, -> { String }, optional: true, nullable: false

field :user_attribute_profile_id, -> { String }, optional: true, nullable: false

field :allowed_strategies, -> { Internal::Types::Array[Auth0::Types::OrganizationTemplateAllowedStrategyEnum] }, optional: true, nullable: false

field :invitation_landing_client_id, -> { String }, optional: true, nullable: false

field :admin_roles_assignment, -> { Internal::Types::Array[String] }, optional: true, nullable: false

field :use_for_organization_discovery, -> { Auth0::Types::OrganizationTemplateUseForOrganizationDiscovery }, optional: true, nullable: false

field :role_visibility_policy, -> { Auth0::Types::OrganizationTemplateRoleVisibilityPolicy }, optional: true, nullable: false
end
end
end
end
Loading
Loading