Skip to content
Open
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
  •  
  •  
  •  
18 changes: 18 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"cliVersion": "5.32.1",
"generatorName": "fernapi/fern-ruby-sdk",
"generatorVersion": "1.12.11",
"generatorConfig": {
"clientModuleName": "Management",
"package-name": "auth0",
"useProvidedDefaults": true,
"enableWireTests": true,
"offsetSemantics": "page-index",
"useDefaultRequestParameterValues": true
},
"originGitCommit": "219914accde9916f411f553a3e3eb35a8478eaaf",
"originGitCommitIsDirty": true,
"invokedBy": "manual",
"requestedVersion": "6.0.0",
"sdkVersion": "6.0.0"
}
120 changes: 120 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Contributing

Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.

## Getting Started

### Prerequisites

- Ruby 3.0+
- Bundler

### Installation

Install the project dependencies:

```bash
bundle install
```

### Building

Build the gem:

```bash
gem build *.gemspec
```

### Testing

Run the test suite:

```bash
bundle exec rspec
```

### Linting and Formatting

Check code style:

```bash
bundle exec rubocop
```

Fix code style issues:

```bash
bundle exec rubocop -a
```

## About Generated Code

**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.

### Generated Files

The following directories contain generated code:
- `lib/` - API client classes and types
- Most Ruby files in the project

### How to Customize

If you need to customize the SDK, you have two options:

#### Option 1: Use `.fernignore`

For custom code that should persist across SDK regenerations:

1. Create a `.fernignore` file in the project root
2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
3. Add your custom code to those files

Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.

For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).

#### Option 2: Contribute to the Generator

If you want to change how code is generated for all users of this SDK:

1. The Ruby SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
2. Generator code is located at `generators/ruby-v2/`
3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
4. Submit a pull request with your changes to the generator

This approach is best for:
- Bug fixes in generated code
- New features that would benefit all users
- Improvements to code generation patterns

## Making Changes

### Workflow

1. Create a new branch for your changes
2. Make your modifications
3. Run tests to ensure nothing breaks: `bundle exec rspec`
4. Run linting: `bundle exec rubocop`
5. Build the gem: `gem build *.gemspec`
6. Commit your changes with a clear commit message
7. Push your branch and create a pull request

### Commit Messages

Write clear, descriptive commit messages that explain what changed and why.

### Code Style

This project uses RuboCop for code formatting. Run `bundle exec rubocop` before committing to ensure your code meets the project's style guidelines.

## Questions or Issues?

If you have questions or run into issues:

1. Check the [Fern documentation](https://buildwithfern.com)
2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
3. Open a new issue if your question hasn't been addressed

## License

By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
389 changes: 388 additions & 1 deletion lib/auth0.rb

Large diffs are not rendered by default.

17 changes: 7 additions & 10 deletions lib/auth0/actions/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,19 @@ def initialize(client:)
# @return [Auth0::Types::ListActionsPaginatedResponseContent]
def list(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[trigger_id action_name deployed page per_page installed]
query_params = {}
query_params["triggerId"] = params[:trigger_id] if params.key?(:trigger_id)
query_params["actionName"] = params[:action_name] if params.key?(:action_name)
query_params["deployed"] = params[:deployed] if params.key?(:deployed)
query_params["page"] = params.fetch(:page, 0)
query_params["per_page"] = params.fetch(:per_page, 50)
query_params["installed"] = params[:installed] if params.key?(:installed)
params.except(*query_param_names)

Auth0::Internal::OffsetItemIterator.new(
initial_page: query_params["page"],
item_field: :actions,
has_next_field: nil,
step: true
step: false
) do |next_page|
query_params["page"] = next_page
request = Auth0::Internal::JSON::Request.new(
Expand All @@ -60,7 +58,8 @@ def list(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::ListActionsPaginatedResponseContent.load(response.body)
parsed_response = Auth0::Types::ListActionsPaginatedResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down Expand Up @@ -153,10 +152,8 @@ def get(request_options: {}, **params)
# @return [untyped]
def delete(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[force]
query_params = {}
query_params["force"] = params[:force] if params.key?(:force)
params = params.except(*query_param_names)

request = Auth0::Internal::JSON::Request.new(
base_url: request_options[:base_url],
Expand All @@ -177,8 +174,8 @@ def delete(request_options: {}, **params)
raise error_class.new(response.body, code: code)
end

# Update an existing action. If this action is currently bound to a trigger, updating it will <strong>not</strong>
# affect any user flows until the action is deployed.
# Update an existing action. If this action is currently bound to a trigger, updating it will **not** affect any
# user flows until the action is deployed.
#
# @param request_options [Hash]
# @param params [Auth0::Actions::Types::UpdateActionRequestContent]
Expand All @@ -193,7 +190,7 @@ def delete(request_options: {}, **params)
def update(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request_data = Auth0::Actions::Types::UpdateActionRequestContent.new(params).to_h
non_body_param_names = ["id"]
non_body_param_names = %w[id]
body = request_data.except(*non_body_param_names)

request = Auth0::Internal::JSON::Request.new(
Expand Down Expand Up @@ -269,7 +266,7 @@ def deploy(request_options: {}, **params)
def test(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request_data = Auth0::Actions::Types::TestActionRequestContent.new(params).to_h
non_body_param_names = ["id"]
non_body_param_names = %w[id]
body = request_data.except(*non_body_param_names)

request = Auth0::Internal::JSON::Request.new(
Expand Down
18 changes: 8 additions & 10 deletions lib/auth0/actions/modules/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@ def initialize(client:)
# @return [Auth0::Types::GetActionModulesResponseContent]
def list(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[page per_page]
query_params = {}
query_params["page"] = params.fetch(:page, 0)
query_params["per_page"] = params.fetch(:per_page, 50)
params.except(*query_param_names)

Auth0::Internal::OffsetItemIterator.new(
initial_page: query_params["page"],
item_field: :modules,
has_next_field: nil,
step: true
step: false
) do |next_page|
query_params["page"] = next_page
request = Auth0::Internal::JSON::Request.new(
Expand All @@ -53,7 +51,8 @@ def list(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::GetActionModulesResponseContent.load(response.body)
parsed_response = Auth0::Types::GetActionModulesResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down Expand Up @@ -176,7 +175,7 @@ def delete(request_options: {}, **params)
def update(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request_data = Auth0::Actions::Modules::Types::UpdateActionModuleRequestContent.new(params).to_h
non_body_param_names = ["id"]
non_body_param_names = %w[id]
body = request_data.except(*non_body_param_names)

request = Auth0::Internal::JSON::Request.new(
Expand Down Expand Up @@ -217,17 +216,15 @@ def update(request_options: {}, **params)
# @return [Auth0::Types::GetActionModuleActionsResponseContent]
def list_actions(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[page per_page]
query_params = {}
query_params["page"] = params.fetch(:page, 0)
query_params["per_page"] = params.fetch(:per_page, 50)
params = params.except(*query_param_names)

Auth0::Internal::OffsetItemIterator.new(
initial_page: query_params["page"],
item_field: :actions,
has_next_field: nil,
step: true
step: false
) do |next_page|
query_params["page"] = next_page
request = Auth0::Internal::JSON::Request.new(
Expand All @@ -244,7 +241,8 @@ def list_actions(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::GetActionModuleActionsResponseContent.load(response.body)
parsed_response = Auth0::Types::GetActionModuleActionsResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand All @@ -268,7 +266,7 @@ def list_actions(request_options: {}, **params)
def rollback(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
request_data = Auth0::Actions::Modules::Types::RollbackActionModuleRequestParameters.new(params).to_h
non_body_param_names = ["id"]
non_body_param_names = %w[id]
body = request_data.except(*non_body_param_names)

request = Auth0::Internal::JSON::Request.new(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ module Modules
module Types
class CreateActionModuleRequestContent < Internal::Types::Model
field :name, -> { String }, optional: false, nullable: false

field :code, -> { String }, optional: false, nullable: false

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

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

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

field :publish, -> { Internal::Types::Boolean }, optional: true, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ module Modules
module Types
class GetActionModuleActionsRequestParameters < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :page, -> { Integer }, optional: true, nullable: false

field :per_page, -> { Integer }, optional: true, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Modules
module Types
class GetActionModulesRequestParameters < Internal::Types::Model
field :page, -> { Integer }, optional: true, nullable: false

field :per_page, -> { Integer }, optional: true, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Modules
module Types
class RollbackActionModuleRequestParameters < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :module_version_id, -> { String }, optional: false, nullable: false
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ module Modules
module Types
class UpdateActionModuleRequestContent < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

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

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

field :dependencies, -> { Internal::Types::Array[Auth0::Types::ActionModuleDependencyRequest] }, optional: true, nullable: false
end
end
Expand Down
7 changes: 3 additions & 4 deletions lib/auth0/actions/modules/versions/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,15 @@ def initialize(client:)
# @return [Auth0::Types::GetActionModuleVersionsResponseContent]
def list(request_options: {}, **params)
params = Auth0::Internal::Types::Utils.normalize_keys(params)
query_param_names = %i[page per_page]
query_params = {}
query_params["page"] = params.fetch(:page, 0)
query_params["per_page"] = params.fetch(:per_page, 50)
params = params.except(*query_param_names)

Auth0::Internal::OffsetItemIterator.new(
initial_page: query_params["page"],
item_field: :versions,
has_next_field: nil,
step: true
step: false
) do |next_page|
query_params["page"] = next_page
request = Auth0::Internal::JSON::Request.new(
Expand All @@ -55,7 +53,8 @@ def list(request_options: {}, **params)
end
code = response.code.to_i
if code.between?(200, 299)
Auth0::Types::GetActionModuleVersionsResponseContent.load(response.body)
parsed_response = Auth0::Types::GetActionModuleVersionsResponseContent.load(response.body)
[parsed_response, response]
else
error_class = Auth0::Errors::ResponseError.subclass_for_code(code)
raise error_class.new(response.body, code: code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ module Versions
module Types
class GetActionModuleVersionsRequestParameters < Internal::Types::Model
field :id, -> { String }, optional: false, nullable: false

field :page, -> { Integer }, optional: true, nullable: false

field :per_page, -> { Integer }, optional: true, nullable: false
end
end
Expand Down
Loading
Loading