diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 859e89b7..45371dd5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,5 @@ # See GitHub's docs for more details: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners -# Rubyist Team -* @workos-inc/ruby +# Rubyist and DX Teams +* @workos/ruby @workos/dx diff --git a/.github/renovate.json b/.github/renovate.json deleted file mode 100644 index f45d8f11..00000000 --- a/.github/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": [ - "config:base" - ] -} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bae7d85a..4762d2fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,21 +17,16 @@ jobs: strategy: matrix: ruby: - - '2.7' - - '3.0' - - '3.1' - - '3.2' + - '3.3' + - '3.4' + - '4.0' steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # 1.307.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Rubocop + - name: Test run: | - bundle exec rubocop - - - name: Spec - run: | - bundle exec rspec + bundle exec rake test diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..91c91892 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,49 @@ +name: Publish API Docs +on: + push: + branches: [main] + workflow_dispatch: +permissions: + contents: read +concurrency: + group: pages + cancel-in-progress: false +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # 1.307.0 + with: + bundler-cache: true + - run: ./script/docs + - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0 + - name: Archive site + run: | + tar \ + --dereference --hard-dereference \ + --directory docs/_site \ + -cvf "$RUNNER_TEMP/artifact.tar" \ + --exclude=.git \ + --exclude=.github \ + . + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: github-pages + path: ${{ runner.temp }}/artifact.tar + retention-days: 1 + if-no-files-found: error + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 + id: deployment diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml new file mode 100644 index 00000000..0c9b2bc8 --- /dev/null +++ b/.github/workflows/lint-pr-title.yml @@ -0,0 +1,20 @@ +name: Lint PR Title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..5606ff16 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: + push: + branches: + - 'main' + pull_request: {} + +defaults: + run: + shell: bash + +jobs: + standard: + name: Lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # 1.307.0 + with: + bundler-cache: true + + - name: Run Standardrb + run: | + bundle exec standardrb diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..c5fa9143 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,53 @@ +name: Release Please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - name: Generate token + id: generate-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # 3.2.0 + with: + app-id: ${{ vars.SDK_BOT_APP_ID }} + private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }} + + - uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0 + id: release + with: + token: ${{ steps.generate-token.outputs.token }} + + - name: Update Gemfile.lock on release PR + if: steps.release.outputs.pr + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + ref: ${{ fromJSON(steps.release.outputs.pr).headBranchName }} + token: ${{ steps.generate-token.outputs.token }} + + - name: Set up Ruby + if: steps.release.outputs.pr + uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # 1.307.0 + with: + ruby-version: ruby + + - name: Bundle install and commit + if: steps.release.outputs.pr + run: | + bundle install + if git diff --quiet Gemfile.lock; then + echo "Gemfile.lock is up to date" + else + git config user.name "workos-sdk-automation[bot]" + git config user.email "255426317+workos-sdk-automation[bot]@users.noreply.github.com" + git add Gemfile.lock + git commit -m "chore: update Gemfile.lock" + git push + fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 415ba82c..81188832 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,43 +1,36 @@ name: Release on: - # Support manually pushing a new release - workflow_dispatch: {} - # Trigger when a release is published release: - types: [released] + types: [published] defaults: run: shell: bash jobs: - test: + publish: name: Publish to RubyGems runs-on: ubuntu-latest + permissions: + id-token: write + contents: read steps: - - uses: actions/checkout@v4 - - uses: ruby/setup-ruby@v1 + - name: Configure RubyGems credentials + uses: rubygems/configure-rubygems-credentials@a251ea8ec8e94203b26acddd2010f89b187a44b7 with: - ruby-version: '3.2' - bundler-cache: true - - - name: Spec - run: | - bundle exec rspec - - - name: Publish - env: - RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} - run: | - mkdir -p ~/.gem + role-to-assume: rg_oidc_akr_fn8dx45asckvmsnd2kka - cat << EOF > ~/.gem/credentials - --- - :rubygems_api_key: ${RUBYGEMS_API_KEY} - EOF + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - chmod 0600 ~/.gem/credentials + - name: Setup Ruby + uses: ruby/setup-ruby@6aaa311d81eba98ae12eaffbcb63296ace0efcde # 1.307.0 + with: + bundler-cache: true - bundle exec gem build workos --output=release.gem - bundle exec gem push release.gem + - name: Publish to RubyGems + run: | + VERSION="${GITHUB_REF_NAME#v}" + bundle exec rake build + gem push pkg/workos-${VERSION}.gem --host https://rubygems.org diff --git a/.gitignore b/.gitignore index 03fb3387..c0369d5d 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,6 @@ # .rubocop-https?--* .vscode +.idea/ +docs/_site/ +.yardoc/ diff --git a/.last-synced-sha b/.last-synced-sha new file mode 100644 index 00000000..047fc7ee --- /dev/null +++ b/.last-synced-sha @@ -0,0 +1 @@ +a10d9ecb766d2dd996aecb19aa9c801d78bb7c26 diff --git a/.oagen-manifest.json b/.oagen-manifest.json new file mode 100644 index 00000000..7c73f868 --- /dev/null +++ b/.oagen-manifest.json @@ -0,0 +1,1771 @@ +{ + "version": 2, + "language": "ruby", + "generatedAt": "2026-05-06T22:30:35.198Z", + "files": [ + "lib/workos.rb", + "lib/workos/admin_portal.rb", + "lib/workos/admin_portal/domain_verification_intent_options.rb", + "lib/workos/admin_portal/generate_link.rb", + "lib/workos/admin_portal/intent_options.rb", + "lib/workos/admin_portal/portal_link_response.rb", + "lib/workos/admin_portal/sso_intent_options.rb", + "lib/workos/api_keys.rb", + "lib/workos/api_keys/api_key.rb", + "lib/workos/api_keys/api_key_created.rb", + "lib/workos/api_keys/api_key_created_data.rb", + "lib/workos/api_keys/api_key_created_data_owner.rb", + "lib/workos/api_keys/api_key_owner.rb", + "lib/workos/api_keys/api_key_revoked.rb", + "lib/workos/api_keys/api_key_revoked_data.rb", + "lib/workos/api_keys/api_key_revoked_data_owner.rb", + "lib/workos/api_keys/api_key_validation_response.rb", + "lib/workos/api_keys/create_organization_api_key.rb", + "lib/workos/api_keys/organization_api_key.rb", + "lib/workos/api_keys/organization_api_key_owner.rb", + "lib/workos/api_keys/organization_api_key_with_value.rb", + "lib/workos/api_keys/organization_api_key_with_value_owner.rb", + "lib/workos/api_keys/validate_api_key.rb", + "lib/workos/audit_logs.rb", + "lib/workos/audit_logs/audit_log_action_json.rb", + "lib/workos/audit_logs/audit_log_event.rb", + "lib/workos/audit_logs/audit_log_event_actor.rb", + "lib/workos/audit_logs/audit_log_event_context.rb", + "lib/workos/audit_logs/audit_log_event_create_response.rb", + "lib/workos/audit_logs/audit_log_event_ingestion.rb", + "lib/workos/audit_logs/audit_log_event_target.rb", + "lib/workos/audit_logs/audit_log_export_creation.rb", + "lib/workos/audit_logs/audit_log_export_json.rb", + "lib/workos/audit_logs/audit_log_schema.rb", + "lib/workos/audit_logs/audit_log_schema_actor.rb", + "lib/workos/audit_logs/audit_log_schema_json.rb", + "lib/workos/audit_logs/audit_log_schema_json_actor.rb", + "lib/workos/audit_logs/audit_log_schema_json_target.rb", + "lib/workos/audit_logs/audit_log_schema_target.rb", + "lib/workos/authorization.rb", + "lib/workos/authorization/add_role_permission.rb", + "lib/workos/authorization/assign_role.rb", + "lib/workos/authorization/authorization_check.rb", + "lib/workos/authorization/authorization_permission.rb", + "lib/workos/authorization/authorization_resource.rb", + "lib/workos/authorization/check_authorization.rb", + "lib/workos/authorization/create_authorization_permission.rb", + "lib/workos/authorization/create_authorization_resource.rb", + "lib/workos/authorization/create_organization_role.rb", + "lib/workos/authorization/create_role.rb", + "lib/workos/authorization/permission.rb", + "lib/workos/authorization/permission_created.rb", + "lib/workos/authorization/permission_created_data.rb", + "lib/workos/authorization/permission_deleted.rb", + "lib/workos/authorization/permission_deleted_data.rb", + "lib/workos/authorization/permission_updated.rb", + "lib/workos/authorization/permission_updated_data.rb", + "lib/workos/authorization/remove_role.rb", + "lib/workos/authorization/role.rb", + "lib/workos/authorization/role_created.rb", + "lib/workos/authorization/role_created_data.rb", + "lib/workos/authorization/role_deleted.rb", + "lib/workos/authorization/role_deleted_data.rb", + "lib/workos/authorization/role_list.rb", + "lib/workos/authorization/role_updated.rb", + "lib/workos/authorization/role_updated_data.rb", + "lib/workos/authorization/set_role_permissions.rb", + "lib/workos/authorization/slim_role.rb", + "lib/workos/authorization/update_authorization_permission.rb", + "lib/workos/authorization/update_authorization_resource.rb", + "lib/workos/authorization/update_organization_role.rb", + "lib/workos/authorization/update_role.rb", + "lib/workos/authorization/user_organization_membership_base_list_data.rb", + "lib/workos/authorization/user_role_assignment.rb", + "lib/workos/authorization/user_role_assignment_resource.rb", + "lib/workos/client.rb", + "lib/workos/connect.rb", + "lib/workos/connect/application_credentials_list_item.rb", + "lib/workos/connect/connect_application.rb", + "lib/workos/connect/create_application_secret.rb", + "lib/workos/connect/create_m2m_application.rb", + "lib/workos/connect/create_oauth_application.rb", + "lib/workos/connect/external_auth_complete_response.rb", + "lib/workos/connect/new_connect_application_secret.rb", + "lib/workos/connect/redirect_uri_input.rb", + "lib/workos/connect/update_oauth_application.rb", + "lib/workos/connect/user_consent_option.rb", + "lib/workos/connect/user_consent_option_choice.rb", + "lib/workos/connect/user_management_login_request.rb", + "lib/workos/connect/user_object.rb", + "lib/workos/directory_sync.rb", + "lib/workos/directory_sync/directory.rb", + "lib/workos/directory_sync/directory_group.rb", + "lib/workos/directory_sync/directory_metadata.rb", + "lib/workos/directory_sync/directory_metadata_user.rb", + "lib/workos/directory_sync/directory_user.rb", + "lib/workos/directory_sync/directory_user_email.rb", + "lib/workos/directory_sync/directory_user_with_groups.rb", + "lib/workos/directory_sync/directory_user_with_groups_email.rb", + "lib/workos/directory_sync/dsync_activated.rb", + "lib/workos/directory_sync/dsync_activated_data.rb", + "lib/workos/directory_sync/dsync_activated_data_domain.rb", + "lib/workos/directory_sync/dsync_deactivated.rb", + "lib/workos/directory_sync/dsync_deactivated_data.rb", + "lib/workos/directory_sync/dsync_deactivated_data_domain.rb", + "lib/workos/directory_sync/dsync_deleted.rb", + "lib/workos/directory_sync/dsync_deleted_data.rb", + "lib/workos/directory_sync/dsync_group_created.rb", + "lib/workos/directory_sync/dsync_group_deleted.rb", + "lib/workos/directory_sync/dsync_group_updated.rb", + "lib/workos/directory_sync/dsync_group_updated_data.rb", + "lib/workos/directory_sync/dsync_group_user_added.rb", + "lib/workos/directory_sync/dsync_group_user_added_data.rb", + "lib/workos/directory_sync/dsync_group_user_removed.rb", + "lib/workos/directory_sync/dsync_group_user_removed_data.rb", + "lib/workos/directory_sync/dsync_user_created.rb", + "lib/workos/directory_sync/dsync_user_deleted.rb", + "lib/workos/directory_sync/dsync_user_updated.rb", + "lib/workos/directory_sync/dsync_user_updated_data.rb", + "lib/workos/directory_sync/dsync_user_updated_data_email.rb", + "lib/workos/events.rb", + "lib/workos/events/event_list_list_metadata.rb", + "lib/workos/events/event_schema.rb", + "lib/workos/feature_flags.rb", + "lib/workos/feature_flags/feature_flag.rb", + "lib/workos/feature_flags/feature_flag_owner.rb", + "lib/workos/feature_flags/flag.rb", + "lib/workos/feature_flags/flag_created.rb", + "lib/workos/feature_flags/flag_created_context.rb", + "lib/workos/feature_flags/flag_created_context_actor.rb", + "lib/workos/feature_flags/flag_created_data.rb", + "lib/workos/feature_flags/flag_created_data_owner.rb", + "lib/workos/feature_flags/flag_deleted.rb", + "lib/workos/feature_flags/flag_deleted_context.rb", + "lib/workos/feature_flags/flag_deleted_context_actor.rb", + "lib/workos/feature_flags/flag_deleted_data.rb", + "lib/workos/feature_flags/flag_deleted_data_owner.rb", + "lib/workos/feature_flags/flag_owner.rb", + "lib/workos/feature_flags/flag_rule_updated.rb", + "lib/workos/feature_flags/flag_rule_updated_context.rb", + "lib/workos/feature_flags/flag_rule_updated_context_actor.rb", + "lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb", + "lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb", + "lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb", + "lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb", + "lib/workos/feature_flags/flag_rule_updated_data.rb", + "lib/workos/feature_flags/flag_rule_updated_data_owner.rb", + "lib/workos/feature_flags/flag_updated.rb", + "lib/workos/feature_flags/flag_updated_context.rb", + "lib/workos/feature_flags/flag_updated_context_actor.rb", + "lib/workos/feature_flags/flag_updated_context_previous_attribute.rb", + "lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb", + "lib/workos/feature_flags/flag_updated_data.rb", + "lib/workos/feature_flags/flag_updated_data_owner.rb", + "lib/workos/groups.rb", + "lib/workos/groups/create_group.rb", + "lib/workos/groups/create_group_membership.rb", + "lib/workos/groups/group.rb", + "lib/workos/groups/update_group.rb", + "lib/workos/inflections.rb", + "lib/workos/multi_factor_auth.rb", + "lib/workos/multi_factor_auth/authentication_challenge.rb", + "lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb", + "lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb", + "lib/workos/multi_factor_auth/authentication_factor.rb", + "lib/workos/multi_factor_auth/authentication_factor_enrolled.rb", + "lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb", + "lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb", + "lib/workos/multi_factor_auth/authentication_factor_sms.rb", + "lib/workos/multi_factor_auth/authentication_factor_totp.rb", + "lib/workos/multi_factor_auth/authentication_factors_create_request.rb", + "lib/workos/multi_factor_auth/challenge_authentication_factor.rb", + "lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb", + "lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb", + "lib/workos/organization_domains.rb", + "lib/workos/organization_domains/create_organization_domain.rb", + "lib/workos/organization_domains/organization_domain.rb", + "lib/workos/organization_domains/organization_domain_created.rb", + "lib/workos/organization_domains/organization_domain_created_data.rb", + "lib/workos/organization_domains/organization_domain_deleted.rb", + "lib/workos/organization_domains/organization_domain_deleted_data.rb", + "lib/workos/organization_domains/organization_domain_stand_alone.rb", + "lib/workos/organization_domains/organization_domain_updated.rb", + "lib/workos/organization_domains/organization_domain_updated_data.rb", + "lib/workos/organization_domains/organization_domain_verification_failed.rb", + "lib/workos/organization_domains/organization_domain_verification_failed_data.rb", + "lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb", + "lib/workos/organization_domains/organization_domain_verified.rb", + "lib/workos/organization_domains/organization_domain_verified_data.rb", + "lib/workos/organizations.rb", + "lib/workos/organizations/audit_log_configuration.rb", + "lib/workos/organizations/audit_log_configuration_log_stream.rb", + "lib/workos/organizations/audit_logs_retention_json.rb", + "lib/workos/organizations/organization.rb", + "lib/workos/organizations/organization_created.rb", + "lib/workos/organizations/organization_created_data.rb", + "lib/workos/organizations/organization_created_data_domain.rb", + "lib/workos/organizations/organization_deleted.rb", + "lib/workos/organizations/organization_deleted_data.rb", + "lib/workos/organizations/organization_deleted_data_domain.rb", + "lib/workos/organizations/organization_domain_data.rb", + "lib/workos/organizations/organization_input.rb", + "lib/workos/organizations/organization_membership_created.rb", + "lib/workos/organizations/organization_membership_created_data.rb", + "lib/workos/organizations/organization_membership_deleted.rb", + "lib/workos/organizations/organization_membership_deleted_data.rb", + "lib/workos/organizations/organization_membership_updated.rb", + "lib/workos/organizations/organization_membership_updated_data.rb", + "lib/workos/organizations/organization_role_created.rb", + "lib/workos/organizations/organization_role_created_data.rb", + "lib/workos/organizations/organization_role_deleted.rb", + "lib/workos/organizations/organization_role_deleted_data.rb", + "lib/workos/organizations/organization_role_updated.rb", + "lib/workos/organizations/organization_role_updated_data.rb", + "lib/workos/organizations/organization_updated.rb", + "lib/workos/organizations/organization_updated_data.rb", + "lib/workos/organizations/organization_updated_data_domain.rb", + "lib/workos/organizations/update_audit_logs_retention.rb", + "lib/workos/organizations/update_organization.rb", + "lib/workos/pipes.rb", + "lib/workos/pipes/connected_account.rb", + "lib/workos/pipes/data_integration_access_token_response.rb", + "lib/workos/pipes/data_integration_access_token_response_access_token.rb", + "lib/workos/pipes/data_integration_authorize_url_response.rb", + "lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb", + "lib/workos/pipes/data_integrations_get_user_token_request.rb", + "lib/workos/pipes/data_integrations_list_response.rb", + "lib/workos/pipes/data_integrations_list_response_data.rb", + "lib/workos/pipes/data_integrations_list_response_data_connected_account.rb", + "lib/workos/radar.rb", + "lib/workos/radar/radar_list_entry_already_present_response.rb", + "lib/workos/radar/radar_standalone_assess_request.rb", + "lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb", + "lib/workos/radar/radar_standalone_response.rb", + "lib/workos/radar/radar_standalone_update_radar_attempt_request.rb", + "lib/workos/radar/radar_standalone_update_radar_list_request.rb", + "lib/workos/shared/event_context.rb", + "lib/workos/shared/event_context_actor.rb", + "lib/workos/shared/event_context_google_analytics_session.rb", + "lib/workos/shared/group_created.rb", + "lib/workos/shared/group_deleted.rb", + "lib/workos/shared/group_member_added.rb", + "lib/workos/shared/group_member_added_data.rb", + "lib/workos/shared/group_member_removed.rb", + "lib/workos/shared/group_member_removed_data.rb", + "lib/workos/shared/group_updated.rb", + "lib/workos/shared/waitlist_user.rb", + "lib/workos/shared/waitlist_user_approved.rb", + "lib/workos/shared/waitlist_user_created.rb", + "lib/workos/shared/waitlist_user_denied.rb", + "lib/workos/sso.rb", + "lib/workos/sso/connection.rb", + "lib/workos/sso/connection_activated.rb", + "lib/workos/sso/connection_activated_data.rb", + "lib/workos/sso/connection_activated_data_domain.rb", + "lib/workos/sso/connection_deactivated.rb", + "lib/workos/sso/connection_deactivated_data.rb", + "lib/workos/sso/connection_deactivated_data_domain.rb", + "lib/workos/sso/connection_deleted.rb", + "lib/workos/sso/connection_deleted_data.rb", + "lib/workos/sso/connection_domain.rb", + "lib/workos/sso/connection_option.rb", + "lib/workos/sso/connection_saml_certificate_renewal_required.rb", + "lib/workos/sso/connection_saml_certificate_renewal_required_data.rb", + "lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb", + "lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb", + "lib/workos/sso/connection_saml_certificate_renewed.rb", + "lib/workos/sso/connection_saml_certificate_renewed_data.rb", + "lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb", + "lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb", + "lib/workos/sso/profile.rb", + "lib/workos/sso/sso_authorize_url_response.rb", + "lib/workos/sso/sso_logout_authorize_request.rb", + "lib/workos/sso/sso_logout_authorize_response.rb", + "lib/workos/sso/sso_token_response.rb", + "lib/workos/sso/sso_token_response_oauth_token.rb", + "lib/workos/sso/token_query.rb", + "lib/workos/types/audit_log_configuration_log_stream_state.rb", + "lib/workos/types/audit_log_configuration_log_stream_type.rb", + "lib/workos/types/audit_log_configuration_state.rb", + "lib/workos/types/audit_log_export_json_state.rb", + "lib/workos/types/authenticate_response_authentication_method.rb", + "lib/workos/types/authentication_factor_enrolled_type.rb", + "lib/workos/types/authentication_factor_type.rb", + "lib/workos/types/authentication_factors_create_request_type.rb", + "lib/workos/types/authentication_radar_risk_detected_data_action.rb", + "lib/workos/types/authorization_assignment.rb", + "lib/workos/types/connected_account_state.rb", + "lib/workos/types/connection_activated_data_connection_type.rb", + "lib/workos/types/connection_activated_data_state.rb", + "lib/workos/types/connection_activated_data_status.rb", + "lib/workos/types/connection_deactivated_data_connection_type.rb", + "lib/workos/types/connection_deactivated_data_state.rb", + "lib/workos/types/connection_deactivated_data_status.rb", + "lib/workos/types/connection_deleted_data_connection_type.rb", + "lib/workos/types/connection_deleted_data_state.rb", + "lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb", + "lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb", + "lib/workos/types/connection_state.rb", + "lib/workos/types/connection_status.rb", + "lib/workos/types/connection_type.rb", + "lib/workos/types/connections_connection_type.rb", + "lib/workos/types/create_user_invite_options_locale.rb", + "lib/workos/types/create_user_password_hash_type.rb", + "lib/workos/types/create_webhook_endpoint_events.rb", + "lib/workos/types/data_integration_access_token_response_error.rb", + "lib/workos/types/data_integrations_list_response_data_connected_account_state.rb", + "lib/workos/types/data_integrations_list_response_data_ownership.rb", + "lib/workos/types/directory_state.rb", + "lib/workos/types/directory_type.rb", + "lib/workos/types/directory_user_state.rb", + "lib/workos/types/directory_user_with_groups_state.rb", + "lib/workos/types/dsync_activated_data_state.rb", + "lib/workos/types/dsync_activated_data_type.rb", + "lib/workos/types/dsync_deactivated_data_state.rb", + "lib/workos/types/dsync_deactivated_data_type.rb", + "lib/workos/types/dsync_deleted_data_state.rb", + "lib/workos/types/dsync_deleted_data_type.rb", + "lib/workos/types/dsync_user_updated_data_state.rb", + "lib/workos/types/event_context_actor_source.rb", + "lib/workos/types/flag_created_context_actor_source.rb", + "lib/workos/types/flag_deleted_context_actor_source.rb", + "lib/workos/types/flag_rule_updated_context_access_type.rb", + "lib/workos/types/flag_rule_updated_context_actor_source.rb", + "lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb", + "lib/workos/types/flag_updated_context_actor_source.rb", + "lib/workos/types/generate_link_intent.rb", + "lib/workos/types/invitation_accepted_data_state.rb", + "lib/workos/types/invitation_created_data_state.rb", + "lib/workos/types/invitation_resent_data_state.rb", + "lib/workos/types/invitation_revoked_data_state.rb", + "lib/workos/types/invitation_state.rb", + "lib/workos/types/organization_created_data_domain_state.rb", + "lib/workos/types/organization_created_data_domain_verification_strategy.rb", + "lib/workos/types/organization_deleted_data_domain_state.rb", + "lib/workos/types/organization_deleted_data_domain_verification_strategy.rb", + "lib/workos/types/organization_domain_created_data_state.rb", + "lib/workos/types/organization_domain_created_data_verification_strategy.rb", + "lib/workos/types/organization_domain_data_state.rb", + "lib/workos/types/organization_domain_deleted_data_state.rb", + "lib/workos/types/organization_domain_deleted_data_verification_strategy.rb", + "lib/workos/types/organization_domain_stand_alone_state.rb", + "lib/workos/types/organization_domain_stand_alone_verification_strategy.rb", + "lib/workos/types/organization_domain_state.rb", + "lib/workos/types/organization_domain_updated_data_state.rb", + "lib/workos/types/organization_domain_updated_data_verification_strategy.rb", + "lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb", + "lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb", + "lib/workos/types/organization_domain_verification_failed_data_reason.rb", + "lib/workos/types/organization_domain_verification_strategy.rb", + "lib/workos/types/organization_domain_verified_data_state.rb", + "lib/workos/types/organization_domain_verified_data_verification_strategy.rb", + "lib/workos/types/organization_membership_created_data_status.rb", + "lib/workos/types/organization_membership_deleted_data_status.rb", + "lib/workos/types/organization_membership_status.rb", + "lib/workos/types/organization_membership_updated_data_status.rb", + "lib/workos/types/organization_updated_data_domain_state.rb", + "lib/workos/types/organization_updated_data_domain_verification_strategy.rb", + "lib/workos/types/pagination_order.rb", + "lib/workos/types/profile_connection_type.rb", + "lib/workos/types/radar_action.rb", + "lib/workos/types/radar_standalone_assess_request_action.rb", + "lib/workos/types/radar_standalone_assess_request_auth_method.rb", + "lib/workos/types/radar_standalone_response_blocklist_type.rb", + "lib/workos/types/radar_standalone_response_control.rb", + "lib/workos/types/radar_standalone_response_verdict.rb", + "lib/workos/types/radar_type.rb", + "lib/workos/types/resend_user_invite_options_locale.rb", + "lib/workos/types/role_type.rb", + "lib/workos/types/session_created_data_auth_method.rb", + "lib/workos/types/session_created_data_status.rb", + "lib/workos/types/session_revoked_data_auth_method.rb", + "lib/workos/types/session_revoked_data_status.rb", + "lib/workos/types/sso_provider.rb", + "lib/workos/types/update_user_password_hash_type.rb", + "lib/workos/types/update_webhook_endpoint_events.rb", + "lib/workos/types/update_webhook_endpoint_status.rb", + "lib/workos/types/user_identities_get_item_provider.rb", + "lib/workos/types/user_invite_state.rb", + "lib/workos/types/user_management_authentication_provider.rb", + "lib/workos/types/user_management_authentication_screen_hint.rb", + "lib/workos/types/user_management_organization_membership_statuses.rb", + "lib/workos/types/user_organization_membership_base_list_data_status.rb", + "lib/workos/types/user_organization_membership_status.rb", + "lib/workos/types/user_sessions_auth_method.rb", + "lib/workos/types/user_sessions_status.rb", + "lib/workos/types/vault_byok_key_provider.rb", + "lib/workos/types/vault_data_created_data_actor_source.rb", + "lib/workos/types/vault_data_deleted_data_actor_source.rb", + "lib/workos/types/vault_data_read_data_actor_source.rb", + "lib/workos/types/vault_data_updated_data_actor_source.rb", + "lib/workos/types/vault_dek_decrypted_data_actor_source.rb", + "lib/workos/types/vault_dek_read_data_actor_source.rb", + "lib/workos/types/vault_kek_created_data_actor_source.rb", + "lib/workos/types/vault_metadata_read_data_actor_source.rb", + "lib/workos/types/vault_names_listed_data_actor_source.rb", + "lib/workos/types/waitlist_user_state.rb", + "lib/workos/types/webhook_endpoint_json_status.rb", + "lib/workos/types/widget_session_token_scopes.rb", + "lib/workos/user_management.rb", + "lib/workos/user_management/action_authentication_denied.rb", + "lib/workos/user_management/action_authentication_denied_data.rb", + "lib/workos/user_management/action_user_registration_denied.rb", + "lib/workos/user_management/action_user_registration_denied_data.rb", + "lib/workos/user_management/authenticate_response.rb", + "lib/workos/user_management/authenticate_response_impersonator.rb", + "lib/workos/user_management/authenticate_response_oauth_token.rb", + "lib/workos/user_management/authentication_email_verification_failed.rb", + "lib/workos/user_management/authentication_email_verification_failed_data.rb", + "lib/workos/user_management/authentication_email_verification_failed_data_error.rb", + "lib/workos/user_management/authentication_email_verification_succeeded.rb", + "lib/workos/user_management/authentication_email_verification_succeeded_data.rb", + "lib/workos/user_management/authentication_magic_auth_failed.rb", + "lib/workos/user_management/authentication_magic_auth_failed_data.rb", + "lib/workos/user_management/authentication_magic_auth_failed_data_error.rb", + "lib/workos/user_management/authentication_magic_auth_succeeded.rb", + "lib/workos/user_management/authentication_magic_auth_succeeded_data.rb", + "lib/workos/user_management/authentication_mfa_failed.rb", + "lib/workos/user_management/authentication_mfa_failed_data.rb", + "lib/workos/user_management/authentication_mfa_failed_data_error.rb", + "lib/workos/user_management/authentication_mfa_succeeded.rb", + "lib/workos/user_management/authentication_mfa_succeeded_data.rb", + "lib/workos/user_management/authentication_oauth_failed.rb", + "lib/workos/user_management/authentication_oauth_failed_data.rb", + "lib/workos/user_management/authentication_oauth_failed_data_error.rb", + "lib/workos/user_management/authentication_oauth_succeeded.rb", + "lib/workos/user_management/authentication_oauth_succeeded_data.rb", + "lib/workos/user_management/authentication_passkey_failed.rb", + "lib/workos/user_management/authentication_passkey_failed_data.rb", + "lib/workos/user_management/authentication_passkey_failed_data_error.rb", + "lib/workos/user_management/authentication_passkey_succeeded.rb", + "lib/workos/user_management/authentication_passkey_succeeded_data.rb", + "lib/workos/user_management/authentication_password_failed.rb", + "lib/workos/user_management/authentication_password_failed_data.rb", + "lib/workos/user_management/authentication_password_failed_data_error.rb", + "lib/workos/user_management/authentication_password_succeeded.rb", + "lib/workos/user_management/authentication_password_succeeded_data.rb", + "lib/workos/user_management/authentication_radar_risk_detected.rb", + "lib/workos/user_management/authentication_radar_risk_detected_data.rb", + "lib/workos/user_management/authentication_sso_failed.rb", + "lib/workos/user_management/authentication_sso_failed_data.rb", + "lib/workos/user_management/authentication_sso_failed_data_error.rb", + "lib/workos/user_management/authentication_sso_failed_data_sso.rb", + "lib/workos/user_management/authentication_sso_started.rb", + "lib/workos/user_management/authentication_sso_started_data.rb", + "lib/workos/user_management/authentication_sso_started_data_sso.rb", + "lib/workos/user_management/authentication_sso_succeeded.rb", + "lib/workos/user_management/authentication_sso_succeeded_data.rb", + "lib/workos/user_management/authentication_sso_succeeded_data_sso.rb", + "lib/workos/user_management/authentication_sso_timed_out.rb", + "lib/workos/user_management/authentication_sso_timed_out_data.rb", + "lib/workos/user_management/authentication_sso_timed_out_data_error.rb", + "lib/workos/user_management/authentication_sso_timed_out_data_sso.rb", + "lib/workos/user_management/authorization_code_session_authenticate_request.rb", + "lib/workos/user_management/authorized_connect_application_list_data.rb", + "lib/workos/user_management/confirm_email_change.rb", + "lib/workos/user_management/cors_origin_response.rb", + "lib/workos/user_management/create_cors_origin.rb", + "lib/workos/user_management/create_magic_code_and_return.rb", + "lib/workos/user_management/create_password_reset.rb", + "lib/workos/user_management/create_password_reset_token.rb", + "lib/workos/user_management/create_redirect_uri.rb", + "lib/workos/user_management/create_user.rb", + "lib/workos/user_management/create_user_api_key.rb", + "lib/workos/user_management/create_user_invite_options.rb", + "lib/workos/user_management/create_user_organization_membership.rb", + "lib/workos/user_management/device_authorization_response.rb", + "lib/workos/user_management/device_code_session_authenticate_request.rb", + "lib/workos/user_management/email_change.rb", + "lib/workos/user_management/email_change_confirmation.rb", + "lib/workos/user_management/email_change_confirmation_user.rb", + "lib/workos/user_management/email_verification.rb", + "lib/workos/user_management/email_verification_code_session_authenticate_request.rb", + "lib/workos/user_management/email_verification_created.rb", + "lib/workos/user_management/email_verification_created_data.rb", + "lib/workos/user_management/invitation.rb", + "lib/workos/user_management/invitation_accepted.rb", + "lib/workos/user_management/invitation_accepted_data.rb", + "lib/workos/user_management/invitation_created.rb", + "lib/workos/user_management/invitation_created_data.rb", + "lib/workos/user_management/invitation_resent.rb", + "lib/workos/user_management/invitation_resent_data.rb", + "lib/workos/user_management/invitation_revoked.rb", + "lib/workos/user_management/invitation_revoked_data.rb", + "lib/workos/user_management/jwks_response.rb", + "lib/workos/user_management/jwks_response_keys.rb", + "lib/workos/user_management/jwt_template_response.rb", + "lib/workos/user_management/magic_auth.rb", + "lib/workos/user_management/magic_auth_code_session_authenticate_request.rb", + "lib/workos/user_management/magic_auth_created.rb", + "lib/workos/user_management/magic_auth_created_data.rb", + "lib/workos/user_management/mfa_totp_session_authenticate_request.rb", + "lib/workos/user_management/organization_membership.rb", + "lib/workos/user_management/organization_selection_session_authenticate_request.rb", + "lib/workos/user_management/password_reset.rb", + "lib/workos/user_management/password_reset_created.rb", + "lib/workos/user_management/password_reset_created_data.rb", + "lib/workos/user_management/password_reset_succeeded.rb", + "lib/workos/user_management/password_reset_succeeded_data.rb", + "lib/workos/user_management/password_session_authenticate_request.rb", + "lib/workos/user_management/redirect_uri.rb", + "lib/workos/user_management/refresh_token_session_authenticate_request.rb", + "lib/workos/user_management/resend_user_invite_options.rb", + "lib/workos/user_management/reset_password_response.rb", + "lib/workos/user_management/revoke_session.rb", + "lib/workos/user_management/send_email_change.rb", + "lib/workos/user_management/send_verification_email_response.rb", + "lib/workos/user_management/session_created.rb", + "lib/workos/user_management/session_created_data.rb", + "lib/workos/user_management/session_created_data_impersonator.rb", + "lib/workos/user_management/session_revoked.rb", + "lib/workos/user_management/session_revoked_data.rb", + "lib/workos/user_management/session_revoked_data_impersonator.rb", + "lib/workos/user_management/sso_device_authorization_request.rb", + "lib/workos/user_management/update_jwt_template.rb", + "lib/workos/user_management/update_user.rb", + "lib/workos/user_management/update_user_organization_membership.rb", + "lib/workos/user_management/user.rb", + "lib/workos/user_management/user_api_key.rb", + "lib/workos/user_management/user_api_key_created_data_owner.rb", + "lib/workos/user_management/user_api_key_owner.rb", + "lib/workos/user_management/user_api_key_revoked_data_owner.rb", + "lib/workos/user_management/user_api_key_with_value.rb", + "lib/workos/user_management/user_api_key_with_value_owner.rb", + "lib/workos/user_management/user_created.rb", + "lib/workos/user_management/user_deleted.rb", + "lib/workos/user_management/user_identities_get_item.rb", + "lib/workos/user_management/user_invite.rb", + "lib/workos/user_management/user_organization_membership.rb", + "lib/workos/user_management/user_sessions_impersonator.rb", + "lib/workos/user_management/user_sessions_list_item.rb", + "lib/workos/user_management/user_updated.rb", + "lib/workos/user_management/verify_email_address.rb", + "lib/workos/user_management/verify_email_response.rb", + "lib/workos/user_management_organization_membership_groups.rb", + "lib/workos/vault/vault_byok_key_deleted.rb", + "lib/workos/vault/vault_byok_key_deleted_data.rb", + "lib/workos/vault/vault_byok_key_verification_completed.rb", + "lib/workos/vault/vault_byok_key_verification_completed_data.rb", + "lib/workos/vault/vault_data_created.rb", + "lib/workos/vault/vault_data_created_data.rb", + "lib/workos/vault/vault_data_deleted.rb", + "lib/workos/vault/vault_data_deleted_data.rb", + "lib/workos/vault/vault_data_read.rb", + "lib/workos/vault/vault_data_read_data.rb", + "lib/workos/vault/vault_data_updated.rb", + "lib/workos/vault/vault_data_updated_data.rb", + "lib/workos/vault/vault_dek_decrypted.rb", + "lib/workos/vault/vault_dek_decrypted_data.rb", + "lib/workos/vault/vault_dek_read.rb", + "lib/workos/vault/vault_dek_read_data.rb", + "lib/workos/vault/vault_kek_created.rb", + "lib/workos/vault/vault_kek_created_data.rb", + "lib/workos/vault/vault_metadata_read.rb", + "lib/workos/vault/vault_metadata_read_data.rb", + "lib/workos/vault/vault_names_listed.rb", + "lib/workos/vault/vault_names_listed_data.rb", + "lib/workos/webhooks.rb", + "lib/workos/webhooks/create_webhook_endpoint.rb", + "lib/workos/webhooks/update_webhook_endpoint.rb", + "lib/workos/webhooks/webhook_endpoint_json.rb", + "lib/workos/widgets.rb", + "lib/workos/widgets/widget_session_token.rb", + "lib/workos/widgets/widget_session_token_response.rb", + "rbi/workos/action_authentication_denied.rbi", + "rbi/workos/action_authentication_denied_data.rbi", + "rbi/workos/action_user_registration_denied.rbi", + "rbi/workos/action_user_registration_denied_data.rbi", + "rbi/workos/add_role_permission.rbi", + "rbi/workos/admin_portal.rbi", + "rbi/workos/api_key.rbi", + "rbi/workos/api_key_created.rbi", + "rbi/workos/api_key_created_data.rbi", + "rbi/workos/api_key_created_data_owner.rbi", + "rbi/workos/api_key_owner.rbi", + "rbi/workos/api_key_revoked.rbi", + "rbi/workos/api_key_revoked_data.rbi", + "rbi/workos/api_key_revoked_data_owner.rbi", + "rbi/workos/api_key_validation_response.rbi", + "rbi/workos/api_keys.rbi", + "rbi/workos/application_credentials_list_item.rbi", + "rbi/workos/assign_role.rbi", + "rbi/workos/audit_log_action_json.rbi", + "rbi/workos/audit_log_configuration.rbi", + "rbi/workos/audit_log_configuration_log_stream.rbi", + "rbi/workos/audit_log_event.rbi", + "rbi/workos/audit_log_event_actor.rbi", + "rbi/workos/audit_log_event_context.rbi", + "rbi/workos/audit_log_event_create_response.rbi", + "rbi/workos/audit_log_event_ingestion.rbi", + "rbi/workos/audit_log_event_target.rbi", + "rbi/workos/audit_log_export_creation.rbi", + "rbi/workos/audit_log_export_json.rbi", + "rbi/workos/audit_log_schema.rbi", + "rbi/workos/audit_log_schema_actor.rbi", + "rbi/workos/audit_log_schema_json.rbi", + "rbi/workos/audit_log_schema_json_actor.rbi", + "rbi/workos/audit_log_schema_json_target.rbi", + "rbi/workos/audit_log_schema_target.rbi", + "rbi/workos/audit_logs.rbi", + "rbi/workos/audit_logs_retention_json.rbi", + "rbi/workos/authenticate_response.rbi", + "rbi/workos/authenticate_response_impersonator.rbi", + "rbi/workos/authenticate_response_oauth_token.rbi", + "rbi/workos/authentication_challenge.rbi", + "rbi/workos/authentication_challenge_verify_response.rbi", + "rbi/workos/authentication_challenges_verify_request.rbi", + "rbi/workos/authentication_email_verification_failed.rbi", + "rbi/workos/authentication_email_verification_failed_data.rbi", + "rbi/workos/authentication_email_verification_failed_data_error.rbi", + "rbi/workos/authentication_email_verification_succeeded.rbi", + "rbi/workos/authentication_email_verification_succeeded_data.rbi", + "rbi/workos/authentication_factor.rbi", + "rbi/workos/authentication_factor_enrolled.rbi", + "rbi/workos/authentication_factor_enrolled_sms.rbi", + "rbi/workos/authentication_factor_enrolled_totp.rbi", + "rbi/workos/authentication_factor_sms.rbi", + "rbi/workos/authentication_factor_totp.rbi", + "rbi/workos/authentication_factors_create_request.rbi", + "rbi/workos/authentication_magic_auth_failed.rbi", + "rbi/workos/authentication_magic_auth_failed_data.rbi", + "rbi/workos/authentication_magic_auth_failed_data_error.rbi", + "rbi/workos/authentication_magic_auth_succeeded.rbi", + "rbi/workos/authentication_magic_auth_succeeded_data.rbi", + "rbi/workos/authentication_mfa_failed.rbi", + "rbi/workos/authentication_mfa_failed_data.rbi", + "rbi/workos/authentication_mfa_failed_data_error.rbi", + "rbi/workos/authentication_mfa_succeeded.rbi", + "rbi/workos/authentication_mfa_succeeded_data.rbi", + "rbi/workos/authentication_oauth_failed.rbi", + "rbi/workos/authentication_oauth_failed_data.rbi", + "rbi/workos/authentication_oauth_failed_data_error.rbi", + "rbi/workos/authentication_oauth_succeeded.rbi", + "rbi/workos/authentication_oauth_succeeded_data.rbi", + "rbi/workos/authentication_passkey_failed.rbi", + "rbi/workos/authentication_passkey_failed_data.rbi", + "rbi/workos/authentication_passkey_failed_data_error.rbi", + "rbi/workos/authentication_passkey_succeeded.rbi", + "rbi/workos/authentication_passkey_succeeded_data.rbi", + "rbi/workos/authentication_password_failed.rbi", + "rbi/workos/authentication_password_failed_data.rbi", + "rbi/workos/authentication_password_failed_data_error.rbi", + "rbi/workos/authentication_password_succeeded.rbi", + "rbi/workos/authentication_password_succeeded_data.rbi", + "rbi/workos/authentication_radar_risk_detected.rbi", + "rbi/workos/authentication_radar_risk_detected_data.rbi", + "rbi/workos/authentication_sso_failed.rbi", + "rbi/workos/authentication_sso_failed_data.rbi", + "rbi/workos/authentication_sso_failed_data_error.rbi", + "rbi/workos/authentication_sso_failed_data_sso.rbi", + "rbi/workos/authentication_sso_started.rbi", + "rbi/workos/authentication_sso_started_data.rbi", + "rbi/workos/authentication_sso_started_data_sso.rbi", + "rbi/workos/authentication_sso_succeeded.rbi", + "rbi/workos/authentication_sso_succeeded_data.rbi", + "rbi/workos/authentication_sso_succeeded_data_sso.rbi", + "rbi/workos/authentication_sso_timed_out.rbi", + "rbi/workos/authentication_sso_timed_out_data.rbi", + "rbi/workos/authentication_sso_timed_out_data_error.rbi", + "rbi/workos/authentication_sso_timed_out_data_sso.rbi", + "rbi/workos/authorization.rbi", + "rbi/workos/authorization_check.rbi", + "rbi/workos/authorization_code_session_authenticate_request.rbi", + "rbi/workos/authorization_permission.rbi", + "rbi/workos/authorization_resource.rbi", + "rbi/workos/authorized_connect_application_list_data.rbi", + "rbi/workos/challenge_authentication_factor.rbi", + "rbi/workos/check_authorization.rbi", + "rbi/workos/client.rbi", + "rbi/workos/confirm_email_change.rbi", + "rbi/workos/connect.rbi", + "rbi/workos/connect_application.rbi", + "rbi/workos/connected_account.rbi", + "rbi/workos/connection.rbi", + "rbi/workos/connection_activated.rbi", + "rbi/workos/connection_activated_data.rbi", + "rbi/workos/connection_activated_data_domain.rbi", + "rbi/workos/connection_deactivated.rbi", + "rbi/workos/connection_deactivated_data.rbi", + "rbi/workos/connection_deactivated_data_domain.rbi", + "rbi/workos/connection_deleted.rbi", + "rbi/workos/connection_deleted_data.rbi", + "rbi/workos/connection_domain.rbi", + "rbi/workos/connection_option.rbi", + "rbi/workos/connection_saml_certificate_renewal_required.rbi", + "rbi/workos/connection_saml_certificate_renewal_required_data.rbi", + "rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi", + "rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi", + "rbi/workos/connection_saml_certificate_renewed.rbi", + "rbi/workos/connection_saml_certificate_renewed_data.rbi", + "rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi", + "rbi/workos/connection_saml_certificate_renewed_data_connection.rbi", + "rbi/workos/cors_origin_response.rbi", + "rbi/workos/create_application_secret.rbi", + "rbi/workos/create_authorization_permission.rbi", + "rbi/workos/create_authorization_resource.rbi", + "rbi/workos/create_cors_origin.rbi", + "rbi/workos/create_group.rbi", + "rbi/workos/create_group_membership.rbi", + "rbi/workos/create_m2m_application.rbi", + "rbi/workos/create_magic_code_and_return.rbi", + "rbi/workos/create_oauth_application.rbi", + "rbi/workos/create_organization_api_key.rbi", + "rbi/workos/create_organization_domain.rbi", + "rbi/workos/create_organization_role.rbi", + "rbi/workos/create_password_reset.rbi", + "rbi/workos/create_password_reset_token.rbi", + "rbi/workos/create_redirect_uri.rbi", + "rbi/workos/create_role.rbi", + "rbi/workos/create_user.rbi", + "rbi/workos/create_user_api_key.rbi", + "rbi/workos/create_user_invite_options.rbi", + "rbi/workos/create_user_organization_membership.rbi", + "rbi/workos/create_webhook_endpoint.rbi", + "rbi/workos/data_integration_access_token_response.rbi", + "rbi/workos/data_integration_access_token_response_access_token.rbi", + "rbi/workos/data_integration_authorize_url_response.rbi", + "rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi", + "rbi/workos/data_integrations_get_user_token_request.rbi", + "rbi/workos/data_integrations_list_response.rbi", + "rbi/workos/data_integrations_list_response_data.rbi", + "rbi/workos/data_integrations_list_response_data_connected_account.rbi", + "rbi/workos/device_authorization_response.rbi", + "rbi/workos/device_code_session_authenticate_request.rbi", + "rbi/workos/directory.rbi", + "rbi/workos/directory_group.rbi", + "rbi/workos/directory_metadata.rbi", + "rbi/workos/directory_metadata_user.rbi", + "rbi/workos/directory_sync.rbi", + "rbi/workos/directory_user.rbi", + "rbi/workos/directory_user_email.rbi", + "rbi/workos/directory_user_with_groups.rbi", + "rbi/workos/directory_user_with_groups_email.rbi", + "rbi/workos/domain_verification_intent_options.rbi", + "rbi/workos/dsync_activated.rbi", + "rbi/workos/dsync_activated_data.rbi", + "rbi/workos/dsync_activated_data_domain.rbi", + "rbi/workos/dsync_deactivated.rbi", + "rbi/workos/dsync_deactivated_data.rbi", + "rbi/workos/dsync_deactivated_data_domain.rbi", + "rbi/workos/dsync_deleted.rbi", + "rbi/workos/dsync_deleted_data.rbi", + "rbi/workos/dsync_group_created.rbi", + "rbi/workos/dsync_group_deleted.rbi", + "rbi/workos/dsync_group_updated.rbi", + "rbi/workos/dsync_group_updated_data.rbi", + "rbi/workos/dsync_group_user_added.rbi", + "rbi/workos/dsync_group_user_added_data.rbi", + "rbi/workos/dsync_group_user_removed.rbi", + "rbi/workos/dsync_group_user_removed_data.rbi", + "rbi/workos/dsync_user_created.rbi", + "rbi/workos/dsync_user_deleted.rbi", + "rbi/workos/dsync_user_updated.rbi", + "rbi/workos/dsync_user_updated_data.rbi", + "rbi/workos/dsync_user_updated_data_email.rbi", + "rbi/workos/email_change.rbi", + "rbi/workos/email_change_confirmation.rbi", + "rbi/workos/email_change_confirmation_user.rbi", + "rbi/workos/email_verification.rbi", + "rbi/workos/email_verification_code_session_authenticate_request.rbi", + "rbi/workos/email_verification_created.rbi", + "rbi/workos/email_verification_created_data.rbi", + "rbi/workos/enroll_user_authentication_factor.rbi", + "rbi/workos/event_context.rbi", + "rbi/workos/event_context_actor.rbi", + "rbi/workos/event_context_google_analytics_session.rbi", + "rbi/workos/event_list_list_metadata.rbi", + "rbi/workos/event_schema.rbi", + "rbi/workos/events.rbi", + "rbi/workos/external_auth_complete_response.rbi", + "rbi/workos/feature_flag.rbi", + "rbi/workos/feature_flag_owner.rbi", + "rbi/workos/feature_flags.rbi", + "rbi/workos/flag.rbi", + "rbi/workos/flag_created.rbi", + "rbi/workos/flag_created_context.rbi", + "rbi/workos/flag_created_context_actor.rbi", + "rbi/workos/flag_created_data.rbi", + "rbi/workos/flag_created_data_owner.rbi", + "rbi/workos/flag_deleted.rbi", + "rbi/workos/flag_deleted_context.rbi", + "rbi/workos/flag_deleted_context_actor.rbi", + "rbi/workos/flag_deleted_data.rbi", + "rbi/workos/flag_deleted_data_owner.rbi", + "rbi/workos/flag_owner.rbi", + "rbi/workos/flag_rule_updated.rbi", + "rbi/workos/flag_rule_updated_context.rbi", + "rbi/workos/flag_rule_updated_context_actor.rbi", + "rbi/workos/flag_rule_updated_context_configured_target.rbi", + "rbi/workos/flag_rule_updated_context_configured_target_organization.rbi", + "rbi/workos/flag_rule_updated_context_configured_target_user.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi", + "rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi", + "rbi/workos/flag_rule_updated_data.rbi", + "rbi/workos/flag_rule_updated_data_owner.rbi", + "rbi/workos/flag_updated.rbi", + "rbi/workos/flag_updated_context.rbi", + "rbi/workos/flag_updated_context_actor.rbi", + "rbi/workos/flag_updated_context_previous_attribute.rbi", + "rbi/workos/flag_updated_context_previous_attribute_data.rbi", + "rbi/workos/flag_updated_data.rbi", + "rbi/workos/flag_updated_data_owner.rbi", + "rbi/workos/generate_link.rbi", + "rbi/workos/group.rbi", + "rbi/workos/group_created.rbi", + "rbi/workos/group_deleted.rbi", + "rbi/workos/group_member_added.rbi", + "rbi/workos/group_member_added_data.rbi", + "rbi/workos/group_member_removed.rbi", + "rbi/workos/group_member_removed_data.rbi", + "rbi/workos/group_updated.rbi", + "rbi/workos/groups.rbi", + "rbi/workos/intent_options.rbi", + "rbi/workos/invitation.rbi", + "rbi/workos/invitation_accepted.rbi", + "rbi/workos/invitation_accepted_data.rbi", + "rbi/workos/invitation_created.rbi", + "rbi/workos/invitation_created_data.rbi", + "rbi/workos/invitation_resent.rbi", + "rbi/workos/invitation_resent_data.rbi", + "rbi/workos/invitation_revoked.rbi", + "rbi/workos/invitation_revoked_data.rbi", + "rbi/workos/jwks_response.rbi", + "rbi/workos/jwks_response_keys.rbi", + "rbi/workos/jwt_template_response.rbi", + "rbi/workos/magic_auth.rbi", + "rbi/workos/magic_auth_code_session_authenticate_request.rbi", + "rbi/workos/magic_auth_created.rbi", + "rbi/workos/magic_auth_created_data.rbi", + "rbi/workos/mfa_totp_session_authenticate_request.rbi", + "rbi/workos/multi_factor_auth.rbi", + "rbi/workos/new_connect_application_secret.rbi", + "rbi/workos/organization.rbi", + "rbi/workos/organization_api_key.rbi", + "rbi/workos/organization_api_key_owner.rbi", + "rbi/workos/organization_api_key_with_value.rbi", + "rbi/workos/organization_api_key_with_value_owner.rbi", + "rbi/workos/organization_created.rbi", + "rbi/workos/organization_created_data.rbi", + "rbi/workos/organization_created_data_domain.rbi", + "rbi/workos/organization_deleted.rbi", + "rbi/workos/organization_deleted_data.rbi", + "rbi/workos/organization_deleted_data_domain.rbi", + "rbi/workos/organization_domain.rbi", + "rbi/workos/organization_domain_created.rbi", + "rbi/workos/organization_domain_created_data.rbi", + "rbi/workos/organization_domain_data.rbi", + "rbi/workos/organization_domain_deleted.rbi", + "rbi/workos/organization_domain_deleted_data.rbi", + "rbi/workos/organization_domain_stand_alone.rbi", + "rbi/workos/organization_domain_updated.rbi", + "rbi/workos/organization_domain_updated_data.rbi", + "rbi/workos/organization_domain_verification_failed.rbi", + "rbi/workos/organization_domain_verification_failed_data.rbi", + "rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi", + "rbi/workos/organization_domain_verified.rbi", + "rbi/workos/organization_domain_verified_data.rbi", + "rbi/workos/organization_domains.rbi", + "rbi/workos/organization_input.rbi", + "rbi/workos/organization_membership.rbi", + "rbi/workos/organization_membership_created.rbi", + "rbi/workos/organization_membership_created_data.rbi", + "rbi/workos/organization_membership_deleted.rbi", + "rbi/workos/organization_membership_deleted_data.rbi", + "rbi/workos/organization_membership_updated.rbi", + "rbi/workos/organization_membership_updated_data.rbi", + "rbi/workos/organization_role_created.rbi", + "rbi/workos/organization_role_created_data.rbi", + "rbi/workos/organization_role_deleted.rbi", + "rbi/workos/organization_role_deleted_data.rbi", + "rbi/workos/organization_role_updated.rbi", + "rbi/workos/organization_role_updated_data.rbi", + "rbi/workos/organization_selection_session_authenticate_request.rbi", + "rbi/workos/organization_updated.rbi", + "rbi/workos/organization_updated_data.rbi", + "rbi/workos/organization_updated_data_domain.rbi", + "rbi/workos/organizations.rbi", + "rbi/workos/password_reset.rbi", + "rbi/workos/password_reset_created.rbi", + "rbi/workos/password_reset_created_data.rbi", + "rbi/workos/password_reset_succeeded.rbi", + "rbi/workos/password_reset_succeeded_data.rbi", + "rbi/workos/password_session_authenticate_request.rbi", + "rbi/workos/permission.rbi", + "rbi/workos/permission_created.rbi", + "rbi/workos/permission_created_data.rbi", + "rbi/workos/permission_deleted.rbi", + "rbi/workos/permission_deleted_data.rbi", + "rbi/workos/permission_updated.rbi", + "rbi/workos/permission_updated_data.rbi", + "rbi/workos/pipes.rbi", + "rbi/workos/portal_link_response.rbi", + "rbi/workos/profile.rbi", + "rbi/workos/radar.rbi", + "rbi/workos/radar_list_entry_already_present_response.rbi", + "rbi/workos/radar_standalone_assess_request.rbi", + "rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi", + "rbi/workos/radar_standalone_response.rbi", + "rbi/workos/radar_standalone_update_radar_attempt_request.rbi", + "rbi/workos/radar_standalone_update_radar_list_request.rbi", + "rbi/workos/redirect_uri.rbi", + "rbi/workos/redirect_uri_input.rbi", + "rbi/workos/refresh_token_session_authenticate_request.rbi", + "rbi/workos/remove_role.rbi", + "rbi/workos/resend_user_invite_options.rbi", + "rbi/workos/reset_password_response.rbi", + "rbi/workos/revoke_session.rbi", + "rbi/workos/role.rbi", + "rbi/workos/role_created.rbi", + "rbi/workos/role_created_data.rbi", + "rbi/workos/role_deleted.rbi", + "rbi/workos/role_deleted_data.rbi", + "rbi/workos/role_list.rbi", + "rbi/workos/role_updated.rbi", + "rbi/workos/role_updated_data.rbi", + "rbi/workos/send_email_change.rbi", + "rbi/workos/send_verification_email_response.rbi", + "rbi/workos/session_created.rbi", + "rbi/workos/session_created_data.rbi", + "rbi/workos/session_created_data_impersonator.rbi", + "rbi/workos/session_revoked.rbi", + "rbi/workos/session_revoked_data.rbi", + "rbi/workos/session_revoked_data_impersonator.rbi", + "rbi/workos/set_role_permissions.rbi", + "rbi/workos/slim_role.rbi", + "rbi/workos/sso.rbi", + "rbi/workos/sso_authorize_url_response.rbi", + "rbi/workos/sso_device_authorization_request.rbi", + "rbi/workos/sso_intent_options.rbi", + "rbi/workos/sso_logout_authorize_request.rbi", + "rbi/workos/sso_logout_authorize_response.rbi", + "rbi/workos/sso_token_response.rbi", + "rbi/workos/sso_token_response_oauth_token.rbi", + "rbi/workos/token_query.rbi", + "rbi/workos/update_audit_logs_retention.rbi", + "rbi/workos/update_authorization_permission.rbi", + "rbi/workos/update_authorization_resource.rbi", + "rbi/workos/update_group.rbi", + "rbi/workos/update_jwt_template.rbi", + "rbi/workos/update_oauth_application.rbi", + "rbi/workos/update_organization.rbi", + "rbi/workos/update_organization_role.rbi", + "rbi/workos/update_role.rbi", + "rbi/workos/update_user.rbi", + "rbi/workos/update_user_organization_membership.rbi", + "rbi/workos/update_webhook_endpoint.rbi", + "rbi/workos/user.rbi", + "rbi/workos/user_api_key.rbi", + "rbi/workos/user_api_key_created_data_owner.rbi", + "rbi/workos/user_api_key_owner.rbi", + "rbi/workos/user_api_key_revoked_data_owner.rbi", + "rbi/workos/user_api_key_with_value.rbi", + "rbi/workos/user_api_key_with_value_owner.rbi", + "rbi/workos/user_authentication_factor_enroll_response.rbi", + "rbi/workos/user_consent_option.rbi", + "rbi/workos/user_consent_option_choice.rbi", + "rbi/workos/user_created.rbi", + "rbi/workos/user_deleted.rbi", + "rbi/workos/user_identities_get_item.rbi", + "rbi/workos/user_invite.rbi", + "rbi/workos/user_management.rbi", + "rbi/workos/user_management_login_request.rbi", + "rbi/workos/user_management_organization_membership_groups.rbi", + "rbi/workos/user_object.rbi", + "rbi/workos/user_organization_membership.rbi", + "rbi/workos/user_organization_membership_base_list_data.rbi", + "rbi/workos/user_role_assignment.rbi", + "rbi/workos/user_role_assignment_resource.rbi", + "rbi/workos/user_sessions_impersonator.rbi", + "rbi/workos/user_sessions_list_item.rbi", + "rbi/workos/user_updated.rbi", + "rbi/workos/validate_api_key.rbi", + "rbi/workos/vault_byok_key_deleted.rbi", + "rbi/workos/vault_byok_key_deleted_data.rbi", + "rbi/workos/vault_byok_key_verification_completed.rbi", + "rbi/workos/vault_byok_key_verification_completed_data.rbi", + "rbi/workos/vault_data_created.rbi", + "rbi/workos/vault_data_created_data.rbi", + "rbi/workos/vault_data_deleted.rbi", + "rbi/workos/vault_data_deleted_data.rbi", + "rbi/workos/vault_data_read.rbi", + "rbi/workos/vault_data_read_data.rbi", + "rbi/workos/vault_data_updated.rbi", + "rbi/workos/vault_data_updated_data.rbi", + "rbi/workos/vault_dek_decrypted.rbi", + "rbi/workos/vault_dek_decrypted_data.rbi", + "rbi/workos/vault_dek_read.rbi", + "rbi/workos/vault_dek_read_data.rbi", + "rbi/workos/vault_kek_created.rbi", + "rbi/workos/vault_kek_created_data.rbi", + "rbi/workos/vault_metadata_read.rbi", + "rbi/workos/vault_metadata_read_data.rbi", + "rbi/workos/vault_names_listed.rbi", + "rbi/workos/vault_names_listed_data.rbi", + "rbi/workos/verify_email_address.rbi", + "rbi/workos/verify_email_response.rbi", + "rbi/workos/waitlist_user.rbi", + "rbi/workos/waitlist_user_approved.rbi", + "rbi/workos/waitlist_user_created.rbi", + "rbi/workos/waitlist_user_denied.rbi", + "rbi/workos/webhook_endpoint_json.rbi", + "rbi/workos/webhooks.rbi", + "rbi/workos/widget_session_token.rbi", + "rbi/workos/widget_session_token_response.rbi", + "rbi/workos/widgets.rbi", + "test/workos/test_admin_portal.rb", + "test/workos/test_api_keys.rb", + "test/workos/test_audit_logs.rb", + "test/workos/test_authorization.rb", + "test/workos/test_connect.rb", + "test/workos/test_directory_sync.rb", + "test/workos/test_events.rb", + "test/workos/test_feature_flags.rb", + "test/workos/test_groups.rb", + "test/workos/test_model_round_trip.rb", + "test/workos/test_multi_factor_auth.rb", + "test/workos/test_organization_domains.rb", + "test/workos/test_organizations.rb", + "test/workos/test_pipes.rb", + "test/workos/test_radar.rb", + "test/workos/test_sso.rb", + "test/workos/test_user_management.rb", + "test/workos/test_user_management_organization_membership_groups.rb", + "test/workos/test_webhooks.rb", + "test/workos/test_widgets.rb" + ], + "operations": { + "POST /auth/challenges/{id}/verify": { + "sdkMethod": "verify_challenge", + "service": "multi_factor_auth" + }, + "POST /auth/factors/enroll": { + "sdkMethod": "enroll_factor", + "service": "multi_factor_auth" + }, + "GET /auth/factors/{id}": { + "sdkMethod": "get_factor", + "service": "multi_factor_auth" + }, + "DELETE /auth/factors/{id}": { + "sdkMethod": "delete_factor", + "service": "multi_factor_auth" + }, + "POST /auth/factors/{id}/challenge": { + "sdkMethod": "challenge_factor", + "service": "multi_factor_auth" + }, + "POST /authkit/oauth2/complete": { + "sdkMethod": "complete_oauth2", + "service": "connect" + }, + "POST /authorization/organization_memberships/{organization_membership_id}/check": { + "sdkMethod": "check", + "service": "authorization" + }, + "GET /authorization/organization_memberships/{organization_membership_id}/resources": { + "sdkMethod": "list_resources_for_membership", + "service": "authorization" + }, + "GET /authorization/organization_memberships/{organization_membership_id}/resources/{resource_id}/permissions": { + "sdkMethod": "list_effective_permissions", + "service": "authorization" + }, + "GET /authorization/organization_memberships/{organization_membership_id}/resources/{resource_type_slug}/{external_id}/permissions": { + "sdkMethod": "list_effective_permissions_by_external_id", + "service": "authorization" + }, + "GET /authorization/organization_memberships/{organization_membership_id}/role_assignments": { + "sdkMethod": "list_role_assignments", + "service": "authorization" + }, + "POST /authorization/organization_memberships/{organization_membership_id}/role_assignments": { + "sdkMethod": "assign_role", + "service": "authorization" + }, + "DELETE /authorization/organization_memberships/{organization_membership_id}/role_assignments": { + "sdkMethod": "remove_role", + "service": "authorization" + }, + "DELETE /authorization/organization_memberships/{organization_membership_id}/role_assignments/{role_assignment_id}": { + "sdkMethod": "remove_role_assignment", + "service": "authorization" + }, + "GET /authorization/organizations/{organizationId}/roles": { + "sdkMethod": "list_organization_roles", + "service": "authorization" + }, + "POST /authorization/organizations/{organizationId}/roles": { + "sdkMethod": "create_organization_role", + "service": "authorization" + }, + "GET /authorization/organizations/{organizationId}/roles/{slug}": { + "sdkMethod": "get_organization_role", + "service": "authorization" + }, + "PATCH /authorization/organizations/{organizationId}/roles/{slug}": { + "sdkMethod": "update_organization_role", + "service": "authorization" + }, + "DELETE /authorization/organizations/{organizationId}/roles/{slug}": { + "sdkMethod": "delete_organization_role", + "service": "authorization" + }, + "POST /authorization/organizations/{organizationId}/roles/{slug}/permissions": { + "sdkMethod": "add_organization_role_permission", + "service": "authorization" + }, + "PUT /authorization/organizations/{organizationId}/roles/{slug}/permissions": { + "sdkMethod": "set_organization_role_permissions", + "service": "authorization" + }, + "DELETE /authorization/organizations/{organizationId}/roles/{slug}/permissions/{permissionSlug}": { + "sdkMethod": "remove_organization_role_permission", + "service": "authorization" + }, + "GET /authorization/organizations/{organization_id}/resources/{resource_type_slug}/{external_id}": { + "sdkMethod": "get_resource_by_external_id", + "service": "authorization" + }, + "PATCH /authorization/organizations/{organization_id}/resources/{resource_type_slug}/{external_id}": { + "sdkMethod": "update_resource_by_external_id", + "service": "authorization" + }, + "DELETE /authorization/organizations/{organization_id}/resources/{resource_type_slug}/{external_id}": { + "sdkMethod": "delete_resource_by_external_id", + "service": "authorization" + }, + "GET /authorization/organizations/{organization_id}/resources/{resource_type_slug}/{external_id}/organization_memberships": { + "sdkMethod": "list_memberships_for_resource_by_external_id", + "service": "authorization" + }, + "GET /authorization/organizations/{organization_id}/resources/{resource_type_slug}/{external_id}/role_assignments": { + "sdkMethod": "list_role_assignments_for_resource_by_external_id", + "service": "authorization" + }, + "GET /authorization/resources": { + "sdkMethod": "list_resources", + "service": "authorization" + }, + "POST /authorization/resources": { + "sdkMethod": "create_resource", + "service": "authorization" + }, + "GET /authorization/resources/{resource_id}": { + "sdkMethod": "get_resource", + "service": "authorization" + }, + "PATCH /authorization/resources/{resource_id}": { + "sdkMethod": "update_resource", + "service": "authorization" + }, + "DELETE /authorization/resources/{resource_id}": { + "sdkMethod": "delete_resource", + "service": "authorization" + }, + "GET /authorization/resources/{resource_id}/organization_memberships": { + "sdkMethod": "list_memberships_for_resource", + "service": "authorization" + }, + "GET /authorization/resources/{resource_id}/role_assignments": { + "sdkMethod": "list_role_assignments_for_resource", + "service": "authorization" + }, + "GET /authorization/roles": { + "sdkMethod": "list_environment_roles", + "service": "authorization" + }, + "POST /authorization/roles": { + "sdkMethod": "create_environment_role", + "service": "authorization" + }, + "GET /authorization/roles/{slug}": { + "sdkMethod": "get_environment_role", + "service": "authorization" + }, + "PATCH /authorization/roles/{slug}": { + "sdkMethod": "update_environment_role", + "service": "authorization" + }, + "POST /authorization/roles/{slug}/permissions": { + "sdkMethod": "add_environment_role_permission", + "service": "authorization" + }, + "PUT /authorization/roles/{slug}/permissions": { + "sdkMethod": "set_environment_role_permissions", + "service": "authorization" + }, + "GET /authorization/permissions": { + "sdkMethod": "list_permissions", + "service": "authorization" + }, + "POST /authorization/permissions": { + "sdkMethod": "create_permission", + "service": "authorization" + }, + "GET /authorization/permissions/{slug}": { + "sdkMethod": "get_permission", + "service": "authorization" + }, + "PATCH /authorization/permissions/{slug}": { + "sdkMethod": "update_permission", + "service": "authorization" + }, + "DELETE /authorization/permissions/{slug}": { + "sdkMethod": "delete_permission", + "service": "authorization" + }, + "GET /connect/applications": { + "sdkMethod": "list_applications", + "service": "connect" + }, + "POST /connect/applications": { + "sdkMethod": "create_application", + "service": "connect" + }, + "POST /connect/applications#CreateOAuthApplication": { + "sdkMethod": "create_oauth_application", + "service": "connect" + }, + "POST /connect/applications#CreateM2MApplication": { + "sdkMethod": "create_m2m_application", + "service": "connect" + }, + "GET /connect/applications/{id}": { + "sdkMethod": "get_application", + "service": "connect" + }, + "PUT /connect/applications/{id}": { + "sdkMethod": "update_application", + "service": "connect" + }, + "DELETE /connect/applications/{id}": { + "sdkMethod": "delete_application", + "service": "connect" + }, + "GET /connect/applications/{id}/client_secrets": { + "sdkMethod": "list_application_client_secrets", + "service": "connect" + }, + "POST /connect/applications/{id}/client_secrets": { + "sdkMethod": "create_application_client_secret", + "service": "connect" + }, + "DELETE /connect/client_secrets/{id}": { + "sdkMethod": "delete_client_secret", + "service": "connect" + }, + "GET /connections": { + "sdkMethod": "list_connections", + "service": "sso" + }, + "GET /connections/{id}": { + "sdkMethod": "get_connection", + "service": "sso" + }, + "DELETE /connections/{id}": { + "sdkMethod": "delete_connection", + "service": "sso" + }, + "POST /data-integrations/{slug}/authorize": { + "sdkMethod": "authorize_data_integration", + "service": "pipes" + }, + "POST /data-integrations/{slug}/token": { + "sdkMethod": "create_data_integration_token", + "service": "pipes" + }, + "GET /directories": { + "sdkMethod": "list_directories", + "service": "directory_sync" + }, + "GET /directories/{id}": { + "sdkMethod": "get_directory", + "service": "directory_sync" + }, + "DELETE /directories/{id}": { + "sdkMethod": "delete_directory", + "service": "directory_sync" + }, + "GET /directory_groups": { + "sdkMethod": "list_groups", + "service": "directory_sync" + }, + "GET /directory_groups/{id}": { + "sdkMethod": "get_group", + "service": "directory_sync" + }, + "GET /directory_users": { + "sdkMethod": "list_users", + "service": "directory_sync" + }, + "GET /directory_users/{id}": { + "sdkMethod": "get_user", + "service": "directory_sync" + }, + "GET /events": { + "sdkMethod": "list_events", + "service": "events" + }, + "GET /feature-flags": { + "sdkMethod": "list_feature_flags", + "service": "feature_flags" + }, + "GET /feature-flags/{slug}": { + "sdkMethod": "get_feature_flag", + "service": "feature_flags" + }, + "PUT /feature-flags/{slug}/disable": { + "sdkMethod": "disable_feature_flag", + "service": "feature_flags" + }, + "PUT /feature-flags/{slug}/enable": { + "sdkMethod": "enable_feature_flag", + "service": "feature_flags" + }, + "POST /feature-flags/{slug}/targets/{resourceId}": { + "sdkMethod": "add_flag_target", + "service": "feature_flags" + }, + "DELETE /feature-flags/{slug}/targets/{resourceId}": { + "sdkMethod": "remove_flag_target", + "service": "feature_flags" + }, + "POST /organization_domains": { + "sdkMethod": "create_organization_domain", + "service": "organization_domains" + }, + "GET /organization_domains/{id}": { + "sdkMethod": "get_organization_domain", + "service": "organization_domains" + }, + "DELETE /organization_domains/{id}": { + "sdkMethod": "delete_organization_domain", + "service": "organization_domains" + }, + "POST /organization_domains/{id}/verify": { + "sdkMethod": "verify_organization_domain", + "service": "organization_domains" + }, + "GET /organizations": { + "sdkMethod": "list_organizations", + "service": "organizations" + }, + "POST /organizations": { + "sdkMethod": "create_organization", + "service": "organizations" + }, + "GET /organizations/external_id/{external_id}": { + "sdkMethod": "get_organization_by_external_id", + "service": "organizations" + }, + "GET /organizations/{id}": { + "sdkMethod": "get_organization", + "service": "organizations" + }, + "PUT /organizations/{id}": { + "sdkMethod": "update_organization", + "service": "organizations" + }, + "DELETE /organizations/{id}": { + "sdkMethod": "delete_organization", + "service": "organizations" + }, + "GET /organizations/{id}/audit_log_configuration": { + "sdkMethod": "get_audit_log_configuration", + "service": "organizations" + }, + "GET /organizations/{id}/audit_logs_retention": { + "sdkMethod": "get_organization_audit_logs_retention", + "service": "audit_logs" + }, + "PUT /organizations/{id}/audit_logs_retention": { + "sdkMethod": "update_organization_audit_logs_retention", + "service": "audit_logs" + }, + "GET /organizations/{organizationId}/api_keys": { + "sdkMethod": "list_organization_api_keys", + "service": "api_keys" + }, + "POST /organizations/{organizationId}/api_keys": { + "sdkMethod": "create_organization_api_key", + "service": "api_keys" + }, + "GET /organizations/{organizationId}/feature-flags": { + "sdkMethod": "list_organization_feature_flags", + "service": "feature_flags" + }, + "GET /organizations/{organizationId}/groups": { + "sdkMethod": "list_organization_groups", + "service": "groups" + }, + "POST /organizations/{organizationId}/groups": { + "sdkMethod": "create_organization_group", + "service": "groups" + }, + "GET /organizations/{organizationId}/groups/{groupId}": { + "sdkMethod": "get_organization_group", + "service": "groups" + }, + "PATCH /organizations/{organizationId}/groups/{groupId}": { + "sdkMethod": "update_organization_group", + "service": "groups" + }, + "DELETE /organizations/{organizationId}/groups/{groupId}": { + "sdkMethod": "delete_organization_group", + "service": "groups" + }, + "GET /organizations/{organizationId}/groups/{groupId}/organization-memberships": { + "sdkMethod": "list_group_organization_memberships", + "service": "groups" + }, + "POST /organizations/{organizationId}/groups/{groupId}/organization-memberships": { + "sdkMethod": "create_group_organization_membership", + "service": "groups" + }, + "DELETE /organizations/{organizationId}/groups/{groupId}/organization-memberships/{omId}": { + "sdkMethod": "delete_group_organization_membership", + "service": "groups" + }, + "POST /portal/generate_link": { + "sdkMethod": "generate_link", + "service": "admin_portal" + }, + "POST /radar/attempts": { + "sdkMethod": "create_attempt", + "service": "radar" + }, + "PUT /radar/attempts/{id}": { + "sdkMethod": "update_attempt", + "service": "radar" + }, + "POST /radar/lists/{type}/{action}": { + "sdkMethod": "add_list_entry", + "service": "radar" + }, + "DELETE /radar/lists/{type}/{action}": { + "sdkMethod": "remove_list_entry", + "service": "radar" + }, + "GET /sso/authorize": { + "sdkMethod": "get_authorization_url", + "service": "sso" + }, + "GET /sso/logout": { + "sdkMethod": "get_logout_url", + "service": "sso" + }, + "POST /sso/logout/authorize": { + "sdkMethod": "authorize_logout", + "service": "sso" + }, + "GET /sso/profile": { + "sdkMethod": "get_profile", + "service": "sso" + }, + "POST /sso/token": { + "sdkMethod": "get_profile_and_token", + "service": "sso" + }, + "GET /sso/jwks/{clientId}": { + "sdkMethod": "get_jwks", + "service": "user_management" + }, + "POST /user_management/authenticate": { + "sdkMethod": "create_authenticate", + "service": "user_management" + }, + "POST /user_management/authenticate#PasswordSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_password", + "service": "user_management" + }, + "POST /user_management/authenticate#AuthorizationCodeSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_code", + "service": "user_management" + }, + "POST /user_management/authenticate#RefreshTokenSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_refresh_token", + "service": "user_management" + }, + "POST /user_management/authenticate#MagicAuthCodeSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_magic_auth", + "service": "user_management" + }, + "POST /user_management/authenticate#EmailVerificationCodeSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_email_verification", + "service": "user_management" + }, + "POST /user_management/authenticate#MFATotpSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_totp", + "service": "user_management" + }, + "POST /user_management/authenticate#OrganizationSelectionSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_organization_selection", + "service": "user_management" + }, + "POST /user_management/authenticate#DeviceCodeSessionAuthenticateRequest": { + "sdkMethod": "authenticate_with_device_code", + "service": "user_management" + }, + "GET /user_management/authorize": { + "sdkMethod": "get_authorization_url", + "service": "user_management" + }, + "POST /user_management/authorize/device": { + "sdkMethod": "create_device", + "service": "user_management" + }, + "GET /user_management/sessions/logout": { + "sdkMethod": "get_logout_url", + "service": "user_management" + }, + "POST /user_management/sessions/revoke": { + "sdkMethod": "revoke_session", + "service": "user_management" + }, + "POST /user_management/cors_origins": { + "sdkMethod": "create_cors_origin", + "service": "user_management" + }, + "GET /user_management/email_verification/{id}": { + "sdkMethod": "get_email_verification", + "service": "user_management" + }, + "POST /user_management/password_reset": { + "sdkMethod": "reset_password", + "service": "user_management" + }, + "POST /user_management/password_reset/confirm": { + "sdkMethod": "confirm_password_reset", + "service": "user_management" + }, + "GET /user_management/password_reset/{id}": { + "sdkMethod": "get_password_reset", + "service": "user_management" + }, + "GET /user_management/users": { + "sdkMethod": "list_users", + "service": "user_management" + }, + "POST /user_management/users": { + "sdkMethod": "create_user", + "service": "user_management" + }, + "GET /user_management/users/external_id/{external_id}": { + "sdkMethod": "get_user_by_external_id", + "service": "user_management" + }, + "GET /user_management/users/{id}": { + "sdkMethod": "get_user", + "service": "user_management" + }, + "PUT /user_management/users/{id}": { + "sdkMethod": "update_user", + "service": "user_management" + }, + "DELETE /user_management/users/{id}": { + "sdkMethod": "delete_user", + "service": "user_management" + }, + "POST /user_management/users/{id}/email_change/confirm": { + "sdkMethod": "confirm_email_change", + "service": "user_management" + }, + "POST /user_management/users/{id}/email_change/send": { + "sdkMethod": "send_email_change", + "service": "user_management" + }, + "POST /user_management/users/{id}/email_verification/confirm": { + "sdkMethod": "verify_email", + "service": "user_management" + }, + "POST /user_management/users/{id}/email_verification/send": { + "sdkMethod": "send_verification_email", + "service": "user_management" + }, + "GET /user_management/users/{id}/identities": { + "sdkMethod": "get_user_identities", + "service": "user_management" + }, + "GET /user_management/users/{id}/sessions": { + "sdkMethod": "list_sessions", + "service": "user_management" + }, + "GET /user_management/invitations": { + "sdkMethod": "list_invitations", + "service": "user_management" + }, + "POST /user_management/invitations": { + "sdkMethod": "send_invitation", + "service": "user_management" + }, + "GET /user_management/invitations/by_token/{token}": { + "sdkMethod": "find_invitation_by_token", + "service": "user_management" + }, + "GET /user_management/invitations/{id}": { + "sdkMethod": "get_invitation", + "service": "user_management" + }, + "POST /user_management/invitations/{id}/accept": { + "sdkMethod": "accept_invitation", + "service": "user_management" + }, + "POST /user_management/invitations/{id}/resend": { + "sdkMethod": "resend_invitation", + "service": "user_management" + }, + "POST /user_management/invitations/{id}/revoke": { + "sdkMethod": "revoke_invitation", + "service": "user_management" + }, + "GET /user_management/jwt_template": { + "sdkMethod": "list_jwt_template", + "service": "user_management" + }, + "PUT /user_management/jwt_template": { + "sdkMethod": "update_jwt_template", + "service": "user_management" + }, + "POST /user_management/magic_auth": { + "sdkMethod": "create_magic_auth", + "service": "user_management" + }, + "GET /user_management/magic_auth/{id}": { + "sdkMethod": "get_magic_auth", + "service": "user_management" + }, + "GET /user_management/organization_memberships": { + "sdkMethod": "list_organization_memberships", + "service": "user_management" + }, + "POST /user_management/organization_memberships": { + "sdkMethod": "create_organization_membership", + "service": "user_management" + }, + "GET /user_management/organization_memberships/{id}": { + "sdkMethod": "get_organization_membership", + "service": "user_management" + }, + "PUT /user_management/organization_memberships/{id}": { + "sdkMethod": "update_organization_membership", + "service": "user_management" + }, + "DELETE /user_management/organization_memberships/{id}": { + "sdkMethod": "delete_organization_membership", + "service": "user_management" + }, + "PUT /user_management/organization_memberships/{id}/deactivate": { + "sdkMethod": "deactivate_organization_membership", + "service": "user_management" + }, + "PUT /user_management/organization_memberships/{id}/reactivate": { + "sdkMethod": "reactivate_organization_membership", + "service": "user_management" + }, + "GET /user_management/organization_memberships/{omId}/groups": { + "sdkMethod": "list_organization_membership_groups", + "service": "user_management_organization_membership_groups" + }, + "POST /user_management/redirect_uris": { + "sdkMethod": "create_redirect_uri", + "service": "user_management" + }, + "GET /user_management/users/{userId}/feature-flags": { + "sdkMethod": "list_user_feature_flags", + "service": "feature_flags" + }, + "GET /user_management/users/{user_id}/authorized_applications": { + "sdkMethod": "list_user_authorized_applications", + "service": "user_management" + }, + "DELETE /user_management/users/{user_id}/authorized_applications/{application_id}": { + "sdkMethod": "delete_user_authorized_application", + "service": "user_management" + }, + "GET /user_management/users/{user_id}/connected_accounts/{slug}": { + "sdkMethod": "get_user_connected_account", + "service": "pipes" + }, + "DELETE /user_management/users/{user_id}/connected_accounts/{slug}": { + "sdkMethod": "delete_user_connected_account", + "service": "pipes" + }, + "GET /user_management/users/{user_id}/data_providers": { + "sdkMethod": "list_user_data_providers", + "service": "pipes" + }, + "GET /user_management/users/{userlandUserId}/auth_factors": { + "sdkMethod": "list_user_auth_factors", + "service": "multi_factor_auth" + }, + "POST /user_management/users/{userlandUserId}/auth_factors": { + "sdkMethod": "create_user_auth_factor", + "service": "multi_factor_auth" + }, + "GET /webhook_endpoints": { + "sdkMethod": "list_webhook_endpoints", + "service": "webhooks" + }, + "POST /webhook_endpoints": { + "sdkMethod": "create_webhook_endpoint", + "service": "webhooks" + }, + "PATCH /webhook_endpoints/{id}": { + "sdkMethod": "update_webhook_endpoint", + "service": "webhooks" + }, + "DELETE /webhook_endpoints/{id}": { + "sdkMethod": "delete_webhook_endpoint", + "service": "webhooks" + }, + "POST /widgets/token": { + "sdkMethod": "create_token", + "service": "widgets" + }, + "POST /api_keys/validations": { + "sdkMethod": "create_validation", + "service": "api_keys" + }, + "DELETE /api_keys/{id}": { + "sdkMethod": "delete_api_key", + "service": "api_keys" + }, + "GET /user_management/users/{userId}/api_keys": { + "sdkMethod": "list_user_api_keys", + "service": "user_management" + }, + "POST /user_management/users/{userId}/api_keys": { + "sdkMethod": "create_user_api_key", + "service": "user_management" + }, + "GET /audit_logs/actions": { + "sdkMethod": "list_actions", + "service": "audit_logs" + }, + "GET /audit_logs/actions/{actionName}/schemas": { + "sdkMethod": "list_action_schemas", + "service": "audit_logs" + }, + "POST /audit_logs/actions/{actionName}/schemas": { + "sdkMethod": "create_schema", + "service": "audit_logs" + }, + "POST /audit_logs/events": { + "sdkMethod": "create_event", + "service": "audit_logs" + }, + "POST /audit_logs/exports": { + "sdkMethod": "create_export", + "service": "audit_logs" + }, + "GET /audit_logs/exports/{auditLogExportId}": { + "sdkMethod": "get_export", + "service": "audit_logs" + } + } +} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..c2430e7a --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "8.0.1" +} diff --git a/.rspec b/.rspec deleted file mode 100644 index c99d2e73..00000000 --- a/.rspec +++ /dev/null @@ -1 +0,0 @@ ---require spec_helper diff --git a/.rubocop.yml b/.rubocop.yml deleted file mode 100644 index 655716e2..00000000 --- a/.rubocop.yml +++ /dev/null @@ -1,31 +0,0 @@ -# Disabling due to conflict with Ruby 2.7/3.1 -Layout/BlockAlignment: - Enabled: false -Layout/DotPosition: - EnforcedStyle: trailing -Layout/EmptyLineAfterMagicComment: - Enabled: false -Layout/EmptyLines: - Enabled: false -Layout/LineLength: - IgnoredPatterns: - - 'VCR\.use_cassette' - - '(\A|\s)/.*?/' -Metrics/BlockLength: - ExcludedMethods: ['describe', 'context', 'before'] -Metrics/MethodLength: - Max: 30 -Metrics/ModuleLength: - Max: 200 -Metrics/ParameterLists: - Max: 6 -Naming/ConstantName: - Exclude: - - 'lib/workos/user_management.rb' - - 'lib/workos/types/*.rb' -Style/TrailingCommaInArguments: - EnforcedStyleForMultiline: 'consistent_comma' -Style/TrailingCommaInHashLiteral: - EnforcedStyleForMultiline: 'consistent_comma' -AllCops: - TargetRubyVersion: 2.7 diff --git a/.ruby-version b/.ruby-version index b5021469..b9b3b0de 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.0.2 +3.3.11 diff --git a/.standard.yml b/.standard.yml new file mode 100644 index 00000000..49bff5f1 --- /dev/null +++ b/.standard.yml @@ -0,0 +1 @@ +ruby_version: 3.3 diff --git a/.yardopts b/.yardopts new file mode 100644 index 00000000..9e582e14 --- /dev/null +++ b/.yardopts @@ -0,0 +1,6 @@ +--output-dir docs/_site +--markup markdown +lib/**/*.rb +- +README.md +CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..f6cfc1ab --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,121 @@ +# Changelog + +## [8.0.1](https://github.com/workos/workos-ruby/compare/v8.0.0...v8.0.1) (2026-05-12) + + +### Bug Fixes + +* harden session sealing, log redaction, and webhook tolerance checks ([#482](https://github.com/workos/workos-ruby/issues/482)) ([347fe1e](https://github.com/workos/workos-ruby/commit/347fe1edf296778d7ea331e666a7957870074b9f)) + +## [8.0.0](https://github.com/workos/workos-ruby/compare/v7.1.2...v8.0.0) (2026-05-06) + + +### ⚠ BREAKING CHANGES + +* **authorization:** Consolidate order enums to PaginationOrder +* **api_keys:** Separate organization and user API key types +* **user_management:** Consolidate order enums to PaginationOrder +* **vault:** Add BYOK key deleted event and consolidate key provider enum +* **types:** Consolidate pagination order enums +* **authorization:** Rename RoleAssignment to UserRoleAssignment + +### Features + +* **api_keys:** Separate organization and user API key types ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **authorization:** Add new role assignment listing endpoints ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **authorization:** Consolidate order enums to PaginationOrder ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **authorization:** Rename RoleAssignment to UserRoleAssignment ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **directory_sync:** Add name field to directory users ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **docs:** publish YARD API docs + llms.txt to GitHub Pages ([#480](https://github.com/workos/workos-ruby/issues/480)) ([117eeac](https://github.com/workos/workos-ruby/commit/117eeac5d25c896c7a9b989592f3525f51e52a3d)) +* **events:** Add admin_portal source to event context actor ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **sso:** Add name field to SSO profile ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **types:** Consolidate pagination order enums ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **user_management:** Add get JWT template endpoint ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **user_management:** Add user API key management ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **user_management:** Add user field to membership and organization membership ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **user_management:** Consolidate order enums to PaginationOrder ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) +* **vault:** Add BYOK key deleted event and consolidate key provider enum ([956386a](https://github.com/workos/workos-ruby/commit/956386a27cb0f8a8707442fa98b74a317f3f9920)) + +## [7.1.2](https://github.com/workos/workos-ruby/compare/v7.1.1...v7.1.2) (2026-05-06) + + +### Bug Fixes + +* decode legacy v6 sealed sessions on unseal ([#479](https://github.com/workos/workos-ruby/issues/479)) ([1d8b4aa](https://github.com/workos/workos-ruby/commit/1d8b4aaa26e77e6d7820feb7e2f81278a77b0cf4)) +* replace parameter-group hashes with typed variant classes ([#473](https://github.com/workos/workos-ruby/issues/473)) ([a66c15b](https://github.com/workos/workos-ruby/commit/a66c15b6070ad8c26f0ca0b9ad7414f7b2ce8d8a)) +* set canonical User-Agent header format ([#476](https://github.com/workos/workos-ruby/issues/476)) ([6728358](https://github.com/workos/workos-ruby/commit/67283581886a122f36d907229a71211665623219)) + +## [7.1.1](https://github.com/workos/workos-ruby/compare/v7.1.0...v7.1.1) (2026-04-29) + + +### Bug Fixes + +* seal session client-side in Session#refresh ([#470](https://github.com/workos/workos-ruby/issues/470)) ([32662ab](https://github.com/workos/workos-ruby/commit/32662ab3d67ffdcc895141aa8fd5efb22ba79fdb)) + +## [7.1.0](https://github.com/workos/workos-ruby/compare/v7.0.0...v7.1.0) (2026-04-27) + + +### Features + +* **generated:** update generated SDK from spec changes ([#465](https://github.com/workos/workos-ruby/issues/465)) ([6c145d2](https://github.com/workos/workos-ruby/commit/6c145d2bfec9af8fcffdc5ffe678f452ea925f22)) + + +### Bug Fixes + +* add ruby/setup-ruby to release-please workflow ([aa5ebd0](https://github.com/workos/workos-ruby/commit/aa5ebd0e26edc291f54d92b2f4681a224b0d3889)) +* eagerly load configuration.rb to fix WorkOS.configure ([#467](https://github.com/workos/workos-ruby/issues/467)) ([eea391c](https://github.com/workos/workos-ruby/commit/eea391cd88015373fb89f3b8fbe1dda9c5cfedbe)) +* remove stale URN-prefixed alias files breaking Zeitwerk ([#466](https://github.com/workos/workos-ruby/issues/466)) ([92b2aa5](https://github.com/workos/workos-ruby/commit/92b2aa5166e370bc8f9aaaee22626058d93521a5)) +* update Gemfile.lock in release-please PR and bump action pins ([2aa0574](https://github.com/workos/workos-ruby/commit/2aa0574f3084e79af488c2125adbfc337604a3be)) +* update Zeitwerk autoload for inflections.rb ([#460](https://github.com/workos/workos-ruby/issues/460)) ([4fa1332](https://github.com/workos/workos-ruby/commit/4fa1332f66c14e89c6df8d8d6af6ac8024824b15)) + +## [7.0.0](https://github.com/workos/workos-ruby/compare/v6.2.0...v7.0.0) (2026-04-20) + +This is a major release that introduces a fully redesigned SDK architecture. The SDK is now **generated from the WorkOS OpenAPI spec**, bringing type safety, consistent interfaces, and improved developer ergonomics. + +### High-Level Changes + +- **Client-centric architecture**: The SDK now revolves around an instantiated `WorkOS::Client` rather than module-level service calls. All product areas are accessed through client methods (e.g., `client.organizations`, `client.user_management`, `client.sso`). + +- **Generated request/response models**: Typed models replace raw hashes. Response models no longer inherit from `Hash` — use accessor methods instead of bracket notation. + +- **Per-request overrides**: The new runtime supports `request_options:` for per-request API key, timeout, base URL, and retry overrides — useful for multi-tenant setups. + +- **Minimum Ruby 3.3+**: The minimum Ruby version has been raised to 3.3. + +- **Renamed services and methods**: Several top-level services were renamed (e.g., `WorkOS::Portal` → `client.admin_portal`, `WorkOS::MFA` → `client.multi_factor_auth`). Method signatures now use explicit keyword arguments. + +- **Session management refactor**: AuthKit session sealing, refresh, and authentication flows were overhauled with a dedicated `SessionManager` on the client instance. + +- **New capabilities**: Device code flow, public/PKCE clients, `auto_paging_each` pagination, and `last_response` observability on all responses. + +### Migration Guide + +For detailed instructions on updating your application, see the **[v7 Migration Guide](https://github.com/workos/workos-ruby/blob/main/docs/V7_MIGRATION_GUIDE.md)**. + + +## [6.2.0](https://github.com/workos/workos-ruby/compare/v6.1.0...v6.2.0) (2026-03-06) + + +### Features + +* **user-management:** add directory_managed to OrganizationMembership ([#446](https://github.com/workos/workos-ruby/issues/446)) ([914d824](https://github.com/workos/workos-ruby/commit/914d824668b70950905d5db666978e9609c9f706)) +* **user-management:** add invitation accept endpoint ([#448](https://github.com/workos/workos-ruby/issues/448)) ([b5b4da1](https://github.com/workos/workos-ruby/commit/b5b4da1c031bc5f688562fdc33506e03b769f650)) + + +### Bug Fixes + +* update renovate rules ([#443](https://github.com/workos/workos-ruby/issues/443)) ([f156c79](https://github.com/workos/workos-ruby/commit/f156c799e88269493104628760f94b8abaebf542)) + +## [6.1.0](https://github.com/workos/workos-ruby/compare/workos-v6.0.0...workos/v6.1.0) (2026-02-10) + + +### Features + +* add support for totp_secret ([#300](https://github.com/workos/workos-ruby/issues/300)) ([c0a26bf](https://github.com/workos/workos-ruby/commit/c0a26bf745fb49ebaac7c5241e99d51188b886bb)) +* Include Feature Flags decoded from the JWT in the payload of a Session ([#386](https://github.com/workos/workos-ruby/issues/386)) ([31a0e79](https://github.com/workos/workos-ruby/commit/31a0e7901247652182dcaad95e131357b93d0d71)) +* **workos-ruby:** Add `connection` to `authorization_url` ([#78](https://github.com/workos/workos-ruby/issues/78)) ([c3a0e8e](https://github.com/workos/workos-ruby/commit/c3a0e8e4031a3ee888d925c11f1fd2fb152f0a16)) + + +### Bug Fixes + +* add `invitation_token` parameter to authentication methods ([#438](https://github.com/workos/workos-ruby/issues/438)) ([d24e3dc](https://github.com/workos/workos-ruby/commit/d24e3dc2995de26970415e4570a7ed810d432715)) diff --git a/Gemfile b/Gemfile index 7f4f5e95..fb35914d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,11 @@ # frozen_string_literal: true -source 'https://rubygems.org' +source "https://rubygems.org" gemspec + +group :docs do + gem "yard" + gem "yard-markdown" + gem "webrick" +end diff --git a/Gemfile.lock b/Gemfile.lock index 82bba0eb..562ccdf7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,71 +1,162 @@ PATH remote: . specs: - workos (4.2.1) + workos (8.0.1) + jwt (~> 3.1) + logger (~> 1.7) + zeitwerk (~> 2.6) GEM remote: https://rubygems.org/ specs: - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.0) - ast (2.4.2) - bigdecimal (3.1.7) - crack (1.0.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) + ast (2.4.3) + base64 (0.3.0) + bigdecimal (4.1.2) + crack (1.0.1) bigdecimal rexml - diff-lcs (1.5.1) - hashdiff (1.1.0) - parallel (1.24.0) - parser (3.3.0.5) + csv (3.3.5) + date (3.5.1) + drb (2.2.3) + erb (6.0.4) + hashdiff (1.2.1) + json (2.19.4) + jwt (3.1.2) + base64 + language_server-protocol (3.17.0.5) + lint_roller (1.1.0) + logger (1.7.0) + minitest (6.0.4) + drb (~> 2.0) + prism (~> 1.5) + parallel (1.28.0) + parser (3.3.11.1) ast (~> 2.4.1) racc - public_suffix (5.0.4) - racc (1.7.3) + prism (1.9.0) + psych (5.3.1) + date + stringio + public_suffix (7.0.5) + racc (1.8.1) rainbow (3.1.1) - regexp_parser (2.9.0) - rexml (3.2.6) - rspec (3.9.0) - rspec-core (~> 3.9.0) - rspec-expectations (~> 3.9.0) - rspec-mocks (~> 3.9.0) - rspec-core (3.9.3) - rspec-support (~> 3.9.3) - rspec-expectations (3.9.4) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-mocks (3.9.1) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.9.0) - rspec-support (3.9.4) - rubocop (0.93.1) + rake (13.4.2) + rdoc (7.2.0) + erb + psych (>= 4.0.0) + tsort + regexp_parser (2.12.0) + rexml (3.4.4) + rubocop (1.84.2) + json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 2.7.1.5) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8) - rexml - rubocop-ast (>= 0.6.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.49.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.31.2) - parser (>= 3.3.0.4) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.49.1) + parser (>= 3.3.7.2) + prism (~> 1.7) + rubocop-performance (1.26.1) + lint_roller (~> 1.1) + rubocop (>= 1.75.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (1.13.0) - unicode-display_width (1.8.0) - vcr (5.0.0) - webmock (3.23.0) + standard (1.54.0) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.84.0) + standard-custom (~> 1.0.0) + standard-performance (~> 1.8) + standard-custom (1.0.2) + lint_roller (~> 1.0) + rubocop (~> 1.50) + standard-performance (1.9.0) + lint_roller (~> 1.1) + rubocop-performance (~> 1.26.0) + stringio (3.2.0) + tsort (0.2.0) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.2.0) + webmock (3.26.2) addressable (>= 2.8.0) crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) + webrick (1.9.2) + yard (0.9.43) + yard-markdown (0.7.1) + csv + rdoc + yard + zeitwerk (2.7.5) PLATFORMS + arm64-darwin-25 ruby DEPENDENCIES bundler (>= 2.0.1) - rspec (~> 3.9.0) - rubocop (~> 0.77) - vcr (~> 5.0.0) - webmock + minitest (~> 6.0) + rake + standard (~> 1.49) + webmock (~> 3.26) + webrick workos! + yard + yard-markdown + +CHECKSUMS + addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af + ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383 + base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b + bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd + crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e + csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f + date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0 + drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373 + erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9 + hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1 + json (2.19.4) sha256=670a7d333fb3b18ca5b29cb255eb7bef099e40d88c02c80bd42a3f30fe5239ac + jwt (3.1.2) sha256=af6991f19a6bb4060d618d9add7a66f0eeb005ac0bc017cd01f63b42e122d535 + language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc + lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87 + logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203 + minitest (6.0.4) sha256=df1304664589d40f46089247fdc451f866b0ce0d7cae1457a15fc1eb7d48dca1 + parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970 + parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54 + prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85 + psych (5.3.1) sha256=eb7a57cef10c9d70173ff74e739d843ac3b2c019a003de48447b2963d81b1974 + public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623 + racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f + rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a + rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701 + rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192 + regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb + rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142 + rubocop (1.84.2) sha256=5692cea54168f3dc8cb79a6fe95c5424b7ea893c707ad7a4307b0585e88dbf5f + rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035 + rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834 + ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33 + standard (1.54.0) sha256=7a4b08f83d9893083c8f03bc486f0feeb6a84d48233b40829c03ef4767ea0100 + standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b + standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2 + stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1 + tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f + unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42 + unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f + webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90 + webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131 + workos (8.0.1) + yard (0.9.43) sha256=cf8733a8f0485df2a162927e9b5f182215a61f6d22de096b8f402c726a1c5821 + yard-markdown (0.7.1) sha256=06c378632dfe7ba053be9ba469eb4701aa0470e36bcf7e5546f353eb90c1bfd1 + zeitwerk (2.7.5) sha256=d8da92128c09ea6ec62c949011b00ed4a20242b255293dd66bf41545398f73dd BUNDLED WITH - 2.2.33 + 4.0.3 diff --git a/README.md b/README.md index d365e4b2..8365ac0f 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,209 @@ # WorkOS Ruby Library -The WorkOS library for Ruby provides convenient access to the WorkOS API from applications written in Ruby. +The WorkOS Ruby SDK provides convenient access to the WorkOS API from applications written in Ruby. ## Documentation -See the [API Reference](https://workos.com/docs/reference/client-libraries) for Ruby usage examples. +- [Ruby SDK documentation](https://docs.workos.com/sdk/ruby) +- [API reference](https://workos.com/docs/reference/client-libraries) ## Installation Install the package with: -``` +```sh gem install workos ``` If you're using Bundler to manage your application's gems, add the WorkOS gem to your Gemfile: -``` -source 'https://rubygems.org' +```ruby +source "https://rubygems.org" -gem 'workos' +gem "workos" ``` ## Configuration -To use the library you must provide an API key, located in the WorkOS dashboard, as an environment variable `WORKOS_API_KEY`: +To use the library, provide your WorkOS API key as `WORKOS_API_KEY` and, for AuthKit and SSO flows, your client ID as `WORKOS_CLIENT_ID`: ```sh -$ WORKOS_API_KEY=[your api key] ruby app.rb +WORKOS_API_KEY=sk_test_123 WORKOS_CLIENT_ID=client_123 ruby app.rb ``` -Or, you may set the key yourself, such as in an initializer in your application load path: +Or configure the SDK in an initializer: ```ruby # /config/initializers/workos.rb +require "workos" + WorkOS.configure do |config| - config.key = '[your api key]' + config.api_key = ENV.fetch("WORKOS_API_KEY") + config.client_id = ENV["WORKOS_CLIENT_ID"] config.timeout = 120 + config.logger = Logger.new($stdout) + config.log_level = :info +end + +client = WorkOS.client +``` + +## Client patterns + +### Singleton (recommended for most apps) + +```ruby +WorkOS.configure do |config| + config.api_key = ENV.fetch("WORKOS_API_KEY") + config.client_id = ENV["WORKOS_CLIENT_ID"] +end + +WorkOS.client.organizations.list_organizations +``` + +### Multi-tenant (one client per API key) + +```ruby +tenant_a = WorkOS::Client.new(api_key: "sk_tenant_a", client_id: "client_a") +tenant_b = WorkOS::Client.new(api_key: "sk_tenant_b", client_id: "client_b") + +tenant_a.organizations.list_organizations +tenant_b.organizations.list_organizations +``` + +### Public / PKCE (browser, mobile, CLI) + +```ruby +public_client = WorkOS::PublicClient.create(client_id: "client_123") +url, verifier, state = public_client.user_management.get_authorization_url_with_pkce( + redirect_uri: "https://example.com/callback" +) +``` + +### Fork safety (Puma / Unicorn) + +The SDK caches persistent connections per fiber. After forking, call +`WorkOS.reset_client` (or `client.shutdown`) to close inherited sockets: + +```ruby +# config/puma.rb +on_worker_boot { WorkOS.reset_client } +``` + +## Per-request options + +Every API call accepts `request_options:` for per-call overrides: + +```ruby +organization = WorkOS.client.organizations.get_organization( + id: "org_123", + request_options: { + timeout: 10, + extra_headers: {"X-Request-Source" => "admin"}, + idempotency_key: "org-create-123" + } +) +``` + +`Idempotency-Key` is only sent when you provide `request_options[:idempotency_key]`, or when the SDK retries a mutating request after a transient failure. + +## Usage Examples + +### List organizations + +```ruby +organizations = WorkOS.client.organizations.list_organizations(limit: 10) + +organizations.data.each do |organization| + puts "#{organization.id}: #{organization.name}" +end +``` + +### Get an organization + +```ruby +organization = WorkOS.client.organizations.get_organization(id: "org_123") +puts organization.name +``` + +### Create a user + +```ruby +user = WorkOS.client.user_management.create_user( + email: "marceline@example.com", + first_name: "Marceline", + last_name: "Abadeer" +) + +puts user.id +``` + +### Sealed sessions (cookie_password requirements) + +When you use `client.session_manager` to seal session cookies, the +`cookie_password` you supply must be **at least 32 bytes** of high-entropy +secret material (typically 32 random bytes encoded as base64 or a 64-char +hex string). The SDK derives the AES-256-GCM key from this password via +SHA-256, and a passphrase shorter than 32 bytes makes the resulting key +materially easier to brute-force offline. + +Generate a suitable secret once and store it as an environment variable: + +```sh +ruby -rsecurerandom -e 'puts SecureRandom.base64(32)' +``` + +Anything shorter than 32 bytes (including `nil` or `""`) raises +`ArgumentError` at SDK init time — sealing or unsealing will not silently +proceed with a weakened key. + +### Verify a webhook + +```ruby +payload = request.body.read +signature = request.env.fetch("HTTP_WORKOS_SIGNATURE") +secret = ENV.fetch("WORKOS_WEBHOOK_SECRET") + +event = WorkOS.client.webhooks.construct_event( + payload: payload, + sig_header: signature, + secret: secret +) + +puts event.event +``` + +## Pagination + +List endpoints return `WorkOS::Types::ListStruct`, which supports inspecting pagination metadata or iterating through every record automatically. + +```ruby +users = WorkOS.client.user_management.list_users(limit: 100) + +users.auto_paging_each do |user| + puts user.email +end +``` + +You can also iterate page by page: + +```ruby +users.each_page do |page| + puts page.list_metadata +end +``` + +## Error Handling + +The SDK raises typed errors for API and transport failures. + +```ruby +begin + WorkOS.client.organizations.get_organization(id: "org_123") +rescue WorkOS::APIError => e + warn "#{e.class}: #{e.message}" + warn "status=#{e.http_status} request_id=#{e.request_id} code=#{e.code}" end ``` @@ -45,9 +211,22 @@ end For our SDKs WorkOS follows a Semantic Versioning ([SemVer](https://semver.org/)) process where all releases will have a version X.Y.Z (like 1.0.0) pattern wherein Z would be a bug fix (e.g., 1.0.1), Y would be a minor release (1.1.0) and X would be a major release (2.0.0). We permit any breaking changes to only be released in major versions and strongly recommend reading changelogs before making any major version upgrades. +## Beta Releases + +WorkOS has features in Beta that can be accessed via Beta releases. We would love for you to try these +and share feedback with us before these features reach general availability (GA). To install a Beta version, +please follow the [installation steps](#installation) above using the Beta release version. + +> Note: there can be breaking changes between Beta versions. Therefore, we recommend pinning the package version to a +> specific version. This way you can install the same version each time without breaking changes unless you are +> intentionally looking for the latest Beta version. + +We highly recommend keeping an eye on when the Beta feature you are interested in goes from Beta to stable so that you +can move to using the stable version. + ## More Information -* [Single Sign-On Guide](https://workos.com/docs/sso/guide) -* [Directory Sync Guide](https://workos.com/docs/directory-sync/guide) -* [Admin Portal Guide](https://workos.com/docs/admin-portal/guide) -* [Magic Link Guide](https://workos.com/docs/magic-link/guide) +- [Ruby SDK documentation](https://docs.workos.com/sdk/ruby) +- [Single Sign-On Guide](https://workos.com/docs/sso/guide) +- [Directory Sync Guide](https://workos.com/docs/directory-sync/guide) +- [Admin Portal Guide](https://workos.com/docs/admin-portal/guide) diff --git a/Rakefile b/Rakefile new file mode 100644 index 00000000..b3021e54 --- /dev/null +++ b/Rakefile @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rake/testtask" + +Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/test_*.rb"] +end + +task default: :test diff --git a/context7.json b/context7.json new file mode 100644 index 00000000..ed85fa0f --- /dev/null +++ b/context7.json @@ -0,0 +1,4 @@ +{ + "url": "https://context7.com/workos/workos-ruby", + "public_key": "pk_q7NnKuFFXMWA7WnmjMHQU" +} \ No newline at end of file diff --git a/docs/V7_MIGRATION_GUIDE.md b/docs/V7_MIGRATION_GUIDE.md new file mode 100644 index 00000000..11166fb7 --- /dev/null +++ b/docs/V7_MIGRATION_GUIDE.md @@ -0,0 +1,801 @@ +# WorkOS Ruby SDK v7 Migration Guide + +This guide covers the changes required to migrate from the v6 Ruby SDK to the next major release of `workos`. + +The biggest change is architectural: the SDK is now centered around an instantiated `WorkOS::Client` with client-scoped service accessors, generated request/response models, and a hand-maintained instance-scoped HTTP runtime. + +## Quick Start + +1. Upgrade to Ruby 3.3 or newer. +2. Upgrade the gem: + + ```ruby + gem "workos", "~> 7.0" + ``` + +3. Replace module-style service calls with a `WorkOS::Client` or `WorkOS.client`: + + ```ruby + require "workos" + + WorkOS.configure do |config| + config.api_key = ENV.fetch("WORKOS_API_KEY") + config.client_id = ENV["WORKOS_CLIENT_ID"] + end + + client = WorkOS.client + ``` + +4. Update renamed services, changed method signatures, and changed return types. +5. Re-run your tests and verify auth, session, SSO, webhook, and pagination flows end-to-end. + +--- + +## Ruby and Dependency Requirements + +### Minimum Ruby version is now 3.3+ + +The new SDK requires Ruby 3.3 or newer. + +### Runtime dependencies changed + +- `zeitwerk` is now required. +- `logger` is now a runtime dependency. +- `encryptor` was removed from the main gemspec. + +--- + +## Biggest Conceptual Changes + +### 1. The SDK now revolves around an instantiated client + +Before: + +```ruby +WorkOS.configure do |config| + config.key = ENV["WORKOS_API_KEY"] +end + +organizations = WorkOS::Organizations.list_organizations +``` + +After: + +```ruby +WorkOS.configure do |config| + config.api_key = ENV.fetch("WORKOS_API_KEY") + config.client_id = ENV["WORKOS_CLIENT_ID"] +end + +client = WorkOS.client +organizations = client.organizations.list_organizations +``` + +`WorkOS.configure` still exists, but the configuration object changed and the intended integration style is now a client instance. + +### 2. Most product areas are now accessed through client methods + +Instead of calling module methods like `WorkOS::Organizations.list_organizations` or `WorkOS::Portal.generate_link`, you now call lazy client accessors: + +- `client.organizations` +- `client.user_management` +- `client.sso` +- `client.directory_sync` +- `client.multi_factor_auth` +- `client.admin_portal` +- `client.audit_logs` +- `client.authorization` +- `client.webhooks` +- `client.passwordless` + +### 3. The runtime is instance-scoped and supports per-request overrides + +The new runtime stores credentials, base URL, timeout, retry settings, and service wiring on the client instance. + +Methods now consistently accept: + +```ruby +request_options: { + api_key: "sk_...", # per-request API key override (useful for multi-tenant) + timeout: 10, + base_url: "https://api.workos.com", + max_retries: 1, + idempotency_key: "org-create-123", + extra_headers: {"X-Request-Source" => "admin"} +} +``` + +If your integration depended on global mutable config being the source of truth for requests, review that code carefully. + +### 4. AuthKit and session helpers moved to client-based helpers + +Before: + +```ruby +session = WorkOS::UserManagement.load_sealed_session( + client_id: client_id, + session_data: session_data, + cookie_password: cookie_password +) +``` + +After: + +```ruby +client = WorkOS::Client.new( + api_key: ENV.fetch("WORKOS_API_KEY"), + client_id: ENV.fetch("WORKOS_CLIENT_ID") +) + +session = client.session_manager.load( + seal_data: session_data, + cookie_password: cookie_password +) +``` + +If you use AuthKit session sealing, refresh, PKCE, or logout helpers, review those flows carefully. + +--- + +## Breaking Changes by Area + +### Client bootstrap and configuration + +#### Configuration field names changed + +Before: + +```ruby +WorkOS.configure do |config| + config.key = ENV["WORKOS_API_KEY"] + config.api_hostname = "api.workos.com" +end +``` + +After: + +```ruby +WorkOS.configure do |config| + config.api_key = ENV.fetch("WORKOS_API_KEY") + config.base_url = "https://api.workos.com" # default + config.client_id = ENV["WORKOS_CLIENT_ID"] + config.timeout = 30 # default; seconds per request + config.max_retries = 2 # default; set to 0 to disable retries + config.logger = Logger.new($stdout) # optional; enables request logging + config.log_level = :info # optional; :debug, :info, :warn, :error +end +``` + +**Note:** In v6, `Configuration` auto-populated `api_key` from `ENV["WORKOS_API_KEY"]` (and legacy `ENV["WORKOS_KEY"]`). In v7 you must set `config.api_key` explicitly. + +#### Fork safety: `reset_client` and `shutdown` + +If you run a forking web server (Puma, Unicorn), reset the cached client in the worker boot hook to avoid sharing sockets across forked processes: + +```ruby +# config/puma.rb +on_worker_boot do + WorkOS.reset_client +end +``` + +If you manage your own `WorkOS::Client` instance, call `client.shutdown` before forking to close persistent connections on the current fiber/thread. + +#### Direct module-style service access is no longer the default integration pattern + +Code like this should be removed: + +```ruby +WorkOS::Organizations.list_organizations +WorkOS::Portal.generate_link(...) +WorkOS::MFA.verify_challenge(...) +WorkOS::UserManagement.authenticate_with_code(...) +``` + +Use the client methods instead: + +```ruby +client.organizations.list_organizations +client.admin_portal.generate_link(...) +client.multi_factor_auth.verify_challenge(...) +client.user_management.authenticate_with_code(...) +``` + +### Service renames and access patterns + +#### Several top-level service names changed + +Update these references: + +- `WorkOS::Portal` -> `client.admin_portal` +- `WorkOS::MFA` -> `client.multi_factor_auth` +- `WorkOS::Organizations` -> `client.organizations` +- `WorkOS::UserManagement` -> `client.user_management` +- `WorkOS::DirectorySync` -> `client.directory_sync` +- `WorkOS::AuditLogs` -> `client.audit_logs` + +#### Non-spec helpers are still available, but they moved behind the client + +Helpers for PKCE, public clients, passwordless, vault, and session management still exist, but they are no longer organized the same way as the v5 surface. + +Examples: + +```ruby +client.session_manager +client.passwordless +client.pkce +WorkOS::PublicClient.create(client_id: "client_123") +``` + +### Method signatures + +#### Many methods moved from option hashes or old keywords to explicit named arguments + +Before: + +```ruby +WorkOS::Organizations.list_organizations(after: "org_123", limit: 25) +WorkOS::Organizations.update_organization(organization: "org_123", name: "Acme") +``` + +After: + +```ruby +client.organizations.list_organizations(after: "org_123", limit: 25) +client.organizations.update_organization(id: "org_123", name: "Acme") +``` + +Notable signature changes: + +- `update_organization(organization: ...)` -> `update_organization(id: ...)` +- mutating calls now take `request_options:` instead of ad hoc transport arguments like `idempotency_key:` +- auth helpers infer `client_id` and `client_secret` from the client instead of requiring them on every call + +#### Auth helper signatures changed substantially + +Before: + +```ruby +response = WorkOS::UserManagement.authenticate_with_code( + code: code, + client_id: client_id, + ip_address: ip_address, + user_agent: user_agent, + session: { seal_session: true, cookie_password: cookie_password } +) +``` + +After: + +```ruby +response = client.user_management.authenticate_with_code( + code: code, + ip_address: ip_address, + device_id: device_id, + user_agent: user_agent, + request_options: {} +) +``` + +Review all usages of: + +- `authenticate_with_code` +- `authenticate_with_password` +- `authenticate_with_refresh_token` +- `authenticate_with_magic_auth` +- `authenticate_with_email_verification` +- `authenticate_with_totp` +- `authenticate_with_organization_selection` +- `authenticate_with_device_code` +- `authenticate_with_code_pkce` (hand-maintained) + +#### `get_jwks_url` signature changed + +`get_jwks_url` changed from a positional argument to a keyword argument: + +```ruby +# Before +url = WorkOS::UserManagement.get_jwks_url("client_123") + +# After +url = client.user_management.get_jwks_url(client_id: "client_123") +# client_id defaults to the client instance's client_id if omitted +``` + +#### Authorization URL helpers were renamed + +Before: + +```ruby +WorkOS::UserManagement.authorization_url(...) +WorkOS::SSO.authorization_url(...) +``` + +After: + +```ruby +client.user_management.get_authorization_url(...) +client.user_management.get_authorization_url_with_pkce(...) +client.sso.get_authorization_url(...) +client.sso.get_authorization_url_with_pkce(...) +``` + +### Return types and models + +#### Some methods now return typed models instead of primitives + +Before: + +```ruby +link = WorkOS::Portal.generate_link( + intent: "sso", + organization: "org_123" +) +``` + +After: + +```ruby +response = client.admin_portal.generate_link( + organization: "org_123", + intent: "sso" +) + +link = response.link +``` + +If your code expects a raw string or hash, check the return type again. + +#### Some auth and MFA model class names changed + +Examples: + +- `WorkOS::AuthenticationResponse` -> `WorkOS::AuthenticateResponse` +- `WorkOS::RefreshAuthenticationResponse` -> folded into `WorkOS::AuthenticateResponse` +- `WorkOS::ProfileAndToken` -> `WorkOS::SSOTokenResponse` +- `WorkOS::Factor` -> `WorkOS::AuthenticationFactor` +- `WorkOS::Challenge` -> `WorkOS::AuthenticationChallenge` +- `WorkOS::VerifyChallenge` -> `WorkOS::AuthenticationChallengeVerifyResponse` +- `WorkOS::AuthenticationFactorAndChallenge` -> `WorkOS::AuthenticationFactorEnrolled` (factor fields) + `WorkOS::AuthenticationChallenge` (challenge fields) +- `WorkOS::WorkOSError` -> `WorkOS::Error` + +If your code imports, type-checks, or pattern matches on these classes, update those references. In particular, any `rescue WorkOS::WorkOSError` must become `rescue WorkOS::Error`. + +#### Response models no longer inherit from `Hash` + +In v6, `WorkOS::DirectoryUser`, `WorkOS::DirectoryGroup`, and other models inherited from an internal `DeprecatedHashWrapper < Hash`. That meant an instance was simultaneously a model and a `Hash`, which produced confusing behavior like this (see [#316](https://github.com/workos/workos-ruby/issues/316)): + +```ruby +user.is_a?(WorkOS::DirectoryUser) # => true +user.is_a?(Hash) # => true (v6) +user.to_hash.is_a?(WorkOS::DirectoryUser) # => true (v6 — returned self) +user.to_h # => "{...}" (v6 — returned a JSON string) +user[:id] # => "user_123" with a deprecation warning +``` + +In v7, models are plain classes that `include WorkOS::HashProvider`. They are no longer `Hash` instances: + +```ruby +user.is_a?(WorkOS::DirectoryUser) # => true +user.is_a?(Hash) # => false +user.to_h # => { id: "user_123", email: "...", ... } (real Hash) +user.to_h.is_a?(Hash) # => true +user.to_json # => '{"id":"user_123",...}' +user[:id] # => NoMethodError +user.to_hash # => NoMethodError +``` + +Update call sites accordingly: + +- Replace `user[:attr]` with the accessor method (`user.attr`). +- Replace `user.to_hash` with `user.to_h`. +- If you relied on passing a model into `**splat` or `Hash#merge` (which used the implicit `to_hash` coercion), call `.to_h` explicitly: `merge(user.to_h)`, `some_method(**user.to_h)`. +- If you called `.to_h` and expected a JSON string, use `.to_json` instead. +- If you passed a model to `JSON.generate(user)`, use `JSON.generate(user.to_h)` instead -- `JSON.generate` no longer traverses hash keys on models. +- Any `rescue`/log/assertion that inspects a model with `is_a?(Hash)` needs to be updated. + +The `DeprecatedHashWrapper` class and its deprecation warnings have been removed. + +### Error handling + +#### Error classes are still typed, but the base class contract changed + +Before: + +```ruby +begin + WorkOS::Organizations.get_organization(id: "org_123") +rescue WorkOS::TimeoutError => e + warn e.retry_after + warn e.data +end +``` + +After: + +```ruby +begin + client.organizations.get_organization(id: "org_123") +rescue WorkOS::APIConnectionError => e + warn e.message + warn e.request_id + warn e.code + warn e.body.inspect +end +``` + +Important differences: + +- the base error class was renamed from `WorkOS::WorkOSError` to `WorkOS::Error` -- any `rescue WorkOS::WorkOSError` must be updated +- transport failures now raise `WorkOS::APIConnectionError` +- the old `WorkOS::TimeoutError` is no longer part of the new error surface +- the old `e.data` field is now `e.body`, and `e.errors`, `e.error_description`, `e.retry_after` were removed +- the old extra fields like `retry_after`, `errors`, `error_description`, and `data` are not exposed the same way + +If your code rescues specific exception types or reads fields from exceptions, review every rescue path. + +### Pagination + +#### `ListStruct` is still the pagination wrapper, but it is more capable now + +Before: + +```ruby +result = WorkOS::Organizations.list_organizations +result.data +result.list_metadata +``` + +After: + +```ruby +result = client.organizations.list_organizations(limit: 100) + +result.data +result.list_metadata +result.auto_paging_each do |organization| + puts organization.id +end +``` + +This is mostly an improvement, but if you implemented your own pagination assumptions around the old response shape, test those code paths again. + +`ListStruct` no longer masquerades as a `Hash`. If any caller did `result.is_a?(Hash)` or `result[:data]` on a list response, use `result.data` and `result.list_metadata` instead. + +Additional pagination helpers available in v7: + +- `result.next_page` / `result.previous_page` -- programmatic cursor walks (returns a new `ListStruct` or `nil`) +- `result.each_page { |page| ... }` -- iterate one page at a time (useful for bulk upserts) +- `result.has_more?` -- check if a next page exists +- Some list endpoints now accept `order: "normal"` as a third option alongside `"asc"` / `"desc"` (descending with reversed cursor semantics) + +### Webhook verification + +Webhook signature verification moved from module-style calls to the client instance. + +Before: + +```ruby +event = WorkOS::Webhooks.construct_event( + payload: request.body.read, + sig_header: request.headers["WorkOS-Signature"], + secret: ENV["WORKOS_WEBHOOK_SECRET"] +) +``` + +After: + +```ruby +event = client.webhooks.construct_event( + payload: request.body.read, + sig_header: request.headers["WorkOS-Signature"], + secret: ENV["WORKOS_WEBHOOK_SECRET"] +) +``` + +The same applies to `verify_event`, `verify_header`, `compute_signature`, and `parse_signature_header`. All are now instance methods on `client.webhooks`. + +### AuthKit sessions and cookies + +Session management was one of the largest refactors in v7. The old `WorkOS::Session`, the `session:` kwarg on `authenticate_with_*`, and the class-level `seal_data` / `unseal_data` helpers were all replaced by a dedicated `WorkOS::SessionManager` on the client. The behavior is similar, but the surface area, return types, parameter names, and reason strings all changed. + +If your application seals session cookies, refreshes access tokens, or decodes the access-token JWT, every one of these call sites needs to be updated. + +#### `cookie_password` minimum length (32 bytes) + +v7 enforces a **minimum 32-byte length** on every `cookie_password` you supply +to the session manager (`load`, `seal_data`, `unseal_data`, +`seal_session_from_auth_response`, and the underlying `Encryptors::AesGcm`). + +Anything shorter — including `nil` or `""` — now raises `ArgumentError` at the +moment the SDK is asked to seal or unseal. Older deployments that used a +short passphrase (e.g. a 16-character secret) will start erroring at app +boot or the next sealed-session request. + +Pick a 32+ byte secret once and store it as an environment variable: + +```sh +ruby -rsecurerandom -e 'puts SecureRandom.base64(32)' +``` + +The KDF itself (single-pass SHA-256) is unchanged in this release, so +existing sealed cookies continue to round-trip as long as the same +(now-length-validated) password is in use. + +#### Sealing a cookie from an authentication response + +In v6, you asked `authenticate_with_*` to seal the cookie for you: + +```ruby +response = WorkOS::UserManagement.authenticate_with_code( + code: code, + client_id: client_id, + session: { seal_session: true, cookie_password: cookie_password } +) + +response.sealed_session # => "..." +``` + +In v7, the `session:` kwarg has been removed from **every** `authenticate_with_*` helper. Seal the cookie yourself after the authenticate call: + +```ruby +response = client.user_management.authenticate_with_code(code: code) + +sealed = client.session_manager.seal_session_from_auth_response( + access_token: response.access_token, + refresh_token: response.refresh_token, + cookie_password: cookie_password, + user: response.user, + impersonator: response.impersonator +) +``` + +This applies to all of: + +- `authenticate_with_code` +- `authenticate_with_password` +- `authenticate_with_refresh_token` +- `authenticate_with_magic_auth` +- `authenticate_with_email_verification` +- `authenticate_with_totp` +- `authenticate_with_organization_selection` +- `authenticate_with_device_code` + +#### Loading a session from a sealed cookie + +Before: + +```ruby +session = WorkOS::UserManagement.load_sealed_session( + client_id: client_id, + session_data: session_data, + cookie_password: cookie_password, + encryptor: custom_encryptor # optional +) +``` + +After: + +```ruby +session = client.session_manager.load( + seal_data: session_data, + cookie_password: cookie_password +) +``` + +Notable changes: + +- The kwarg is renamed from `session_data:` to `seal_data:`. +- `client_id` is no longer passed per-call; it is read from the client instance. +- A custom `encryptor:` is now supplied when the manager is created, not on `load`: + + ```ruby + client.session_manager(encryptor: custom_encryptor) + # or, for full control: + WorkOS::SessionManager.new(client, encryptor: custom_encryptor) + ``` + + **Note:** Calling `client.session_manager(encryptor: x)` replaces the cached manager instance. Call it once at boot, or construct `WorkOS::SessionManager.new(client, encryptor: ...)` explicitly if you need per-request encryptors. + +#### Authenticating a loaded session + +The return type changed from a `Hash` to a typed result object. **Any code that reads `result[:authenticated]` or `result[:reason]` needs to be updated.** + +Before: + +```ruby +result = session.authenticate + +result[:authenticated] # => true / false +result[:reason] # => 'INVALID_SESSION_COOKIE' (uppercase string) +result[:session_id] +result[:feature_flags] +``` + +After: + +```ruby +result = session.authenticate + +case result +when WorkOS::SessionManager::AuthSuccess + result.authenticated # => true + result.session_id + result.organization_id + result.role + result.roles + result.permissions + result.entitlements + result.feature_flags + result.user + result.impersonator +when WorkOS::SessionManager::AuthError + result.authenticated # => false + result.reason # => "invalid_session_cookie" (lowercase string) +end +``` + +Additional behavioral changes: + +- **Reason strings are now lowercase.** `'NO_SESSION_COOKIE_PROVIDED'` → `"no_session_cookie_provided"`, `'INVALID_SESSION_COOKIE'` → `"invalid_session_cookie"`, `'INVALID_JWT'` → `"invalid_jwt"`. These are exposed as constants on `WorkOS::SessionManager` (`NO_SESSION_COOKIE_PROVIDED`, `INVALID_SESSION_COOKIE`, `INVALID_JWT`) — prefer the constants over string literals. +- **`claim_extractor` semantics changed.** In v6 the block's returned Hash was merged flat into the result Hash. In v7 the returned Hash is stored as `custom_claims` on `AuthSuccess` and accessed via `#[]` or via dynamic readers: + + ```ruby + result = session.authenticate do |decoded_jwt| + { tenant_id: decoded_jwt["tenant_id"] } + end + + result[:tenant_id] # => "tnt_123" + result.tenant_id # => "tnt_123" + result.to_h[:tenant_id] + ``` + + The extractor **must** return a Hash and **must not** overwrite reserved keys (`authenticated`, `session_id`, `organization_id`, `role`, `roles`, `permissions`, `entitlements`, `user`, `impersonator`, `feature_flags`); doing either raises `ArgumentError`. + +#### Refreshing a loaded session + +The return shape was flattened and the option-hash parameter style was replaced with keyword arguments. + +Before: + +```ruby +result = session.refresh( + cookie_password: cookie_password, + organization_id: "org_123" +) + +result[:authenticated] +result[:sealed_session] +result[:session].user # nested AuthenticationResponse +result[:session].sealed_session +result[:reason] +``` + +After: + +```ruby +result = session.refresh( + organization_id: "org_123", + cookie_password: cookie_password # optional; defaults to the password used at load +) + +case result +when WorkOS::SessionManager::RefreshSuccess + result.sealed_session # new sealed cookie to write back to the browser + result.session_id + result.organization_id + result.role + result.roles + result.permissions + result.entitlements + result.user + result.impersonator + result.feature_flags +when WorkOS::SessionManager::RefreshError + result.authenticated # => false + result.reason +end +``` + +The nested `result[:session]` field is gone; the fields that used to live on that inner `AuthenticationResponse` are now exposed directly on `RefreshSuccess`. `session.refresh` also updates the `Session`'s internal `seal_data` / `cookie_password` in place, so a subsequent `session.authenticate` will use the refreshed token without reconstructing the `Session`. + +For call sites that don't need a long-lived `Session` object, `SessionManager` also exposes inline helpers: + +```ruby +client.session_manager.authenticate(seal_data: session_data, cookie_password: cookie_password) +client.session_manager.refresh(seal_data: session_data, cookie_password: cookie_password) +``` + +#### Building a logout URL + +Before: + +```ruby +url = session.get_logout_url(return_to: "https://example.com") +# or, if you only had the session_id: +url = WorkOS::UserManagement.get_logout_url(session_id: sid) +``` + +After: + +```ruby +url = session.get_logout_url(return_to: "https://example.com") +# or, via the UserManagement service: +url = client.user_management.get_logout_url(session_id: sid, return_to: "https://example.com") +``` + +`Session#get_logout_url` now calls `authenticate` internally to extract the `session_id` and raises `WorkOS::Error` (instead of a plain `RuntimeError`) if authentication fails. + +#### Raw seal / unseal helpers + +The class methods `WorkOS::Session.seal_data` and `WorkOS::Session.unseal_data` were removed. Use the instance methods on `SessionManager` instead: + +```ruby +# Before +sealed = WorkOS::Session.seal_data(payload, key) +WorkOS::Session.unseal_data(sealed, key) + +# After +sealed = client.session_manager.seal_data(payload, key) +client.session_manager.unseal_data(sealed, key) +``` + +A custom encryptor passed to `client.session_manager(encryptor: ...)` is used by these helpers as well. A custom encryptor must respond to `seal(data, key) -> String` and `unseal(sealed_string, key) -> Hash`. The `encryptor` gem is no longer a dependency; if your `Gemfile.lock` pinned it transitively, you may remove it unless your custom encryptor requires it. + +#### Deprecations to clean up + +- `WorkOS::SessionManager::SEAL_VERSION` has been removed. Use `WorkOS::Encryptors::AesGcm::SEAL_VERSION` if you need the seal-version constant. +- Direct instantiation of `WorkOS::Session.new` now requires a `SessionManager` instance as its first positional argument and is not part of the public contract. Always use `client.session_manager.load(seal_data:, cookie_password:)` instead. + +If your app relies on session sealing or cookie refresh behavior, verify those flows carefully in integration tests. + +--- + +## New in v7 + +### Device code flow + +v7 adds device-code authorization via two methods: + +```ruby +# Start device authorization +device = client.user_management.authorize_device(redirect_uri: "https://app.example.com/callback") +device.device_code # poll with this +device.user_code # display to the user +device.interval # polling interval + +# Poll for completion +response = client.user_management.authenticate_with_device_code( + device_code: device.device_code +) +``` + +### Public / PKCE clients + +If you're running in a context that cannot store an API key (browser, mobile, CLI), construct a public client: + +```ruby +client = WorkOS::PublicClient.create(client_id: "client_...") +url, verifier, state = client.user_management.get_authorization_url_with_pkce( + redirect_uri: "https://app.example.com/callback" +) +# user authenticates, you get `code` on the callback +response = client.user_management.authenticate_with_code_pkce( + code: code, code_verifier: verifier +) +``` + +### Observability: `last_response` on all responses + +Every model and list response now exposes `last_response` with HTTP metadata: + +```ruby +org = client.organizations.get_organization(id: "org_123") +org.last_response.http_status # => 200 +org.last_response.request_id # => "req_..." +org.last_response.http_headers # => { "x-request-id" => "...", ... } + +# Also available on paginated responses: +result = client.organizations.list_organizations +result.last_response.http_status +``` diff --git a/lib/workos.rb b/lib/workos.rb index d8d6507f..0b92065f 100644 --- a/lib/workos.rb +++ b/lib/workos.rb @@ -1,86 +1,39 @@ # frozen_string_literal: true -require 'workos/version' -require 'json' -require 'workos/hash_provider' -require 'workos/configuration' +# This file is auto-generated by oagen. Do not edit. -# Use the WorkOS module to authenticate your -# requests to the WorkOS API. The gem will read -# your API key automatically from the ENV var `WORKOS_API_KEY`. -# Alternatively, you can set the key yourself with -# `WorkOS.configure { |config| config.key = [your api key] }` somewhere -# in the load path of your application, such as an initializer. -module WorkOS - def self.default_config - Configuration.new.tap do |config| - config.api_hostname = ENV['WORKOS_API_HOSTNAME'] || 'api.workos.com' - # Remove WORKOS_KEY at some point in the future. Keeping it here now for - # backwards compatibility. - config.key = ENV['WORKOS_API_KEY'] || ENV['WORKOS_KEY'] - end - end - - def self.config - @config ||= default_config - end - - def self.configure - yield(config) - end - - def self.key=(value) - warn '`WorkOS.key=` is deprecated. Use `WorkOS.configure` instead.' - - config.key = value - end +require "zeitwerk" - def self.key - warn '`WorkOS.key` is deprecated. Use `WorkOS.configure` instead.' - - config.key - end - - autoload :AuditLogExport, 'workos/audit_log_export' - autoload :AuthenticationFactorAndChallenge, 'workos/authentication_factor_and_challenge' - autoload :AuthenticationResponse, 'workos/authentication_response' - autoload :AuditLogs, 'workos/audit_logs' - autoload :Challenge, 'workos/challenge' - autoload :Client, 'workos/client' - autoload :Connection, 'workos/connection' - autoload :DeprecatedHashWrapper, 'workos/deprecated_hash_wrapper' - autoload :Directory, 'workos/directory' - autoload :DirectoryGroup, 'workos/directory_group' - autoload :DirectorySync, 'workos/directory_sync' - autoload :DirectoryUser, 'workos/directory_user' - autoload :Event, 'workos/event' - autoload :Events, 'workos/events' - autoload :Factor, 'workos/factor' - autoload :Impersonator, 'workos/impersonator' - autoload :Invitation, 'workos/invitation' - autoload :MFA, 'workos/mfa' - autoload :Organization, 'workos/organization' - autoload :Organizations, 'workos/organizations' - autoload :OrganizationMembership, 'workos/organization_membership' - autoload :Passwordless, 'workos/passwordless' - autoload :Portal, 'workos/portal' - autoload :Profile, 'workos/profile' - autoload :ProfileAndToken, 'workos/profile_and_token' - autoload :RefreshAuthenticationResponse, 'workos/refresh_authentication_response' - autoload :SSO, 'workos/sso' - autoload :Types, 'workos/types' - autoload :User, 'workos/user' - autoload :UserAndToken, 'workos/user_and_token' - autoload :UserManagement, 'workos/user_management' - autoload :UserResponse, 'workos/user_response' - autoload :VerifyChallenge, 'workos/verify_challenge' - autoload :Webhook, 'workos/webhook' - autoload :Webhooks, 'workos/webhooks' - - # Errors - autoload :APIError, 'workos/errors' - autoload :AuthenticationError, 'workos/errors' - autoload :InvalidRequestError, 'workos/errors' - autoload :SignatureVerificationError, 'workos/errors' - autoload :TimeoutError, 'workos/errors' +module WorkOS end + +loader = Zeitwerk::Loader.for_gem +require_relative "workos/inflections" +loader.inflector.inflect(WORKOS_INFLECTIONS) +loader.collapse("#{__dir__}/workos/admin_portal") +loader.collapse("#{__dir__}/workos/api_keys") +loader.collapse("#{__dir__}/workos/audit_logs") +loader.collapse("#{__dir__}/workos/authorization") +loader.collapse("#{__dir__}/workos/connect") +loader.collapse("#{__dir__}/workos/directory_sync") +loader.collapse("#{__dir__}/workos/events") +loader.collapse("#{__dir__}/workos/feature_flags") +loader.collapse("#{__dir__}/workos/groups") +loader.collapse("#{__dir__}/workos/multi_factor_auth") +loader.collapse("#{__dir__}/workos/organization_domains") +loader.collapse("#{__dir__}/workos/organizations") +loader.collapse("#{__dir__}/workos/pipes") +loader.collapse("#{__dir__}/workos/radar") +loader.collapse("#{__dir__}/workos/shared") +loader.collapse("#{__dir__}/workos/sso") +loader.collapse("#{__dir__}/workos/user_management") +loader.collapse("#{__dir__}/workos/vault") +loader.collapse("#{__dir__}/workos/webhooks") +loader.collapse("#{__dir__}/workos/widgets") +loader.ignore("#{__dir__}/workos/errors.rb") +loader.ignore("#{__dir__}/workos/inflections.rb") +loader.ignore("#{__dir__}/workos/configuration.rb") +loader.setup + +require "workos/errors" +require "workos/configuration" diff --git a/lib/workos/actions.rb b/lib/workos/actions.rb new file mode 100644 index 00000000..ed145a79 --- /dev/null +++ b/lib/workos/actions.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained AuthKit Actions helpers (H03): +# - request signature verification (incoming) +# - response signing (outgoing Allow/Deny verdict) +# These are client-side cryptographic helpers and never spec-driven. + +require "json" +require "openssl" +require "workos/util/signature" + +module WorkOS + # AuthKit Actions request verification + response signing. + # + # action = client.actions.construct_action( + # payload: req.body, sig_header: req.headers["WorkOS-Signature"], + # secret: ENV["WORKOS_ACTIONS_SECRET"] + # ) + # resp = client.actions.sign_response( + # action_type: "authentication", verdict: "Allow", + # secret: ENV["WORKOS_ACTIONS_SECRET"] + # ) + module Actions + DEFAULT_TOLERANCE_SECONDS = 30 + + ACTION_TYPE_TO_RESPONSE_OBJECT = { + "authentication" => "authentication_action_response", + "user_registration" => "user_registration_action_response" + }.freeze + + module_function + + # Verify a request signature; raises on failure. + def verify_header(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS) + timestamp_ms, signature_hash = parse_signature_header(sig_header) + issued_at = timestamp_ms.to_i / 1000.0 + if (Time.now.to_f - issued_at).abs > tolerance + raise WorkOS::SignatureVerificationError.new( + message: "Timestamp outside the tolerance zone", + http_status: nil + ) + end + expected = compute_signature(payload: payload, timestamp: timestamp_ms, secret: secret) + unless secure_compare(signature_hash, expected) + raise WorkOS::SignatureVerificationError.new( + message: "Signature hash does not match the expected signature hash for payload", + http_status: nil + ) + end + true + end + + # Verify and deserialize an Actions request payload. + def construct_action(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS) + verify_header(payload: payload, sig_header: sig_header, secret: secret, tolerance: tolerance) + JSON.parse(payload) + end + + # Build and sign an Actions response. action_type is "authentication" or + # "user_registration"; verdict is "Allow" or "Deny". + def sign_response(action_type:, verdict:, secret:, error_message: nil) + object_type = ACTION_TYPE_TO_RESPONSE_OBJECT[action_type.to_s] + raise ArgumentError, "Unknown action_type: #{action_type}" unless object_type + timestamp_ms = (Time.now.to_f * 1000).to_i + response_payload = {"timestamp" => timestamp_ms, "verdict" => verdict} + response_payload["error_message"] = error_message if error_message + payload_json = JSON.generate(response_payload) + signed_payload = "#{timestamp_ms}.#{payload_json}" + { + "object" => object_type, + "payload" => response_payload, + "signature" => OpenSSL::HMAC.hexdigest("SHA256", secret, signed_payload) + } + end + + # Compute HMAC-SHA256 hex signature for a (timestamp, payload) pair. + def compute_signature(payload:, timestamp:, secret:) + WorkOS::Util::Signature.compute(payload: payload, timestamp: timestamp, secret: secret) + end + + # Parse a "t=, v1=" header into [timestamp, signature]. + def parse_signature_header(sig_header) + WorkOS::Util::Signature.parse_header(sig_header) + rescue ArgumentError => e + raise WorkOS::SignatureVerificationError.new(message: e.message, http_status: nil) + end + + def secure_compare(a, b) + WorkOS::Util::Signature.secure_compare(a, b) + end + end +end diff --git a/lib/workos/admin_portal.rb b/lib/workos/admin_portal.rb new file mode 100644 index 00000000..bd4ba292 --- /dev/null +++ b/lib/workos/admin_portal.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class AdminPortal + def initialize(client) + @client = client + end + + # Generate a Portal Link + # @param return_url [String, nil] The URL to go to when an admin clicks on your logo in the Admin Portal. If not specified, the return URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used. + # @param success_url [String, nil] The URL to redirect the admin to when they finish setup. If not specified, the success URL configured on the [Redirects](https://dashboard.workos.com/redirects) page will be used. + # @param organization [String] An [Organization](https://workos.com/docs/reference/organization) identifier. + # @param intent [WorkOS::Types::GenerateLinkIntent, nil] The intent of the Admin Portal. - `sso` - Launch Admin Portal for creating SSO connections - `dsync` - Launch Admin Portal for creating Directory Sync connections - `audit_logs` - Launch Admin Portal for viewing Audit Logs - `log_streams` - Launch Admin Portal for creating Log Streams - `domain_verification` - Launch Admin Portal for Domain Verification - `certificate_renewal` - Launch Admin Portal for renewing SAML Certificates - `bring_your_own_key` - Launch Admin Portal for configuring Bring Your Own Key + # @param intent_options [WorkOS::IntentOptions, nil] Options to configure the Admin Portal based on the intent. + # @param it_contact_emails [Array, nil] The email addresses of the IT contacts to grant access to the Admin Portal for the given organization. Accepts up to 20 emails. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::PortalLinkResponse] + def generate_link( + organization:, + return_url: nil, + success_url: nil, + intent: nil, + intent_options: nil, + it_contact_emails: nil, + request_options: {} + ) + body = { + "return_url" => return_url, + "success_url" => success_url, + "organization" => organization, + "intent" => intent, + "intent_options" => intent_options, + "it_contact_emails" => it_contact_emails + }.compact + response = @client.request( + method: :post, + path: "/portal/generate_link", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::PortalLinkResponse.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 + end +end diff --git a/lib/workos/admin_portal/domain_verification_intent_options.rb b/lib/workos/admin_portal/domain_verification_intent_options.rb new file mode 100644 index 00000000..cfc703c5 --- /dev/null +++ b/lib/workos/admin_portal/domain_verification_intent_options.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DomainVerificationIntentOptions < WorkOS::Types::BaseModel + HASH_ATTRS = { + domain_name: :domain_name + }.freeze + + attr_accessor :domain_name + + def initialize(json) + hash = self.class.normalize(json) + @domain_name = hash[:domain_name] + end + end +end diff --git a/lib/workos/admin_portal/generate_link.rb b/lib/workos/admin_portal/generate_link.rb new file mode 100644 index 00000000..29868954 --- /dev/null +++ b/lib/workos/admin_portal/generate_link.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GenerateLink < WorkOS::Types::BaseModel + HASH_ATTRS = { + return_url: :return_url, + success_url: :success_url, + organization: :organization, + intent: :intent, + intent_options: :intent_options, + it_contact_emails: :it_contact_emails + }.freeze + + attr_accessor \ + :return_url, + :success_url, + :organization, + :intent, + :intent_options, + :it_contact_emails + + def initialize(json) + hash = self.class.normalize(json) + @return_url = hash[:return_url] + @success_url = hash[:success_url] + @organization = hash[:organization] + @intent = hash[:intent] + @intent_options = hash[:intent_options] ? WorkOS::IntentOptions.new(hash[:intent_options]) : nil + @it_contact_emails = hash[:it_contact_emails] || [] + end + end +end diff --git a/lib/workos/admin_portal/intent_options.rb b/lib/workos/admin_portal/intent_options.rb new file mode 100644 index 00000000..a19104fe --- /dev/null +++ b/lib/workos/admin_portal/intent_options.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class IntentOptions < WorkOS::Types::BaseModel + HASH_ATTRS = { + sso: :sso, + domain_verification: :domain_verification + }.freeze + + attr_accessor \ + :sso, + :domain_verification + + def initialize(json) + hash = self.class.normalize(json) + @sso = hash[:sso] ? WorkOS::SSOIntentOptions.new(hash[:sso]) : nil + @domain_verification = hash[:domain_verification] ? WorkOS::DomainVerificationIntentOptions.new(hash[:domain_verification]) : nil + end + end +end diff --git a/lib/workos/admin_portal/portal_link_response.rb b/lib/workos/admin_portal/portal_link_response.rb new file mode 100644 index 00000000..0fa99d09 --- /dev/null +++ b/lib/workos/admin_portal/portal_link_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PortalLinkResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + link: :link + }.freeze + + attr_accessor :link + + def initialize(json) + hash = self.class.normalize(json) + @link = hash[:link] + end + end +end diff --git a/lib/workos/admin_portal/sso_intent_options.rb b/lib/workos/admin_portal/sso_intent_options.rb new file mode 100644 index 00000000..13bfa8e4 --- /dev/null +++ b/lib/workos/admin_portal/sso_intent_options.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSOIntentOptions < WorkOS::Types::BaseModel + HASH_ATTRS = { + bookmark_slug: :bookmark_slug, + provider_type: :provider_type + }.freeze + + attr_accessor \ + :bookmark_slug, + :provider_type + + def initialize(json) + hash = self.class.normalize(json) + @bookmark_slug = hash[:bookmark_slug] + @provider_type = hash[:provider_type] + end + end +end diff --git a/lib/workos/api_keys.rb b/lib/workos/api_keys.rb new file mode 100644 index 00000000..5f105047 --- /dev/null +++ b/lib/workos/api_keys.rb @@ -0,0 +1,128 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class ApiKeys + def initialize(client) + @client = client + end + + # List API keys for an organization + # @param organization_id [String] Unique identifier of the Organization. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organization_api_keys( + organization_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/api_keys", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organization_api_keys( + organization_id: organization_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::OrganizationApiKey, + filters: {organization_id: organization_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Create an API key for an organization + # @param organization_id [String] Unique identifier of the Organization. + # @param name [String] The name for the API key. + # @param permissions [Array, nil] The permission slugs to assign to the API key. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationApiKeyWithValue] + def create_organization_api_key( + organization_id:, + name:, + permissions: nil, + request_options: {} + ) + body = { + "name" => name, + "permissions" => permissions + }.compact + response = @client.request( + method: :post, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/api_keys", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::OrganizationApiKeyWithValue.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 + + # Validate API key + # @param value [String] The value for an API key. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ApiKeyValidationResponse] + def create_validation( + value:, + request_options: {} + ) + body = { + "value" => value + } + response = @client.request( + method: :post, + path: "/api_keys/validations", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ApiKeyValidationResponse.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 an API key + # @param id [String] The unique ID of the API key. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_api_key( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/api_keys/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end + end +end diff --git a/lib/workos/api_keys/api_key.rb b/lib/workos/api_keys/api_key.rb new file mode 100644 index 00000000..c69d2fa9 --- /dev/null +++ b/lib/workos/api_keys/api_key.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? (case hash[:owner][:type] when "organization" then WorkOS::ApiKeyOwner.new(hash[:owner]) when "user" then WorkOS::UserApiKeyOwner.new(hash[:owner]) else hash[:owner] end) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/api_keys/api_key_created.rb b/lib/workos/api_keys/api_key_created.rb new file mode 100644 index 00000000..f5e7179a --- /dev/null +++ b/lib/workos/api_keys/api_key_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ApiKeyCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/api_keys/api_key_created_data.rb b/lib/workos/api_keys/api_key_created_data.rb new file mode 100644 index 00000000..8128befc --- /dev/null +++ b/lib/workos/api_keys/api_key_created_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? (case hash[:owner][:type] when "organization" then WorkOS::ApiKeyCreatedDataOwner.new(hash[:owner]) when "user" then WorkOS::UserApiKeyCreatedDataOwner.new(hash[:owner]) else hash[:owner] end) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/api_keys/api_key_created_data_owner.rb b/lib/workos/api_keys/api_key_created_data_owner.rb new file mode 100644 index 00000000..d0163f32 --- /dev/null +++ b/lib/workos/api_keys/api_key_created_data_owner.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyCreatedDataOwner < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + id: :id + }.freeze + + attr_accessor \ + :type, + :id + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @id = hash[:id] + end + end +end diff --git a/lib/workos/api_keys/api_key_owner.rb b/lib/workos/api_keys/api_key_owner.rb new file mode 100644 index 00000000..3540d188 --- /dev/null +++ b/lib/workos/api_keys/api_key_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ApiKeyOwner = ApiKeyCreatedDataOwner +end diff --git a/lib/workos/api_keys/api_key_revoked.rb b/lib/workos/api_keys/api_key_revoked.rb new file mode 100644 index 00000000..9414c921 --- /dev/null +++ b/lib/workos/api_keys/api_key_revoked.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyRevoked < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ApiKeyRevokedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/api_keys/api_key_revoked_data.rb b/lib/workos/api_keys/api_key_revoked_data.rb new file mode 100644 index 00000000..a0d21f82 --- /dev/null +++ b/lib/workos/api_keys/api_key_revoked_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ApiKeyRevokedData = ApiKeyCreatedData +end diff --git a/lib/workos/api_keys/api_key_revoked_data_owner.rb b/lib/workos/api_keys/api_key_revoked_data_owner.rb new file mode 100644 index 00000000..d209e591 --- /dev/null +++ b/lib/workos/api_keys/api_key_revoked_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ApiKeyRevokedDataOwner = ApiKeyCreatedDataOwner +end diff --git a/lib/workos/api_keys/api_key_validation_response.rb b/lib/workos/api_keys/api_key_validation_response.rb new file mode 100644 index 00000000..7415d5c0 --- /dev/null +++ b/lib/workos/api_keys/api_key_validation_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyValidationResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + api_key: :api_key + }.freeze + + attr_accessor :api_key + + def initialize(json) + hash = self.class.normalize(json) + @api_key = hash[:api_key] ? WorkOS::ApiKey.new(hash[:api_key]) : nil + end + end +end diff --git a/lib/workos/api_keys/create_organization_api_key.rb b/lib/workos/api_keys/create_organization_api_key.rb new file mode 100644 index 00000000..51a01c95 --- /dev/null +++ b/lib/workos/api_keys/create_organization_api_key.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateOrganizationApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + permissions: :permissions + }.freeze + + attr_accessor \ + :name, + :permissions + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @permissions = hash[:permissions] || [] + end + end +end diff --git a/lib/workos/api_keys/organization_api_key.rb b/lib/workos/api_keys/organization_api_key.rb new file mode 100644 index 00000000..f2131bae --- /dev/null +++ b/lib/workos/api_keys/organization_api_key.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? WorkOS::OrganizationApiKeyOwner.new(hash[:owner]) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/api_keys/organization_api_key_owner.rb b/lib/workos/api_keys/organization_api_key_owner.rb new file mode 100644 index 00000000..6b8527a8 --- /dev/null +++ b/lib/workos/api_keys/organization_api_key_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + OrganizationApiKeyOwner = ApiKeyCreatedDataOwner +end diff --git a/lib/workos/api_keys/organization_api_key_with_value.rb b/lib/workos/api_keys/organization_api_key_with_value.rb new file mode 100644 index 00000000..c8bced69 --- /dev/null +++ b/lib/workos/api_keys/organization_api_key_with_value.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationApiKeyWithValue < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at, + value: :value + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at, + :value + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? WorkOS::OrganizationApiKeyWithValueOwner.new(hash[:owner]) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @value = hash[:value] + end + end +end diff --git a/lib/workos/api_keys/organization_api_key_with_value_owner.rb b/lib/workos/api_keys/organization_api_key_with_value_owner.rb new file mode 100644 index 00000000..8b685426 --- /dev/null +++ b/lib/workos/api_keys/organization_api_key_with_value_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + OrganizationApiKeyWithValueOwner = ApiKeyCreatedDataOwner +end diff --git a/lib/workos/api_keys/validate_api_key.rb b/lib/workos/api_keys/validate_api_key.rb new file mode 100644 index 00000000..e7d92a4c --- /dev/null +++ b/lib/workos/api_keys/validate_api_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ValidateApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + value: :value + }.freeze + + attr_accessor :value + + def initialize(json) + hash = self.class.normalize(json) + @value = hash[:value] + end + end +end diff --git a/lib/workos/audit_log_export.rb b/lib/workos/audit_log_export.rb deleted file mode 100644 index a7176831..00000000 --- a/lib/workos/audit_log_export.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The AuditLogExport class represents the WorkOS entity created when exporting Audit Log Events. - class AuditLogExport - include HashProvider - - attr_accessor :object, :id, :state, :url, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @object = hash[:object] - @id = hash[:id] - @state = hash[:state] - @url = hash[:url] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - object: object, - id: id, - state: state, - url: url, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/audit_logs.rb b/lib/workos/audit_logs.rb index 7865e2ca..e70e9eb0 100644 --- a/lib/workos/audit_logs.rb +++ b/lib/workos/audit_logs.rb @@ -1,88 +1,268 @@ # frozen_string_literal: true -require 'net/http' -require 'uri' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The Audit Logs module provides convenience methods for working with the - # WorkOS Audit Logs platform. You'll need a valid API key. - module AuditLogs - class << self - include Client - - # Create an Audit Log Event. - # - # @param [String] organization An Organization ID - # @param [Hash] event An Audit Log Event - # @param [String] idempotency_key An idempotency key - # - # @return [nil] - def create_event(organization:, event:, idempotency_key: nil) - request = post_request( - path: '/audit_logs/events', - auth: true, - idempotency_key: idempotency_key, - body: { - organization_id: organization, - event: event, - }, - ) +require "json" - execute_request(request: request) - end +module WorkOS + class AuditLogs + def initialize(client) + @client = client + end - # Create an Export of Audit Log Events. - # - # @param [String] organization An Organization ID - # @param [String] range_start ISO-8601 datetime - # @param [String] range_end ISO-8601 datetime - # @param [Array] actions A list of actions to filter by - # @param [Array] @deprecated use `actor_names` instead - # @param [Array] actor_names A list of actor names to filter by - # @param [Array] actor_ids A list of actor ids to filter by - # @param [Array] targets A list of target types to filter by - # - # @return [WorkOS::AuditLogExport] - def create_export(organization:, range_start:, range_end:, actions: nil, # rubocop:disable Metrics/ParameterLists - actors: nil, targets: nil, actor_names: nil, actor_ids: nil) - body = { - organization_id: organization, - range_start: range_start, - range_end: range_end, - } + # Get Retention + # @param id [String] Unique identifier of the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogsRetentionJson] + def get_organization_audit_logs_retention( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(id)}/audit_logs_retention", + auth: true, + request_options: request_options + ) + result = WorkOS::AuditLogsRetentionJson.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 - body['actions'] = actions unless actions.nil? - body['actors'] = actors unless actors.nil? - body['actor_names'] = actor_names unless actor_names.nil? - body['actor_ids'] = actor_ids unless actor_ids.nil? - body['targets'] = targets unless targets.nil? + # Set Retention + # @param id [String] Unique identifier of the Organization. + # @param retention_period_in_days [Integer] The number of days Audit Log events will be retained. Valid values are `30` and `365`. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogsRetentionJson] + def update_organization_audit_logs_retention( + id:, + retention_period_in_days:, + request_options: {} + ) + body = { + "retention_period_in_days" => retention_period_in_days + } + response = @client.request( + method: :put, + path: "/organizations/#{WorkOS::Util.encode_path(id)}/audit_logs_retention", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuditLogsRetentionJson.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 - request = post_request( - path: '/audit_logs/exports', - auth: true, - body: body, + # List Actions + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_actions( + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/audit_logs/actions", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_actions( + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuditLogActionJson, + filters: {before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end - response = execute_request(request: request) + # List Schemas + # @param action_name [String] The name of the Audit Log action. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_action_schemas( + action_name:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/audit_logs/actions/#{WorkOS::Util.encode_path(action_name)}/schemas", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_action_schemas( + action_name: action_name, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuditLogSchemaJson, + filters: {action_name: action_name, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end - WorkOS::AuditLogExport.new(response.body) - end + # Create Schema + # @param action_name [String] The name of the Audit Log action. + # @param actor [WorkOS::AuditLogSchemaActor, nil] The metadata schema for the actor. + # @param targets [Array] The list of targets for the schema. + # @param metadata [Hash{String => Object}, nil] Optional JSON schema for event metadata. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogSchemaJson] + def create_schema( + action_name:, + targets:, + actor: nil, + metadata: nil, + request_options: {} + ) + body = { + "actor" => actor, + "targets" => targets, + "metadata" => metadata + }.compact + response = @client.request( + method: :post, + path: "/audit_logs/actions/#{WorkOS::Util.encode_path(action_name)}/schemas", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuditLogSchemaJson.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 - # Retrieves an Export of Audit Log Events - # - # @param [String] id An Audit Log Export ID - # - # @return [WorkOS::AuditLogExport] - def get_export(id:) - request = get_request( - auth: true, - path: "/audit_logs/exports/#{id}", - ) + # Create Event + # @param organization_id [String] The unique ID of the Organization. + # @param event [WorkOS::AuditLogEvent] The audit log event to create. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogEventCreateResponse] + def create_event( + organization_id:, + event:, + request_options: {} + ) + body = { + "organization_id" => organization_id, + "event" => event + } + response = @client.request( + method: :post, + path: "/audit_logs/events", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuditLogEventCreateResponse.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 - response = execute_request(request: request) + # Create Export + # @param organization_id [String] The unique ID of the Organization. + # @param range_start [String] ISO-8601 value for start of the export range. + # @param range_end [String] ISO-8601 value for end of the export range. + # @param actions [Array, nil] List of actions to filter against. + # @param actors [Array, nil] (deprecated) Deprecated. Use `actor_names` instead. + # @param actor_names [Array, nil] List of actor names to filter against. + # @param actor_ids [Array, nil] List of actor IDs to filter against. + # @param targets [Array, nil] List of target types to filter against. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogExportJson] + def create_export( + organization_id:, + range_start:, + range_end:, + actions: nil, + actors: nil, + actor_names: nil, + actor_ids: nil, + targets: nil, + request_options: {} + ) + body = { + "organization_id" => organization_id, + "range_start" => range_start, + "range_end" => range_end, + "actions" => actions, + "actors" => actors, + "actor_names" => actor_names, + "actor_ids" => actor_ids, + "targets" => targets + }.compact + response = @client.request( + method: :post, + path: "/audit_logs/exports", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuditLogExportJson.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 - WorkOS::AuditLogExport.new(response.body) - end + # Get Export + # @param audit_log_export_id [String] The unique ID of the Audit Log Export. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogExportJson] + def get_export( + audit_log_export_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/audit_logs/exports/#{WorkOS::Util.encode_path(audit_log_export_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::AuditLogExportJson.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 end end diff --git a/lib/workos/audit_logs/audit_log_action.rb b/lib/workos/audit_logs/audit_log_action.rb new file mode 100644 index 00000000..05f51dbf --- /dev/null +++ b/lib/workos/audit_logs/audit_log_action.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class AuditLogAction + include HashProvider + + HASH_ATTRS = { + object: :object, + name: :name, + schema: :schema, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :name, + :schema, + :created_at, + :updated_at + + def initialize(json) + hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true) + hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String) + @object = hash[:object] + @name = hash[:name] + @schema = hash[:schema] ? WorkOS::AuditLogSchema.new(hash[:schema]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_action_json.rb b/lib/workos/audit_logs/audit_log_action_json.rb new file mode 100644 index 00000000..adf5b40a --- /dev/null +++ b/lib/workos/audit_logs/audit_log_action_json.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogActionJson < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + name: :name, + schema: :schema, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :name, + :schema, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @name = hash[:name] + @schema = hash[:schema] ? WorkOS::AuditLogSchemaJson.new(hash[:schema]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event.rb b/lib/workos/audit_logs/audit_log_event.rb new file mode 100644 index 00000000..cfd9f418 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogEvent < WorkOS::Types::BaseModel + HASH_ATTRS = { + action: :action, + occurred_at: :occurred_at, + actor: :actor, + targets: :targets, + context: :context, + metadata: :metadata, + version: :version + }.freeze + + attr_accessor \ + :action, + :occurred_at, + :actor, + :targets, + :context, + :metadata, + :version + + def initialize(json) + hash = self.class.normalize(json) + @action = hash[:action] + @occurred_at = hash[:occurred_at] + @actor = hash[:actor] ? WorkOS::AuditLogEventActor.new(hash[:actor]) : nil + @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogEventTarget.new(item) : nil } + @context = hash[:context] ? WorkOS::AuditLogEventContext.new(hash[:context]) : nil + @metadata = hash[:metadata] || {} + @version = hash[:version] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event_actor.rb b/lib/workos/audit_logs/audit_log_event_actor.rb new file mode 100644 index 00000000..ae70d4f5 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event_actor.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogEventActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + type: :type, + name: :name, + metadata: :metadata + }.freeze + + attr_accessor \ + :id, + :type, + :name, + :metadata + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @type = hash[:type] + @name = hash[:name] + @metadata = hash[:metadata] || {} + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event_context.rb b/lib/workos/audit_logs/audit_log_event_context.rb new file mode 100644 index 00000000..c6ff6a78 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event_context.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogEventContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + location: :location, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :location, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @location = hash[:location] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event_create_response.rb b/lib/workos/audit_logs/audit_log_event_create_response.rb new file mode 100644 index 00000000..d79450a0 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event_create_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogEventCreateResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + success: :success + }.freeze + + attr_accessor :success + + def initialize(json) + hash = self.class.normalize(json) + @success = hash[:success] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event_ingestion.rb b/lib/workos/audit_logs/audit_log_event_ingestion.rb new file mode 100644 index 00000000..b348450b --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event_ingestion.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogEventIngestion < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + event: :event + }.freeze + + attr_accessor \ + :organization_id, + :event + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @event = hash[:event] ? WorkOS::AuditLogEvent.new(hash[:event]) : nil + end + end +end diff --git a/lib/workos/audit_logs/audit_log_event_target.rb b/lib/workos/audit_logs/audit_log_event_target.rb new file mode 100644 index 00000000..ed10f38f --- /dev/null +++ b/lib/workos/audit_logs/audit_log_event_target.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuditLogEventTarget = AuditLogEventActor +end diff --git a/lib/workos/audit_logs/audit_log_export.rb b/lib/workos/audit_logs/audit_log_export.rb new file mode 100644 index 00000000..b3d56fdf --- /dev/null +++ b/lib/workos/audit_logs/audit_log_export.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class AuditLogExport + include HashProvider + + HASH_ATTRS = { + object: :object, + id: :id, + state: :state, + url: :url, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :state, + :url, + :created_at, + :updated_at + + def initialize(json) + hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true) + hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String) + @object = hash[:object] + @id = hash[:id] + @state = hash[:state] + @url = hash[:url] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_export_creation.rb b/lib/workos/audit_logs/audit_log_export_creation.rb new file mode 100644 index 00000000..8034cf9d --- /dev/null +++ b/lib/workos/audit_logs/audit_log_export_creation.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogExportCreation < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + range_start: :range_start, + range_end: :range_end, + actions: :actions, + actors: :actors, + actor_names: :actor_names, + actor_ids: :actor_ids, + targets: :targets + }.freeze + + # @!attribute actors + # @deprecated Deprecated. Use `actor_names` instead. + + attr_accessor \ + :organization_id, + :range_start, + :range_end, + :actions, + :actor_names, + :actor_ids, + :targets + + def actors + warn "[DEPRECATION] `actors` is deprecated and will be removed in a future version.", uplevel: 1 + @actors + end + + attr_writer :actors + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @range_start = hash[:range_start] + @range_end = hash[:range_end] + @actions = hash[:actions] || [] + @actors = hash[:actors] || [] + @actor_names = hash[:actor_names] || [] + @actor_ids = hash[:actor_ids] || [] + @targets = hash[:targets] || [] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_export_json.rb b/lib/workos/audit_logs/audit_log_export_json.rb new file mode 100644 index 00000000..c762c435 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_export_json.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogExportJson < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + state: :state, + url: :url, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :state, + :url, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @state = hash[:state] + @url = hash[:url] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_schema.rb b/lib/workos/audit_logs/audit_log_schema.rb new file mode 100644 index 00000000..953374ef --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogSchema < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor: :actor, + targets: :targets, + metadata: :metadata + }.freeze + + attr_accessor \ + :actor, + :targets, + :metadata + + def initialize(json) + hash = self.class.normalize(json) + @actor = hash[:actor] ? WorkOS::AuditLogSchemaActor.new(hash[:actor]) : nil + @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogSchemaTarget.new(item) : nil } + @metadata = hash[:metadata] || {} + end + end +end diff --git a/lib/workos/audit_logs/audit_log_schema_actor.rb b/lib/workos/audit_logs/audit_log_schema_actor.rb new file mode 100644 index 00000000..1e8a2e32 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema_actor.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogSchemaActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + metadata: :metadata + }.freeze + + attr_accessor :metadata + + def initialize(json) + hash = self.class.normalize(json) + @metadata = hash[:metadata] || {} + end + end +end diff --git a/lib/workos/audit_logs/audit_log_schema_json.rb b/lib/workos/audit_logs/audit_log_schema_json.rb new file mode 100644 index 00000000..d96487cb --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema_json.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogSchemaJson < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + version: :version, + actor: :actor, + targets: :targets, + metadata: :metadata, + created_at: :created_at + }.freeze + + attr_accessor \ + :object, + :version, + :actor, + :targets, + :metadata, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @version = hash[:version] + @actor = hash[:actor] ? WorkOS::AuditLogSchemaJsonActor.new(hash[:actor]) : nil + @targets = (hash[:targets] || []).map { |item| item ? WorkOS::AuditLogSchemaJsonTarget.new(item) : nil } + @metadata = hash[:metadata] || {} + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/audit_logs/audit_log_schema_json_actor.rb b/lib/workos/audit_logs/audit_log_schema_json_actor.rb new file mode 100644 index 00000000..8c476ede --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema_json_actor.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuditLogSchemaJsonActor = AuditLogSchemaActor +end diff --git a/lib/workos/audit_logs/audit_log_schema_json_target.rb b/lib/workos/audit_logs/audit_log_schema_json_target.rb new file mode 100644 index 00000000..068382f0 --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema_json_target.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogSchemaJsonTarget < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + metadata: :metadata + }.freeze + + attr_accessor \ + :type, + :metadata + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @metadata = hash[:metadata] || {} + end + end +end diff --git a/lib/workos/audit_logs/audit_log_schema_target.rb b/lib/workos/audit_logs/audit_log_schema_target.rb new file mode 100644 index 00000000..80fabc5d --- /dev/null +++ b/lib/workos/audit_logs/audit_log_schema_target.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuditLogSchemaTarget = AuditLogSchemaJsonTarget +end diff --git a/lib/workos/authentication_factor_and_challenge.rb b/lib/workos/authentication_factor_and_challenge.rb deleted file mode 100644 index 83e8e904..00000000 --- a/lib/workos/authentication_factor_and_challenge.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The AuthenticationFactorAndChallenge class represents - # an authentication factor and challenge for a given user. - class AuthenticationFactorAndChallenge - include HashProvider - - attr_accessor :authentication_factor, :authentication_challenge - - def initialize(authentication_response_json) - json = JSON.parse(authentication_response_json, symbolize_names: true) - @authentication_factor = WorkOS::Factor.new( - json[:authentication_factor].to_json, - ) - @authentication_challenge = WorkOS::Challenge.new( - json[:authentication_challenge].to_json, - ) - end - - def to_json(*) - { - authentication_factor: authentication_factor.to_json, - authentication_challenge: authentication_challenge.to_json, - } - end - end -end diff --git a/lib/workos/authentication_response.rb b/lib/workos/authentication_response.rb deleted file mode 100644 index 3bba0040..00000000 --- a/lib/workos/authentication_response.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The AuthenticationResponse class represents an Authentication Response as well as an corresponding - # response data that can later be appended on. - class AuthenticationResponse - include HashProvider - - attr_accessor :user, :organization_id, :impersonator, :access_token, :refresh_token - - def initialize(authentication_response_json) - json = JSON.parse(authentication_response_json, symbolize_names: true) - @user = WorkOS::User.new(json[:user].to_json) - @organization_id = json[:organization_id] - @impersonator = - if (impersonator_json = json[:impersonator]) - Impersonator.new(email: impersonator_json[:email], - reason: impersonator_json[:reason],) - end - @access_token = json[:access_token] - @refresh_token = json[:refresh_token] - end - - def to_json(*) - { - user: user.to_json, - organization_id: organization_id, - impersonator: impersonator.to_json, - access_token: access_token, - refresh_token: refresh_token, - } - end - end -end diff --git a/lib/workos/authorization.rb b/lib/workos/authorization.rb new file mode 100644 index 00000000..d7c29cd6 --- /dev/null +++ b/lib/workos/authorization.rb @@ -0,0 +1,1395 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Authorization + # Identifies the resource target (by id variant). + # + # @!attribute [r] resource_id + # @return [String] + ResourceTargetById = Data.define(:resource_id) + + # Identifies the resource target (by external id variant). + # + # @!attribute [r] resource_external_id + # @return [String] + # @!attribute [r] resource_type_slug + # @return [String] + ResourceTargetByExternalId = Data.define(:resource_external_id, :resource_type_slug) + + # Identifies the parent resource (by id variant). + # + # @!attribute [r] parent_resource_id + # @return [String] + ParentResourceById = Data.define(:parent_resource_id) + + # Identifies the parent resource (by external id variant). + # + # @!attribute [r] parent_resource_type_slug + # @return [String] + # @!attribute [r] parent_resource_external_id + # @return [String] + ParentResourceByExternalId = Data.define(:parent_resource_type_slug, :parent_resource_external_id) + + # Identifies the parent (by id variant). + # + # @!attribute [r] parent_resource_id + # @return [String] + ParentById = Data.define(:parent_resource_id) + + # Identifies the parent (by external id variant). + # + # @!attribute [r] parent_resource_type_slug + # @return [String] + # @!attribute [r] parent_external_id + # @return [String] + ParentByExternalId = Data.define(:parent_resource_type_slug, :parent_external_id) + + def initialize(client) + @client = client + end + + # Check authorization + # @param organization_membership_id [String] The ID of the organization membership to check. + # @param permission_slug [String] The slug of the permission to check. + # @param resource_target [WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId] Identifies the resource target. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationCheck] + def check( + organization_membership_id:, + permission_slug:, + resource_target:, + request_options: {} + ) + body = { + "permission_slug" => permission_slug + } + case resource_target + when WorkOS::Authorization::ResourceTargetById + body["resource_id"] = resource_target.resource_id + when WorkOS::Authorization::ResourceTargetByExternalId + body["resource_external_id"] = resource_target.resource_external_id + body["resource_type_slug"] = resource_target.resource_type_slug + else + raise ArgumentError, "expected resource_target to be one of: WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId, got #{resource_target.class}" + end + response = @client.request( + method: :post, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/check", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthorizationCheck.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 + + # List resources for organization membership + # @param organization_membership_id [String] The ID of the organization membership. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param permission_slug [String] The permission slug to filter by. Only child resources where the organization membership has this permission are returned. + # @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId] Identifies the parent resource. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_resources_for_membership( + organization_membership_id:, + permission_slug:, + parent_resource:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "permission_slug" => permission_slug + }.compact + case parent_resource + when WorkOS::Authorization::ParentResourceById + params["parent_resource_id"] = parent_resource.parent_resource_id + when WorkOS::Authorization::ParentResourceByExternalId + params["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug + params["parent_resource_external_id"] = parent_resource.parent_resource_external_id + else + raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}" + end + response = @client.request( + method: :get, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_resources_for_membership( + organization_membership_id: organization_membership_id, + before: before, + after: cursor, + limit: limit, + order: order, + permission_slug: permission_slug, + parent_resource: parent_resource, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizationResource, + filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order, permission_slug: permission_slug, parent_resource: parent_resource}, + fetch_next: fetch_next + ) + end + + # List effective permissions for an organization membership on a resource + # @param organization_membership_id [String] The ID of the organization membership. + # @param resource_id [String] The ID of the authorization resource. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_effective_permissions( + organization_membership_id:, + resource_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources/#{WorkOS::Util.encode_path(resource_id)}/permissions", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_effective_permissions( + organization_membership_id: organization_membership_id, + resource_id: resource_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizationPermission, + filters: {organization_membership_id: organization_membership_id, resource_id: resource_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # List effective permissions for an organization membership on a resource by external ID + # @param organization_membership_id [String] The ID of the organization membership. + # @param resource_type_slug [String] The slug of the resource type. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_effective_permissions_by_external_id( + organization_membership_id:, + resource_type_slug:, + external_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/permissions", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_effective_permissions_by_external_id( + organization_membership_id: organization_membership_id, + resource_type_slug: resource_type_slug, + external_id: external_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizationPermission, + filters: {organization_membership_id: organization_membership_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # List role assignments + # @param organization_membership_id [String] The ID of the organization membership. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_role_assignments( + organization_membership_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_role_assignments( + organization_membership_id: organization_membership_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserRoleAssignment, + filters: {organization_membership_id: organization_membership_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Assign a role + # @param organization_membership_id [String] The ID of the organization membership. + # @param role_slug [String] The slug of the role to assign. + # @param resource_target [WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId] Identifies the resource target. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserRoleAssignment] + def assign_role( + organization_membership_id:, + role_slug:, + resource_target:, + request_options: {} + ) + body = { + "role_slug" => role_slug + } + case resource_target + when WorkOS::Authorization::ResourceTargetById + body["resource_id"] = resource_target.resource_id + when WorkOS::Authorization::ResourceTargetByExternalId + body["resource_external_id"] = resource_target.resource_external_id + body["resource_type_slug"] = resource_target.resource_type_slug + else + raise ArgumentError, "expected resource_target to be one of: WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId, got #{resource_target.class}" + end + response = @client.request( + method: :post, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserRoleAssignment.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 + + # Remove a role assignment + # @param organization_membership_id [String] The ID of the organization membership. + # @param role_slug [String] The slug of the role to remove. + # @param resource_target [WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId] Identifies the resource target. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def remove_role( + organization_membership_id:, + role_slug:, + resource_target:, + request_options: {} + ) + params = {} + case resource_target + when WorkOS::Authorization::ResourceTargetById + params["resource_id"] = resource_target.resource_id + when WorkOS::Authorization::ResourceTargetByExternalId + params["resource_external_id"] = resource_target.resource_external_id + params["resource_type_slug"] = resource_target.resource_type_slug + else + raise ArgumentError, "expected resource_target to be one of: WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId, got #{resource_target.class}" + end + body = { + "role_slug" => role_slug + } + @client.request( + method: :delete, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments", + auth: true, + params: params, + body: body, + request_options: request_options + ) + nil + end + + # Remove a role assignment by ID + # @param organization_membership_id [String] The ID of the organization membership. + # @param role_assignment_id [String] The ID of the role assignment to remove. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def remove_role_assignment( + organization_membership_id:, + role_assignment_id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/authorization/organization_memberships/#{WorkOS::Util.encode_path(organization_membership_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}", + auth: true, + request_options: request_options + ) + nil + end + + # List custom roles + # @param organization_id [String] The ID of the organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::RoleList] + def list_organization_roles( + organization_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles", + auth: true, + request_options: request_options + ) + result = WorkOS::RoleList.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 + + # Create a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String, nil] A unique identifier for the role within the organization. When provided, must begin with 'org-' and contain only lowercase letters, numbers, hyphens, and underscores. When omitted, a slug is auto-generated from the role name and a random suffix. + # @param name [String] A descriptive name for the role. + # @param description [String, nil] An optional description of the role's purpose. + # @param resource_type_slug [String, nil] The slug of the resource type the role is scoped to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def create_organization_role( + organization_id:, + name:, + slug: nil, + description: nil, + resource_type_slug: nil, + request_options: {} + ) + body = { + "slug" => slug, + "name" => name, + "description" => description, + "resource_type_slug" => resource_type_slug + }.compact + response = @client.request( + method: :post, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Get a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def get_organization_role( + organization_id:, + slug:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Update a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param name [String, nil] A descriptive name for the role. + # @param description [String, nil] An optional description of the role's purpose. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def update_organization_role( + organization_id:, + slug:, + name: nil, + description: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + response = @client.request( + method: :patch, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_organization_role( + organization_id:, + slug:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + nil + end + + # Add a permission to a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param body_slug [String] The slug of the permission to add to the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def add_organization_role_permission( + organization_id:, + slug:, + body_slug:, + request_options: {} + ) + body = { + "slug" => body_slug + } + response = @client.request( + method: :post, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Set permissions for a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param permissions [Array] The permission slugs to assign to the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def set_organization_role_permissions( + organization_id:, + slug:, + permissions:, + request_options: {} + ) + body = { + "permissions" => permissions + } + response = @client.request( + method: :put, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Remove a permission from a custom role + # @param organization_id [String] The ID of the organization. + # @param slug [String] The slug of the role. + # @param permission_slug [String] The slug of the permission to remove. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def remove_organization_role_permission( + organization_id:, + slug:, + permission_slug:, + request_options: {} + ) + response = @client.request( + method: :delete, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/roles/#{WorkOS::Util.encode_path(slug)}/permissions/#{WorkOS::Util.encode_path(permission_slug)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Get a resource by external ID + # @param organization_id [String] The ID of the organization that owns the resource. + # @param resource_type_slug [String] The slug of the resource type. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationResource] + def get_resource_by_external_id( + organization_id:, + resource_type_slug:, + external_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::AuthorizationResource.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 + + # Update a resource by external ID + # @param organization_id [String] The ID of the organization that owns the resource. + # @param resource_type_slug [String] The slug of the resource type. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param name [String, nil] A display name for the resource. + # @param description [String, nil] An optional description of the resource. + # @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, nil] Identifies the parent resource. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationResource] + def update_resource_by_external_id( + organization_id:, + resource_type_slug:, + external_id:, + name: nil, + description: nil, + parent_resource: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + if parent_resource + case parent_resource + when WorkOS::Authorization::ParentResourceById + body["parent_resource_id"] = parent_resource.parent_resource_id + when WorkOS::Authorization::ParentResourceByExternalId + body["parent_resource_external_id"] = parent_resource.parent_resource_external_id + body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug + else + raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}" + end + end + response = @client.request( + method: :patch, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthorizationResource.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 an authorization resource by external ID + # @param organization_id [String] The ID of the organization that owns the resource. + # @param resource_type_slug [String] The slug of the resource type. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param cascade_delete [Boolean, nil] If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_resource_by_external_id( + organization_id:, + resource_type_slug:, + external_id:, + cascade_delete: false, + request_options: {} + ) + params = { + "cascade_delete" => cascade_delete + }.compact + @client.request( + method: :delete, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}", + auth: true, + params: params, + request_options: request_options + ) + nil + end + + # List memberships for a resource by external ID + # @param organization_id [String] The ID of the organization that owns the resource. + # @param resource_type_slug [String] The slug of the resource type this resource belongs to. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned. + # @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use "direct" for direct assignments only, or "indirect" to include inherited assignments. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_memberships_for_resource_by_external_id( + organization_id:, + resource_type_slug:, + external_id:, + permission_slug:, + before: nil, + after: nil, + limit: 10, + order: "desc", + assignment: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "permission_slug" => permission_slug, + "assignment" => assignment + }.compact + response = @client.request( + method: :get, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/organization_memberships", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_memberships_for_resource_by_external_id( + organization_id: organization_id, + resource_type_slug: resource_type_slug, + external_id: external_id, + before: before, + after: cursor, + limit: limit, + order: order, + permission_slug: permission_slug, + assignment: assignment, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserOrganizationMembershipBaseListData, + filters: {organization_id: organization_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order, permission_slug: permission_slug, assignment: assignment}, + fetch_next: fetch_next + ) + end + + # List role assignments for a resource by external ID + # @param organization_id [String] The ID of the organization that owns the resource. + # @param resource_type_slug [String] The slug of the resource type. + # @param external_id [String] An identifier you provide to reference the resource in your system. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_role_assignments_for_resource_by_external_id( + organization_id:, + resource_type_slug:, + external_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/organizations/#{WorkOS::Util.encode_path(organization_id)}/resources/#{WorkOS::Util.encode_path(resource_type_slug)}/#{WorkOS::Util.encode_path(external_id)}/role_assignments", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_role_assignments_for_resource_by_external_id( + organization_id: organization_id, + resource_type_slug: resource_type_slug, + external_id: external_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserRoleAssignment, + filters: {organization_id: organization_id, resource_type_slug: resource_type_slug, external_id: external_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # List resources + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param organization_id [String, nil] Filter resources by organization ID. + # @param resource_type_slug [String, nil] Filter resources by resource type slug. + # @param resource_external_id [String, nil] Filter resources by external ID. + # @param search [String, nil] Search resources by name. + # @param parent [WorkOS::Authorization::ParentById, WorkOS::Authorization::ParentByExternalId, nil] Identifies the parent. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_resources( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + resource_type_slug: nil, + resource_external_id: nil, + search: nil, + parent: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id, + "resource_type_slug" => resource_type_slug, + "resource_external_id" => resource_external_id, + "search" => search + }.compact + if parent + case parent + when WorkOS::Authorization::ParentById + params["parent_resource_id"] = parent.parent_resource_id + when WorkOS::Authorization::ParentByExternalId + params["parent_resource_type_slug"] = parent.parent_resource_type_slug + params["parent_external_id"] = parent.parent_external_id + else + raise ArgumentError, "expected parent to be one of: WorkOS::Authorization::ParentById, WorkOS::Authorization::ParentByExternalId, got #{parent.class}" + end + end + response = @client.request( + method: :get, + path: "/authorization/resources", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_resources( + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + resource_type_slug: resource_type_slug, + resource_external_id: resource_external_id, + search: search, + parent: parent, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizationResource, + filters: {before: before, limit: limit, order: order, organization_id: organization_id, resource_type_slug: resource_type_slug, resource_external_id: resource_external_id, search: search, parent: parent}, + fetch_next: fetch_next + ) + end + + # Create an authorization resource + # @param external_id [String] An external identifier for the resource. + # @param name [String] A display name for the resource. + # @param description [String, nil] An optional description of the resource. + # @param resource_type_slug [String] The slug of the resource type. + # @param organization_id [String] The ID of the organization this resource belongs to. + # @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, nil] Identifies the parent resource. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationResource] + def create_resource( + external_id:, + name:, + resource_type_slug:, + organization_id:, + description: nil, + parent_resource: nil, + request_options: {} + ) + body = { + "external_id" => external_id, + "name" => name, + "description" => description, + "resource_type_slug" => resource_type_slug, + "organization_id" => organization_id + }.compact + if parent_resource + case parent_resource + when WorkOS::Authorization::ParentResourceById + body["parent_resource_id"] = parent_resource.parent_resource_id + when WorkOS::Authorization::ParentResourceByExternalId + body["parent_resource_external_id"] = parent_resource.parent_resource_external_id + body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug + else + raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}" + end + end + response = @client.request( + method: :post, + path: "/authorization/resources", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthorizationResource.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 + + # Get a resource + # @param resource_id [String] The ID of the authorization resource. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationResource] + def get_resource( + resource_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::AuthorizationResource.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 + + # Update a resource + # @param resource_id [String] The ID of the authorization resource. + # @param name [String, nil] A display name for the resource. + # @param description [String, nil] An optional description of the resource. + # @param parent_resource [WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, nil] Identifies the parent resource. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationResource] + def update_resource( + resource_id:, + name: nil, + description: nil, + parent_resource: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + if parent_resource + case parent_resource + when WorkOS::Authorization::ParentResourceById + body["parent_resource_id"] = parent_resource.parent_resource_id + when WorkOS::Authorization::ParentResourceByExternalId + body["parent_resource_external_id"] = parent_resource.parent_resource_external_id + body["parent_resource_type_slug"] = parent_resource.parent_resource_type_slug + else + raise ArgumentError, "expected parent_resource to be one of: WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId, got #{parent_resource.class}" + end + end + response = @client.request( + method: :patch, + path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthorizationResource.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 an authorization resource + # @param resource_id [String] The ID of the authorization resource. + # @param cascade_delete [Boolean, nil] If true, deletes all descendant resources and role assignments. If not set and the resource has children or assignments, the request will fail. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_resource( + resource_id:, + cascade_delete: false, + request_options: {} + ) + params = { + "cascade_delete" => cascade_delete + }.compact + @client.request( + method: :delete, + path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}", + auth: true, + params: params, + request_options: request_options + ) + nil + end + + # List organization memberships for resource + # @param resource_id [String] The ID of the authorization resource. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param permission_slug [String] The permission slug to filter by. Only users with this permission on the resource are returned. + # @param assignment [WorkOS::Types::AuthorizationAssignment, nil] Filter by assignment type. Use `direct` for direct assignments only, or `indirect` to include inherited assignments. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_memberships_for_resource( + resource_id:, + permission_slug:, + before: nil, + after: nil, + limit: 10, + order: "desc", + assignment: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "permission_slug" => permission_slug, + "assignment" => assignment + }.compact + response = @client.request( + method: :get, + path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}/organization_memberships", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_memberships_for_resource( + resource_id: resource_id, + before: before, + after: cursor, + limit: limit, + order: order, + permission_slug: permission_slug, + assignment: assignment, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserOrganizationMembershipBaseListData, + filters: {resource_id: resource_id, before: before, limit: limit, order: order, permission_slug: permission_slug, assignment: assignment}, + fetch_next: fetch_next + ) + end + + # List role assignments for a resource + # @param resource_id [String] The ID of the authorization resource. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_role_assignments_for_resource( + resource_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/resources/#{WorkOS::Util.encode_path(resource_id)}/role_assignments", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_role_assignments_for_resource( + resource_id: resource_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserRoleAssignment, + filters: {resource_id: resource_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # List environment roles + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::RoleList] + def list_environment_roles(request_options: {}) + response = @client.request( + method: :get, + path: "/authorization/roles", + auth: true, + request_options: request_options + ) + result = WorkOS::RoleList.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 + + # Create an environment role + # @param slug [String] A unique slug for the role. + # @param name [String] A descriptive name for the role. + # @param description [String, nil] An optional description of the role. + # @param resource_type_slug [String, nil] The slug of the resource type the role is scoped to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def create_environment_role( + slug:, + name:, + description: nil, + resource_type_slug: nil, + request_options: {} + ) + body = { + "slug" => slug, + "name" => name, + "description" => description, + "resource_type_slug" => resource_type_slug + }.compact + response = @client.request( + method: :post, + path: "/authorization/roles", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Get an environment role + # @param slug [String] The slug of the environment role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def get_environment_role( + slug:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Update an environment role + # @param slug [String] The slug of the environment role. + # @param name [String, nil] A descriptive name for the role. + # @param description [String, nil] An optional description of the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def update_environment_role( + slug:, + name: nil, + description: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + response = @client.request( + method: :patch, + path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Add a permission to an environment role + # @param slug [String] The slug of the environment role. + # @param body_slug [String] The slug of the permission to add to the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def add_environment_role_permission( + slug:, + body_slug:, + request_options: {} + ) + body = { + "slug" => body_slug + } + response = @client.request( + method: :post, + path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}/permissions", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # Set permissions for an environment role + # @param slug [String] The slug of the environment role. + # @param permissions [Array] The permission slugs to assign to the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Role] + def set_environment_role_permissions( + slug:, + permissions:, + request_options: {} + ) + body = { + "permissions" => permissions + } + response = @client.request( + method: :put, + path: "/authorization/roles/#{WorkOS::Util.encode_path(slug)}/permissions", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Role.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 + + # List permissions + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_permissions( + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/permissions", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_permissions( + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizationPermission, + filters: {before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Create a permission + # @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. + # @param name [String] A descriptive name for the Permission. + # @param description [String, nil] An optional description of the Permission. + # @param resource_type_slug [String, nil] The slug of the resource type this permission is scoped to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Permission] + def create_permission( + slug:, + name:, + description: nil, + resource_type_slug: nil, + request_options: {} + ) + body = { + "slug" => slug, + "name" => name, + "description" => description, + "resource_type_slug" => resource_type_slug + }.compact + response = @client.request( + method: :post, + path: "/authorization/permissions", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Permission.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 + + # Get a permission + # @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationPermission] + def get_permission( + slug:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + result = WorkOS::AuthorizationPermission.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 + + # Update a permission + # @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. + # @param name [String, nil] A descriptive name for the Permission. + # @param description [String, nil] An optional description of the Permission. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthorizationPermission] + def update_permission( + slug:, + name: nil, + description: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + response = @client.request( + method: :patch, + path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthorizationPermission.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 a permission + # @param slug [String] A unique key to reference the permission. Must be lowercase and contain only letters, numbers, hyphens, underscores, colons, periods, and asterisks. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_permission( + slug:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/authorization/permissions/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + nil + end + end +end diff --git a/lib/workos/authorization/add_role_permission.rb b/lib/workos/authorization/add_role_permission.rb new file mode 100644 index 00000000..da22eb7b --- /dev/null +++ b/lib/workos/authorization/add_role_permission.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AddRolePermission < WorkOS::Types::BaseModel + HASH_ATTRS = { + slug: :slug + }.freeze + + attr_accessor :slug + + def initialize(json) + hash = self.class.normalize(json) + @slug = hash[:slug] + end + end +end diff --git a/lib/workos/authorization/assign_role.rb b/lib/workos/authorization/assign_role.rb new file mode 100644 index 00000000..3a550c03 --- /dev/null +++ b/lib/workos/authorization/assign_role.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AssignRole < WorkOS::Types::BaseModel + HASH_ATTRS = { + role_slug: :role_slug, + resource_id: :resource_id, + resource_external_id: :resource_external_id, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :role_slug, + :resource_id, + :resource_external_id, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @role_slug = hash[:role_slug] + @resource_id = hash[:resource_id] + @resource_external_id = hash[:resource_external_id] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/authorization_check.rb b/lib/workos/authorization/authorization_check.rb new file mode 100644 index 00000000..0164ed1a --- /dev/null +++ b/lib/workos/authorization/authorization_check.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthorizationCheck < WorkOS::Types::BaseModel + HASH_ATTRS = { + authorized: :authorized + }.freeze + + attr_accessor :authorized + + def initialize(json) + hash = self.class.normalize(json) + @authorized = hash[:authorized] + end + end +end diff --git a/lib/workos/authorization/authorization_permission.rb b/lib/workos/authorization/authorization_permission.rb new file mode 100644 index 00000000..cf85df81 --- /dev/null +++ b/lib/workos/authorization/authorization_permission.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthorizationPermission < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + slug: :slug, + name: :name, + description: :description, + system: :system, + resource_type_slug: :resource_type_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :slug, + :name, + :description, + :system, + :resource_type_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @system = hash[:system] + @resource_type_slug = hash[:resource_type_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/authorization_resource.rb b/lib/workos/authorization/authorization_resource.rb new file mode 100644 index 00000000..1d7928df --- /dev/null +++ b/lib/workos/authorization/authorization_resource.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthorizationResource < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + name: :name, + description: :description, + organization_id: :organization_id, + parent_resource_id: :parent_resource_id, + id: :id, + external_id: :external_id, + resource_type_slug: :resource_type_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :name, + :description, + :organization_id, + :parent_resource_id, + :id, + :external_id, + :resource_type_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @name = hash[:name] + @description = hash[:description] + @organization_id = hash[:organization_id] + @parent_resource_id = hash[:parent_resource_id] + @id = hash[:id] + @external_id = hash[:external_id] + @resource_type_slug = hash[:resource_type_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/check_authorization.rb b/lib/workos/authorization/check_authorization.rb new file mode 100644 index 00000000..490d5260 --- /dev/null +++ b/lib/workos/authorization/check_authorization.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CheckAuthorization < WorkOS::Types::BaseModel + HASH_ATTRS = { + permission_slug: :permission_slug, + resource_id: :resource_id, + resource_external_id: :resource_external_id, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :permission_slug, + :resource_id, + :resource_external_id, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @permission_slug = hash[:permission_slug] + @resource_id = hash[:resource_id] + @resource_external_id = hash[:resource_external_id] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/create_authorization_permission.rb b/lib/workos/authorization/create_authorization_permission.rb new file mode 100644 index 00000000..d28bf57b --- /dev/null +++ b/lib/workos/authorization/create_authorization_permission.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateAuthorizationPermission < WorkOS::Types::BaseModel + HASH_ATTRS = { + slug: :slug, + name: :name, + description: :description, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :slug, + :name, + :description, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/create_authorization_resource.rb b/lib/workos/authorization/create_authorization_resource.rb new file mode 100644 index 00000000..2aece3ad --- /dev/null +++ b/lib/workos/authorization/create_authorization_resource.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateAuthorizationResource < WorkOS::Types::BaseModel + HASH_ATTRS = { + external_id: :external_id, + name: :name, + description: :description, + resource_type_slug: :resource_type_slug, + organization_id: :organization_id, + parent_resource_id: :parent_resource_id, + parent_resource_external_id: :parent_resource_external_id, + parent_resource_type_slug: :parent_resource_type_slug + }.freeze + + attr_accessor \ + :external_id, + :name, + :description, + :resource_type_slug, + :organization_id, + :parent_resource_id, + :parent_resource_external_id, + :parent_resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @external_id = hash[:external_id] + @name = hash[:name] + @description = hash[:description] + @resource_type_slug = hash[:resource_type_slug] + @organization_id = hash[:organization_id] + @parent_resource_id = hash[:parent_resource_id] + @parent_resource_external_id = hash[:parent_resource_external_id] + @parent_resource_type_slug = hash[:parent_resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/create_organization_role.rb b/lib/workos/authorization/create_organization_role.rb new file mode 100644 index 00000000..2b229d04 --- /dev/null +++ b/lib/workos/authorization/create_organization_role.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateOrganizationRole < WorkOS::Types::BaseModel + HASH_ATTRS = { + slug: :slug, + name: :name, + description: :description, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :slug, + :name, + :description, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/create_role.rb b/lib/workos/authorization/create_role.rb new file mode 100644 index 00000000..b8e617f1 --- /dev/null +++ b/lib/workos/authorization/create_role.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + CreateRole = CreateAuthorizationPermission +end diff --git a/lib/workos/authorization/permission.rb b/lib/workos/authorization/permission.rb new file mode 100644 index 00000000..745284a1 --- /dev/null +++ b/lib/workos/authorization/permission.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + Permission = AuthorizationPermission +end diff --git a/lib/workos/authorization/permission_created.rb b/lib/workos/authorization/permission_created.rb new file mode 100644 index 00000000..57783b4c --- /dev/null +++ b/lib/workos/authorization/permission_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PermissionCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PermissionCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/permission_created_data.rb b/lib/workos/authorization/permission_created_data.rb new file mode 100644 index 00000000..69a41462 --- /dev/null +++ b/lib/workos/authorization/permission_created_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PermissionCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + slug: :slug, + name: :name, + description: :description, + system: :system, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :slug, + :name, + :description, + :system, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @system = hash[:system] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/permission_deleted.rb b/lib/workos/authorization/permission_deleted.rb new file mode 100644 index 00000000..bc86c1f1 --- /dev/null +++ b/lib/workos/authorization/permission_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PermissionDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PermissionDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/permission_deleted_data.rb b/lib/workos/authorization/permission_deleted_data.rb new file mode 100644 index 00000000..99152a37 --- /dev/null +++ b/lib/workos/authorization/permission_deleted_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + PermissionDeletedData = PermissionCreatedData +end diff --git a/lib/workos/authorization/permission_updated.rb b/lib/workos/authorization/permission_updated.rb new file mode 100644 index 00000000..b5d36157 --- /dev/null +++ b/lib/workos/authorization/permission_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PermissionUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PermissionUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/permission_updated_data.rb b/lib/workos/authorization/permission_updated_data.rb new file mode 100644 index 00000000..5af757df --- /dev/null +++ b/lib/workos/authorization/permission_updated_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + PermissionUpdatedData = PermissionCreatedData +end diff --git a/lib/workos/authorization/remove_role.rb b/lib/workos/authorization/remove_role.rb new file mode 100644 index 00000000..8fca3899 --- /dev/null +++ b/lib/workos/authorization/remove_role.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + RemoveRole = AssignRole +end diff --git a/lib/workos/authorization/role.rb b/lib/workos/authorization/role.rb new file mode 100644 index 00000000..f5272bb7 --- /dev/null +++ b/lib/workos/authorization/role.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Role < WorkOS::Types::BaseModel + HASH_ATTRS = { + slug: :slug, + object: :object, + id: :id, + name: :name, + description: :description, + type: :type, + resource_type_slug: :resource_type_slug, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :slug, + :object, + :id, + :name, + :description, + :type, + :resource_type_slug, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @slug = hash[:slug] + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @description = hash[:description] + @type = hash[:type] + @resource_type_slug = hash[:resource_type_slug] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/role_created.rb b/lib/workos/authorization/role_created.rb new file mode 100644 index 00000000..54e64472 --- /dev/null +++ b/lib/workos/authorization/role_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RoleCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::RoleCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/role_created_data.rb b/lib/workos/authorization/role_created_data.rb new file mode 100644 index 00000000..e15482df --- /dev/null +++ b/lib/workos/authorization/role_created_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RoleCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + slug: :slug, + resource_type_slug: :resource_type_slug, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :slug, + :resource_type_slug, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @slug = hash[:slug] + @resource_type_slug = hash[:resource_type_slug] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/role_deleted.rb b/lib/workos/authorization/role_deleted.rb new file mode 100644 index 00000000..1bb859a1 --- /dev/null +++ b/lib/workos/authorization/role_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RoleDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::RoleDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/role_deleted_data.rb b/lib/workos/authorization/role_deleted_data.rb new file mode 100644 index 00000000..fdb74ff5 --- /dev/null +++ b/lib/workos/authorization/role_deleted_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + RoleDeletedData = RoleCreatedData +end diff --git a/lib/workos/authorization/role_list.rb b/lib/workos/authorization/role_list.rb new file mode 100644 index 00000000..4dfe809c --- /dev/null +++ b/lib/workos/authorization/role_list.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RoleList < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data: :data + }.freeze + + attr_accessor \ + :object, + :data + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data = (hash[:data] || []).map { |item| item ? WorkOS::Role.new(item) : nil } + end + end +end diff --git a/lib/workos/authorization/role_updated.rb b/lib/workos/authorization/role_updated.rb new file mode 100644 index 00000000..da154750 --- /dev/null +++ b/lib/workos/authorization/role_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RoleUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::RoleUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/authorization/role_updated_data.rb b/lib/workos/authorization/role_updated_data.rb new file mode 100644 index 00000000..ae681399 --- /dev/null +++ b/lib/workos/authorization/role_updated_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + RoleUpdatedData = RoleCreatedData +end diff --git a/lib/workos/authorization/set_role_permissions.rb b/lib/workos/authorization/set_role_permissions.rb new file mode 100644 index 00000000..3e66efee --- /dev/null +++ b/lib/workos/authorization/set_role_permissions.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SetRolePermissions < WorkOS::Types::BaseModel + HASH_ATTRS = { + permissions: :permissions + }.freeze + + attr_accessor :permissions + + def initialize(json) + hash = self.class.normalize(json) + @permissions = hash[:permissions] || [] + end + end +end diff --git a/lib/workos/authorization/slim_role.rb b/lib/workos/authorization/slim_role.rb new file mode 100644 index 00000000..7e98507b --- /dev/null +++ b/lib/workos/authorization/slim_role.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + SlimRole = AddRolePermission +end diff --git a/lib/workos/authorization/update_authorization_permission.rb b/lib/workos/authorization/update_authorization_permission.rb new file mode 100644 index 00000000..9d6ee344 --- /dev/null +++ b/lib/workos/authorization/update_authorization_permission.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateAuthorizationPermission < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + description: :description + }.freeze + + attr_accessor \ + :name, + :description + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @description = hash[:description] + end + end +end diff --git a/lib/workos/authorization/update_authorization_resource.rb b/lib/workos/authorization/update_authorization_resource.rb new file mode 100644 index 00000000..3ca4fa3b --- /dev/null +++ b/lib/workos/authorization/update_authorization_resource.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateAuthorizationResource < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + description: :description, + parent_resource_id: :parent_resource_id, + parent_resource_external_id: :parent_resource_external_id, + parent_resource_type_slug: :parent_resource_type_slug + }.freeze + + attr_accessor \ + :name, + :description, + :parent_resource_id, + :parent_resource_external_id, + :parent_resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @description = hash[:description] + @parent_resource_id = hash[:parent_resource_id] + @parent_resource_external_id = hash[:parent_resource_external_id] + @parent_resource_type_slug = hash[:parent_resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/update_organization_role.rb b/lib/workos/authorization/update_organization_role.rb new file mode 100644 index 00000000..68573440 --- /dev/null +++ b/lib/workos/authorization/update_organization_role.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UpdateOrganizationRole = UpdateAuthorizationPermission +end diff --git a/lib/workos/authorization/update_role.rb b/lib/workos/authorization/update_role.rb new file mode 100644 index 00000000..cdaa6c16 --- /dev/null +++ b/lib/workos/authorization/update_role.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UpdateRole = UpdateAuthorizationPermission +end diff --git a/lib/workos/authorization/user_organization_membership_base_list_data.rb b/lib/workos/authorization/user_organization_membership_base_list_data.rb new file mode 100644 index 00000000..5403c5df --- /dev/null +++ b/lib/workos/authorization/user_organization_membership_base_list_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserOrganizationMembershipBaseListData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + directory_managed: :directory_managed, + organization_name: :organization_name, + custom_attributes: :custom_attributes, + created_at: :created_at, + updated_at: :updated_at, + user: :user + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :directory_managed, + :organization_name, + :custom_attributes, + :created_at, + :updated_at, + :user + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @directory_managed = hash[:directory_managed] + @organization_name = hash[:organization_name] + @custom_attributes = hash[:custom_attributes] || {} + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + end + end +end diff --git a/lib/workos/authorization/user_role_assignment.rb b/lib/workos/authorization/user_role_assignment.rb new file mode 100644 index 00000000..0a0ff87e --- /dev/null +++ b/lib/workos/authorization/user_role_assignment.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserRoleAssignment < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_membership_id: :organization_membership_id, + role: :role, + resource: :resource, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_membership_id, + :role, + :resource, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_membership_id = hash[:organization_membership_id] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @resource = hash[:resource] ? WorkOS::UserRoleAssignmentResource.new(hash[:resource]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/user_role_assignment_resource.rb b/lib/workos/authorization/user_role_assignment_resource.rb new file mode 100644 index 00000000..9128e967 --- /dev/null +++ b/lib/workos/authorization/user_role_assignment_resource.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserRoleAssignmentResource < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + external_id: :external_id, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :id, + :external_id, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @external_id = hash[:external_id] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/base_client.rb b/lib/workos/base_client.rb new file mode 100644 index 00000000..f6495644 --- /dev/null +++ b/lib/workos/base_client.rb @@ -0,0 +1,421 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +require "json" +require "logger" +require "net/http" +require "securerandom" +require "uri" +require "workos/errors" + +module WorkOS + # Instance-scoped HTTP runtime that implements request execution, + # retry policy with exponential backoff + jitter, error translation, + # and per-request option overrides. + # + # @example Create a client with custom settings + # client = WorkOS::Client.new( + # api_key: "sk_...", + # client_id: "client_...", + # timeout: 60, + # max_retries: 3, + # logger: Logger.new($stdout), + # log_level: :info + # ) + # + # @example Shut down connections before forking + # client.shutdown + class BaseClient + DEFAULT_BASE_URL = "https://api.workos.com" + DEFAULT_TIMEOUT = 30 + DEFAULT_MAX_RETRIES = 2 + RETRYABLE_STATUSES = [408, 409, 429, 500, 502, 503, 504].freeze + MAX_CACHED_CONNECTIONS = 8 + RETRY_BACKOFF_BASE = 0.5 + LOG_SEVERITY = {debug: 0, info: 1, warn: 2, error: 3, unknown: 4}.freeze + + USER_AGENT = [ + "WorkOS", + "#{defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : "ruby"}/#{RUBY_VERSION}", + RUBY_PLATFORM, + "v#{WorkOS::VERSION}" + ].join("; ").freeze + + attr_reader :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level + + def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, client_id: nil, + timeout: DEFAULT_TIMEOUT, max_retries: DEFAULT_MAX_RETRIES, + logger: nil, log_level: nil, random: Random.new) + @api_key = api_key + @base_url = base_url + @client_id = client_id + @timeout = timeout + @max_retries = max_retries + @logger = logger + @log_level = log_level + @random = random + end + + # -- Request builders ------------------------------------------------- + + def get_request(path:, auth: false, params: {}, request_options: nil) + build_request(Net::HTTP::Get, append_query(path, params), + auth: auth, request_options: request_options) + end + + def post_request(path:, auth: false, body: {}, params: {}, request_options: nil) + req = build_request(Net::HTTP::Post, append_query(path, params), + auth: auth, request_options: request_options) + req.body = body.nil? ? "" : body.compact.to_json + req["Content-Type"] = "application/json" + inject_idempotency_key(req, request_options) + req + end + + def put_request(path:, auth: false, body: {}, params: {}, request_options: nil) + req = build_request(Net::HTTP::Put, append_query(path, params), + auth: auth, request_options: request_options) + req.body = body.nil? ? "" : body.compact.to_json + req["Content-Type"] = "application/json" + inject_idempotency_key(req, request_options) + req + end + + def patch_request(path:, auth: false, body: {}, params: {}, request_options: nil) + req = build_request(Net::HTTP::Patch, append_query(path, params), + auth: auth, request_options: request_options) + req.body = body.nil? ? "" : body.compact.to_json + req["Content-Type"] = "application/json" + inject_idempotency_key(req, request_options) + req + end + + def delete_request(path:, auth: false, body: nil, params: {}, request_options: nil) + req = build_request(Net::HTTP::Delete, append_query(path, params), + auth: auth, request_options: request_options) + if body + req.body = body.compact.to_json + req["Content-Type"] = "application/json" + end + req + end + + # -- Convenience entry point ------------------------------------------ + + # Unified request helper: builds the verb-specific request and executes + # it in a single call, removing the need for callers to pass + # request_options twice. + def request(method:, path:, auth: true, params: {}, body: nil, request_options: {}) + raise ArgumentError, "unsupported method" unless %i[get post put patch delete].include?(method) + request_options = (request_options || {}).transform_keys(&:to_sym) + + req = case method + when :get + get_request(path: path, auth: auth, params: params, request_options: request_options) + when :post + post_request(path: path, auth: auth, body: body, params: params, request_options: request_options) + when :put + put_request(path: path, auth: auth, body: body, params: params, request_options: request_options) + when :patch + patch_request(path: path, auth: auth, body: body, params: params, request_options: request_options) + when :delete + delete_request(path: path, auth: auth, body: body, params: params, request_options: request_options) + end + execute_request(request: req, request_options: request_options) + end + + # -- Execution -------------------------------------------------------- + + def execute_request(request:, request_options: nil) + opts = (request_options || {}).transform_keys(&:to_sym) + base = opts[:base_url] || @base_url + timeout = opts[:timeout] || @timeout + retries = opts[:max_retries] || @max_retries + attempt = 0 + + loop do + loggable_path = redact_path(request.path) + log(:debug, "request start", method: request.method, path: loggable_path, attempt: attempt + 1) + http = connection_for(base, timeout) + response = http.request(request) + return response if response.is_a?(Net::HTTPSuccess) + + if attempt < retries && retryable?(response) + attempt += 1 + inject_retry_idempotency_key(request) + log(:info, "request retry", method: request.method, path: loggable_path, attempt: attempt + 1, status: response.code.to_i) + sleep(retry_delay(response, attempt)) + next + end + log(:warn, "request error", method: request.method, path: loggable_path, status: response.code.to_i, request_id: response["x-request-id"] || response["X-Request-Id"]) + handle_error_response(response) + rescue Net::OpenTimeout, Net::ReadTimeout, + Errno::ECONNRESET, Errno::ECONNREFUSED, + IOError, Errno::EPIPE => e + evict_connection(base) + if attempt < retries + attempt += 1 + inject_retry_idempotency_key(request) + log(:info, "request retry", method: request.method, path: loggable_path, attempt: attempt + 1, error: e.class.name) + sleep(retry_delay(nil, attempt)) + next + end + log(:warn, "connection error", method: request.method, path: loggable_path, error: e.class.name, message: e.message) + raise WorkOS::APIConnectionError.new(message: e.message) + end + end + + # Close all persistent connections cached by this client on the current + # fiber/thread. + # + # Call this before forking (e.g. in a Puma `on_worker_boot` block) to + # avoid sharing `Net::HTTP` sockets across processes. + # + # @return [void] + def shutdown + connections = thread_connections.values + thread_connections.clear + connections.each { |connection| connection.finish if connection.started? } + end + + private + + # Redact path segments that carry bearer-equivalent tokens (e.g. + # `/user_management/invitations/by_token/`, + # `/user_management/magic_auth/`, password-reset / email- + # verification token paths) before the path is written to a logger. + # The WorkOS API exposes a small number of "by_token" endpoints whose + # path segments are themselves authentication material; redacting them + # here means the SDK never emits the token in its own log/retry/error + # messages even when the host application configures verbose logging. + REDACTED_TOKEN_PREFIXES = %w[ + /user_management/invitations/by_token + /user_management/magic_auth + /user_management/password_reset + /user_management/email_verification + ].freeze + private_constant :REDACTED_TOKEN_PREFIXES + + # Query-string keys whose values are bearer-equivalent or otherwise + # sensitive and should never appear in SDK log lines. Defense-in-depth + # for any path that flows through execute_request with a sensitive + # query parameter (most WorkOS-issued tokens are path segments or POST + # bodies, but a few flows — e.g. authorize/logout redirects — surface + # them in the query string). + REDACTED_QUERY_KEYS = %w[ + token + code + code_challenge + code_verifier + session_id + refresh_token + access_token + ].freeze + private_constant :REDACTED_QUERY_KEYS + + def redact_path(path) + return path if path.nil? || path.empty? + + # Strip query string for the prefix match; reattach (scrubbed) after. + path_only, query = path.split("?", 2) + REDACTED_TOKEN_PREFIXES.each do |prefix| + next unless path_only.start_with?("#{prefix}/") + + # Replace every segment after the matched prefix with "[REDACTED]". + remainder = path_only[(prefix.length + 1)..] + next if remainder.nil? || remainder.empty? + + redacted = remainder.split("/").map { "[REDACTED]" }.join("/") + path_only = "#{prefix}/#{redacted}" + break + end + query ? "#{path_only}?#{redact_query(query)}" : path_only + end + + def redact_query(query) + return query if query.nil? || query.empty? + + query.split("&").map { |pair| + key, value = pair.split("=", 2) + if value && !value.empty? && REDACTED_QUERY_KEYS.include?(key) + "#{key}=[REDACTED]" + else + pair + end + }.join("&") + end + + def append_query(path, params) + return path unless params.is_a?(Hash) && !params.empty? + + query = URI.encode_www_form(params.compact) + return path if query.empty? + + path.include?("?") ? "#{path}&#{query}" : "#{path}?#{query}" + end + + def connection_for(base_url, timeout) + uri = URI(base_url) + key = connection_key(uri, timeout) + conn = thread_connections[key] + + if conn&.started? + conn.read_timeout = timeout + conn.open_timeout = timeout + return conn + end + + http = Net::HTTP.new(uri.host, uri.port) + http.use_ssl = (uri.scheme == "https") + http.read_timeout = timeout + http.open_timeout = timeout + http.keep_alive_timeout = 30 + http.start + cache = thread_connections + cache[key] = http + evict_lru_connections(cache) if cache.size > MAX_CACHED_CONNECTIONS + http + end + + def evict_connection(base_url) + uri = URI(base_url) + keys = thread_connections.keys.select { |key| key.start_with?("#{uri.scheme}:#{uri.host}:#{uri.port}:") } + keys.each do |key| + connection = thread_connections.delete(key) + connection&.finish if connection&.started? + end + rescue IOError + # Already closed, ignore + end + + def evict_lru_connections(cache) + while cache.size > MAX_CACHED_CONNECTIONS + oldest_key = cache.keys.first + conn = cache.delete(oldest_key) + conn&.finish if conn&.started? + end + rescue IOError + # Already closed, ignore + end + + def connection_key(uri, timeout) + "#{uri.scheme}:#{uri.host}:#{uri.port}:#{timeout}" + end + + def thread_connections + Fiber[:workos_connections] ||= {} + end + + def build_request(klass, path, auth:, request_options:) + opts = request_options.is_a?(Hash) ? request_options : {} + request = klass.new(path) + if auth + key = opts[:api_key] || opts["api_key"] || @api_key + request["Authorization"] = "Bearer #{key}" if key && !key.empty? + end + request["User-Agent"] = USER_AGENT + # Apply user headers before idempotency injection so caller-supplied + # Idempotency-Key values win. + apply_extra_headers(request, request_options) + request + end + + def apply_extra_headers(request, request_options) + return unless request_options.is_a?(Hash) + + extra = request_options[:extra_headers] || request_options["extra_headers"] + return unless extra.is_a?(Hash) + + extra.each { |k, v| request[k.to_s] = v.to_s } + end + + def inject_idempotency_key(request, request_options) + opts = request_options.is_a?(Hash) ? request_options : {} + key = opts[:idempotency_key] || opts["idempotency_key"] + return if key.nil? || key.to_s.empty? + + request["Idempotency-Key"] ||= key + end + + def inject_retry_idempotency_key(request) + return unless %w[POST PUT PATCH].include?(request.method) + return if request["Idempotency-Key"] + + request["Idempotency-Key"] = SecureRandom.uuid + end + + def log(level, message, details = {}) + sink = @logger + return unless sink + return unless loggable?(level) + + formatter = details.compact.map { |key, value| "#{key}=#{value}" }.join(" ") + line = formatter.empty? ? message : "#{message} #{formatter}" + if sink.respond_to?(level) + sink.public_send(level, line) + elsif sink.respond_to?(:add) + sink.add(log_level_to_severity(level), line) + end + end + + def loggable?(level) + LOG_SEVERITY.fetch(level, LOG_SEVERITY[:unknown]) >= LOG_SEVERITY.fetch(@log_level || :debug, LOG_SEVERITY[:debug]) + end + + def log_level_to_severity(level) + case level + when :debug then ::Logger::DEBUG + when :info then ::Logger::INFO + when :warn then ::Logger::WARN + when :error then ::Logger::ERROR + else ::Logger::UNKNOWN + end + end + + def retryable?(response) + RETRYABLE_STATUSES.include?(response.code.to_i) + end + + def retry_delay(response, attempt) + if response + retry_after = response["Retry-After"] + return retry_after.to_f if retry_after&.to_f&.positive? + end + + base = RETRY_BACKOFF_BASE * (2**(attempt - 1)) + jitter = @random.rand * 0.25 * base + base + jitter + end + + def handle_error_response(response) + status = response.code.to_i + body = begin + JSON.parse(response.body.to_s) + rescue JSON::ParserError + {} + end + request_id = response["x-request-id"] || response["X-Request-Id"] + error_args = { + message: body["message"] || "HTTP #{status}", + http_status: status, + request_id: request_id, + code: body["code"], + body: body + } + + case status + when 400 then raise WorkOS::InvalidRequestError.new(**error_args) + when 401 then raise WorkOS::AuthenticationError.new(**error_args) + when 403 then raise WorkOS::ForbiddenRequestError.new(**error_args) + when 404 then raise WorkOS::NotFoundError.new(**error_args) + when 409 + raise WorkOS::IdempotencyError.new(**error_args) if body["code"] == "idempotency_error" + + raise WorkOS::APIError.new(**error_args) + when 422 then raise WorkOS::UnprocessableEntityError.new(**error_args) + when 429 then raise WorkOS::RateLimitExceededError.new(**error_args) + else raise WorkOS::APIError.new(**error_args) + end + end + end +end diff --git a/lib/workos/challenge.rb b/lib/workos/challenge.rb deleted file mode 100644 index fece268d..00000000 --- a/lib/workos/challenge.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Challnge class provides a lightweight wrapper around - # a WorkOS DirectoryUser resource. This class is not meant to be instantiated - # in DirectoryUser space, and is instantiated internally but exposed. - class Challenge - include HashProvider - - attr_accessor :id, :object, :expires_at, :code, :authentication_factor_id, :updated_at, :created_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @object = hash[:object] - @expires_at = hash[:expires_at] - @code = hash[:code] - @authentication_factor_id = hash[:authentication_factor_id] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - object: object, - expires_at: expires_at, - code: code, - authentication_factor_id: authentication_factor_id, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/client.rb b/lib/workos/client.rb index a946b0e8..fa9b29bb 100644 --- a/lib/workos/client.rb +++ b/lib/workos/client.rb @@ -1,145 +1,108 @@ # frozen_string_literal: true +# This file is auto-generated by oagen. Do not edit. + module WorkOS - # A Net::HTTP based API client for interacting with the WorkOS API - module Client - include Kernel - - def client - Net::HTTP.new(WorkOS.config.api_hostname, 443).tap do |http_client| - http_client.use_ssl = true - http_client.open_timeout = WorkOS.config.timeout - http_client.read_timeout = WorkOS.config.timeout - http_client.write_timeout = WorkOS.config.timeout if RUBY_VERSION >= '2.6.0' - end - end - - def execute_request(request:) - begin - response = client.request(request) - rescue Net::OpenTimeout, Net::ReadTimeout, Net::WriteTimeout - raise TimeoutError.new( - message: 'API Timeout Error', - ) - end - - http_status = response.code.to_i - handle_error_response(response: response) if http_status >= 400 - - response - end - - def get_request(path:, auth: false, params: {}, access_token: nil) - uri = URI(path) - uri.query = URI.encode_www_form(params) if params - - request = Net::HTTP::Get.new( - uri.to_s, - 'Content-Type' => 'application/json', - ) - - request['Authorization'] = "Bearer #{access_token || WorkOS.config.key!}" if auth - request['User-Agent'] = user_agent - request - end - - def post_request(path:, auth: false, idempotency_key: nil, body: nil) - request = Net::HTTP::Post.new(path, 'Content-Type' => 'application/json') - request.body = body.to_json if body - request['Authorization'] = "Bearer #{WorkOS.config.key!}" if auth - request['Idempotency-Key'] = idempotency_key if idempotency_key - request['User-Agent'] = user_agent - request - end - - def delete_request(path:, auth: false, params: {}) - uri = URI(path) - uri.query = URI.encode_www_form(params) if params - - request = Net::HTTP::Delete.new( - uri.to_s, - 'Content-Type' => 'application/json', - ) - - request['Authorization'] = "Bearer #{WorkOS.config.key!}" if auth - request['User-Agent'] = user_agent - request - end - - def put_request(path:, auth: false, idempotency_key: nil, body: nil) - request = Net::HTTP::Put.new(path, 'Content-Type' => 'application/json') - request.body = body.to_json if body - request['Authorization'] = "Bearer #{WorkOS.config.key!}" if auth - request['Idempotency-Key'] = idempotency_key if idempotency_key - request['User-Agent'] = user_agent - request - end - - def user_agent - engine = defined?(::RUBY_ENGINE) ? ::RUBY_ENGINE : 'Ruby' - - [ - 'WorkOS', - "#{engine}/#{RUBY_VERSION}", - RUBY_PLATFORM, - "v#{WorkOS::VERSION}" - ].join('; ') - end - - # rubocop:disable Metrics/MethodLength, Metrics/AbcSize - def handle_error_response(response:) - http_status = response.code.to_i - json = JSON.parse(response.body) - - case http_status - when 400 - raise InvalidRequestError.new( - message: json['message'], - http_status: http_status, - request_id: response['x-request-id'], - code: json['code'], - errors: json['errors'], - ) - when 401 - raise AuthenticationError.new( - message: json['message'], - http_status: http_status, - request_id: response['x-request-id'], - ) - when 404 - raise APIError.new( - message: json['message'], - http_status: http_status, - request_id: response['x-request-id'], - ) - when 422 - message = json['message'] - code = json['code'] - errors = extract_error(json['errors']) if json['errors'] - message += " (#{errors})" if errors - - raise InvalidRequestError.new( - message: message, - http_status: http_status, - request_id: response['x-request-id'], - code: code, - ) - else - raise APIError.new( - message: json['message'], - http_status: http_status, - request_id: response['x-request-id'], - ) - end - end - # rubocop:enable Metrics/MethodLength, Metrics/AbcSize - - private - - def extract_error(errors) - errors.map do |error| - "#{error['field']}: #{error['code']}" - end.join('; ') + class Client < BaseClient + def multi_factor_auth + @multi_factor_auth ||= WorkOS::MultiFactorAuth.new(self) + end + + def connect + @connect ||= WorkOS::Connect.new(self) + end + + def authorization + @authorization ||= WorkOS::Authorization.new(self) + end + + def sso + @sso ||= WorkOS::SSO.new(self) + end + + def pipes + @pipes ||= WorkOS::Pipes.new(self) + end + + def directory_sync + @directory_sync ||= WorkOS::DirectorySync.new(self) + end + + def events + @events ||= WorkOS::Events.new(self) + end + + def feature_flags + @feature_flags ||= WorkOS::FeatureFlags.new(self) + end + + def organization_domains + @organization_domains ||= WorkOS::OrganizationDomains.new(self) + end + + def organizations + @organizations ||= WorkOS::Organizations.new(self) + end + + def api_keys + @api_keys ||= WorkOS::ApiKeys.new(self) + end + + def groups + @groups ||= WorkOS::Groups.new(self) + end + + def admin_portal + @admin_portal ||= WorkOS::AdminPortal.new(self) + end + + def radar + @radar ||= WorkOS::Radar.new(self) + end + + def user_management + @user_management ||= WorkOS::UserManagement.new(self) + end + + def user_management_organization_membership_groups + @user_management_organization_membership_groups ||= WorkOS::UserManagementOrganizationMembershipGroups.new(self) + end + + def webhooks + @webhooks ||= WorkOS::Webhooks.new(self) + end + + def widgets + @widgets ||= WorkOS::Widgets.new(self) + end + + def audit_logs + @audit_logs ||= WorkOS::AuditLogs.new(self) + end + + # @oagen-ignore-start — non-spec service accessors (hand-maintained) + + def passwordless + @passwordless ||= WorkOS::Passwordless.new(self) + end + + def vault + @vault ||= WorkOS::Vault.new(self) + end + + def actions + @actions ||= WorkOS::Actions + end + + def session_manager(encryptor: nil) + return @session_manager if @session_manager && encryptor.nil? + + @session_manager = WorkOS::SessionManager.new(self, encryptor: encryptor) + end + + def pkce + @pkce ||= WorkOS::PKCE end + # @oagen-ignore-end end end diff --git a/lib/workos/configuration.rb b/lib/workos/configuration.rb index 58be1f5c..a96f9e8f 100644 --- a/lib/workos/configuration.rb +++ b/lib/workos/configuration.rb @@ -1,16 +1,67 @@ # frozen_string_literal: true +# @oagen-ignore-file — hand-maintained runtime module WorkOS - # Configuration class sets config initializer + # Global configuration holder for `WorkOS.configure`. + # + # @example + # WorkOS.configure do |config| + # config.api_key = ENV.fetch("WORKOS_API_KEY") + # config.client_id = ENV["WORKOS_CLIENT_ID"] + # config.logger = Logger.new($stdout) + # config.log_level = :info + # end class Configuration - attr_accessor :api_hostname, :timeout, :key + attr_accessor :api_key, :base_url, :client_id, :timeout, :max_retries, :logger, :log_level def initialize - @timeout = 60 + @base_url = WorkOS::BaseClient::DEFAULT_BASE_URL + @timeout = WorkOS::BaseClient::DEFAULT_TIMEOUT + @max_retries = WorkOS::BaseClient::DEFAULT_MAX_RETRIES + end + end + + class << self + # Yield the global configuration for modification. + # + # WorkOS.configure do |config| + # config.api_key = "sk_..." + # config.client_id = "client_..." + # end + def configure + yield(configuration) + end + + # The global configuration instance. + def configuration + @configuration ||= Configuration.new + end + + # A convenience client built from the global configuration. + # Lazy-initialized; reset by calling WorkOS.reset_client. + def client + @client ||= Client.new( + api_key: configuration.api_key, + base_url: configuration.base_url, + client_id: configuration.client_id, + timeout: configuration.timeout, + max_retries: configuration.max_retries, + logger: configuration.logger, + log_level: configuration.log_level + ) end - def key! - key or raise '`WorkOS.config.key` not set' + # Reset the cached singleton client. Shuts down any open connections + # on the current fiber/thread, then clears the cached client so the + # next call to {.client} builds a fresh one. + # + # Call this after reconfiguring, or in a Puma/Unicorn `on_worker_boot` + # block to avoid sharing sockets across forked processes. + # + # @return [void] + def reset_client + @client&.shutdown + @client = nil end end end diff --git a/lib/workos/connect.rb b/lib/workos/connect.rb new file mode 100644 index 00000000..09bb810a --- /dev/null +++ b/lib/workos/connect.rb @@ -0,0 +1,329 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Connect + def initialize(client) + @client = client + end + + # Complete external authentication + # @param external_auth_id [String] Identifier provided when AuthKit redirected to your login page. + # @param user [WorkOS::UserObject] The user to create or update in AuthKit. + # @param user_consent_options [Array, nil] Array of [User Consent Options](https://workos.com/docs/reference/workos-connect/standalone/user-consent-options) to store with the session. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ExternalAuthCompleteResponse] + def complete_oauth2( + external_auth_id:, + user:, + user_consent_options: nil, + request_options: {} + ) + body = { + "external_auth_id" => external_auth_id, + "user" => user, + "user_consent_options" => user_consent_options + }.compact + response = @client.request( + method: :post, + path: "/authkit/oauth2/complete", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ExternalAuthCompleteResponse.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 + + # List Connect Applications + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param organization_id [String, nil] Filter Connect Applications by organization ID. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_applications( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :get, + path: "/connect/applications", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_applications( + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::ConnectApplication, + filters: {before: before, limit: limit, order: order, organization_id: organization_id}, + fetch_next: fetch_next + ) + end + + # Create a Connect Application + # @param name [String] The name of the application. + # @param application_type [String] The type of application to create. + # @param description [String, nil] A description for the application. + # @param scopes [Array, nil] The OAuth scopes granted to the application. + # @param redirect_uris [Array, nil] Redirect URIs for the application. + # @param uses_pkce [Boolean, nil] Whether the application uses PKCE (Proof Key for Code Exchange). + # @param is_first_party [Boolean, nil] Whether this is a first-party application. Third-party applications require an organization_id. + # @param organization_id [String, nil] The organization ID this application belongs to. Required when is_first_party is false. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectApplication] + def create_application( + name:, + application_type:, + description: nil, + scopes: nil, + redirect_uris: nil, + uses_pkce: nil, + is_first_party: nil, + organization_id: nil, + request_options: {} + ) + body = { + "name" => name, + "application_type" => application_type, + "description" => description, + "scopes" => scopes, + "redirect_uris" => redirect_uris, + "uses_pkce" => uses_pkce, + "is_first_party" => is_first_party, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :post, + path: "/connect/applications", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ConnectApplication.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 + + # Create oauth application. + # @param name [String] + # @param is_first_party [Boolean] + # @param description [String, nil] + # @param scopes [Array, nil] + # @param redirect_uris [Array, nil] + # @param uses_pkce [Boolean, nil] + # @param organization_id [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::ConnectApplication] + def create_oauth_application( + name:, + is_first_party:, + description: nil, + scopes: nil, + redirect_uris: nil, + uses_pkce: nil, + organization_id: nil, + request_options: {} + ) + body = { + "application_type" => "oauth", + "name" => name, + "is_first_party" => is_first_party, + "description" => description, + "scopes" => scopes, + "redirect_uris" => redirect_uris, + "uses_pkce" => uses_pkce, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :post, + path: "/connect/applications", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::ConnectApplication.new(response.body) + end + + # Create m2m application. + # @param name [String] + # @param organization_id [String] + # @param description [String, nil] + # @param scopes [Array, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::ConnectApplication] + def create_m2m_application( + name:, + organization_id:, + description: nil, + scopes: nil, + request_options: {} + ) + body = { + "application_type" => "m2m", + "name" => name, + "organization_id" => organization_id, + "description" => description, + "scopes" => scopes + }.compact + response = @client.request( + method: :post, + path: "/connect/applications", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::ConnectApplication.new(response.body) + end + + # Get a Connect Application + # @param id [String] The application ID or client ID of the Connect Application. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectApplication] + def get_application( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/connect/applications/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::ConnectApplication.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 + + # Update a Connect Application + # @param id [String] The application ID or client ID of the Connect Application. + # @param name [String, nil] The name of the application. + # @param description [String, nil] A description for the application. + # @param scopes [Array, nil] The OAuth scopes granted to the application. + # @param redirect_uris [Array, nil] Updated redirect URIs for the application. OAuth applications only. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectApplication] + def update_application( + id:, + name: nil, + description: nil, + scopes: nil, + redirect_uris: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description, + "scopes" => scopes, + "redirect_uris" => redirect_uris + }.compact + response = @client.request( + method: :put, + path: "/connect/applications/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ConnectApplication.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 a Connect Application + # @param id [String] The application ID or client ID of the Connect Application. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_application( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/connect/applications/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end + + # List Client Secrets for a Connect Application + # @param id [String] The application ID or client ID of the Connect Application. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [Array] + def list_application_client_secrets( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/connect/applications/#{WorkOS::Util.encode_path(id)}/client_secrets", + auth: true, + request_options: request_options + ) + parsed = JSON.parse(response.body) + (parsed || []).map { |item| WorkOS::ApplicationCredentialsListItem.new(item) } + end + + # Create a new client secret for a Connect Application + # @param id [String] The application ID or client ID of the Connect Application. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::NewConnectApplicationSecret] + def create_application_client_secret( + id:, + request_options: {} + ) + response = @client.request( + method: :post, + path: "/connect/applications/#{WorkOS::Util.encode_path(id)}/client_secrets", + auth: true, + request_options: request_options + ) + result = WorkOS::NewConnectApplicationSecret.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 a Client Secret + # @param id [String] The unique ID of the client secret. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_client_secret( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/connect/client_secrets/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end + end +end diff --git a/lib/workos/connect/application_credentials_list_item.rb b/lib/workos/connect/application_credentials_list_item.rb new file mode 100644 index 00000000..c027d3c2 --- /dev/null +++ b/lib/workos/connect/application_credentials_list_item.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApplicationCredentialsListItem < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + secret_hint: :secret_hint, + last_used_at: :last_used_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :secret_hint, + :last_used_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @secret_hint = hash[:secret_hint] + @last_used_at = hash[:last_used_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/connect/connect_application.rb b/lib/workos/connect/connect_application.rb new file mode 100644 index 00000000..39230b72 --- /dev/null +++ b/lib/workos/connect/connect_application.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectApplication < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + client_id: :client_id, + description: :description, + name: :name, + scopes: :scopes, + created_at: :created_at, + updated_at: :updated_at, + application_type: :application_type, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :object, + :id, + :client_id, + :description, + :name, + :scopes, + :created_at, + :updated_at, + :application_type, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @client_id = hash[:client_id] + @description = hash[:description] + @name = hash[:name] + @scopes = hash[:scopes] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @application_type = hash[:application_type] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/connect/create_application_secret.rb b/lib/workos/connect/create_application_secret.rb new file mode 100644 index 00000000..6b3b1a03 --- /dev/null +++ b/lib/workos/connect/create_application_secret.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateApplicationSecret < WorkOS::Types::BaseModel + HASH_ATTRS = {}.freeze + + def initialize(json) + self.class.normalize(json) + end + end +end diff --git a/lib/workos/connect/create_m2m_application.rb b/lib/workos/connect/create_m2m_application.rb new file mode 100644 index 00000000..d8ca27e6 --- /dev/null +++ b/lib/workos/connect/create_m2m_application.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateM2MApplication < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + application_type: :application_type, + description: :description, + scopes: :scopes, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :name, + :application_type, + :description, + :scopes, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @application_type = hash[:application_type] + @description = hash[:description] + @scopes = hash[:scopes] || [] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/connect/create_oauth_application.rb b/lib/workos/connect/create_oauth_application.rb new file mode 100644 index 00000000..ea780400 --- /dev/null +++ b/lib/workos/connect/create_oauth_application.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateOAuthApplication < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + application_type: :application_type, + description: :description, + scopes: :scopes, + redirect_uris: :redirect_uris, + uses_pkce: :uses_pkce, + is_first_party: :is_first_party, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :name, + :application_type, + :description, + :scopes, + :redirect_uris, + :uses_pkce, + :is_first_party, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @application_type = hash[:application_type] + @description = hash[:description] + @scopes = hash[:scopes] || [] + @redirect_uris = (hash[:redirect_uris] || []).map { |item| item ? WorkOS::RedirectUriInput.new(item) : nil } + @uses_pkce = hash[:uses_pkce] + @is_first_party = hash[:is_first_party] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/connect/external_auth_complete_response.rb b/lib/workos/connect/external_auth_complete_response.rb new file mode 100644 index 00000000..71dfcc7b --- /dev/null +++ b/lib/workos/connect/external_auth_complete_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ExternalAuthCompleteResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + redirect_uri: :redirect_uri + }.freeze + + attr_accessor :redirect_uri + + def initialize(json) + hash = self.class.normalize(json) + @redirect_uri = hash[:redirect_uri] + end + end +end diff --git a/lib/workos/connect/new_connect_application_secret.rb b/lib/workos/connect/new_connect_application_secret.rb new file mode 100644 index 00000000..a6a05b68 --- /dev/null +++ b/lib/workos/connect/new_connect_application_secret.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class NewConnectApplicationSecret < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + secret_hint: :secret_hint, + last_used_at: :last_used_at, + created_at: :created_at, + updated_at: :updated_at, + secret: :secret + }.freeze + + attr_accessor \ + :object, + :id, + :secret_hint, + :last_used_at, + :created_at, + :updated_at, + :secret + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @secret_hint = hash[:secret_hint] + @last_used_at = hash[:last_used_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @secret = hash[:secret] + end + end +end diff --git a/lib/workos/connect/redirect_uri_input.rb b/lib/workos/connect/redirect_uri_input.rb new file mode 100644 index 00000000..36bf7b3b --- /dev/null +++ b/lib/workos/connect/redirect_uri_input.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RedirectUriInput < WorkOS::Types::BaseModel + HASH_ATTRS = { + uri: :uri, + default: :default + }.freeze + + attr_accessor \ + :uri, + :default + + def initialize(json) + hash = self.class.normalize(json) + @uri = hash[:uri] + @default = hash[:default] + end + end +end diff --git a/lib/workos/connect/update_oauth_application.rb b/lib/workos/connect/update_oauth_application.rb new file mode 100644 index 00000000..1845ae13 --- /dev/null +++ b/lib/workos/connect/update_oauth_application.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateOAuthApplication < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + description: :description, + scopes: :scopes, + redirect_uris: :redirect_uris + }.freeze + + attr_accessor \ + :name, + :description, + :scopes, + :redirect_uris + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @description = hash[:description] + @scopes = hash[:scopes] || [] + @redirect_uris = (hash[:redirect_uris] || []).map { |item| item ? WorkOS::RedirectUriInput.new(item) : nil } + end + end +end diff --git a/lib/workos/connect/user_consent_option.rb b/lib/workos/connect/user_consent_option.rb new file mode 100644 index 00000000..e1df94e8 --- /dev/null +++ b/lib/workos/connect/user_consent_option.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserConsentOption < WorkOS::Types::BaseModel + HASH_ATTRS = { + claim: :claim, + type: :type, + label: :label, + choices: :choices + }.freeze + + attr_accessor \ + :claim, + :type, + :label, + :choices + + def initialize(json) + hash = self.class.normalize(json) + @claim = hash[:claim] + @type = hash[:type] + @label = hash[:label] + @choices = (hash[:choices] || []).map { |item| item ? WorkOS::UserConsentOptionChoice.new(item) : nil } + end + end +end diff --git a/lib/workos/connect/user_consent_option_choice.rb b/lib/workos/connect/user_consent_option_choice.rb new file mode 100644 index 00000000..6128a9f9 --- /dev/null +++ b/lib/workos/connect/user_consent_option_choice.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserConsentOptionChoice < WorkOS::Types::BaseModel + HASH_ATTRS = { + value: :value, + label: :label + }.freeze + + attr_accessor \ + :value, + :label + + def initialize(json) + hash = self.class.normalize(json) + @value = hash[:value] + @label = hash[:label] + end + end +end diff --git a/lib/workos/connect/user_management_login_request.rb b/lib/workos/connect/user_management_login_request.rb new file mode 100644 index 00000000..245fab6c --- /dev/null +++ b/lib/workos/connect/user_management_login_request.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserManagementLoginRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + external_auth_id: :external_auth_id, + user: :user, + user_consent_options: :user_consent_options + }.freeze + + attr_accessor \ + :external_auth_id, + :user, + :user_consent_options + + def initialize(json) + hash = self.class.normalize(json) + @external_auth_id = hash[:external_auth_id] + @user = hash[:user] ? WorkOS::UserObject.new(hash[:user]) : nil + @user_consent_options = (hash[:user_consent_options] || []).map { |item| item ? WorkOS::UserConsentOption.new(item) : nil } + end + end +end diff --git a/lib/workos/connect/user_object.rb b/lib/workos/connect/user_object.rb new file mode 100644 index 00000000..9d263482 --- /dev/null +++ b/lib/workos/connect/user_object.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserObject < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + email: :email, + first_name: :first_name, + last_name: :last_name, + metadata: :metadata + }.freeze + + attr_accessor \ + :id, + :email, + :first_name, + :last_name, + :metadata + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @metadata = hash[:metadata] || {} + end + end +end diff --git a/lib/workos/connection.rb b/lib/workos/connection.rb deleted file mode 100644 index 2608fc16..00000000 --- a/lib/workos/connection.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Connection class provides a lightweight wrapper around - # a WorkOS Connection resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - # Note: status is deprecated - use state instead - class Connection - include HashProvider - - attr_accessor :id, :name, :connection_type, :domains, :organization_id, - :state, :status, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @name = hash[:name] - @connection_type = hash[:connection_type] - @domains = hash[:domains] - @organization_id = hash[:organization_id] - @state = hash[:state] - @status = hash[:status] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - name: name, - connection_type: connection_type, - domains: domains, - organization_id: organization_id, - state: state, - status: status, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/deprecated_hash_wrapper.rb b/lib/workos/deprecated_hash_wrapper.rb deleted file mode 100644 index 756da4a6..00000000 --- a/lib/workos/deprecated_hash_wrapper.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # A Temporary wrapper class for a Hash, currently the base class for - # WorOS::DirectoryGroup and WorkOS::DirectoryUser. Makes all the Hash - # methods available to those classes, but will also emit a deprecation - # warning whenever any of them are used. - # - # Once we deprecate Hash compatibility, this model can be deleted. - class DeprecatedHashWrapper < Hash - (public_instance_methods - Object.methods).each do |method_name| - define_method method_name do |*args, &block| - print_deprecation_warning(method_name) - super(*args, &block) - end - end - - # call the original implementation of :replace in Hash, - # so we don't show the deprecation warning - def replace_without_warning(new_hash) - method(:replace).super_method&.call(new_hash) - end - - def [](attribute_name) - usage = "#{object_name}.#{attribute_name}" - warning_message = "WARNING: The Hash style access for #{class_name} attributes is deprecated -and will be removed in a future version. Please use `#{usage}` or equivalent accessor.\n" - - print_deprecation_warning('[]', warning_message) - - super(attribute_name.to_sym) - end - - private - - def deprecation_warning(method_name) - usage = "#{object_name}.to_h.#{method_name}" - - "WARNING: Hash compatibility for #{class_name} is deprecated and will be removed -in a future version. Please use `#{usage}` to access methods on the attribute Hash object.\n" - end - - def print_deprecation_warning(method_name, warning_message = deprecation_warning(method_name)) - if RUBY_VERSION > '3' - warn warning_message, category: :deprecated - else - warn warning_message - end - end - - def class_name - self.class.name - end - - # We want to do class_name.demodulize.underscore here, but that's not available in Ruby 1.9, so - # implementing the demodulize and underscore methods here. - def object_name - i = class_name.rindex('::') - object_name = i ? class_name[(i + 2)..-1] : class_name - underscore(object_name) - end - - def underscore(camel_cased_word) - return camel_cased_word.to_s unless /[A-Z-]|::/.match?(camel_cased_word) - - word = camel_cased_word.to_s.gsub('::', '/') - word.gsub!(/(?:(?<=([A-Za-z\d]))|\b)((?=a)b)(?=\b|[^a-z])/) do - "#{Regexp.last_match(1) && '_'}#{Regexp.last_match(2).downcase}" - end - word.gsub!(/([A-Z]+)(?=[A-Z][a-z])|([a-z\d])(?=[A-Z])/) { (Regexp.last_match(1) || Regexp.last_match(2)) << '_' } - word.tr!('-', '_') - word.downcase! - word - end - end -end diff --git a/lib/workos/directory.rb b/lib/workos/directory.rb deleted file mode 100644 index 7aeb4bce..00000000 --- a/lib/workos/directory.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Directory class provides a lightweight wrapper around - # a WorkOS Directory resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - class Directory - include HashProvider - - attr_accessor :id, :domain, :name, :type, :state, :organization_id, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @name = hash[:name] - @domain = hash[:domain] - @type = hash[:type] - @state = hash[:state] - @organization_id = hash[:organization_id] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - name: name, - domain: domain, - type: type, - state: state, - organization_id: organization_id, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/directory_group.rb b/lib/workos/directory_group.rb deleted file mode 100644 index 7cdd5a2c..00000000 --- a/lib/workos/directory_group.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The DirectoryGroup class provides a lightweight wrapper around - # a WorkOS DirectoryGroup resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - class DirectoryGroup < DeprecatedHashWrapper - include HashProvider - - attr_accessor :id, :directory_id, :idp_id, :name, :created_at, :updated_at, - :raw_attributes, :organization_id - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @directory_id = hash[:directory_id] - @organization_id = hash[:organization_id] - @idp_id = hash[:idp_id] - @name = hash[:name] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - @raw_attributes = hash[:raw_attributes] - - replace_without_warning(to_json) - end - - def to_json(*) - { - id: id, - directory_id: directory_id, - organization_id: organization_id, - idp_id: idp_id, - name: name, - created_at: created_at, - updated_at: updated_at, - raw_attributes: raw_attributes, - } - end - end -end diff --git a/lib/workos/directory_sync.rb b/lib/workos/directory_sync.rb index 999fdfce..ac473f94 100644 --- a/lib/workos/directory_sync.rb +++ b/lib/workos/directory_sync.rb @@ -1,200 +1,247 @@ # frozen_string_literal: true -require 'net/http' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The Directory Sync module provides convenience methods for working with the - # WorkOS Directory Sync platform. You'll need a valid API key and to have - # created a Directory Sync connection on your WorkOS dashboard. - # - # @see https://docs.workos.com/directory-sync/overview - module DirectorySync - class << self - include Client - - # Retrieve directories. - # - # @param [Hash] options An options hash - # @option options [String] domain The domain of the directory to be - # retrieved. - # @option options [String] search A search term for direcory names. - # @option options [String] limit Maximum number of records to return. - # @option options [String] order The order in which to paginate records - # @option options [String] before Pagination cursor to receive records - # before a provided Directory ID. - # @option options [String] after Pagination cursor to receive records - # before a provided Directory ID. - # @option options [String] organization_id The ID for an Organization configured on WorkOS. - # - # @return [Hash] - def list_directories(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/directories', - auth: true, - params: options, - ), - ) - - parsed_response = JSON.parse(response.body) - directories = parsed_response['data'].map do |directory| - ::WorkOS::Directory.new(directory.to_json) - end - - WorkOS::Types::ListStruct.new( - data: directories, - list_metadata: parsed_response['listMetadata'], - ) - end - - # Retrieve directory. - # - # @param [String] id Directory unique identifier - # - # @example - # WorkOS::SSO.get_directory(id: 'directory_01FK17DWRHH7APAFXT5B52PV0W') - # => #] + def list_directories( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + search: nil, + domain: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id, + "search" => search, + "domain" => domain + }.compact + response = @client.request( + method: :get, + path: "/directories", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_directories( + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + search: search, + domain: domain, + request_options: request_options ) - end + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Directory, + filters: {before: before, limit: limit, order: order, organization_id: organization_id, search: search, domain: domain}, + fetch_next: fetch_next + ) + end - # Retrieve the directory group with the given ID. - # - # @param [String] id The ID of the directory group. - # - # @return WorkOS::DirectoryGroup - def get_group(id) - response = execute_request( - request: get_request( - path: "/directory_groups/#{id}", - auth: true, - ), - ) + # Get a Directory + # @param id [String] Unique identifier for the Directory. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Directory] + def get_directory( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/directories/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Directory.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 - ::WorkOS::DirectoryGroup.new(response.body) - end + # Delete a Directory + # @param id [String] Unique identifier for the Directory. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_directory( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/directories/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - # Retrieve the directory user with the given ID. - # - # @param [String] id The ID of the directory user. - # - # @return WorkOS::DirectoryUser - def get_user(id) - response = execute_request( - request: get_request( - path: "/directory_users/#{id}", - auth: true, - ), + # List Directory Groups + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param directory [String, nil] Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API. + # @param user [String, nil] Unique identifier of the WorkOS Directory User. This value can be obtained from the WorkOS API. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_groups( + before: nil, + after: nil, + limit: 10, + order: "desc", + directory: nil, + user: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "directory" => directory, + "user" => user + }.compact + response = @client.request( + method: :get, + path: "/directory_groups", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_groups( + before: before, + after: cursor, + limit: limit, + order: order, + directory: directory, + user: user, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::DirectoryGroup, + filters: {before: before, limit: limit, order: order, directory: directory, user: user}, + fetch_next: fetch_next + ) + end - ::WorkOS::DirectoryUser.new(response.body) - end + # Get a Directory Group + # @param id [String] Unique identifier for the Directory Group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DirectoryGroup] + def get_group( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/directory_groups/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::DirectoryGroup.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 the directory with the given ID. - # - # @param [String] id The ID of the directory. - # - # @return Boolean - def delete_directory(id) - request = delete_request( - auth: true, - path: "/directories/#{id}", + # List Directory Users + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param directory [String, nil] Unique identifier of the WorkOS Directory. This value can be obtained from the WorkOS dashboard or from the WorkOS API. + # @param group [String, nil] Unique identifier of the WorkOS Directory Group. This value can be obtained from the WorkOS API. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_users( + before: nil, + after: nil, + limit: 10, + order: "desc", + directory: nil, + group: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "directory" => directory, + "group" => group + }.compact + response = @client.request( + method: :get, + path: "/directory_users", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_users( + before: before, + after: cursor, + limit: limit, + order: order, + directory: directory, + group: group, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::DirectoryUserWithGroups, + filters: {before: before, limit: limit, order: order, directory: directory, group: group}, + fetch_next: fetch_next + ) + end - response = execute_request(request: request) - - response.is_a? Net::HTTPSuccess - end + # Get a Directory User + # @param id [String] Unique identifier for the Directory User. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DirectoryUserWithGroups] + def get_user( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/directory_users/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::DirectoryUserWithGroups.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 end end diff --git a/lib/workos/directory_sync/directory.rb b/lib/workos/directory_sync/directory.rb new file mode 100644 index 00000000..b69fcc33 --- /dev/null +++ b/lib/workos/directory_sync/directory.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Directory < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + external_key: :external_key, + type: :type, + state: :state, + name: :name, + domain: :domain, + metadata: :metadata, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :external_key, + :type, + :state, + :name, + :domain, + :metadata, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @external_key = hash[:external_key] + @type = hash[:type] + @state = hash[:state] + @name = hash[:name] + @domain = hash[:domain] + @metadata = hash[:metadata] ? WorkOS::DirectoryMetadata.new(hash[:metadata]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/directory_sync/directory_group.rb b/lib/workos/directory_sync/directory_group.rb new file mode 100644 index 00000000..8e115930 --- /dev/null +++ b/lib/workos/directory_sync/directory_group.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryGroup < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + idp_id: :idp_id, + directory_id: :directory_id, + organization_id: :organization_id, + name: :name, + raw_attributes: :raw_attributes, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :idp_id, + :directory_id, + :organization_id, + :name, + :raw_attributes, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @idp_id = hash[:idp_id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @name = hash[:name] + @raw_attributes = hash[:raw_attributes] || {} + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/directory_sync/directory_metadata.rb b/lib/workos/directory_sync/directory_metadata.rb new file mode 100644 index 00000000..386a0be0 --- /dev/null +++ b/lib/workos/directory_sync/directory_metadata.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryMetadata < WorkOS::Types::BaseModel + HASH_ATTRS = { + users: :users, + groups: :groups + }.freeze + + attr_accessor \ + :users, + :groups + + def initialize(json) + hash = self.class.normalize(json) + @users = hash[:users] ? WorkOS::DirectoryMetadataUser.new(hash[:users]) : nil + @groups = hash[:groups] + end + end +end diff --git a/lib/workos/directory_sync/directory_metadata_user.rb b/lib/workos/directory_sync/directory_metadata_user.rb new file mode 100644 index 00000000..1d43f750 --- /dev/null +++ b/lib/workos/directory_sync/directory_metadata_user.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryMetadataUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + active: :active, + inactive: :inactive + }.freeze + + attr_accessor \ + :active, + :inactive + + def initialize(json) + hash = self.class.normalize(json) + @active = hash[:active] + @inactive = hash[:inactive] + end + end +end diff --git a/lib/workos/directory_sync/directory_user.rb b/lib/workos/directory_sync/directory_user.rb new file mode 100644 index 00000000..e5c7d28e --- /dev/null +++ b/lib/workos/directory_sync/directory_user.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + directory_id: :directory_id, + organization_id: :organization_id, + idp_id: :idp_id, + email: :email, + first_name: :first_name, + last_name: :last_name, + name: :name, + emails: :emails, + job_title: :job_title, + username: :username, + state: :state, + raw_attributes: :raw_attributes, + custom_attributes: :custom_attributes, + role: :role, + roles: :roles, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + # @!attribute emails + # @deprecated A list of email addresses for the user. + # @!attribute job_title + # @deprecated The job title of the user. + # @!attribute username + # @deprecated The username of the user. + # @!attribute raw_attributes + # @deprecated The raw attributes received from the directory provider. + + attr_accessor \ + :object, + :id, + :directory_id, + :organization_id, + :idp_id, + :email, + :first_name, + :last_name, + :name, + :state, + :custom_attributes, + :role, + :roles, + :created_at, + :updated_at + + def emails + warn "[DEPRECATION] `emails` is deprecated and will be removed in a future version.", uplevel: 1 + @emails + end + + attr_writer :emails + + def job_title + warn "[DEPRECATION] `job_title` is deprecated and will be removed in a future version.", uplevel: 1 + @job_title + end + + attr_writer :job_title + + def username + warn "[DEPRECATION] `username` is deprecated and will be removed in a future version.", uplevel: 1 + @username + end + + attr_writer :username + + def raw_attributes + warn "[DEPRECATION] `raw_attributes` is deprecated and will be removed in a future version.", uplevel: 1 + @raw_attributes + end + + attr_writer :raw_attributes + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @idp_id = hash[:idp_id] + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @name = hash[:name] + @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserEmail.new(item) : nil } + @job_title = hash[:job_title] + @username = hash[:username] + @state = hash[:state] + @raw_attributes = hash[:raw_attributes] || {} + @custom_attributes = hash[:custom_attributes] || {} + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/directory_sync/directory_user_email.rb b/lib/workos/directory_sync/directory_user_email.rb new file mode 100644 index 00000000..bb922a3b --- /dev/null +++ b/lib/workos/directory_sync/directory_user_email.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryUserEmail < WorkOS::Types::BaseModel + HASH_ATTRS = { + primary: :primary, + type: :type, + value: :value + }.freeze + + attr_accessor \ + :primary, + :type, + :value + + def initialize(json) + hash = self.class.normalize(json) + @primary = hash[:primary] + @type = hash[:type] + @value = hash[:value] + end + end +end diff --git a/lib/workos/directory_sync/directory_user_with_groups.rb b/lib/workos/directory_sync/directory_user_with_groups.rb new file mode 100644 index 00000000..7bcbf7c0 --- /dev/null +++ b/lib/workos/directory_sync/directory_user_with_groups.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DirectoryUserWithGroups < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + directory_id: :directory_id, + organization_id: :organization_id, + idp_id: :idp_id, + email: :email, + first_name: :first_name, + last_name: :last_name, + name: :name, + emails: :emails, + job_title: :job_title, + username: :username, + state: :state, + raw_attributes: :raw_attributes, + custom_attributes: :custom_attributes, + role: :role, + roles: :roles, + created_at: :created_at, + updated_at: :updated_at, + groups: :groups + }.freeze + + # @!attribute emails + # @deprecated A list of email addresses for the user. + # @!attribute job_title + # @deprecated The job title of the user. + # @!attribute username + # @deprecated The username of the user. + # @!attribute raw_attributes + # @deprecated The raw attributes received from the directory provider. + # @!attribute groups + # @deprecated The directory groups the user belongs to. Deprecated: starting May 1, 2026, this field returns an empty array by default for newly created teams. Existing teams currently depending on this field should migrate to the new access pattern for better throughput performance — the field is unbounded by user, so users with many group memberships produce large, slow response payloads. Use the List Directory Groups endpoint with a `user` filter to fetch a user's group memberships. + + attr_accessor \ + :object, + :id, + :directory_id, + :organization_id, + :idp_id, + :email, + :first_name, + :last_name, + :name, + :state, + :custom_attributes, + :role, + :roles, + :created_at, + :updated_at + + def emails + warn "[DEPRECATION] `emails` is deprecated and will be removed in a future version.", uplevel: 1 + @emails + end + + attr_writer :emails + + def job_title + warn "[DEPRECATION] `job_title` is deprecated and will be removed in a future version.", uplevel: 1 + @job_title + end + + attr_writer :job_title + + def username + warn "[DEPRECATION] `username` is deprecated and will be removed in a future version.", uplevel: 1 + @username + end + + attr_writer :username + + def raw_attributes + warn "[DEPRECATION] `raw_attributes` is deprecated and will be removed in a future version.", uplevel: 1 + @raw_attributes + end + + attr_writer :raw_attributes + + def groups + warn "[DEPRECATION] `groups` is deprecated and will be removed in a future version.", uplevel: 1 + @groups + end + + attr_writer :groups + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @idp_id = hash[:idp_id] + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @name = hash[:name] + @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DirectoryUserWithGroupsEmail.new(item) : nil } + @job_title = hash[:job_title] + @username = hash[:username] + @state = hash[:state] + @raw_attributes = hash[:raw_attributes] || {} + @custom_attributes = hash[:custom_attributes] || {} + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @groups = (hash[:groups] || []).map { |item| item ? WorkOS::DirectoryGroup.new(item) : nil } + end + end +end diff --git a/lib/workos/directory_sync/directory_user_with_groups_email.rb b/lib/workos/directory_sync/directory_user_with_groups_email.rb new file mode 100644 index 00000000..8c558690 --- /dev/null +++ b/lib/workos/directory_sync/directory_user_with_groups_email.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + DirectoryUserWithGroupsEmail = DirectoryUserEmail +end diff --git a/lib/workos/directory_sync/dsync_activated.rb b/lib/workos/directory_sync/dsync_activated.rb new file mode 100644 index 00000000..8a8d4c32 --- /dev/null +++ b/lib/workos/directory_sync/dsync_activated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncActivated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncActivatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_activated_data.rb b/lib/workos/directory_sync/dsync_activated_data.rb new file mode 100644 index 00000000..b432c979 --- /dev/null +++ b/lib/workos/directory_sync/dsync_activated_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncActivatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + type: :type, + state: :state, + name: :name, + created_at: :created_at, + updated_at: :updated_at, + external_key: :external_key, + domains: :domains + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :type, + :state, + :name, + :created_at, + :updated_at, + :external_key, + :domains + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @type = hash[:type] + @state = hash[:state] + @name = hash[:name] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @external_key = hash[:external_key] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::DsyncActivatedDataDomain.new(item) : nil } + end + end +end diff --git a/lib/workos/directory_sync/dsync_activated_data_domain.rb b/lib/workos/directory_sync/dsync_activated_data_domain.rb new file mode 100644 index 00000000..f444b8a2 --- /dev/null +++ b/lib/workos/directory_sync/dsync_activated_data_domain.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncActivatedDataDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + domain: :domain + }.freeze + + attr_accessor \ + :object, + :id, + :domain + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @domain = hash[:domain] + end + end +end diff --git a/lib/workos/directory_sync/dsync_deactivated.rb b/lib/workos/directory_sync/dsync_deactivated.rb new file mode 100644 index 00000000..7955aad0 --- /dev/null +++ b/lib/workos/directory_sync/dsync_deactivated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncDeactivated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncDeactivatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_deactivated_data.rb b/lib/workos/directory_sync/dsync_deactivated_data.rb new file mode 100644 index 00000000..afe57f6c --- /dev/null +++ b/lib/workos/directory_sync/dsync_deactivated_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncDeactivatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + type: :type, + state: :state, + name: :name, + created_at: :created_at, + updated_at: :updated_at, + external_key: :external_key, + domains: :domains + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :type, + :state, + :name, + :created_at, + :updated_at, + :external_key, + :domains + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @type = hash[:type] + @state = hash[:state] + @name = hash[:name] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @external_key = hash[:external_key] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::DsyncDeactivatedDataDomain.new(item) : nil } + end + end +end diff --git a/lib/workos/directory_sync/dsync_deactivated_data_domain.rb b/lib/workos/directory_sync/dsync_deactivated_data_domain.rb new file mode 100644 index 00000000..e131f29d --- /dev/null +++ b/lib/workos/directory_sync/dsync_deactivated_data_domain.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + DsyncDeactivatedDataDomain = DsyncActivatedDataDomain +end diff --git a/lib/workos/directory_sync/dsync_deleted.rb b/lib/workos/directory_sync/dsync_deleted.rb new file mode 100644 index 00000000..71048d2c --- /dev/null +++ b/lib/workos/directory_sync/dsync_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_deleted_data.rb b/lib/workos/directory_sync/dsync_deleted_data.rb new file mode 100644 index 00000000..24172251 --- /dev/null +++ b/lib/workos/directory_sync/dsync_deleted_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + type: :type, + state: :state, + name: :name, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :type, + :state, + :name, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @type = hash[:type] + @state = hash[:state] + @name = hash[:name] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_created.rb b/lib/workos/directory_sync/dsync_group_created.rb new file mode 100644 index 00000000..796aa890 --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DirectoryGroup.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_deleted.rb b/lib/workos/directory_sync/dsync_group_deleted.rb new file mode 100644 index 00000000..71ad0b07 --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DirectoryGroup.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_updated.rb b/lib/workos/directory_sync/dsync_group_updated.rb new file mode 100644 index 00000000..f6e549f7 --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncGroupUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_updated_data.rb b/lib/workos/directory_sync/dsync_group_updated_data.rb new file mode 100644 index 00000000..485abbbc --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_updated_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + idp_id: :idp_id, + directory_id: :directory_id, + organization_id: :organization_id, + name: :name, + raw_attributes: :raw_attributes, + created_at: :created_at, + updated_at: :updated_at, + previous_attributes: :previous_attributes + }.freeze + + attr_accessor \ + :object, + :id, + :idp_id, + :directory_id, + :organization_id, + :name, + :raw_attributes, + :created_at, + :updated_at, + :previous_attributes + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @idp_id = hash[:idp_id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @name = hash[:name] + @raw_attributes = hash[:raw_attributes] || {} + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @previous_attributes = hash[:previous_attributes] || {} + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_user_added.rb b/lib/workos/directory_sync/dsync_group_user_added.rb new file mode 100644 index 00000000..b43325eb --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_user_added.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupUserAdded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncGroupUserAddedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_user_added_data.rb b/lib/workos/directory_sync/dsync_group_user_added_data.rb new file mode 100644 index 00000000..aab4db3c --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_user_added_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupUserAddedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + directory_id: :directory_id, + user: :user, + group: :group + }.freeze + + attr_accessor \ + :directory_id, + :user, + :group + + def initialize(json) + hash = self.class.normalize(json) + @directory_id = hash[:directory_id] + @user = hash[:user] ? WorkOS::DirectoryUser.new(hash[:user]) : nil + @group = hash[:group] ? WorkOS::DirectoryGroup.new(hash[:group]) : nil + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_user_removed.rb b/lib/workos/directory_sync/dsync_group_user_removed.rb new file mode 100644 index 00000000..9b65fd90 --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_user_removed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncGroupUserRemoved < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncGroupUserRemovedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_group_user_removed_data.rb b/lib/workos/directory_sync/dsync_group_user_removed_data.rb new file mode 100644 index 00000000..12dc6905 --- /dev/null +++ b/lib/workos/directory_sync/dsync_group_user_removed_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + DsyncGroupUserRemovedData = DsyncGroupUserAddedData +end diff --git a/lib/workos/directory_sync/dsync_user_created.rb b/lib/workos/directory_sync/dsync_user_created.rb new file mode 100644 index 00000000..6bde4dcb --- /dev/null +++ b/lib/workos/directory_sync/dsync_user_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncUserCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DirectoryUser.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_user_deleted.rb b/lib/workos/directory_sync/dsync_user_deleted.rb new file mode 100644 index 00000000..b25ee2f8 --- /dev/null +++ b/lib/workos/directory_sync/dsync_user_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncUserDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DirectoryUser.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_user_updated.rb b/lib/workos/directory_sync/dsync_user_updated.rb new file mode 100644 index 00000000..a4d24305 --- /dev/null +++ b/lib/workos/directory_sync/dsync_user_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncUserUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::DsyncUserUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/directory_sync/dsync_user_updated_data.rb b/lib/workos/directory_sync/dsync_user_updated_data.rb new file mode 100644 index 00000000..55791806 --- /dev/null +++ b/lib/workos/directory_sync/dsync_user_updated_data.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncUserUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + directory_id: :directory_id, + organization_id: :organization_id, + idp_id: :idp_id, + email: :email, + first_name: :first_name, + last_name: :last_name, + name: :name, + emails: :emails, + job_title: :job_title, + username: :username, + state: :state, + raw_attributes: :raw_attributes, + custom_attributes: :custom_attributes, + role: :role, + roles: :roles, + created_at: :created_at, + updated_at: :updated_at, + previous_attributes: :previous_attributes + }.freeze + + # @!attribute emails + # @deprecated A list of email addresses for the user. + # @!attribute job_title + # @deprecated The job title of the user. + # @!attribute username + # @deprecated The username of the user. + # @!attribute raw_attributes + # @deprecated The raw attributes received from the directory provider. + + attr_accessor \ + :object, + :id, + :directory_id, + :organization_id, + :idp_id, + :email, + :first_name, + :last_name, + :name, + :state, + :custom_attributes, + :role, + :roles, + :created_at, + :updated_at, + :previous_attributes + + def emails + warn "[DEPRECATION] `emails` is deprecated and will be removed in a future version.", uplevel: 1 + @emails + end + + attr_writer :emails + + def job_title + warn "[DEPRECATION] `job_title` is deprecated and will be removed in a future version.", uplevel: 1 + @job_title + end + + attr_writer :job_title + + def username + warn "[DEPRECATION] `username` is deprecated and will be removed in a future version.", uplevel: 1 + @username + end + + attr_writer :username + + def raw_attributes + warn "[DEPRECATION] `raw_attributes` is deprecated and will be removed in a future version.", uplevel: 1 + @raw_attributes + end + + attr_writer :raw_attributes + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @idp_id = hash[:idp_id] + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @name = hash[:name] + @emails = (hash[:emails] || []).map { |item| item ? WorkOS::DsyncUserUpdatedDataEmail.new(item) : nil } + @job_title = hash[:job_title] + @username = hash[:username] + @state = hash[:state] + @raw_attributes = hash[:raw_attributes] || {} + @custom_attributes = hash[:custom_attributes] || {} + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @previous_attributes = hash[:previous_attributes] || {} + end + end +end diff --git a/lib/workos/directory_sync/dsync_user_updated_data_email.rb b/lib/workos/directory_sync/dsync_user_updated_data_email.rb new file mode 100644 index 00000000..8dadcb20 --- /dev/null +++ b/lib/workos/directory_sync/dsync_user_updated_data_email.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + DsyncUserUpdatedDataEmail = DirectoryUserEmail +end diff --git a/lib/workos/directory_user.rb b/lib/workos/directory_user.rb deleted file mode 100644 index 1868efac..00000000 --- a/lib/workos/directory_user.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The DirectoryUser class provides a lightweight wrapper around - # a WorkOS DirectoryUser resource. This class is not meant to be instantiated - # in DirectoryUser space, and is instantiated internally but exposed. - class DirectoryUser < DeprecatedHashWrapper - include HashProvider - - attr_accessor :id, :idp_id, :emails, :first_name, :last_name, :job_title, :username, :state, - :groups, :custom_attributes, :raw_attributes, :directory_id, :organization_id, - :created_at, :updated_at - - # rubocop:disable Metrics/AbcSize - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @directory_id = hash[:directory_id] - @organization_id = hash[:organization_id] - @idp_id = hash[:idp_id] - @emails = hash[:emails] - @first_name = hash[:first_name] - @last_name = hash[:last_name] - @job_title = hash[:job_title] - @username = hash[:username] - @state = hash[:state] - @groups = hash[:groups] - @custom_attributes = hash[:custom_attributes] - @raw_attributes = hash[:raw_attributes] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - - replace_without_warning(to_json) - end - # rubocop:enable Metrics/AbcSize - - def to_json(*) - { - id: id, - directory_id: directory_id, - organization_id: organization_id, - idp_id: idp_id, - emails: emails, - first_name: first_name, - last_name: last_name, - job_title: job_title, - username: username, - state: state, - groups: groups, - custom_attributes: custom_attributes, - raw_attributes: raw_attributes, - created_at: created_at, - updated_at: updated_at, - } - end - - def primary_email - primary_email = (emails || []).find { |email| email[:primary] } - return primary_email[:value] if primary_email - end - end -end diff --git a/lib/workos/encryptors.rb b/lib/workos/encryptors.rb new file mode 100644 index 00000000..5ef4d190 --- /dev/null +++ b/lib/workos/encryptors.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Namespace for pluggable session encryptors. + +module WorkOS + module Encryptors + end +end diff --git a/lib/workos/encryptors/aes_gcm.rb b/lib/workos/encryptors/aes_gcm.rb new file mode 100644 index 00000000..451c7918 --- /dev/null +++ b/lib/workos/encryptors/aes_gcm.rb @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Default AES-256-GCM encryptor for sealed session cookies. +# Implements the seal/unseal interface expected by SessionManager. + +require "base64" +require "digest" +require "json" +require "openssl" +require "securerandom" + +module WorkOS + module Encryptors + class AesGcm + SEAL_VERSION = 0x01 + # Minimum cookie_password byte length. AES-256-GCM derives a 32-byte + # key from the password via SHA-256; a passphrase shorter than the + # output it derives to provides less than the full keyspace and makes + # offline brute-force feasible. See README + V7_MIGRATION_GUIDE.md. + MIN_KEY_BYTES = 32 + + def seal(data, key) + validate_key!(key) + json = data.is_a?(String) ? data : JSON.generate(data) + cipher = OpenSSL::Cipher.new("aes-256-gcm").encrypt + cipher.key = derive_key(key) + iv = SecureRandom.random_bytes(12) + cipher.iv = iv + ciphertext = cipher.update(json) + cipher.final + Base64.strict_encode64(SEAL_VERSION.chr + iv + cipher.auth_tag + ciphertext) + end + + def unseal(sealed, key) + validate_key!(key) + raw = Base64.decode64(sealed.to_s) + begin + decode_v7(raw, key) + rescue ArgumentError, OpenSSL::Cipher::CipherError => original_error + begin + decode_old(raw, key) + rescue ArgumentError, OpenSSL::Cipher::CipherError + raise original_error + end + end + end + + private + + def decode_v7(raw, key) + raise ArgumentError, "Sealed payload too short" if raw.bytesize < 1 + 12 + 16 + version = raw.byteslice(0, 1).bytes.first + raise ArgumentError, "Unknown seal version: #{version}" unless version == SEAL_VERSION + iv = raw.byteslice(1, 12) + tag = raw.byteslice(13, 16) + ciphertext = raw.byteslice(29, raw.bytesize - 29) + cipher = OpenSSL::Cipher.new("aes-256-gcm").decrypt + cipher.key = derive_key(key) + cipher.iv = iv + cipher.auth_tag = tag + + parse_decoded(cipher.update(ciphertext) + cipher.final) + end + + def decode_old(raw, key) + # v6 sealed sessions were Base64(iv + ciphertext + auth_tag) using the + # `encryptor` gem without the v7 version byte or key derivation. + raise ArgumentError, "Legacy sealed payload too short" if raw.bytesize < 12 + 16 + + iv = raw.byteslice(0, 12) + encrypted = raw.byteslice(12, raw.bytesize - 12) + ciphertext = encrypted.byteslice(0, encrypted.bytesize - 16) + tag = encrypted.byteslice(encrypted.bytesize - 16, 16) + + cipher = OpenSSL::Cipher.new("aes-256-gcm").decrypt + cipher.key = key.to_s + cipher.iv = iv + cipher.auth_tag = tag + + parse_decoded(cipher.update(ciphertext) + cipher.final) + end + + def parse_decoded(decoded) + decoded.force_encoding(Encoding::UTF_8) + begin + JSON.parse(decoded) + rescue JSON::ParserError + decoded + end + end + + def derive_key(passphrase) + Digest::SHA256.digest(passphrase.to_s) + end + + def validate_key!(key) + raise ArgumentError, "cookie_password is required" if key.nil? || key.to_s.empty? + raise ArgumentError, "cookie_password must be at least #{MIN_KEY_BYTES} bytes" if key.to_s.bytesize < MIN_KEY_BYTES + end + end + end +end diff --git a/lib/workos/errors.rb b/lib/workos/errors.rb index d6b1f096..af2df39b 100644 --- a/lib/workos/errors.rb +++ b/lib/workos/errors.rb @@ -1,65 +1,28 @@ # frozen_string_literal: true +# @oagen-ignore-file — hand-maintained runtime module WorkOS - # Parent class for WorkOS related errors - class WorkOSError < StandardError - attr_reader :http_status - attr_reader :request_id - attr_reader :code - attr_reader :errors + # Base class for all SDK errors. + class Error < StandardError + attr_reader :http_status, :request_id, :code, :body - # rubocop:disable Metrics/ParameterLists - def initialize( - message: nil, - error: nil, - error_description: nil, - http_status: nil, - request_id: nil, - code: nil, - errors: nil - ) - @message = message - @error = error - @error_description = error_description + def initialize(message:, http_status: nil, request_id: nil, code: nil, body: nil) + super(message) @http_status = http_status @request_id = request_id @code = code - @errors = errors - end - # rubocop:enable Metrics/ParameterLists - - def to_s - status_string = @http_status.nil? ? '' : "Status #{@http_status}, " - id_string = @request_id.nil? ? '' : " - request ID: #{@request_id}" - if @error && @error_description - error_string = "error: #{@error}, error_description: #{@error_description}" - "#{status_string}#{error_string}#{id_string}" - elsif @error - "#{status_string}#{@error}#{id_string}" - else - "#{status_string}#{@message}#{id_string}" - end + @body = body end end - # APIError is a generic error that may be raised in cases where none of the - # other named errors cover the problem. It could also be raised in the case - # that a new error has been introduced in the API, but this version of the - # Ruby SDK doesn't know how to handle it. - class APIError < WorkOSError; end - - # AuthenticationError is raised when invalid credentials are used to connect - # to WorkOS's servers. - class AuthenticationError < WorkOSError; end - - # InvalidRequestError is raised when a request is initiated with invalid - # parameters. - class InvalidRequestError < WorkOSError; end - - # SignatureVerificationError is raised when the signature verification for a - # webhook fails - class SignatureVerificationError < WorkOSError; end - - # TimeoutError is raised when the HTTP request to the API times out - class TimeoutError < WorkOSError; end + class APIError < Error; end + class APIConnectionError < Error; end + class AuthenticationError < APIError; end + class ForbiddenRequestError < APIError; end + class IdempotencyError < APIError; end + class InvalidRequestError < APIError; end + class NotFoundError < APIError; end + class RateLimitExceededError < APIError; end + class UnprocessableEntityError < APIError; end + class SignatureVerificationError < Error; end end diff --git a/lib/workos/event.rb b/lib/workos/event.rb deleted file mode 100644 index 5e38a951..00000000 --- a/lib/workos/event.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Event class provides a lightweight wrapper around - # a WorkOS Event resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - class Event - include HashProvider - - attr_accessor :id, :event, :data, :created_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @event = hash[:event] - @created_at = hash[:created_at] - @data = hash[:data] - end - - def to_json(*) - { - id: id, - event: event, - data: data, - created_at: created_at, - } - end - end -end diff --git a/lib/workos/events.rb b/lib/workos/events.rb index 25e28d96..b8b97111 100644 --- a/lib/workos/events.rb +++ b/lib/workos/events.rb @@ -1,45 +1,73 @@ # frozen_string_literal: true -require 'net/http' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The Events module provides convenience methods for working with the - # WorkOS Events platform. You'll need a valid API key and be in the - # Events beta to be able to access the API - # - module Events - class << self - include Client - - # Retrieve events. - # - # @param [Hash] options An options hash - # @option options [String] event The type of event - # retrieved. - # @option options [String] limit Maximum number of records to return. - # @option options [String] after Pagination cursor to receive records - # after a provided Event ID. - # - # @return [Hash] - def list_events(options = {}) - response = execute_request( - request: get_request( - path: '/events', - auth: true, - params: options, - ), - ) +require "json" - parsed_response = JSON.parse(response.body) - events = parsed_response['data'].map do |event| - ::WorkOS::Event.new(event.to_json) - end +module WorkOS + class Events + def initialize(client) + @client = client + end - WorkOS::Types::ListStruct.new( - data: events, - list_metadata: parsed_response['list_metadata'], + # List events + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param events [Array, nil] Filter events by one or more event types (e.g. `dsync.user.created`). + # @param range_start [String, nil] ISO-8601 date string to filter events created after this date. + # @param range_end [String, nil] ISO-8601 date string to filter events created before this date. + # @param organization_id [String, nil] Filter events by the [Organization](https://workos.com/docs/reference/organization) that the event is associated with. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_events( + before: nil, + after: nil, + limit: 10, + order: "desc", + events: nil, + range_start: nil, + range_end: nil, + organization_id: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "events" => events, + "range_start" => range_start, + "range_end" => range_end, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :get, + path: "/events", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_events( + before: before, + after: cursor, + limit: limit, + order: order, + events: events, + range_start: range_start, + range_end: range_end, + organization_id: organization_id, + request_options: request_options ) - end + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::EventSchema, + filters: {before: before, limit: limit, order: order, events: events, range_start: range_start, range_end: range_end, organization_id: organization_id}, + fetch_next: fetch_next + ) end end end diff --git a/lib/workos/events/event_list_list_metadata.rb b/lib/workos/events/event_list_list_metadata.rb new file mode 100644 index 00000000..47625502 --- /dev/null +++ b/lib/workos/events/event_list_list_metadata.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EventListListMetadata < WorkOS::Types::BaseModel + HASH_ATTRS = { + after: :after + }.freeze + + attr_accessor :after + + def initialize(json) + hash = self.class.normalize(json) + @after = hash[:after] + end + end +end diff --git a/lib/workos/events/event_schema.rb b/lib/workos/events/event_schema.rb new file mode 100644 index 00000000..f965dea5 --- /dev/null +++ b/lib/workos/events/event_schema.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EventSchema < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context + }.freeze + + attr_accessor \ + :object, + :id, + :event, + :data, + :created_at, + :context + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] || {} + @created_at = hash[:created_at] + @context = hash[:context] || {} + end + end +end diff --git a/lib/workos/factor.rb b/lib/workos/factor.rb deleted file mode 100644 index bacfb58e..00000000 --- a/lib/workos/factor.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Factor class provides a lightweight wrapper around - # a WorkOS DirectoryUser resource. This class is not meant to be instantiated - # in DirectoryUser space, and is instantiated internally but exposed. - class Factor - include HashProvider - attr_accessor :id, :object, :type, :sms, :totp, :updated_at, :created_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @object = hash[:object] - @type = hash[:type] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - @totp = hash[:totp] - @sms = hash[:sms] - end - - def to_json(*) - { - id: id, - object: object, - type: type, - totp: totp, - sms: sms, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/feature_flags.rb b/lib/workos/feature_flags.rb new file mode 100644 index 00000000..00019cad --- /dev/null +++ b/lib/workos/feature_flags.rb @@ -0,0 +1,246 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class FeatureFlags + def initialize(client) + @client = client + end + + # List feature flags + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_feature_flags( + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/feature-flags", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_feature_flags( + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Flag, + filters: {before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Get a feature flag + # @param slug [String] A unique key to reference the Feature Flag. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Flag] + def get_feature_flag( + slug:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/feature-flags/#{WorkOS::Util.encode_path(slug)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Flag.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 + + # Disable a feature flag + # @param slug [String] A unique key to reference the Feature Flag. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::FeatureFlag] + def disable_feature_flag( + slug:, + request_options: {} + ) + response = @client.request( + method: :put, + path: "/feature-flags/#{WorkOS::Util.encode_path(slug)}/disable", + auth: true, + request_options: request_options + ) + result = WorkOS::FeatureFlag.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 + + # Enable a feature flag + # @param slug [String] A unique key to reference the Feature Flag. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::FeatureFlag] + def enable_feature_flag( + slug:, + request_options: {} + ) + response = @client.request( + method: :put, + path: "/feature-flags/#{WorkOS::Util.encode_path(slug)}/enable", + auth: true, + request_options: request_options + ) + result = WorkOS::FeatureFlag.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 + + # Add a feature flag target + # @param resource_id [String] The resource ID in format "user_" or "org_". + # @param slug [String] The unique slug identifier of the feature flag. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def add_flag_target( + resource_id:, + slug:, + request_options: {} + ) + @client.request( + method: :post, + path: "/feature-flags/#{WorkOS::Util.encode_path(slug)}/targets/#{WorkOS::Util.encode_path(resource_id)}", + auth: true, + request_options: request_options + ) + nil + end + + # Remove a feature flag target + # @param resource_id [String] The resource ID in format "user_" or "org_". + # @param slug [String] The unique slug identifier of the feature flag. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def remove_flag_target( + resource_id:, + slug:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/feature-flags/#{WorkOS::Util.encode_path(slug)}/targets/#{WorkOS::Util.encode_path(resource_id)}", + auth: true, + request_options: request_options + ) + nil + end + + # List enabled feature flags for an organization + # @param organization_id [String] Unique identifier of the Organization. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organization_feature_flags( + organization_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/feature-flags", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organization_feature_flags( + organization_id: organization_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Flag, + filters: {organization_id: organization_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # List enabled feature flags for a user + # @param user_id [String] The ID of the user. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_user_feature_flags( + user_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/feature-flags", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_user_feature_flags( + user_id: user_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Flag, + filters: {user_id: user_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + end +end diff --git a/lib/workos/feature_flags/feature_flag.rb b/lib/workos/feature_flags/feature_flag.rb new file mode 100644 index 00000000..126ebcb9 --- /dev/null +++ b/lib/workos/feature_flags/feature_flag.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FeatureFlag < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + slug: :slug, + name: :name, + description: :description, + owner: :owner, + tags: :tags, + enabled: :enabled, + default_value: :default_value, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :slug, + :name, + :description, + :owner, + :tags, + :enabled, + :default_value, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @owner = hash[:owner] ? WorkOS::FeatureFlagOwner.new(hash[:owner]) : nil + @tags = hash[:tags] || [] + @enabled = hash[:enabled] + @default_value = hash[:default_value] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/feature_flags/feature_flag_owner.rb b/lib/workos/feature_flags/feature_flag_owner.rb new file mode 100644 index 00000000..5b995a3f --- /dev/null +++ b/lib/workos/feature_flags/feature_flag_owner.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FeatureFlagOwner < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + first_name: :first_name, + last_name: :last_name + }.freeze + + attr_accessor \ + :email, + :first_name, + :last_name + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + end + end +end diff --git a/lib/workos/feature_flags/flag.rb b/lib/workos/feature_flags/flag.rb new file mode 100644 index 00000000..60092a2b --- /dev/null +++ b/lib/workos/feature_flags/flag.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + Flag = FeatureFlag +end diff --git a/lib/workos/feature_flags/flag_created.rb b/lib/workos/feature_flags/flag_created.rb new file mode 100644 index 00000000..c9bb4782 --- /dev/null +++ b/lib/workos/feature_flags/flag_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::FlagCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::FlagCreatedContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/feature_flags/flag_created_context.rb b/lib/workos/feature_flags/flag_created_context.rb new file mode 100644 index 00000000..c3d9efb8 --- /dev/null +++ b/lib/workos/feature_flags/flag_created_context.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagCreatedContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + actor: :actor + }.freeze + + attr_accessor \ + :client_id, + :actor + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @actor = hash[:actor] ? WorkOS::FlagCreatedContextActor.new(hash[:actor]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_created_context_actor.rb b/lib/workos/feature_flags/flag_created_context_actor.rb new file mode 100644 index 00000000..115493a9 --- /dev/null +++ b/lib/workos/feature_flags/flag_created_context_actor.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagCreatedContextActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + source: :source, + name: :name + }.freeze + + attr_accessor \ + :id, + :source, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @source = hash[:source] + @name = hash[:name] + end + end +end diff --git a/lib/workos/feature_flags/flag_created_data.rb b/lib/workos/feature_flags/flag_created_data.rb new file mode 100644 index 00000000..e2ada050 --- /dev/null +++ b/lib/workos/feature_flags/flag_created_data.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + environment_id: :environment_id, + slug: :slug, + name: :name, + description: :description, + owner: :owner, + tags: :tags, + enabled: :enabled, + default_value: :default_value, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :environment_id, + :slug, + :name, + :description, + :owner, + :tags, + :enabled, + :default_value, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @environment_id = hash[:environment_id] + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @owner = hash[:owner] ? WorkOS::FlagCreatedDataOwner.new(hash[:owner]) : nil + @tags = hash[:tags] || [] + @enabled = hash[:enabled] + @default_value = hash[:default_value] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/feature_flags/flag_created_data_owner.rb b/lib/workos/feature_flags/flag_created_data_owner.rb new file mode 100644 index 00000000..4a43b76c --- /dev/null +++ b/lib/workos/feature_flags/flag_created_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagCreatedDataOwner = FeatureFlagOwner +end diff --git a/lib/workos/feature_flags/flag_deleted.rb b/lib/workos/feature_flags/flag_deleted.rb new file mode 100644 index 00000000..8703a07b --- /dev/null +++ b/lib/workos/feature_flags/flag_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::FlagDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::FlagDeletedContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/feature_flags/flag_deleted_context.rb b/lib/workos/feature_flags/flag_deleted_context.rb new file mode 100644 index 00000000..104b9369 --- /dev/null +++ b/lib/workos/feature_flags/flag_deleted_context.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagDeletedContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + actor: :actor + }.freeze + + attr_accessor \ + :client_id, + :actor + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @actor = hash[:actor] ? WorkOS::FlagDeletedContextActor.new(hash[:actor]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_deleted_context_actor.rb b/lib/workos/feature_flags/flag_deleted_context_actor.rb new file mode 100644 index 00000000..1c08635c --- /dev/null +++ b/lib/workos/feature_flags/flag_deleted_context_actor.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagDeletedContextActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + source: :source, + name: :name + }.freeze + + attr_accessor \ + :id, + :source, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @source = hash[:source] + @name = hash[:name] + end + end +end diff --git a/lib/workos/feature_flags/flag_deleted_data.rb b/lib/workos/feature_flags/flag_deleted_data.rb new file mode 100644 index 00000000..c599d787 --- /dev/null +++ b/lib/workos/feature_flags/flag_deleted_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagDeletedData = FlagCreatedData +end diff --git a/lib/workos/feature_flags/flag_deleted_data_owner.rb b/lib/workos/feature_flags/flag_deleted_data_owner.rb new file mode 100644 index 00000000..d71a86e7 --- /dev/null +++ b/lib/workos/feature_flags/flag_deleted_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagDeletedDataOwner = FeatureFlagOwner +end diff --git a/lib/workos/feature_flags/flag_owner.rb b/lib/workos/feature_flags/flag_owner.rb new file mode 100644 index 00000000..159a30ee --- /dev/null +++ b/lib/workos/feature_flags/flag_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagOwner = FeatureFlagOwner +end diff --git a/lib/workos/feature_flags/flag_rule_updated.rb b/lib/workos/feature_flags/flag_rule_updated.rb new file mode 100644 index 00000000..f87d2363 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::FlagRuleUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::FlagRuleUpdatedContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context.rb b/lib/workos/feature_flags/flag_rule_updated_context.rb new file mode 100644 index 00000000..01d49432 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + actor: :actor, + access_type: :access_type, + configured_targets: :configured_targets, + previous_attributes: :previous_attributes + }.freeze + + attr_accessor \ + :client_id, + :actor, + :access_type, + :configured_targets, + :previous_attributes + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @actor = hash[:actor] ? WorkOS::FlagRuleUpdatedContextActor.new(hash[:actor]) : nil + @access_type = hash[:access_type] + @configured_targets = hash[:configured_targets] ? WorkOS::FlagRuleUpdatedContextConfiguredTarget.new(hash[:configured_targets]) : nil + @previous_attributes = hash[:previous_attributes] ? WorkOS::FlagRuleUpdatedContextPreviousAttribute.new(hash[:previous_attributes]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_actor.rb b/lib/workos/feature_flags/flag_rule_updated_context_actor.rb new file mode 100644 index 00000000..d904b983 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_actor.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + source: :source, + name: :name + }.freeze + + attr_accessor \ + :id, + :source, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @source = hash[:source] + @name = hash[:name] + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb b/lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb new file mode 100644 index 00000000..2ab51a5f --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_configured_target.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextConfiguredTarget < WorkOS::Types::BaseModel + HASH_ATTRS = { + organizations: :organizations, + users: :users + }.freeze + + attr_accessor \ + :organizations, + :users + + def initialize(json) + hash = self.class.normalize(json) + @organizations = (hash[:organizations] || []).map { |item| item ? WorkOS::FlagRuleUpdatedContextConfiguredTargetOrganization.new(item) : nil } + @users = (hash[:users] || []).map { |item| item ? WorkOS::FlagRuleUpdatedContextConfiguredTargetUser.new(item) : nil } + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb b/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb new file mode 100644 index 00000000..8f915fcf --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_configured_target_organization.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextConfiguredTargetOrganization < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + name: :name + }.freeze + + attr_accessor \ + :id, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @name = hash[:name] + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb b/lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb new file mode 100644 index 00000000..d9b257a4 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_configured_target_user.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextConfiguredTargetUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + email: :email + }.freeze + + attr_accessor \ + :id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb new file mode 100644 index 00000000..1f09fbf5 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextPreviousAttribute < WorkOS::Types::BaseModel + HASH_ATTRS = { + data: :data, + context: :context + }.freeze + + attr_accessor \ + :data, + :context + + def initialize(json) + hash = self.class.normalize(json) + @data = hash[:data] ? WorkOS::FlagRuleUpdatedContextPreviousAttributeData.new(hash[:data]) : nil + @context = hash[:context] ? WorkOS::FlagRuleUpdatedContextPreviousAttributeContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb new file mode 100644 index 00000000..76a4940a --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + access_type: :access_type, + configured_targets: :configured_targets + }.freeze + + attr_accessor \ + :access_type, + :configured_targets + + def initialize(json) + hash = self.class.normalize(json) + @access_type = hash[:access_type] + @configured_targets = hash[:configured_targets] ? WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget.new(hash[:configured_targets]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb new file mode 100644 index 00000000..7c16548f --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget = FlagRuleUpdatedContextConfiguredTarget +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb new file mode 100644 index 00000000..76d9b785 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization = FlagRuleUpdatedContextConfiguredTargetOrganization +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb new file mode 100644 index 00000000..b65292d3 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_context_configured_target_user.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser = FlagRuleUpdatedContextConfiguredTargetUser +end diff --git a/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb new file mode 100644 index 00000000..7f666491 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_context_previous_attribute_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeData < WorkOS::Types::BaseModel + HASH_ATTRS = { + enabled: :enabled, + default_value: :default_value + }.freeze + + attr_accessor \ + :enabled, + :default_value + + def initialize(json) + hash = self.class.normalize(json) + @enabled = hash[:enabled] + @default_value = hash[:default_value] + end + end +end diff --git a/lib/workos/feature_flags/flag_rule_updated_data.rb b/lib/workos/feature_flags/flag_rule_updated_data.rb new file mode 100644 index 00000000..9562b293 --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagRuleUpdatedData = FlagCreatedData +end diff --git a/lib/workos/feature_flags/flag_rule_updated_data_owner.rb b/lib/workos/feature_flags/flag_rule_updated_data_owner.rb new file mode 100644 index 00000000..e92d909c --- /dev/null +++ b/lib/workos/feature_flags/flag_rule_updated_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagRuleUpdatedDataOwner = FeatureFlagOwner +end diff --git a/lib/workos/feature_flags/flag_updated.rb b/lib/workos/feature_flags/flag_updated.rb new file mode 100644 index 00000000..488c9604 --- /dev/null +++ b/lib/workos/feature_flags/flag_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::FlagUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::FlagUpdatedContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/feature_flags/flag_updated_context.rb b/lib/workos/feature_flags/flag_updated_context.rb new file mode 100644 index 00000000..fa1932cd --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_context.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagUpdatedContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + actor: :actor, + previous_attributes: :previous_attributes + }.freeze + + attr_accessor \ + :client_id, + :actor, + :previous_attributes + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @actor = hash[:actor] ? WorkOS::FlagUpdatedContextActor.new(hash[:actor]) : nil + @previous_attributes = hash[:previous_attributes] ? WorkOS::FlagUpdatedContextPreviousAttribute.new(hash[:previous_attributes]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_updated_context_actor.rb b/lib/workos/feature_flags/flag_updated_context_actor.rb new file mode 100644 index 00000000..368a082e --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_context_actor.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagUpdatedContextActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + source: :source, + name: :name + }.freeze + + attr_accessor \ + :id, + :source, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @source = hash[:source] + @name = hash[:name] + end + end +end diff --git a/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb b/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb new file mode 100644 index 00000000..4bdb14ee --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_context_previous_attribute.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagUpdatedContextPreviousAttribute < WorkOS::Types::BaseModel + HASH_ATTRS = { + data: :data + }.freeze + + attr_accessor :data + + def initialize(json) + hash = self.class.normalize(json) + @data = hash[:data] ? WorkOS::FlagUpdatedContextPreviousAttributeData.new(hash[:data]) : nil + end + end +end diff --git a/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb b/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb new file mode 100644 index 00000000..394cd75f --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_context_previous_attribute_data.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class FlagUpdatedContextPreviousAttributeData < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + description: :description, + tags: :tags, + enabled: :enabled, + default_value: :default_value + }.freeze + + attr_accessor \ + :name, + :description, + :tags, + :enabled, + :default_value + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @description = hash[:description] + @tags = hash[:tags] || [] + @enabled = hash[:enabled] + @default_value = hash[:default_value] + end + end +end diff --git a/lib/workos/feature_flags/flag_updated_data.rb b/lib/workos/feature_flags/flag_updated_data.rb new file mode 100644 index 00000000..30a2d7a8 --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagUpdatedData = FlagCreatedData +end diff --git a/lib/workos/feature_flags/flag_updated_data_owner.rb b/lib/workos/feature_flags/flag_updated_data_owner.rb new file mode 100644 index 00000000..dce0a7a0 --- /dev/null +++ b/lib/workos/feature_flags/flag_updated_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + FlagUpdatedDataOwner = FeatureFlagOwner +end diff --git a/lib/workos/groups.rb b/lib/workos/groups.rb new file mode 100644 index 00000000..934f0e76 --- /dev/null +++ b/lib/workos/groups.rb @@ -0,0 +1,256 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Groups + def initialize(client) + @client = client + end + + # List groups + # @param organization_id [String] The ID of the organization. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organization_groups( + organization_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organization_groups( + organization_id: organization_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Group, + filters: {organization_id: organization_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Create a group + # @param organization_id [String] The ID of the organization. + # @param name [String] The name of the Group. + # @param description [String, nil] An optional description of the Group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Group] + def create_organization_group( + organization_id:, + name:, + description: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + response = @client.request( + method: :post, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Group.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 + + # Get a group + # @param organization_id [String] The ID of the organization. + # @param group_id [String] The ID of the group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Group] + def get_organization_group( + organization_id:, + group_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Group.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 + + # Update a group + # @param organization_id [String] The ID of the organization. + # @param group_id [String] The ID of the group. + # @param name [String, nil] The name of the Group. + # @param description [String, nil] An optional description of the Group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Group] + def update_organization_group( + organization_id:, + group_id:, + name: nil, + description: nil, + request_options: {} + ) + body = { + "name" => name, + "description" => description + }.compact + response = @client.request( + method: :patch, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Group.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 a group + # @param organization_id [String] The ID of the organization. + # @param group_id [String] The ID of the group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_organization_group( + organization_id:, + group_id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}", + auth: true, + request_options: request_options + ) + nil + end + + # List Group members + # @param organization_id [String] Unique identifier of the Organization. + # @param group_id [String] Unique identifier of the Group. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_group_organization_memberships( + organization_id:, + group_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}/organization-memberships", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_group_organization_memberships( + organization_id: organization_id, + group_id: group_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserOrganizationMembershipBaseListData, + filters: {organization_id: organization_id, group_id: group_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Add a member to a Group + # @param organization_id [String] Unique identifier of the Organization. + # @param group_id [String] Unique identifier of the Group. + # @param organization_membership_id [String] The ID of the Organization Membership to add to the group. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Group] + def create_group_organization_membership( + organization_id:, + group_id:, + organization_membership_id:, + request_options: {} + ) + body = { + "organization_membership_id" => organization_membership_id + } + response = @client.request( + method: :post, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}/organization-memberships", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Group.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 + + # Remove a member from a Group + # @param organization_id [String] Unique identifier of the Organization. + # @param group_id [String] Unique identifier of the Group. + # @param om_id [String] Unique identifier of the Organization Membership. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_group_organization_membership( + organization_id:, + group_id:, + om_id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/groups/#{WorkOS::Util.encode_path(group_id)}/organization-memberships/#{WorkOS::Util.encode_path(om_id)}", + auth: true, + request_options: request_options + ) + nil + end + end +end diff --git a/lib/workos/groups/create_group.rb b/lib/workos/groups/create_group.rb new file mode 100644 index 00000000..0b8627d2 --- /dev/null +++ b/lib/workos/groups/create_group.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateGroup < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + description: :description + }.freeze + + attr_accessor \ + :name, + :description + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @description = hash[:description] + end + end +end diff --git a/lib/workos/groups/create_group_membership.rb b/lib/workos/groups/create_group_membership.rb new file mode 100644 index 00000000..4ba3c762 --- /dev/null +++ b/lib/workos/groups/create_group_membership.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateGroupMembership < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_membership_id: :organization_membership_id + }.freeze + + attr_accessor :organization_membership_id + + def initialize(json) + hash = self.class.normalize(json) + @organization_membership_id = hash[:organization_membership_id] + end + end +end diff --git a/lib/workos/groups/group.rb b/lib/workos/groups/group.rb new file mode 100644 index 00000000..eba34bbe --- /dev/null +++ b/lib/workos/groups/group.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Group < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + name: :name, + description: :description, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :name, + :description, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @name = hash[:name] + @description = hash[:description] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/groups/update_group.rb b/lib/workos/groups/update_group.rb new file mode 100644 index 00000000..3b1b5710 --- /dev/null +++ b/lib/workos/groups/update_group.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UpdateGroup = UpdateAuthorizationPermission +end diff --git a/lib/workos/hash_provider.rb b/lib/workos/hash_provider.rb index de3e7beb..474a3944 100644 --- a/lib/workos/hash_provider.rb +++ b/lib/workos/hash_provider.rb @@ -1,18 +1,44 @@ # frozen_string_literal: true +# @oagen-ignore-file — hand-maintained runtime module WorkOS - # Module to include an explicit method for converting a model into a Hash containing - # its attributes. Default implementation will simply call to_json. Individual classes - # may override. module HashProvider - include Kernel + def to_h + self.class::HASH_ATTRS.each_with_object({}) do |(raw_key, attr_name), hash| + hash[raw_key] = serialize_field(instance_variable_get(:"@#{attr_name}")) + end + end - def to_json(*) - raise 'Must be implemented by including class.' + def to_json(*args) + to_h.to_json(*args) end - def to_h - to_json + def inspect + attrs = self.class::HASH_ATTRS.values.filter_map do |attr_name| + value = instance_variable_get(:"@#{attr_name}") + next if value.nil? + + "#{attr_name}=#{value.inspect}" + end + + return "#<#{self.class}>" if attrs.empty? + + "#<#{self.class} #{attrs.join(" ")}>" + end + + private + + def serialize_field(value) + case value + when nil + nil + when Array + value.map { |item| serialize_field(item) } + when Hash + value.each_with_object({}) { |(key, item), hash| hash[key] = serialize_field(item) } + else + (value.respond_to?(:to_h) && !value.is_a?(Hash)) ? value.to_h : value + end end end end diff --git a/lib/workos/impersonator.rb b/lib/workos/impersonator.rb deleted file mode 100644 index 08c64b8d..00000000 --- a/lib/workos/impersonator.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # Contains information about a WorkOS Dashboard user impersonating - # a User Management user. - class Impersonator - include HashProvider - - attr_accessor :email, :reason - - def initialize(email:, reason:) - @email = email - @reason = reason - end - - def to_json(*) - { - email: email, - reason: reason, - } - end - end -end diff --git a/lib/workos/inflections.rb b/lib/workos/inflections.rb new file mode 100644 index 00000000..bfcd121c --- /dev/null +++ b/lib/workos/inflections.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# Zeitwerk inflection overrides for the WorkOS gem. +# Maps file basenames to class/module names where the default +# CamelCase inference disagrees with the canonical class name. +WORKOS_INFLECTIONS = { + "authenticate_response_oauth_token" => "AuthenticateResponseOAuthToken", + "authentication_mfa_failed" => "AuthenticationMFAFailed", + "authentication_mfa_failed_data" => "AuthenticationMFAFailedData", + "authentication_mfa_failed_data_error" => "AuthenticationMFAFailedDataError", + "authentication_mfa_succeeded" => "AuthenticationMFASucceeded", + "authentication_mfa_succeeded_data" => "AuthenticationMFASucceededData", + "authentication_oauth_failed" => "AuthenticationOAuthFailed", + "authentication_oauth_failed_data" => "AuthenticationOAuthFailedData", + "authentication_oauth_failed_data_error" => "AuthenticationOAuthFailedDataError", + "authentication_oauth_succeeded" => "AuthenticationOAuthSucceeded", + "authentication_oauth_succeeded_data" => "AuthenticationOAuthSucceededData", + "authentication_sso_failed" => "AuthenticationSSOFailed", + "authentication_sso_failed_data" => "AuthenticationSSOFailedData", + "authentication_sso_failed_data_error" => "AuthenticationSSOFailedDataError", + "authentication_sso_failed_data_sso" => "AuthenticationSSOFailedDataSSO", + "authentication_sso_started" => "AuthenticationSSOStarted", + "authentication_sso_started_data" => "AuthenticationSSOStartedData", + "authentication_sso_started_data_sso" => "AuthenticationSSOStartedDataSSO", + "authentication_sso_succeeded" => "AuthenticationSSOSucceeded", + "authentication_sso_succeeded_data" => "AuthenticationSSOSucceededData", + "authentication_sso_succeeded_data_sso" => "AuthenticationSSOSucceededDataSSO", + "authentication_sso_timed_out" => "AuthenticationSSOTimedOut", + "authentication_sso_timed_out_data" => "AuthenticationSSOTimedOutData", + "authentication_sso_timed_out_data_error" => "AuthenticationSSOTimedOutDataError", + "authentication_sso_timed_out_data_sso" => "AuthenticationSSOTimedOutDataSSO", + "connection_saml_certificate_renewal_required" => "ConnectionSAMLCertificateRenewalRequired", + "connection_saml_certificate_renewal_required_data" => "ConnectionSAMLCertificateRenewalRequiredData", + "connection_saml_certificate_renewal_required_data_certificate" => "ConnectionSAMLCertificateRenewalRequiredDataCertificate", + "connection_saml_certificate_renewal_required_data_certificate_certificate_type" => "ConnectionSAMLCertificateRenewalRequiredDataCertificateCertificateType", + "connection_saml_certificate_renewal_required_data_connection" => "ConnectionSAMLCertificateRenewalRequiredDataConnection", + "connection_saml_certificate_renewed" => "ConnectionSAMLCertificateRenewed", + "connection_saml_certificate_renewed_data" => "ConnectionSAMLCertificateRenewedData", + "connection_saml_certificate_renewed_data_certificate" => "ConnectionSAMLCertificateRenewedDataCertificate", + "connection_saml_certificate_renewed_data_certificate_certificate_type" => "ConnectionSAMLCertificateRenewedDataCertificateCertificateType", + "connection_saml_certificate_renewed_data_connection" => "ConnectionSAMLCertificateRenewedDataConnection", + "cors_origin_response" => "CORSOriginResponse", + "create_cors_origin" => "CreateCORSOrigin", + "create_m2m_application" => "CreateM2MApplication", + "create_oauth_application" => "CreateOAuthApplication", + "jwt_template_response" => "JWTTemplateResponse", + "m2m" => "M2M", + "mfa_totp_session_authenticate_request" => "MFATotpSessionAuthenticateRequest", + "pkce" => "PKCE", + "sso" => "SSO", + "sso_authorize_url_response" => "SSOAuthorizeUrlResponse", + "sso_device_authorization_request" => "SSODeviceAuthorizationRequest", + "sso_intent_options" => "SSOIntentOptions", + "sso_logout_authorize_request" => "SSOLogoutAuthorizeRequest", + "sso_logout_authorize_response" => "SSOLogoutAuthorizeResponse", + "sso_provider" => "SSOProvider", + "sso_token_response" => "SSOTokenResponse", + "sso_token_response_oauth_token" => "SSOTokenResponseOAuthToken", + "update_jwt_template" => "UpdateJWTTemplate", + "update_oauth_application" => "UpdateOAuthApplication", + "workos" => "WorkOS" +}.freeze diff --git a/lib/workos/invitation.rb b/lib/workos/invitation.rb deleted file mode 100644 index a18f1c57..00000000 --- a/lib/workos/invitation.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Invitation class provides a lightweight wrapper around a WorkOS Invitation - # resource. This class is not meant to be instantiated in a user space, - # and is instantiated internally but exposed. - class Invitation - include HashProvider - - attr_accessor :id, :email, :state, :accepted_at, :revoked_at, - :expires_at, :token, :organization_id, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @email = hash[:email] - @state = hash[:state] - @token = hash[:token] - @organization_id = hash[:organization_id] - @accepted_at = hash[:accepted_at] - @revoked_at = hash[:revoked_at] - @expires_at = hash[:expires_at] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - email: email, - state: state, - token: token, - organization_id: organization_id, - accepted_at: accepted_at, - revoked_at: revoked_at, - expires_at: expires_at, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/mfa.rb b/lib/workos/mfa.rb deleted file mode 100644 index 1f3d43ac..00000000 --- a/lib/workos/mfa.rb +++ /dev/null @@ -1,136 +0,0 @@ -# frozen_string_literal: true - -require 'net/http' -require 'uri' - -module WorkOS - # The MFA module provides convenience methods for working with the WorkOS - # MFA platform. You'll need a valid API key - module MFA - class << self - include Client - def delete_factor(id:) - response = execute_request( - request: delete_request( - path: "/auth/factors/#{id}", - auth: true, - ), - ) - response.is_a? Net::HTTPSuccess - end - - def get_factor( - id: - ) - response = execute_request( - request: get_request( - path: "/auth/factors/#{id}", - auth: true, - ), - ) - WorkOS::Factor.new(response.body) - end - - # rubocop:disable Metrics/CyclomaticComplexity - # rubocop:disable Metrics/PerceivedComplexity - def validate_args( - type:, - totp_issuer: nil, - totp_user: nil, - phone_number: nil - ) - if type != 'sms' && type != 'totp' && type != 'generic_otp' - raise ArgumentError, "Type argument must be either 'sms' or 'totp'" - end - if (type == 'totp' && totp_issuer.nil?) || (type == 'totp' && totp_user.nil?) - raise ArgumentError, 'Incomplete arguments. Need to specify both totp_issuer and totp_user when type is totp' - end - return unless type == 'sms' && phone_number.nil? - - raise ArgumentError, 'Incomplete arguments. Need to specify phone_number when type is sms' - end - # rubocop:enable Metrics/CyclomaticComplexity - # rubocop:enable Metrics/PerceivedComplexity - - def enroll_factor( - type:, - totp_issuer: nil, - totp_user: nil, - phone_number: nil - ) - validate_args( - type: type, - totp_issuer: totp_issuer, - totp_user: totp_user, - phone_number: phone_number, - ) - response = execute_request(request: post_request( - auth: true, - body: { - type: type, - totp_issuer: totp_issuer, - totp_user: totp_user, - phone_number: phone_number, - }, - path: '/auth/factors/enroll', - )) - WorkOS::Factor.new(response.body) - end - - def challenge_factor( - authentication_factor_id: nil, - sms_template: nil - ) - if authentication_factor_id.nil? - raise ArgumentError, "Incomplete arguments: 'authentication_factor_id' is a required argument" - end - - request = post_request( - auth: true, - body: { - sms_template: sms_template, - }, - path: "/auth/factors/#{authentication_factor_id}/challenge", - ) - - response = execute_request(request: request) - WorkOS::Challenge.new(response.body) - end - - def verify_factor( - authentication_challenge_id: nil, - code: nil - ) - warn '[DEPRECATION] `verify_factor` is deprecated. Please use `verify_challenge` instead.' - - verify_challenge( - authentication_challenge_id: authentication_challenge_id, - code: code, - ) - end - - def verify_challenge( - authentication_challenge_id: nil, - code: nil - ) - - if authentication_challenge_id.nil? || code.nil? - raise ArgumentError, "Incomplete arguments: 'authentication_challenge_id' and 'code' are required arguments" - end - - options = { - "code": code, - } - - response = execute_request( - request: post_request( - path: "/auth/challenges/#{authentication_challenge_id}/verify", - auth: true, - body: options, - ), - ) - WorkOS::VerifyChallenge.new(response.body) - end - end - end -end diff --git a/lib/workos/multi_factor_auth.rb b/lib/workos/multi_factor_auth.rb new file mode 100644 index 00000000..fb38831f --- /dev/null +++ b/lib/workos/multi_factor_auth.rb @@ -0,0 +1,215 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class MultiFactorAuth + def initialize(client) + @client = client + end + + # Verify Challenge + # @param id [String] The unique ID of the Authentication Challenge. + # @param code [String] The one-time code to verify. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthenticationChallengeVerifyResponse] + def verify_challenge( + id:, + code:, + request_options: {} + ) + body = { + "code" => code + } + response = @client.request( + method: :post, + path: "/auth/challenges/#{WorkOS::Util.encode_path(id)}/verify", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthenticationChallengeVerifyResponse.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 + + # Enroll Factor + # @param type [WorkOS::Types::AuthenticationFactorsCreateRequestType] The type of factor to enroll. + # @param phone_number [String, nil] Required when type is 'sms'. + # @param totp_issuer [String, nil] Required when type is 'totp'. + # @param totp_user [String, nil] Required when type is 'totp'. + # @param user_id [String, nil] The ID of the user to associate the factor with. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthenticationFactorEnrolled] + def enroll_factor( + type:, + phone_number: nil, + totp_issuer: nil, + totp_user: nil, + user_id: nil, + request_options: {} + ) + body = { + "type" => type, + "phone_number" => phone_number, + "totp_issuer" => totp_issuer, + "totp_user" => totp_user, + "user_id" => user_id + }.compact + response = @client.request( + method: :post, + path: "/auth/factors/enroll", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthenticationFactorEnrolled.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 + + # Get Factor + # @param id [String] The unique ID of the Factor. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthenticationFactor] + def get_factor( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/auth/factors/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::AuthenticationFactor.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 Factor + # @param id [String] The unique ID of the Factor. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_factor( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/auth/factors/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end + + # Challenge Factor + # @param id [String] The unique ID of the Authentication Factor to be challenged. + # @param sms_template [String, nil] A custom template for the SMS message. Use the {{code}} placeholder to include the verification code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthenticationChallenge] + def challenge_factor( + id:, + sms_template: nil, + request_options: {} + ) + body = { + "sms_template" => sms_template + }.compact + response = @client.request( + method: :post, + path: "/auth/factors/#{WorkOS::Util.encode_path(id)}/challenge", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthenticationChallenge.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 + + # List authentication factors + # @param userland_user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user). + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_user_auth_factors( + userland_user_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(userland_user_id)}/auth_factors", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_user_auth_factors( + userland_user_id: userland_user_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthenticationFactor, + filters: {userland_user_id: userland_user_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Enroll an authentication factor + # @param userland_user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user). + # @param type [String] The type of the factor to enroll. + # @param totp_issuer [String, nil] Your application or company name displayed in the user's authenticator app. + # @param totp_user [String, nil] The user's account name displayed in their authenticator app. + # @param totp_secret [String, nil] The Base32-encoded shared secret for TOTP factors. This can be provided when creating the auth factor, otherwise it will be generated. The algorithm used to derive TOTP codes is SHA-1, the code length is 6 digits, and the timestep is 30 seconds – the secret must be compatible with these parameters. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserAuthenticationFactorEnrollResponse] + def create_user_auth_factor( + userland_user_id:, + type:, + totp_issuer: nil, + totp_user: nil, + totp_secret: nil, + request_options: {} + ) + body = { + "type" => type, + "totp_issuer" => totp_issuer, + "totp_user" => totp_user, + "totp_secret" => totp_secret + }.compact + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(userland_user_id)}/auth_factors", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserAuthenticationFactorEnrollResponse.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 + end +end diff --git a/lib/workos/multi_factor_auth/authentication_challenge.rb b/lib/workos/multi_factor_auth/authentication_challenge.rb new file mode 100644 index 00000000..d04cec17 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_challenge.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationChallenge < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + expires_at: :expires_at, + code: :code, + authentication_factor_id: :authentication_factor_id, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :expires_at, + :code, + :authentication_factor_id, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @expires_at = hash[:expires_at] + @code = hash[:code] + @authentication_factor_id = hash[:authentication_factor_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb b/lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb new file mode 100644 index 00000000..65878b64 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_challenge_verify_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationChallengeVerifyResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + challenge: :challenge, + valid: :valid + }.freeze + + attr_accessor \ + :challenge, + :valid + + def initialize(json) + hash = self.class.normalize(json) + @challenge = hash[:challenge] ? WorkOS::AuthenticationChallenge.new(hash[:challenge]) : nil + @valid = hash[:valid] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb b/lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb new file mode 100644 index 00000000..43d397e8 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_challenges_verify_request.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationChallengesVerifyRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + code: :code + }.freeze + + attr_accessor :code + + def initialize(json) + hash = self.class.normalize(json) + @code = hash[:code] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factor.rb b/lib/workos/multi_factor_auth/authentication_factor.rb new file mode 100644 index 00000000..5a229119 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactor < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + type: :type, + user_id: :user_id, + sms: :sms, + totp: :totp, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :type, + :user_id, + :sms, + :totp, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @type = hash[:type] + @user_id = hash[:user_id] + @sms = hash[:sms] ? WorkOS::AuthenticationFactorSms.new(hash[:sms]) : nil + @totp = hash[:totp] ? WorkOS::AuthenticationFactorTotp.new(hash[:totp]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factor_enrolled.rb b/lib/workos/multi_factor_auth/authentication_factor_enrolled.rb new file mode 100644 index 00000000..f8ae8c86 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor_enrolled.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactorEnrolled < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + type: :type, + user_id: :user_id, + sms: :sms, + totp: :totp, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :type, + :user_id, + :sms, + :totp, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @type = hash[:type] + @user_id = hash[:user_id] + @sms = hash[:sms] ? WorkOS::AuthenticationFactorEnrolledSms.new(hash[:sms]) : nil + @totp = hash[:totp] ? WorkOS::AuthenticationFactorEnrolledTotp.new(hash[:totp]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb b/lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb new file mode 100644 index 00000000..f6265c4e --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor_enrolled_sms.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactorEnrolledSms < WorkOS::Types::BaseModel + HASH_ATTRS = { + phone_number: :phone_number + }.freeze + + attr_accessor :phone_number + + def initialize(json) + hash = self.class.normalize(json) + @phone_number = hash[:phone_number] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb b/lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb new file mode 100644 index 00000000..b291f215 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor_enrolled_totp.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactorEnrolledTotp < WorkOS::Types::BaseModel + HASH_ATTRS = { + issuer: :issuer, + user: :user, + secret: :secret, + qr_code: :qr_code, + uri: :uri + }.freeze + + attr_accessor \ + :issuer, + :user, + :secret, + :qr_code, + :uri + + def initialize(json) + hash = self.class.normalize(json) + @issuer = hash[:issuer] + @user = hash[:user] + @secret = hash[:secret] + @qr_code = hash[:qr_code] + @uri = hash[:uri] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factor_sms.rb b/lib/workos/multi_factor_auth/authentication_factor_sms.rb new file mode 100644 index 00000000..5ecbb900 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor_sms.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationFactorSms = AuthenticationFactorEnrolledSms +end diff --git a/lib/workos/multi_factor_auth/authentication_factor_totp.rb b/lib/workos/multi_factor_auth/authentication_factor_totp.rb new file mode 100644 index 00000000..56a3b06d --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factor_totp.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactorTotp < WorkOS::Types::BaseModel + HASH_ATTRS = { + issuer: :issuer, + user: :user + }.freeze + + attr_accessor \ + :issuer, + :user + + def initialize(json) + hash = self.class.normalize(json) + @issuer = hash[:issuer] + @user = hash[:user] + end + end +end diff --git a/lib/workos/multi_factor_auth/authentication_factors_create_request.rb b/lib/workos/multi_factor_auth/authentication_factors_create_request.rb new file mode 100644 index 00000000..3668f7b2 --- /dev/null +++ b/lib/workos/multi_factor_auth/authentication_factors_create_request.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationFactorsCreateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + phone_number: :phone_number, + totp_issuer: :totp_issuer, + totp_user: :totp_user, + user_id: :user_id + }.freeze + + attr_accessor \ + :type, + :phone_number, + :totp_issuer, + :totp_user, + :user_id + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @phone_number = hash[:phone_number] + @totp_issuer = hash[:totp_issuer] + @totp_user = hash[:totp_user] + @user_id = hash[:user_id] + end + end +end diff --git a/lib/workos/multi_factor_auth/challenge_authentication_factor.rb b/lib/workos/multi_factor_auth/challenge_authentication_factor.rb new file mode 100644 index 00000000..4b327792 --- /dev/null +++ b/lib/workos/multi_factor_auth/challenge_authentication_factor.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ChallengeAuthenticationFactor < WorkOS::Types::BaseModel + HASH_ATTRS = { + sms_template: :sms_template + }.freeze + + attr_accessor :sms_template + + def initialize(json) + hash = self.class.normalize(json) + @sms_template = hash[:sms_template] + end + end +end diff --git a/lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb b/lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb new file mode 100644 index 00000000..fefc8fd5 --- /dev/null +++ b/lib/workos/multi_factor_auth/enroll_user_authentication_factor.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EnrollUserAuthenticationFactor < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + totp_issuer: :totp_issuer, + totp_user: :totp_user, + totp_secret: :totp_secret + }.freeze + + attr_accessor \ + :type, + :totp_issuer, + :totp_user, + :totp_secret + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @totp_issuer = hash[:totp_issuer] + @totp_user = hash[:totp_user] + @totp_secret = hash[:totp_secret] + end + end +end diff --git a/lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb b/lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb new file mode 100644 index 00000000..3be11320 --- /dev/null +++ b/lib/workos/multi_factor_auth/user_authentication_factor_enroll_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserAuthenticationFactorEnrollResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + authentication_factor: :authentication_factor, + authentication_challenge: :authentication_challenge + }.freeze + + attr_accessor \ + :authentication_factor, + :authentication_challenge + + def initialize(json) + hash = self.class.normalize(json) + @authentication_factor = hash[:authentication_factor] ? WorkOS::AuthenticationFactorEnrolled.new(hash[:authentication_factor]) : nil + @authentication_challenge = hash[:authentication_challenge] ? WorkOS::AuthenticationChallenge.new(hash[:authentication_challenge]) : nil + end + end +end diff --git a/lib/workos/organization.rb b/lib/workos/organization.rb deleted file mode 100644 index 75145ece..00000000 --- a/lib/workos/organization.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Organization class provides a lightweight wrapper around - # a WorkOS Organization resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - class Organization - include HashProvider - - attr_accessor :id, :domains, :name, :allow_profiles_outside_organization, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @name = hash[:name] - @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] - @domains = hash[:domains] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - name: name, - allow_profiles_outside_organization: allow_profiles_outside_organization, - domains: domains, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/organization_domains.rb b/lib/workos/organization_domains.rb new file mode 100644 index 00000000..c0b9970d --- /dev/null +++ b/lib/workos/organization_domains.rb @@ -0,0 +1,94 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class OrganizationDomains + def initialize(client) + @client = client + end + + # Create an Organization Domain + # @param domain [String] The domain to add to the organization. + # @param organization_id [String] The ID of the organization to add the domain to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationDomain] + def create_organization_domain( + domain:, + organization_id:, + request_options: {} + ) + body = { + "domain" => domain, + "organization_id" => organization_id + } + response = @client.request( + method: :post, + path: "/organization_domains", + auth: true, + body: body, + request_options: 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 + + # Get an Organization Domain + # @param id [String] Unique identifier of the organization domain. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationDomainStandAlone] + def get_organization_domain( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organization_domains/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: 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 + + # Delete an Organization Domain + # @param id [String] Unique identifier of the organization domain. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_organization_domain( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/organization_domains/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end + + # Verify an Organization Domain + # @param id [String] Unique identifier of the organization domain. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationDomainStandAlone] + 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: 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 + end +end diff --git a/lib/workos/organization_domains/create_organization_domain.rb b/lib/workos/organization_domains/create_organization_domain.rb new file mode 100644 index 00000000..ba3c2b77 --- /dev/null +++ b/lib/workos/organization_domains/create_organization_domain.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateOrganizationDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + domain: :domain, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :domain, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @domain = hash[:domain] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain.rb b/lib/workos/organization_domains/organization_domain.rb new file mode 100644 index 00000000..c4698d13 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_created.rb b/lib/workos/organization_domains/organization_domain_created.rb new file mode 100644 index 00000000..6fe193ea --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDomainCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_created_data.rb b/lib/workos/organization_domains/organization_domain_created_data.rb new file mode 100644 index 00000000..8f1627fa --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_created_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_deleted.rb b/lib/workos/organization_domains/organization_domain_deleted.rb new file mode 100644 index 00000000..b7944ed2 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDomainDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_deleted_data.rb b/lib/workos/organization_domains/organization_domain_deleted_data.rb new file mode 100644 index 00000000..570802e6 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_deleted_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_stand_alone.rb b/lib/workos/organization_domains/organization_domain_stand_alone.rb new file mode 100644 index 00000000..48cc33e3 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_stand_alone.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainStandAlone < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_updated.rb b/lib/workos/organization_domains/organization_domain_updated.rb new file mode 100644 index 00000000..4ef6abeb --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDomainUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_updated_data.rb b/lib/workos/organization_domains/organization_domain_updated_data.rb new file mode 100644 index 00000000..93753eca --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_updated_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_verification_failed.rb b/lib/workos/organization_domains/organization_domain_verification_failed.rb new file mode 100644 index 00000000..58caaca0 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_verification_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainVerificationFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDomainVerificationFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_verification_failed_data.rb b/lib/workos/organization_domains/organization_domain_verification_failed_data.rb new file mode 100644 index 00000000..a34a611e --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_verification_failed_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainVerificationFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + reason: :reason, + organization_domain: :organization_domain + }.freeze + + attr_accessor \ + :reason, + :organization_domain + + def initialize(json) + hash = self.class.normalize(json) + @reason = hash[:reason] + @organization_domain = hash[:organization_domain] ? WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain.new(hash[:organization_domain]) : nil + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb b/lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb new file mode 100644 index 00000000..aed6cc0e --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_verification_failed_data_organization_domain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainVerificationFailedDataOrganizationDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_verified.rb b/lib/workos/organization_domains/organization_domain_verified.rb new file mode 100644 index 00000000..7172f83f --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_verified.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainVerified < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDomainVerifiedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organization_domains/organization_domain_verified_data.rb b/lib/workos/organization_domains/organization_domain_verified_data.rb new file mode 100644 index 00000000..564a9f37 --- /dev/null +++ b/lib/workos/organization_domains/organization_domain_verified_data.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainVerifiedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organization_membership.rb b/lib/workos/organization_membership.rb deleted file mode 100644 index 946ac6f7..00000000 --- a/lib/workos/organization_membership.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The OrganizationMembership class provides a lightweight wrapper around a WorkOS OrganizationMembership - # resource. This class is not meant to be instantiated in a user space, - # and is instantiated internally but exposed. - class OrganizationMembership - include HashProvider - - attr_accessor :id, :user_id, :organization_id, :status, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @user_id = hash[:user_id] - @organization_id = hash[:organization_id] - @status = hash[:status] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - user_id: user_id, - organization_id: organization_id, - status: status, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/organizations.rb b/lib/workos/organizations.rb index 2c1282c2..d03fd37b 100644 --- a/lib/workos/organizations.rb +++ b/lib/workos/organizations.rb @@ -1,163 +1,220 @@ # frozen_string_literal: true -require 'net/http' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The Organizations module provides resource methods for working with Organizations - module Organizations - class << self - include Client - - # Retrieve a list of organizations that have connections configured - # within your WorkOS dashboard. - # - # @param [Array] domains Filter organizations to only return those - # that are associated with the provided domains. - # @param [String] before A pagination argument used to request - # organizations before the provided Organization ID. - # @param [String] after A pagination argument used to request - # organizations after the provided Organization ID. - # @param [Integer] limit A pagination argument used to limit the number - # @param [String] order The order in which to paginate records - # of listed Organizations that are returned. - def list_organizations(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/organizations', - auth: true, - params: options, - ), - ) - - parsed_response = JSON.parse(response.body) - - organizations = parsed_response['data'].map do |organization| - ::WorkOS::Organization.new(organization.to_json) - end - - WorkOS::Types::ListStruct.new( - data: organizations, - list_metadata: parsed_response['listMetadata'], - ) - end - - # Get an Organization - # - # @param [String] id Organization unique identifier - # - # @example - # WorkOS::Portal.get_organization(id: 'org_02DRA1XNSJDZ19A31F183ECQW9') - # => #"organization_domain", - # :id=>"org_domain_01E6PK9N3XMD8RHWF7S66380AR", - # :domain=>"foo-corp.com"}]> - # - # @return [WorkOS::Organization] - def get_organization(id:) - request = get_request( - auth: true, - path: "/organizations/#{id}", - ) - - response = execute_request(request: request) - - WorkOS::Organization.new(response.body) - end - - # Create an organization - # - # @param [Array] domains List of domains that belong to the - # organization - # @param [String] name A unique, descriptive name for the organization - # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections - # within the Organization allow profiles that are outside of the Organization's configured User Email Domains. - # @param [String] idempotency_key An idempotency key - def create_organization(domains:, name:, allow_profiles_outside_organization: nil, idempotency_key: nil) - request = post_request( - auth: true, - body: { - domains: domains, - name: name, - allow_profiles_outside_organization: allow_profiles_outside_organization, - }, - path: '/organizations', - idempotency_key: idempotency_key, - ) - - response = execute_request(request: request) - check_and_raise_organization_error(response: response) +require "json" - WorkOS::Organization.new(response.body) - end - - # Update an organization - # - # @param [String] organization Organization unique identifier - # @param [Array] domains List of domains that belong to the - # organization - # @param [String] name A unique, descriptive name for the organization - # @param [Boolean, nil] allow_profiles_outside_organization Whether Connections - # within the Organization allow profiles that are outside of the Organization's configured User Email Domains. - def update_organization(organization:, domains:, name:, allow_profiles_outside_organization: nil) - request = put_request( - auth: true, - body: { - domains: domains, - name: name, - allow_profiles_outside_organization: allow_profiles_outside_organization, - }, - path: "/organizations/#{organization}", - ) - - response = execute_request(request: request) - check_and_raise_organization_error(response: response) - - WorkOS::Organization.new(response.body) - end +module WorkOS + class Organizations + def initialize(client) + @client = client + end - # Delete an Organization - # - # @param [String] id Organization unique identifier - # - # @example - # WorkOS::SSO.delete_organization(id: 'org_01EHZNVPK3SFK441A1RGBFSHRT') - # => true - # - # @return [Bool] - returns `true` if successful - def delete_organization(id:) - request = delete_request( - auth: true, - path: "/organizations/#{id}", + # List Organizations + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param domains [Array, nil] The domains of an Organization. Any Organization with a matching domain will be returned. + # @param search [String, nil] Searchable text for an Organization. Matches against the organization name. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organizations( + before: nil, + after: nil, + limit: 10, + order: "desc", + domains: nil, + search: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "domains" => domains, + "search" => search + }.compact + response = @client.request( + method: :get, + path: "/organizations", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organizations( + before: before, + after: cursor, + limit: limit, + order: order, + domains: domains, + search: search, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Organization, + filters: {before: before, limit: limit, order: order, domains: domains, search: search}, + fetch_next: fetch_next + ) + end - response = execute_request(request: request) + # Create an Organization + # @param name [String] The name of the organization. + # @param allow_profiles_outside_organization [Boolean, nil] Whether the organization allows profiles from outside the organization to sign in. + # @param domains [Array, nil] The domains associated with the organization. Deprecated in favor of `domain_data`. + # @param domain_data [Array, nil] The domains associated with the organization, including verification state. + # @param metadata [Hash{String => String}, nil] Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization. + # @param external_id [String, nil] An external identifier for the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Organization] + def create_organization( + name:, + allow_profiles_outside_organization: nil, + domains: nil, + domain_data: nil, + metadata: nil, + external_id: nil, + request_options: {} + ) + body = { + "name" => name, + "allow_profiles_outside_organization" => allow_profiles_outside_organization, + "domains" => domains, + "domain_data" => domain_data, + "metadata" => metadata, + "external_id" => external_id + }.compact + response = @client.request( + method: :post, + path: "/organizations", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Organization.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 - response.is_a? Net::HTTPSuccess - end + # Get an Organization by External ID + # @param external_id [String] The external ID of the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Organization] + def get_organization_by_external_id( + external_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/external_id/#{WorkOS::Util.encode_path(external_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Organization.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 - private + # Get an Organization + # @param id [String] Unique identifier of the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Organization] + def get_organization( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Organization.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 - def check_and_raise_organization_error(response:) - begin - body = JSON.parse(response.body) - return unless body['message'] + # Update an Organization + # @param id [String] Unique identifier of the Organization. + # @param name [String, nil] The name of the organization. + # @param allow_profiles_outside_organization [Boolean, nil] Whether the organization allows profiles from outside the organization to sign in. + # @param domains [Array, nil] (deprecated) The domains associated with the organization. Deprecated in favor of `domain_data`. + # @param domain_data [Array, nil] The domains associated with the organization, including verification state. + # @param stripe_customer_id [String, nil] The Stripe customer ID associated with the organization. + # @param metadata [Hash{String => String}, nil] Object containing [metadata](https://workos.com/docs/authkit/metadata) key/value pairs associated with the Organization. + # @param external_id [String, nil] An external identifier for the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Organization] + def update_organization( + id:, + name: nil, + allow_profiles_outside_organization: nil, + domains: nil, + domain_data: nil, + stripe_customer_id: nil, + metadata: nil, + external_id: nil, + request_options: {} + ) + body = { + "name" => name, + "allow_profiles_outside_organization" => allow_profiles_outside_organization, + "domains" => domains, + "domain_data" => domain_data, + "stripe_customer_id" => stripe_customer_id, + "metadata" => metadata, + "external_id" => external_id + }.compact + response = @client.request( + method: :put, + path: "/organizations/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::Organization.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 - message = body['message'] - request_id = response['x-request-id'] - rescue StandardError - message = 'Something went wrong' - end + # Delete an Organization + # @param id [String] Unique identifier of the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_organization( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/organizations/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - raise APIError.new( - message: message, - http_status: nil, - request_id: request_id, - ) - end + # Get Audit Log Configuration + # @param id [String] Unique identifier of the Organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuditLogConfiguration] + def get_audit_log_configuration( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(id)}/audit_log_configuration", + auth: true, + request_options: request_options + ) + result = WorkOS::AuditLogConfiguration.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 end end diff --git a/lib/workos/organizations/audit_log_configuration.rb b/lib/workos/organizations/audit_log_configuration.rb new file mode 100644 index 00000000..e273e018 --- /dev/null +++ b/lib/workos/organizations/audit_log_configuration.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogConfiguration < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + retention_period_in_days: :retention_period_in_days, + state: :state, + log_stream: :log_stream + }.freeze + + attr_accessor \ + :organization_id, + :retention_period_in_days, + :state, + :log_stream + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @retention_period_in_days = hash[:retention_period_in_days] + @state = hash[:state] + @log_stream = hash[:log_stream] ? WorkOS::AuditLogConfigurationLogStream.new(hash[:log_stream]) : nil + end + end +end diff --git a/lib/workos/organizations/audit_log_configuration_log_stream.rb b/lib/workos/organizations/audit_log_configuration_log_stream.rb new file mode 100644 index 00000000..6d05aaac --- /dev/null +++ b/lib/workos/organizations/audit_log_configuration_log_stream.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogConfigurationLogStream < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + type: :type, + state: :state, + last_synced_at: :last_synced_at, + created_at: :created_at + }.freeze + + attr_accessor \ + :id, + :type, + :state, + :last_synced_at, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @type = hash[:type] + @state = hash[:state] + @last_synced_at = hash[:last_synced_at] + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/organizations/audit_logs_retention.rb b/lib/workos/organizations/audit_logs_retention.rb new file mode 100644 index 00000000..c7fe1ab2 --- /dev/null +++ b/lib/workos/organizations/audit_logs_retention.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class AuditLogsRetention + include HashProvider + + HASH_ATTRS = { + retention_period_in_days: :retention_period_in_days + }.freeze + + attr_accessor :retention_period_in_days + + def initialize(json) + hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true) + hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String) + @retention_period_in_days = hash[:retention_period_in_days] + end + end +end diff --git a/lib/workos/organizations/audit_logs_retention_json.rb b/lib/workos/organizations/audit_logs_retention_json.rb new file mode 100644 index 00000000..f3ed1b6e --- /dev/null +++ b/lib/workos/organizations/audit_logs_retention_json.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuditLogsRetentionJson < WorkOS::Types::BaseModel + HASH_ATTRS = { + retention_period_in_days: :retention_period_in_days + }.freeze + + attr_accessor :retention_period_in_days + + def initialize(json) + hash = self.class.normalize(json) + @retention_period_in_days = hash[:retention_period_in_days] + end + end +end diff --git a/lib/workos/organizations/organization.rb b/lib/workos/organizations/organization.rb new file mode 100644 index 00000000..03892166 --- /dev/null +++ b/lib/workos/organizations/organization.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Organization < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + domains: :domains, + metadata: :metadata, + external_id: :external_id, + stripe_customer_id: :stripe_customer_id, + created_at: :created_at, + updated_at: :updated_at, + allow_profiles_outside_organization: :allow_profiles_outside_organization + }.freeze + + # @!attribute allow_profiles_outside_organization + # @deprecated Whether the Organization allows profiles outside of its managed domains. + + attr_accessor \ + :object, + :id, + :name, + :domains, + :metadata, + :external_id, + :stripe_customer_id, + :created_at, + :updated_at + + def allow_profiles_outside_organization + warn "[DEPRECATION] `allow_profiles_outside_organization` is deprecated and will be removed in a future version.", uplevel: 1 + @allow_profiles_outside_organization + end + + attr_writer :allow_profiles_outside_organization + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::OrganizationDomain.new(item) : nil } + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @stripe_customer_id = hash[:stripe_customer_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] + end + end +end diff --git a/lib/workos/organizations/organization_created.rb b/lib/workos/organizations/organization_created.rb new file mode 100644 index 00000000..b4cd5b82 --- /dev/null +++ b/lib/workos/organizations/organization_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_created_data.rb b/lib/workos/organizations/organization_created_data.rb new file mode 100644 index 00000000..13d18eab --- /dev/null +++ b/lib/workos/organizations/organization_created_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + domains: :domains, + metadata: :metadata, + external_id: :external_id, + stripe_customer_id: :stripe_customer_id, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :name, + :domains, + :metadata, + :external_id, + :stripe_customer_id, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::OrganizationCreatedDataDomain.new(item) : nil } + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @stripe_customer_id = hash[:stripe_customer_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_created_data_domain.rb b/lib/workos/organizations/organization_created_data_domain.rb new file mode 100644 index 00000000..c6c18fd7 --- /dev/null +++ b/lib/workos/organizations/organization_created_data_domain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationCreatedDataDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_deleted.rb b/lib/workos/organizations/organization_deleted.rb new file mode 100644 index 00000000..1a2381be --- /dev/null +++ b/lib/workos/organizations/organization_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_deleted_data.rb b/lib/workos/organizations/organization_deleted_data.rb new file mode 100644 index 00000000..88259c39 --- /dev/null +++ b/lib/workos/organizations/organization_deleted_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + domains: :domains, + metadata: :metadata, + external_id: :external_id, + stripe_customer_id: :stripe_customer_id, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :name, + :domains, + :metadata, + :external_id, + :stripe_customer_id, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::OrganizationDeletedDataDomain.new(item) : nil } + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @stripe_customer_id = hash[:stripe_customer_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_deleted_data_domain.rb b/lib/workos/organizations/organization_deleted_data_domain.rb new file mode 100644 index 00000000..bc40f61c --- /dev/null +++ b/lib/workos/organizations/organization_deleted_data_domain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDeletedDataDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_domain_data.rb b/lib/workos/organizations/organization_domain_data.rb new file mode 100644 index 00000000..df58b2f5 --- /dev/null +++ b/lib/workos/organizations/organization_domain_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationDomainData < WorkOS::Types::BaseModel + HASH_ATTRS = { + domain: :domain, + state: :state + }.freeze + + attr_accessor \ + :domain, + :state + + def initialize(json) + hash = self.class.normalize(json) + @domain = hash[:domain] + @state = hash[:state] + end + end +end diff --git a/lib/workos/organizations/organization_input.rb b/lib/workos/organizations/organization_input.rb new file mode 100644 index 00000000..b4479b36 --- /dev/null +++ b/lib/workos/organizations/organization_input.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationInput < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + allow_profiles_outside_organization: :allow_profiles_outside_organization, + domains: :domains, + domain_data: :domain_data, + metadata: :metadata, + external_id: :external_id + }.freeze + + attr_accessor \ + :name, + :allow_profiles_outside_organization, + :domains, + :domain_data, + :metadata, + :external_id + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] + @domains = hash[:domains] || [] + @domain_data = (hash[:domain_data] || []).map { |item| item ? WorkOS::OrganizationDomainData.new(item) : nil } + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + end + end +end diff --git a/lib/workos/organizations/organization_membership_created.rb b/lib/workos/organizations/organization_membership_created.rb new file mode 100644 index 00000000..64864fbc --- /dev/null +++ b/lib/workos/organizations/organization_membership_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationMembershipCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_membership_created_data.rb b/lib/workos/organizations/organization_membership_created_data.rb new file mode 100644 index 00000000..79f18f08 --- /dev/null +++ b/lib/workos/organizations/organization_membership_created_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + role: :role, + roles: :roles, + custom_attributes: :custom_attributes, + directory_managed: :directory_managed, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :role, + :roles, + :custom_attributes, + :directory_managed, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @custom_attributes = hash[:custom_attributes] || {} + @directory_managed = hash[:directory_managed] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_membership_deleted.rb b/lib/workos/organizations/organization_membership_deleted.rb new file mode 100644 index 00000000..ae5f3507 --- /dev/null +++ b/lib/workos/organizations/organization_membership_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationMembershipDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_membership_deleted_data.rb b/lib/workos/organizations/organization_membership_deleted_data.rb new file mode 100644 index 00000000..227d309a --- /dev/null +++ b/lib/workos/organizations/organization_membership_deleted_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + role: :role, + roles: :roles, + custom_attributes: :custom_attributes, + directory_managed: :directory_managed, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :role, + :roles, + :custom_attributes, + :directory_managed, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @custom_attributes = hash[:custom_attributes] || {} + @directory_managed = hash[:directory_managed] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_membership_updated.rb b/lib/workos/organizations/organization_membership_updated.rb new file mode 100644 index 00000000..3127cb78 --- /dev/null +++ b/lib/workos/organizations/organization_membership_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationMembershipUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_membership_updated_data.rb b/lib/workos/organizations/organization_membership_updated_data.rb new file mode 100644 index 00000000..3c045383 --- /dev/null +++ b/lib/workos/organizations/organization_membership_updated_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembershipUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + role: :role, + roles: :roles, + custom_attributes: :custom_attributes, + directory_managed: :directory_managed, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :role, + :roles, + :custom_attributes, + :directory_managed, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @custom_attributes = hash[:custom_attributes] || {} + @directory_managed = hash[:directory_managed] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_role_created.rb b/lib/workos/organizations/organization_role_created.rb new file mode 100644 index 00000000..f55aa5f6 --- /dev/null +++ b/lib/workos/organizations/organization_role_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationRoleCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationRoleCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_role_created_data.rb b/lib/workos/organizations/organization_role_created_data.rb new file mode 100644 index 00000000..36d295b1 --- /dev/null +++ b/lib/workos/organizations/organization_role_created_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationRoleCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + organization_id: :organization_id, + slug: :slug, + name: :name, + description: :description, + resource_type_slug: :resource_type_slug, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :organization_id, + :slug, + :name, + :description, + :resource_type_slug, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @organization_id = hash[:organization_id] + @slug = hash[:slug] + @name = hash[:name] + @description = hash[:description] + @resource_type_slug = hash[:resource_type_slug] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_role_deleted.rb b/lib/workos/organizations/organization_role_deleted.rb new file mode 100644 index 00000000..17ce8ce8 --- /dev/null +++ b/lib/workos/organizations/organization_role_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationRoleDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationRoleDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_role_deleted_data.rb b/lib/workos/organizations/organization_role_deleted_data.rb new file mode 100644 index 00000000..d981a609 --- /dev/null +++ b/lib/workos/organizations/organization_role_deleted_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + OrganizationRoleDeletedData = OrganizationRoleCreatedData +end diff --git a/lib/workos/organizations/organization_role_updated.rb b/lib/workos/organizations/organization_role_updated.rb new file mode 100644 index 00000000..51af21bd --- /dev/null +++ b/lib/workos/organizations/organization_role_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationRoleUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationRoleUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_role_updated_data.rb b/lib/workos/organizations/organization_role_updated_data.rb new file mode 100644 index 00000000..e6390838 --- /dev/null +++ b/lib/workos/organizations/organization_role_updated_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + OrganizationRoleUpdatedData = OrganizationRoleCreatedData +end diff --git a/lib/workos/organizations/organization_updated.rb b/lib/workos/organizations/organization_updated.rb new file mode 100644 index 00000000..c13a99bb --- /dev/null +++ b/lib/workos/organizations/organization_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::OrganizationUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/organizations/organization_updated_data.rb b/lib/workos/organizations/organization_updated_data.rb new file mode 100644 index 00000000..8acef2aa --- /dev/null +++ b/lib/workos/organizations/organization_updated_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + domains: :domains, + metadata: :metadata, + external_id: :external_id, + stripe_customer_id: :stripe_customer_id, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :name, + :domains, + :metadata, + :external_id, + :stripe_customer_id, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::OrganizationUpdatedDataDomain.new(item) : nil } + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @stripe_customer_id = hash[:stripe_customer_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/organization_updated_data_domain.rb b/lib/workos/organizations/organization_updated_data_domain.rb new file mode 100644 index 00000000..24a6d4bc --- /dev/null +++ b/lib/workos/organizations/organization_updated_data_domain.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationUpdatedDataDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + domain: :domain, + state: :state, + verification_prefix: :verification_prefix, + verification_token: :verification_token, + verification_strategy: :verification_strategy, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :domain, + :state, + :verification_prefix, + :verification_token, + :verification_strategy, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @domain = hash[:domain] + @state = hash[:state] + @verification_prefix = hash[:verification_prefix] + @verification_token = hash[:verification_token] + @verification_strategy = hash[:verification_strategy] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/organizations/update_audit_logs_retention.rb b/lib/workos/organizations/update_audit_logs_retention.rb new file mode 100644 index 00000000..14e0ccfa --- /dev/null +++ b/lib/workos/organizations/update_audit_logs_retention.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateAuditLogsRetention < WorkOS::Types::BaseModel + HASH_ATTRS = { + retention_period_in_days: :retention_period_in_days + }.freeze + + attr_accessor :retention_period_in_days + + def initialize(json) + hash = self.class.normalize(json) + @retention_period_in_days = hash[:retention_period_in_days] + end + end +end diff --git a/lib/workos/organizations/update_organization.rb b/lib/workos/organizations/update_organization.rb new file mode 100644 index 00000000..30ada5a4 --- /dev/null +++ b/lib/workos/organizations/update_organization.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateOrganization < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + allow_profiles_outside_organization: :allow_profiles_outside_organization, + domains: :domains, + domain_data: :domain_data, + stripe_customer_id: :stripe_customer_id, + metadata: :metadata, + external_id: :external_id + }.freeze + + # @!attribute domains + # @deprecated The domains associated with the organization. Deprecated in favor of `domain_data`. + + attr_accessor \ + :name, + :allow_profiles_outside_organization, + :domain_data, + :stripe_customer_id, + :metadata, + :external_id + + def domains + warn "[DEPRECATION] `domains` is deprecated and will be removed in a future version.", uplevel: 1 + @domains + end + + attr_writer :domains + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @allow_profiles_outside_organization = hash[:allow_profiles_outside_organization] + @domains = hash[:domains] || [] + @domain_data = (hash[:domain_data] || []).map { |item| item ? WorkOS::OrganizationDomainData.new(item) : nil } + @stripe_customer_id = hash[:stripe_customer_id] + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + end + end +end diff --git a/lib/workos/passwordless.rb b/lib/workos/passwordless.rb index 7ac0c5fd..f36009d2 100644 --- a/lib/workos/passwordless.rb +++ b/lib/workos/passwordless.rb @@ -1,71 +1,76 @@ # frozen_string_literal: true -require 'net/http' +# @oagen-ignore-file +# Hand-maintained: Passwordless session endpoints are not yet in the OpenAPI +# spec, so this module wraps them until they are. +# See https://workos.com/docs/reference/magic-link. +require "json" module WorkOS - # The Passwordless module provides convenience methods for working with - # passwordless sessions including the WorkOS Magic Link. You'll need a valid - # API key. + # Passwordless authentication sessions (magic-link). # - # @see https://workos.com/docs/sso/configuring-magic-link - module Passwordless - class << self - include Client - - # Create a Passwordless Session. - # - # @param [Hash] options A hash with options for the session - # @option options [String] email The email of the user to authenticate. - # @option options [String] state Optional parameter that the redirect URI - # received from WorkOS will contain. The state parameter can be used to - # encode arbitrary information to help restore application state between - # redirects. - # @option options [String] connection Optional parameter for the ID of a - # specific connection. This can be used to create a Passwordless Session - # for a specific connection rather than using the domain from the email - # to determine the Organization and Connection. - # @option options [String] type The type of Passwordless Session to - # create. Currently, the only supported value is 'MagicLink'. - # @option options [String] redirect_uri The URI where users are directed - # after completing the authentication step. Must match a - # configured redirect URI on your WorkOS dashboard. - # - # @return Hash - def create_session(options) - response = execute_request( - request: post_request( - path: '/passwordless/sessions', - auth: true, - body: options, - ), + # session = client.passwordless.create_session(email: "user@example.com") + # client.passwordless.send_session(session.id) + class Passwordless + PasswordlessSession = Struct.new(:id, :email, :expires_at, :link, :object, keyword_init: true) do + def self.from_hash(hash) + new( + id: hash["id"], + email: hash["email"], + expires_at: hash["expires_at"], + link: hash["link"], + object: hash["object"] || "passwordless_session" ) + end - hash = JSON.parse(response.body) - - WorkOS::Types::PasswordlessSessionStruct.new( - id: hash['id'], - email: hash['email'], - expires_at: Date.parse(hash['expires_at']), - link: hash['link'], - ) + def to_h + super.compact end + end - # Send a Passwordless Session via email. - # - # @param [String] session_id The unique identifier of the Passwordless - # Session to send an email for. - # - # @return Hash - def send_session(session_id) - response = execute_request( - request: post_request( - path: "/passwordless/sessions/#{session_id}/send", - auth: true, - ), - ) + def initialize(client) + @client = client + end - JSON.parse(response.body) - end + # Create a passwordless session. + # + # @param email [String] Email of the user to authenticate. + # @param type [String] Session type. Currently only "MagicLink" is supported. + # @param redirect_uri [String, nil] Where to redirect the user after auth. + # @param state [String, nil] Arbitrary state echoed back on redirect. + # @param connection [String, nil] Specific connection ID to use. + # @param expires_in [Integer, nil] Lifetime in seconds. + # @param request_options [Hash] Per-request overrides. + # @return [PasswordlessSession] + def create_session(email:, type: "MagicLink", redirect_uri: nil, state: nil, connection: nil, expires_in: nil, request_options: {}) + body = { + "email" => email, + "type" => type, + "redirect_uri" => redirect_uri, + "state" => state, + "connection" => connection, + "expires_in" => expires_in + }.compact + response = @client.request(method: :post, path: "/passwordless/sessions", auth: true, body: body, request_options: request_options) + PasswordlessSession.from_hash(JSON.parse(response.body)) + end + + # Send the magic-link email for an existing passwordless session. + # + # @param session_id [String] Unique identifier of the passwordless session. + # @param request_options [Hash] Per-request overrides. + # @return [Hash] Server response payload. + def send_session(session_id, request_options: {}) + response = @client.request( + method: :post, + path: "/passwordless/sessions/#{WorkOS::Util.encode_path(session_id)}/send", + auth: true, + body: {}, + request_options: request_options + ) + JSON.parse(response.body || "{}") + rescue JSON::ParserError + {} end end end diff --git a/lib/workos/pipes.rb b/lib/workos/pipes.rb new file mode 100644 index 00000000..c2eefb7e --- /dev/null +++ b/lib/workos/pipes.rb @@ -0,0 +1,149 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Pipes + def initialize(client) + @client = client + end + + # Get authorization URL + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param user_id [String] The ID of the user to authorize. + # @param organization_id [String, nil] An organization ID to scope the authorization to a specific organization. + # @param return_to [String, nil] The URL to redirect the user to after authorization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationAuthorizeUrlResponse] + def authorize_data_integration( + slug:, + user_id:, + organization_id: nil, + return_to: nil, + request_options: {} + ) + body = { + "user_id" => user_id, + "organization_id" => organization_id, + "return_to" => return_to + }.compact + response = @client.request( + method: :post, + path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/authorize", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::DataIntegrationAuthorizeUrlResponse.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 + + # Get an access token for a connected account + # @param slug [String] The identifier of the integration. + # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. + # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationAccessTokenResponse] + def create_data_integration_token( + slug:, + user_id:, + organization_id: nil, + request_options: {} + ) + body = { + "user_id" => user_id, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :post, + path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/token", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::DataIntegrationAccessTokenResponse.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 + + # Get a connected account + # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ConnectedAccount] + def get_user_connected_account( + user_id:, + slug:, + organization_id: nil, + request_options: {} + ) + params = { + "organization_id" => organization_id + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + params: params, + request_options: request_options + ) + result = WorkOS::ConnectedAccount.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 a connected account + # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. + # @param slug [String] The slug identifier of the provider (e.g., `github`, `slack`, `notion`). + # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter if the connection is scoped to an organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_user_connected_account( + user_id:, + slug:, + organization_id: nil, + request_options: {} + ) + params = { + "organization_id" => organization_id + }.compact + @client.request( + method: :delete, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/connected_accounts/#{WorkOS::Util.encode_path(slug)}", + auth: true, + params: params, + request_options: request_options + ) + nil + end + + # List providers + # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier to list providers and connected accounts for. + # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to filter connections for a specific organization. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationsListResponse] + def list_user_data_providers( + user_id:, + organization_id: nil, + request_options: {} + ) + params = { + "organization_id" => organization_id + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/data_providers", + auth: true, + params: params, + request_options: request_options + ) + result = WorkOS::DataIntegrationsListResponse.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 + end +end diff --git a/lib/workos/pipes/connected_account.rb b/lib/workos/pipes/connected_account.rb new file mode 100644 index 00000000..2e496067 --- /dev/null +++ b/lib/workos/pipes/connected_account.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectedAccount < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + scopes: :scopes, + state: :state, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :scopes, + :state, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @scopes = hash[:scopes] || [] + @state = hash[:state] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/pipes/data_integration_access_token_response.rb b/lib/workos/pipes/data_integration_access_token_response.rb new file mode 100644 index 00000000..25d28046 --- /dev/null +++ b/lib/workos/pipes/data_integration_access_token_response.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationAccessTokenResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + active: :active, + access_token: :access_token, + error: :error + }.freeze + + attr_accessor \ + :active, + :access_token, + :error + + def initialize(json) + hash = self.class.normalize(json) + @active = hash[:active] + @access_token = hash[:access_token] ? WorkOS::DataIntegrationAccessTokenResponseAccessToken.new(hash[:access_token]) : nil + @error = hash[:error] + end + end +end diff --git a/lib/workos/pipes/data_integration_access_token_response_access_token.rb b/lib/workos/pipes/data_integration_access_token_response_access_token.rb new file mode 100644 index 00000000..e2db6ef0 --- /dev/null +++ b/lib/workos/pipes/data_integration_access_token_response_access_token.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationAccessTokenResponseAccessToken < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + access_token: :access_token, + expires_at: :expires_at, + scopes: :scopes, + missing_scopes: :missing_scopes + }.freeze + + attr_accessor \ + :object, + :access_token, + :expires_at, + :scopes, + :missing_scopes + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @access_token = hash[:access_token] + @expires_at = hash[:expires_at] + @scopes = hash[:scopes] || [] + @missing_scopes = hash[:missing_scopes] || [] + end + end +end diff --git a/lib/workos/pipes/data_integration_authorize_url_response.rb b/lib/workos/pipes/data_integration_authorize_url_response.rb new file mode 100644 index 00000000..b9f610f1 --- /dev/null +++ b/lib/workos/pipes/data_integration_authorize_url_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationAuthorizeUrlResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + url: :url + }.freeze + + attr_accessor :url + + def initialize(json) + hash = self.class.normalize(json) + @url = hash[:url] + end + end +end diff --git a/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb new file mode 100644 index 00000000..495c04c5 --- /dev/null +++ b/lib/workos/pipes/data_integrations_get_data_integration_authorize_url_request.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + user_id: :user_id, + organization_id: :organization_id, + return_to: :return_to + }.freeze + + attr_accessor \ + :user_id, + :organization_id, + :return_to + + def initialize(json) + hash = self.class.normalize(json) + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @return_to = hash[:return_to] + end + end +end diff --git a/lib/workos/pipes/data_integrations_get_user_token_request.rb b/lib/workos/pipes/data_integrations_get_user_token_request.rb new file mode 100644 index 00000000..0aa4df76 --- /dev/null +++ b/lib/workos/pipes/data_integrations_get_user_token_request.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsGetUserTokenRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + user_id: :user_id, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :user_id, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/pipes/data_integrations_list_response.rb b/lib/workos/pipes/data_integrations_list_response.rb new file mode 100644 index 00000000..35837685 --- /dev/null +++ b/lib/workos/pipes/data_integrations_list_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data: :data + }.freeze + + attr_accessor \ + :object, + :data + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data = (hash[:data] || []).map { |item| item ? WorkOS::DataIntegrationsListResponseData.new(item) : nil } + end + end +end diff --git a/lib/workos/pipes/data_integrations_list_response_data.rb b/lib/workos/pipes/data_integrations_list_response_data.rb new file mode 100644 index 00000000..d84f0a8a --- /dev/null +++ b/lib/workos/pipes/data_integrations_list_response_data.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponseData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + name: :name, + description: :description, + slug: :slug, + integration_type: :integration_type, + credentials_type: :credentials_type, + scopes: :scopes, + ownership: :ownership, + created_at: :created_at, + updated_at: :updated_at, + connected_account: :connected_account + }.freeze + + attr_accessor \ + :object, + :id, + :name, + :description, + :slug, + :integration_type, + :credentials_type, + :scopes, + :ownership, + :created_at, + :updated_at, + :connected_account + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @name = hash[:name] + @description = hash[:description] + @slug = hash[:slug] + @integration_type = hash[:integration_type] + @credentials_type = hash[:credentials_type] + @scopes = hash[:scopes] || [] + @ownership = hash[:ownership] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @connected_account = hash[:connected_account] ? WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(hash[:connected_account]) : nil + end + end +end diff --git a/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb b/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb new file mode 100644 index 00000000..e1957b5a --- /dev/null +++ b/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + scopes: :scopes, + state: :state, + created_at: :created_at, + updated_at: :updated_at, + userlandUserId: :userland_user_id + }.freeze + + # @!attribute userland_user_id + # @deprecated Use `user_id` instead. + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :scopes, + :state, + :created_at, + :updated_at + + def userland_user_id + warn "[DEPRECATION] `userland_user_id` is deprecated and will be removed in a future version.", uplevel: 1 + @userland_user_id + end + + attr_writer :userland_user_id + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @scopes = hash[:scopes] || [] + @state = hash[:state] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @userland_user_id = hash[:userlandUserId] + end + end +end diff --git a/lib/workos/pkce.rb b/lib/workos/pkce.rb new file mode 100644 index 00000000..158e0678 --- /dev/null +++ b/lib/workos/pkce.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained PKCE utilities (H08). +# RFC 7636: code_verifier is 43-128 chars (high-entropy); code_challenge is +# the URL-safe base64 SHA-256 of the verifier (S256 method). + +require "base64" +require "digest" +require "securerandom" + +module WorkOS + # PKCE (Proof Key for Code Exchange) utilities for OAuth public-client flows. + # + # WorkOS::PKCE.generate_code_verifier # => "abc..." + # WorkOS::PKCE.generate_code_challenge(v) # => "xyz..." + # WorkOS::PKCE.generate_pair # => { code_verifier:, code_challenge: } + module PKCE + # Default verifier length in bytes BEFORE base64url encoding. 32 bytes + # → 43 characters of base64url, which is the RFC 7636 minimum. + DEFAULT_VERIFIER_BYTES = 32 + + module_function + + # Generate a cryptographically random PKCE code verifier. + def generate_code_verifier(byte_length = DEFAULT_VERIFIER_BYTES) + Base64.urlsafe_encode64(SecureRandom.random_bytes(byte_length), padding: false) + end + + # Compute the S256 code_challenge for a given verifier. + def generate_code_challenge(code_verifier) + Base64.urlsafe_encode64(Digest::SHA256.digest(code_verifier), padding: false) + end + + # Generate a fresh (verifier, challenge) pair. + # @return [Hash] { code_verifier:, code_challenge: } + def generate_pair + verifier = generate_code_verifier + {code_verifier: verifier, code_challenge: generate_code_challenge(verifier)} + end + end +end diff --git a/lib/workos/portal.rb b/lib/workos/portal.rb deleted file mode 100644 index 90fc37a9..00000000 --- a/lib/workos/portal.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -require 'net/http' - -module WorkOS - # The Portal module provides resource methods for working with the Admin - # Portal product - module Portal - class << self - include Client - - GENERATE_LINK_INTENTS = WorkOS::Types::Intent::ALL - - # Generate a link to grant access to an organization's Admin Portal - # - # @param [String] intent The access scope for the generated Admin Portal - # link. Valid values are: ["audit_logs", "dsync", "log_streams", "sso",] - # @param [String] organization The ID of the organization the Admin - # Portal link will be generated for. - # @param [String] The URL that the end user will be redirected to upon - # exiting the generated Admin Portal. If none is provided, the default - # redirect link set in your WorkOS Dashboard will be used. - # @param [String] The URL to which WorkOS will redirect users to upon - # successfully setting up Single Sign On or Directory Sync. - def generate_link(intent:, organization:, return_url: nil, success_url: nil) - validate_intent(intent) - - request = post_request( - auth: true, - body: { - intent: intent, - organization: organization, - return_url: return_url, - success_url: success_url, - }, - path: '/portal/generate_link', - ) - - response = execute_request(request: request) - - JSON.parse(response.body)['link'] - end - - private - - def validate_intent(intent) - return if GENERATE_LINK_INTENTS.include?(intent) - - raise ArgumentError, "#{intent} is not a valid value." \ - " `intent` must be in #{GENERATE_LINK_INTENTS}" - end - end - end -end diff --git a/lib/workos/profile.rb b/lib/workos/profile.rb deleted file mode 100644 index 92fbe518..00000000 --- a/lib/workos/profile.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Profile class provides a lighweight wrapper around - # a normalized response from the various IDPs WorkOS - # supports as part of the SSO integration. This class - # is not meant to be instantiated in user space, and - # is instantiated internally but exposed. - class Profile - include HashProvider - - attr_accessor :id, :email, :first_name, :last_name, :groups, :organization_id, - :connection_id, :connection_type, :idp_id, :raw_attributes - - def initialize(profile_json) - hash = JSON.parse(profile_json, symbolize_names: true) - - @id = hash[:id] - @email = hash[:email] - @first_name = hash[:first_name] - @last_name = hash[:last_name] - @groups = hash[:groups] - @organization_id = hash[:organization_id] - @connection_id = hash[:connection_id] - @connection_type = hash[:connection_type] - @idp_id = hash[:idp_id] - @raw_attributes = hash[:raw_attributes] - end - - def full_name - [first_name, last_name].compact.join(' ') - end - - def to_json(*) - { - id: id, - email: email, - first_name: first_name, - last_name: last_name, - groups: groups, - organization_id: organization_id, - connection_id: connection_id, - connection_type: connection_type, - idp_id: idp_id, - raw_attributes: raw_attributes, - } - end - end -end diff --git a/lib/workos/profile_and_token.rb b/lib/workos/profile_and_token.rb deleted file mode 100644 index 8031d90f..00000000 --- a/lib/workos/profile_and_token.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The ProfileAndToken class represents a Profile and a corresponding - # Access Token. This class is not meant to be instantiated in user space, and - # is instantiated internally but exposed. - class ProfileAndToken - include HashProvider - - attr_accessor :access_token, :profile - - def initialize(profile_and_token_json) - json = JSON.parse(profile_and_token_json, symbolize_names: true) - - @access_token = json[:access_token] - @profile = WorkOS::Profile.new(json[:profile].to_json) - end - - def to_json(*) - { - access_token: access_token, - profile: profile.to_json, - } - end - end -end diff --git a/lib/workos/public_client.rb b/lib/workos/public_client.rb new file mode 100644 index 00000000..aa6f4fdc --- /dev/null +++ b/lib/workos/public_client.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained public-client factory (H19). +# Public clients (browser, mobile, CLI, desktop) cannot store an API key +# securely; they use PKCE flows and operate without an api_key. + +module WorkOS + module PublicClient + module_function + + # Construct a WorkOS::Client suitable for PKCE-only / public-client use. + # No api_key is required — methods that would normally send a Bearer + # Authorization header will skip it. Use PKCE flows on user_management + # and sso (`get_authorization_url_with_pkce`, `authenticate_with_code_pkce`, + # etc.) instead of methods that require server-side credentials. + # + # @param client_id [String] WorkOS client ID for the application. + # @param opts [Hash] Additional options forwarded to {WorkOS::Client.new} + # (e.g. :base_url, :timeout, :max_retries, :logger, :log_level, :extra_headers). + # @return [WorkOS::Client] + def create(client_id:, **opts) + raise ArgumentError, "client_id is required" if client_id.nil? || client_id.empty? + WorkOS::Client.new(client_id: client_id, **opts) + end + end +end diff --git a/lib/workos/radar.rb b/lib/workos/radar.rb new file mode 100644 index 00000000..451f817f --- /dev/null +++ b/lib/workos/radar.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Radar + def initialize(client) + @client = client + end + + # Create an attempt + # @param ip_address [String] The IP address of the request to assess. + # @param user_agent [String] The user agent string of the request to assess. + # @param email [String] The email address of the user making the request. + # @param auth_method [WorkOS::Types::RadarStandaloneAssessRequestAuthMethod] The authentication method being used. + # @param action [WorkOS::Types::RadarStandaloneAssessRequestAction] The action being performed. + # @param device_fingerprint [String, nil] An optional device fingerprint for the request. + # @param bot_score [String, nil] An optional bot detection score for the request. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::RadarStandaloneResponse] + def create_attempt( + ip_address:, + user_agent:, + email:, + auth_method:, + action:, + device_fingerprint: nil, + bot_score: nil, + request_options: {} + ) + body = { + "ip_address" => ip_address, + "user_agent" => user_agent, + "email" => email, + "auth_method" => auth_method, + "action" => action, + "device_fingerprint" => device_fingerprint, + "bot_score" => bot_score + }.compact + response = @client.request( + method: :post, + path: "/radar/attempts", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::RadarStandaloneResponse.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 + + # Update a Radar attempt + # @param id [String] The unique identifier of the Radar attempt to update. + # @param challenge_status [String, nil] Set to `"success"` to mark the challenge as completed. + # @param attempt_status [String, nil] Set to `"success"` to mark the authentication attempt as successful. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def update_attempt( + id:, + challenge_status: nil, + attempt_status: nil, + request_options: {} + ) + body = { + "challenge_status" => challenge_status, + "attempt_status" => attempt_status + }.compact + @client.request( + method: :put, + path: "/radar/attempts/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options + ) + nil + end + + # Add an entry to a Radar list + # @param type [WorkOS::Types::RadarType] The type of the Radar list (e.g. ip_address, domain, email). + # @param action [WorkOS::Types::RadarAction] The list action indicating whether to add the entry to the allow or block list. + # @param entry [String] The value to add to the list. Must match the format of the list type (e.g. a valid IP address for `ip_address`, a valid email for `email`). + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::RadarListEntryAlreadyPresentResponse] + def add_list_entry( + type:, + action:, + entry:, + request_options: {} + ) + body = { + "entry" => entry + } + response = @client.request( + method: :post, + path: "/radar/lists/#{WorkOS::Util.encode_path(type)}/#{WorkOS::Util.encode_path(action)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::RadarListEntryAlreadyPresentResponse.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 + + # Remove an entry from a Radar list + # @param type [WorkOS::Types::RadarType] The type of the Radar list (e.g. ip_address, domain, email). + # @param action [WorkOS::Types::RadarAction] The list action indicating whether to remove the entry from the allow or block list. + # @param entry [String] The value to remove from the list. Must match an existing entry. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def remove_list_entry( + type:, + action:, + entry:, + request_options: {} + ) + body = { + "entry" => entry + } + @client.request( + method: :delete, + path: "/radar/lists/#{WorkOS::Util.encode_path(type)}/#{WorkOS::Util.encode_path(action)}", + auth: true, + body: body, + request_options: request_options + ) + nil + end + end +end diff --git a/lib/workos/radar/radar_list_entry_already_present_response.rb b/lib/workos/radar/radar_list_entry_already_present_response.rb new file mode 100644 index 00000000..738ab835 --- /dev/null +++ b/lib/workos/radar/radar_list_entry_already_present_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RadarListEntryAlreadyPresentResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + message: :message + }.freeze + + attr_accessor :message + + def initialize(json) + hash = self.class.normalize(json) + @message = hash[:message] + end + end +end diff --git a/lib/workos/radar/radar_standalone_assess_request.rb b/lib/workos/radar/radar_standalone_assess_request.rb new file mode 100644 index 00000000..a66b56de --- /dev/null +++ b/lib/workos/radar/radar_standalone_assess_request.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RadarStandaloneAssessRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + ip_address: :ip_address, + user_agent: :user_agent, + email: :email, + auth_method: :auth_method, + action: :action, + device_fingerprint: :device_fingerprint, + bot_score: :bot_score + }.freeze + + attr_accessor \ + :ip_address, + :user_agent, + :email, + :auth_method, + :action, + :device_fingerprint, + :bot_score + + def initialize(json) + hash = self.class.normalize(json) + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @email = hash[:email] + @auth_method = hash[:auth_method] + @action = hash[:action] + @device_fingerprint = hash[:device_fingerprint] + @bot_score = hash[:bot_score] + end + end +end diff --git a/lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb b/lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb new file mode 100644 index 00000000..70d93caf --- /dev/null +++ b/lib/workos/radar/radar_standalone_delete_radar_list_entry_request.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RadarStandaloneDeleteRadarListEntryRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + entry: :entry + }.freeze + + attr_accessor :entry + + def initialize(json) + hash = self.class.normalize(json) + @entry = hash[:entry] + end + end +end diff --git a/lib/workos/radar/radar_standalone_response.rb b/lib/workos/radar/radar_standalone_response.rb new file mode 100644 index 00000000..dc6be73b --- /dev/null +++ b/lib/workos/radar/radar_standalone_response.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RadarStandaloneResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + verdict: :verdict, + reason: :reason, + attempt_id: :attempt_id, + control: :control, + blocklist_type: :blocklist_type + }.freeze + + attr_accessor \ + :verdict, + :reason, + :attempt_id, + :control, + :blocklist_type + + def initialize(json) + hash = self.class.normalize(json) + @verdict = hash[:verdict] + @reason = hash[:reason] + @attempt_id = hash[:attempt_id] + @control = hash[:control] + @blocklist_type = hash[:blocklist_type] + end + end +end diff --git a/lib/workos/radar/radar_standalone_update_radar_attempt_request.rb b/lib/workos/radar/radar_standalone_update_radar_attempt_request.rb new file mode 100644 index 00000000..307a455d --- /dev/null +++ b/lib/workos/radar/radar_standalone_update_radar_attempt_request.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RadarStandaloneUpdateRadarAttemptRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + challenge_status: :challenge_status, + attempt_status: :attempt_status + }.freeze + + attr_accessor \ + :challenge_status, + :attempt_status + + def initialize(json) + hash = self.class.normalize(json) + @challenge_status = hash[:challenge_status] + @attempt_status = hash[:attempt_status] + end + end +end diff --git a/lib/workos/radar/radar_standalone_update_radar_list_request.rb b/lib/workos/radar/radar_standalone_update_radar_list_request.rb new file mode 100644 index 00000000..b628ab0a --- /dev/null +++ b/lib/workos/radar/radar_standalone_update_radar_list_request.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + RadarStandaloneUpdateRadarListRequest = RadarStandaloneDeleteRadarListEntryRequest +end diff --git a/lib/workos/refresh_authentication_response.rb b/lib/workos/refresh_authentication_response.rb deleted file mode 100644 index 4885e404..00000000 --- a/lib/workos/refresh_authentication_response.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The RefreshAuthenticationResponse contains response data from a successful - # `UserManagement.authenticate_with_refresh_token` call - class RefreshAuthenticationResponse - include HashProvider - - attr_accessor :access_token, :refresh_token - - def initialize(authentication_response_json) - json = JSON.parse(authentication_response_json, symbolize_names: true) - @access_token = json[:access_token] - @refresh_token = json[:refresh_token] - end - - def to_json(*) - { - access_token: access_token, - refresh_token: refresh_token, - } - end - end -end diff --git a/lib/workos/session.rb b/lib/workos/session.rb new file mode 100644 index 00000000..28371731 --- /dev/null +++ b/lib/workos/session.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained Session object. Constructed by SessionManager#load. +require "json" +require "jwt" +require "openssl" +require "uri" + +module WorkOS + # Wraps a sealed session cookie for authentication, refresh, and logout. + # Constructed by {SessionManager#load}; not intended for direct instantiation. + # + # @example Authenticate and refresh + # session = client.session_manager.load(seal_data: cookie, cookie_password: pw) + # result = session.authenticate + # if result.is_a?(SessionManager::AuthError) && result.reason == SessionManager::EXPIRED_JWT + # refresh = session.refresh + # end + # + # @example Build a logout URL + # url = session.get_logout_url(return_to: "https://app.example.com") + class Session + # Minimum cookie_password byte length. AES-256-GCM derives a 32-byte + # key from the password via SHA-256; a passphrase shorter than the + # output it derives to provides less than the full keyspace and makes + # offline brute-force feasible. Require callers to supply at least 32 + # bytes of high-entropy secret. See README + V7_MIGRATION_GUIDE.md. + MIN_COOKIE_PASSWORD_BYTES = 32 + + def initialize(manager, seal_data:, cookie_password:) + raise ArgumentError, "cookie_password is required" if cookie_password.nil? || cookie_password.empty? + raise ArgumentError, "cookie_password must be at least #{MIN_COOKIE_PASSWORD_BYTES} bytes" if cookie_password.bytesize < MIN_COOKIE_PASSWORD_BYTES + @manager = manager + @client = manager.client + @seal_data = seal_data + @cookie_password = cookie_password + end + + attr_reader :seal_data, :cookie_password + + # Authenticates the user based on the session data + # @param include_expired [Boolean] If true, returns decoded token data even when expired (default: false) + # @param block [Proc] Optional block to call to extract additional claims from the decoded JWT + # @return [Hash] A hash containing the authentication response and a reason if the authentication failed + def authenticate(include_expired: false, &claim_extractor) + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::NO_SESSION_COOKIE_PROVIDED) if @seal_data.nil? || @seal_data.empty? + + session = begin + @manager.unseal_data(@seal_data, @cookie_password) + rescue ArgumentError, OpenSSL::Cipher::CipherError + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::INVALID_SESSION_COOKIE) + end + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::INVALID_SESSION_COOKIE) unless session.is_a?(Hash) && session["access_token"] + + decoded = begin + @manager.decode_jwt(session["access_token"], verify_expiration: !include_expired) + rescue JWT::ExpiredSignature + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::EXPIRED_JWT) + rescue JWT::IncorrectAlgorithm + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::INVALID_JWT_ALGORITHM) + rescue JWT::VerificationError + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::INVALID_JWT_SIGNATURE) + rescue JWT::DecodeError + return SessionManager::AuthError.new(authenticated: false, reason: SessionManager::INVALID_JWT) + end + + is_expired = decoded["exp"].nil? || decoded["exp"] < Time.now.to_i + + SessionManager::AuthSuccess.new( + authenticated: !is_expired, + reason: is_expired ? SessionManager::EXPIRED_JWT : nil, + session_id: decoded["sid"], + organization_id: decoded["org_id"], + role: decoded["role"], + roles: decoded["roles"], + permissions: decoded["permissions"], + entitlements: decoded["entitlements"], + user: session["user"], + impersonator: session["impersonator"], + feature_flags: decoded["feature_flags"], + custom_claims: claim_extractor&.call(decoded) + ) + end + + def refresh(organization_id: nil, cookie_password: nil) + effective_password = cookie_password || @cookie_password + # Validate up front so a caller-supplied short password raises ArgumentError + # (matching Session#initialize) instead of being swallowed by the + # unseal_data rescue and surfacing as INVALID_SESSION_COOKIE. + raise ArgumentError, "cookie_password is required" if effective_password.nil? || effective_password.empty? + raise ArgumentError, "cookie_password must be at least #{MIN_COOKIE_PASSWORD_BYTES} bytes" if effective_password.bytesize < MIN_COOKIE_PASSWORD_BYTES + + session = begin + @manager.unseal_data(@seal_data, effective_password) + rescue ArgumentError, OpenSSL::Cipher::CipherError + return SessionManager::RefreshError.new(authenticated: false, reason: SessionManager::INVALID_SESSION_COOKIE) + end + return SessionManager::RefreshError.new(authenticated: false, reason: SessionManager::INVALID_SESSION_COOKIE) unless session.is_a?(Hash) && session["refresh_token"] + + # Uses auth: true (Bearer token) to match authenticate_with_refresh_token. + # client_id is included in the body as required by the OAuth2 token exchange. + body = { + "grant_type" => "refresh_token", + "client_id" => @client.client_id, + "refresh_token" => session["refresh_token"] + } + body["organization_id"] = organization_id if organization_id + + response = @client.request(method: :post, path: "/user_management/authenticate", auth: true, body: body) + auth_response = JSON.parse(response.body) + + sealed = @manager.seal_session_from_auth_response( + access_token: auth_response["access_token"], + refresh_token: auth_response["refresh_token"], + cookie_password: effective_password, + user: auth_response["user"], + impersonator: auth_response["impersonator"] + ) + + # Persist the new seal/password BEFORE decoding the JWT, so a transient + # JWKS fetch error (or any decode failure on the freshly-minted token) + # leaves the Session with a usable sealed cookie that the caller can + # re-#authenticate against, rather than half-updated state. + @seal_data = sealed + @cookie_password = effective_password + + decoded = @manager.decode_jwt(auth_response["access_token"]) + + SessionManager::RefreshSuccess.new( + authenticated: true, + sealed_session: sealed, + session_id: decoded["sid"], + organization_id: auth_response["organization_id"] || decoded["org_id"], + role: decoded["role"], + roles: decoded["roles"], + permissions: decoded["permissions"], + entitlements: decoded["entitlements"], + user: auth_response["user"], + impersonator: auth_response["impersonator"], + feature_flags: decoded["feature_flags"] + ) + rescue WorkOS::AuthenticationError, WorkOS::InvalidRequestError => e + SessionManager::RefreshError.new(authenticated: false, reason: e.message) + rescue JWT::DecodeError => e + # The refresh token was already rotated server-side before decode failed, + # so @seal_data holds the freshly-minted cookie. Surface it on the error + # struct so the caller can write the rotated cookie back to the browser + # and recover on a subsequent #authenticate, rather than re-sending the + # now-revoked refresh token. + SessionManager::RefreshError.new(authenticated: false, reason: e.message, sealed_session: @seal_data) + end + + # Build the WorkOS session-logout URL for the currently authenticated session. + # Requires #authenticate to succeed (so we have the session_id). + def get_logout_url(return_to: nil) + result = authenticate + raise WorkOS::Error.new(message: "Failed to extract session ID for logout URL: #{result.reason}") if result.is_a?(SessionManager::AuthError) + base = @client.base_url + params = {"session_id" => result.session_id} + params["return_to"] = return_to if return_to + uri = URI.join(base, "/user_management/sessions/logout") + uri.query = URI.encode_www_form(params) + uri.to_s + end + end +end diff --git a/lib/workos/session_manager.rb b/lib/workos/session_manager.rb new file mode 100644 index 00000000..64bbaa53 --- /dev/null +++ b/lib/workos/session_manager.rb @@ -0,0 +1,219 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained session-cookie helpers (H04-H07, H13): +# - SessionManager#load(seal_data:, cookie_password:) -> Session (H04) +# - SessionManager#authenticate / #refresh -> inline convenience (H05) +# - SessionManager#seal_data / #unseal_data -> raw seal/unseal (H06) +# - SessionManager#seal_session_from_auth_response -> H07 +# - Session#authenticate / #refresh / #get_logout_url +# +# Symmetric encryption: AES-256-GCM by default. Users may supply a custom +# encryptor (any object responding to `seal(data, key)` and `unseal(sealed, key)`) +# for compatibility with other sealing formats (e.g. Iron/Next.js). + +require "json" +require "jwt" + +module WorkOS + # Manages sealed-session lifecycle: loading, authenticating, refreshing, + # and sealing sessions from authentication responses. + # + # @example Load and authenticate a session + # session = client.session_manager.load( + # seal_data: cookies["wos-session"], + # cookie_password: ENV["COOKIE_PASSWORD"] + # ) + # result = session.authenticate + # + # @example Seal a session from an auth response + # sealed = client.session_manager.seal_session_from_auth_response( + # access_token: response.access_token, + # refresh_token: response.refresh_token, + # cookie_password: ENV["COOKIE_PASSWORD"] + # ) + class SessionManager + JWK_ALGORITHMS = ["RS256"].freeze + + # H04 success / failure shapes — kept minimal & frozen. + class AuthSuccess + RESERVED_KEYS = [ + :authenticated, :reason, :session_id, :organization_id, :role, :roles, + :permissions, :entitlements, :user, :impersonator, :feature_flags + ].freeze + + attr_reader(*RESERVED_KEYS) + + def initialize( + authenticated:, + session_id:, organization_id:, role:, roles:, permissions:, entitlements:, user:, impersonator:, feature_flags:, reason: nil, + custom_claims: nil + ) + @authenticated = authenticated + @reason = reason + @session_id = session_id + @organization_id = organization_id + @role = role + @roles = roles + @permissions = permissions + @entitlements = entitlements + @user = user + @impersonator = impersonator + @feature_flags = feature_flags + @custom_claims = normalize_custom_claims(custom_claims) + define_custom_claim_readers(@custom_claims) + end + + def [](key) + sym_key = key.to_sym + return public_send(sym_key) if RESERVED_KEYS.include?(sym_key) + + @custom_claims[sym_key] + end + + def to_h + RESERVED_KEYS.to_h { |key| [key, public_send(key)] }.merge(@custom_claims) + end + + private + + def define_custom_claim_readers(claims) + claims.each_key do |key| + next if respond_to?(key) + + define_singleton_method(key) { @custom_claims[key] } + end + end + + def normalize_custom_claims(custom_claims) + return {} if custom_claims.nil? + raise ArgumentError, "claim_extractor must return a Hash" unless custom_claims.is_a?(Hash) + + claims = custom_claims.each_with_object({}) do |(key, value), memo| + sym_key = key.to_sym + if RESERVED_KEYS.include?(sym_key) + raise ArgumentError, "claim_extractor cannot overwrite reserved key #{sym_key.inspect}" + end + + memo[sym_key] = value + end + claims.freeze + end + end + AuthError = Struct.new(:authenticated, :reason, keyword_init: true) + + RefreshSuccess = Struct.new( + :authenticated, :sealed_session, :session_id, :organization_id, :role, + :roles, :permissions, :entitlements, :user, :impersonator, :feature_flags, + keyword_init: true + ) + RefreshError = Struct.new(:authenticated, :reason, :sealed_session, keyword_init: true) + + # Failure reason constants + NO_SESSION_COOKIE_PROVIDED = "no_session_cookie_provided" + INVALID_SESSION_COOKIE = "invalid_session_cookie" + INVALID_JWT = "invalid_jwt" + INVALID_JWT_ALGORITHM = "invalid_jwt_algorithm" + INVALID_JWT_SIGNATURE = "invalid_jwt_signature" + EXPIRED_JWT = "expired_jwt" + + # @param client [WorkOS::Client] + # @param encryptor [#seal, #unseal] Optional custom encryptor. Defaults to + # {WorkOS::Encryptors::AesGcm}. A custom encryptor must respond to + # `seal(data, key) -> String` and `unseal(sealed_string, key) -> Hash`. + def initialize(client, encryptor: nil) + @client = client + @encryptor = encryptor || Encryptors::AesGcm.new + @jwks_cache = nil + @jwks_cache_at = nil + @jwks_mutex = Mutex.new + end + + attr_reader :client + + # H04 — Load a Session object from a sealed cookie. + def load(seal_data:, cookie_password:) + Session.new(self, seal_data: seal_data, cookie_password: cookie_password) + end + + # H05 — Inline convenience: authenticate without manual Session construction. + def authenticate(seal_data:, cookie_password:, include_expired: false, &claim_extractor) + load(seal_data: seal_data, cookie_password: cookie_password).authenticate(include_expired: include_expired, &claim_extractor) + end + + # H05 — Inline convenience: refresh without manual Session construction. + def refresh(seal_data:, cookie_password:, organization_id: nil) + load(seal_data: seal_data, cookie_password: cookie_password) + .refresh(organization_id: organization_id) + end + + # H06 — Raw seal: encrypt arbitrary data with a key string. + # Delegates to the configured encryptor (default: AES-256-GCM). + def seal_data(data, key) + validate_cookie_password!(key) + @encryptor.seal(data, key) + end + + # H06 — Raw unseal: returns parsed JSON (Hash) or raw string if not JSON. + # Delegates to the configured encryptor (default: AES-256-GCM). + def unseal_data(sealed, key) + validate_cookie_password!(key) + @encryptor.unseal(sealed, key) + end + + # H07 — Build a sealed session string directly from auth-response fields. + def seal_session_from_auth_response(access_token:, refresh_token:, cookie_password:, user: nil, impersonator: nil) + payload = {"access_token" => access_token, "refresh_token" => refresh_token} + payload["user"] = user if user + payload["impersonator"] = impersonator if impersonator + # Delegates to seal_data, which calls validate_cookie_password!; no need + # to validate here too. + seal_data(payload, cookie_password) + end + + # Verify an access-token JWT against the WorkOS JWKS for this client. + # Used by Session#authenticate; exposed publicly for advanced cases. + # + # NOTE on iss/aud/required_claims: this method intentionally does not + # enforce iss, aud, or required_claims. workos-node's `jose` call and + # workos-php's `isset($exp) && $exp < time()` accept exp-less tokens, and + # cross-SDK parity is required for the planned coordinated hardening of + # these claims. See commit 9ce069f for the rationale behind dropping the + # required_claims: ['exp'] tightening that was considered here. + def decode_jwt(access_token, verify_expiration: true) + jwks = fetch_jwks + JWT.decode( + access_token, + nil, + true, + algorithms: JWK_ALGORITHMS, + jwks: jwks, + verify_aud: false, + verify_expiration: verify_expiration + ).first + end + + private + + # Validate a cookie_password is non-empty and at least the minimum + # byte length required by Session::MIN_COOKIE_PASSWORD_BYTES (32). + # Defense-in-depth — Session#initialize enforces the same invariant + # on the load path; this guards the inline #seal_data / #unseal_data + # entry points. + def validate_cookie_password!(key) + raise ArgumentError, "cookie_password is required" if key.nil? || key.empty? + raise ArgumentError, "cookie_password must be at least #{Session::MIN_COOKIE_PASSWORD_BYTES} bytes" if key.bytesize < Session::MIN_COOKIE_PASSWORD_BYTES + end + + # Cached JWKS fetch (5-minute TTL, thread-safe). + def fetch_jwks(now: Time.now) + @jwks_mutex.synchronize do + return @jwks_cache if @jwks_cache && @jwks_cache_at && (now - @jwks_cache_at) < 300 + response = @client.user_management.get_jwks(client_id: @client.client_id) + @jwks_cache = {"keys" => response.keys.map(&:to_h)} + @jwks_cache_at = now + @jwks_cache + end + end + end +end diff --git a/lib/workos/shared/event_context.rb b/lib/workos/shared/event_context.rb new file mode 100644 index 00000000..eceeeaf8 --- /dev/null +++ b/lib/workos/shared/event_context.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EventContext < WorkOS::Types::BaseModel + HASH_ATTRS = { + google_analytics_client_id: :google_analytics_client_id, + google_analytics_sessions: :google_analytics_sessions, + ajs_anonymous_id: :ajs_anonymous_id, + client_id: :client_id, + actor: :actor, + previous_attributes: :previous_attributes + }.freeze + + attr_accessor \ + :google_analytics_client_id, + :google_analytics_sessions, + :ajs_anonymous_id, + :client_id, + :actor, + :previous_attributes + + def initialize(json) + hash = self.class.normalize(json) + @google_analytics_client_id = hash[:google_analytics_client_id] + @google_analytics_sessions = (hash[:google_analytics_sessions] || []).map { |item| item ? WorkOS::EventContextGoogleAnalyticsSession.new(item) : nil } + @ajs_anonymous_id = hash[:ajs_anonymous_id] + @client_id = hash[:client_id] + @actor = hash[:actor] ? WorkOS::EventContextActor.new(hash[:actor]) : nil + @previous_attributes = hash[:previous_attributes] || {} + end + end +end diff --git a/lib/workos/shared/event_context_actor.rb b/lib/workos/shared/event_context_actor.rb new file mode 100644 index 00000000..87bcc967 --- /dev/null +++ b/lib/workos/shared/event_context_actor.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EventContextActor < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + source: :source, + name: :name + }.freeze + + attr_accessor \ + :id, + :source, + :name + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @source = hash[:source] + @name = hash[:name] + end + end +end diff --git a/lib/workos/shared/event_context_google_analytics_session.rb b/lib/workos/shared/event_context_google_analytics_session.rb new file mode 100644 index 00000000..db7eb102 --- /dev/null +++ b/lib/workos/shared/event_context_google_analytics_session.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EventContextGoogleAnalyticsSession < WorkOS::Types::BaseModel + HASH_ATTRS = { + containerId: :container_id, + sessionId: :session_id, + sessionNumber: :session_number + }.freeze + + attr_accessor \ + :container_id, + :session_id, + :session_number + + def initialize(json) + hash = self.class.normalize(json) + @container_id = hash[:containerId] + @session_id = hash[:sessionId] + @session_number = hash[:sessionNumber] + end + end +end diff --git a/lib/workos/shared/group_created.rb b/lib/workos/shared/group_created.rb new file mode 100644 index 00000000..0dfa881e --- /dev/null +++ b/lib/workos/shared/group_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::Group.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/group_deleted.rb b/lib/workos/shared/group_deleted.rb new file mode 100644 index 00000000..3278fa6b --- /dev/null +++ b/lib/workos/shared/group_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::Group.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/group_member_added.rb b/lib/workos/shared/group_member_added.rb new file mode 100644 index 00000000..b5ba86a5 --- /dev/null +++ b/lib/workos/shared/group_member_added.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupMemberAdded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::GroupMemberAddedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/group_member_added_data.rb b/lib/workos/shared/group_member_added_data.rb new file mode 100644 index 00000000..1b925980 --- /dev/null +++ b/lib/workos/shared/group_member_added_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupMemberAddedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + group_id: :group_id, + organization_membership_id: :organization_membership_id + }.freeze + + attr_accessor \ + :group_id, + :organization_membership_id + + def initialize(json) + hash = self.class.normalize(json) + @group_id = hash[:group_id] + @organization_membership_id = hash[:organization_membership_id] + end + end +end diff --git a/lib/workos/shared/group_member_removed.rb b/lib/workos/shared/group_member_removed.rb new file mode 100644 index 00000000..1594967b --- /dev/null +++ b/lib/workos/shared/group_member_removed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupMemberRemoved < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::GroupMemberRemovedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/group_member_removed_data.rb b/lib/workos/shared/group_member_removed_data.rb new file mode 100644 index 00000000..4bee6e70 --- /dev/null +++ b/lib/workos/shared/group_member_removed_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + GroupMemberRemovedData = GroupMemberAddedData +end diff --git a/lib/workos/shared/group_updated.rb b/lib/workos/shared/group_updated.rb new file mode 100644 index 00000000..d1f774d5 --- /dev/null +++ b/lib/workos/shared/group_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::Group.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/waitlist_user.rb b/lib/workos/shared/waitlist_user.rb new file mode 100644 index 00000000..0ca93111 --- /dev/null +++ b/lib/workos/shared/waitlist_user.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WaitlistUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + approved_at: :approved_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :approved_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @approved_at = hash[:approved_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/shared/waitlist_user_approved.rb b/lib/workos/shared/waitlist_user_approved.rb new file mode 100644 index 00000000..52fe72b7 --- /dev/null +++ b/lib/workos/shared/waitlist_user_approved.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WaitlistUserApproved < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::WaitlistUser.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/waitlist_user_created.rb b/lib/workos/shared/waitlist_user_created.rb new file mode 100644 index 00000000..f20fc2a8 --- /dev/null +++ b/lib/workos/shared/waitlist_user_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WaitlistUserCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::WaitlistUser.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/shared/waitlist_user_denied.rb b/lib/workos/shared/waitlist_user_denied.rb new file mode 100644 index 00000000..45678eaa --- /dev/null +++ b/lib/workos/shared/waitlist_user_denied.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WaitlistUserDenied < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::WaitlistUser.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso.rb b/lib/workos/sso.rb index 567544c8..080093d7 100644 --- a/lib/workos/sso.rb +++ b/lib/workos/sso.rb @@ -1,256 +1,254 @@ # frozen_string_literal: true -require 'net/http' -require 'uri' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The SSO module provides convenience methods for working with the WorkOS - # SSO platform. You'll need a valid API key, a client ID, and to have - # created an SSO connection on your WorkOS dashboard. - # - # @see https://docs.workos.com/sso/overview - module SSO - class << self - include Client +require "json" - PROVIDERS = WorkOS::Types::Provider::ALL +module WorkOS + class SSO + def initialize(client) + @client = client + end - # Generate an Oauth2 authorization URL where your users will - # authenticate using the configured SSO Identity Provider. - # - # @param [String] redirect_uri The URI where users are directed - # after completing the authentication step. Must match a - # configured redirect URI on your WorkOS dashboard. - # @param [String] client_id The WorkOS client ID for the environment - # where you've configured your SSO connection. - # @param [String] domain The domain for the relevant SSO Connection - # configured on your WorkOS dashboard. One of provider, domain, - # connection, or organization is required. - # The domain is deprecated. - # @param [String] provider A provider name for an Identity Provider - # configured on your WorkOS dashboard. Only 'GoogleOAuth' and - # 'MicrosoftOAuth' are supported. - # @param [String] connection The ID for a Connection configured on - # WorkOS. - # @param [String] organization The ID for an Organization configured - # on WorkOS. - # @param [String] state An arbitrary state object - # that is preserved and available to the client in the response. - # @example - # WorkOS::SSO.authorization_url( - # connection: 'conn_123', - # client_id: 'project_01DG5TGK363GRVXP3ZS40WNGEZ', - # redirect_uri: 'https://workos.com/callback', - # state: { - # next_page: '/docs' - # }.to_s - # ) - # - # => "https://api.workos.com/sso/authorize?connection=conn_123" \ - # "&client_id=project_01DG5TGK363GRVXP3ZS40WNGEZ" \ - # "&redirect_uri=https%3A%2F%2Fworkos.com%2Fcallback&" \ - # "response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D" - # - # @return [String] - # rubocop:disable Metrics/ParameterLists - def authorization_url( - redirect_uri:, - client_id: nil, - domain: nil, - domain_hint: nil, - login_hint: nil, - provider: nil, - connection: nil, - organization: nil, - state: '' + # List Connections + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param connection_type [WorkOS::Types::ConnectionsConnectionType, nil] Filter Connections by their type. + # @param domain [String, nil] Filter Connections by their associated domain. + # @param organization_id [String, nil] Filter Connections by their associated organization. + # @param search [String, nil] Searchable text to match against Connection names. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_connections( + before: nil, + after: nil, + limit: 10, + order: "desc", + connection_type: nil, + domain: nil, + organization_id: nil, + search: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "connection_type" => connection_type, + "domain" => domain, + "organization_id" => organization_id, + "search" => search + }.compact + response = @client.request( + method: :get, + path: "/connections", + auth: true, + params: params, + request_options: request_options ) - if domain - warn '[DEPRECATION] `domain` is deprecated. - Please use `organization` instead.' - end - - validate_authorization_url_arguments( - provider: provider, - domain: domain, - connection: connection, - organization: organization, - ) - - query = URI.encode_www_form({ - client_id: client_id, - redirect_uri: redirect_uri, - response_type: 'code', - state: state, + fetch_next = ->(cursor) { + list_connections( + before: before, + after: cursor, + limit: limit, + order: order, + connection_type: connection_type, domain: domain, - domain_hint: domain_hint, - login_hint: login_hint, - provider: provider, - connection: connection, - organization: organization, - }.compact) - - "https://#{WorkOS.config.api_hostname}/sso/authorize?#{query}" - end - # rubocop:enable Metrics/ParameterLists - - def get_profile(access_token:) - response = execute_request( - request: get_request( - path: '/sso/profile', - auth: true, - access_token: access_token, - ), + organization_id: organization_id, + search: search, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Connection, + filters: {before: before, limit: limit, order: order, connection_type: connection_type, domain: domain, organization_id: organization_id, search: search}, + fetch_next: fetch_next + ) + end - WorkOS::Profile.new(response.body) - end - - # Fetch the profile details for the authenticated SSO user. - # - # @param [String] code The authorization code provided in the callback URL - # @param [String] client_id The WorkOS client ID for the environment - # where you've configured your SSO connection - # - # @return [WorkOS::ProfileAndToken] - def profile_and_token(code:, client_id: nil) - body = { - client_id: client_id, - client_secret: WorkOS.config.key!, - grant_type: 'authorization_code', - code: code, - } - - response = client.request(post_request(path: '/sso/token', body: body)) - check_and_raise_profile_and_token_error(response: response) - - WorkOS::ProfileAndToken.new(response.body) - end - - # Retrieve connections. - # - # @param [Hash] options An options hash - # @option options [String] connection_type Authentication service - # provider descriptor. - # @option options [String] domain The domain of the connection to be - # retrieved. - # @option options [String] organization_id The id of the organization - # of the connections to be retrieved. - # @option options [String] limit Maximum number of records to return. - # @option options [String] order The order in which to paginate records - # @option options [String] before Pagination cursor to receive records - # before a provided Connection ID. - # @option options [String] after Pagination cursor to receive records - # before a provided Connection ID. - # - # @return [Hash] - def list_connections(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/connections', - auth: true, - params: options, - ), - ) - - parsed_response = JSON.parse(response.body) - connections = parsed_response['data'].map do |connection| - ::WorkOS::Connection.new(connection.to_json) - end - - WorkOS::Types::ListStruct.new( - data: connections, - list_metadata: parsed_response['listMetadata'], - ) - end - - # Get a Connection - # - # @param [String] id Connection unique identifier - # - # @example - # WorkOS::SSO.get_connection(id: 'conn_02DRA1XNSJDZ19A31F183ECQW9') - # => #"connection_domain", - # :id=>"domain_01E6PK9N3XMD8RHWF7S66380AR", - # :domain=>"example.com"}]> - # - # @return [WorkOS::Connection] - def get_connection(id:) - request = get_request( - auth: true, - path: "/connections/#{id}", - ) + # Get a Connection + # @param id [String] Unique identifier for the Connection. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Connection] + def get_connection( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/connections/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::Connection.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 - response = execute_request(request: request) + # Delete a Connection + # @param id [String] Unique identifier for the Connection. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_connection( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/connections/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - WorkOS::Connection.new(response.body) - end + # Logout Authorize + # @param profile_id [String] The unique ID of the profile to log out. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::SSOLogoutAuthorizeResponse] + def authorize_logout( + profile_id:, + request_options: {} + ) + body = { + "profile_id" => profile_id + } + response = @client.request( + method: :post, + path: "/sso/logout/authorize", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::SSOLogoutAuthorizeResponse.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 a Connection - # - # @param [String] id Connection unique identifier - # - # @example - # WorkOS::SSO.delete_connection(id: 'conn_02DRA1XNSJDZ19A31F183ECQW9') - # => true - # - # @return [Bool] - returns `true` if successful - def delete_connection(id:) - request = delete_request( - auth: true, - path: "/connections/#{id}", - ) + # Get a User Profile + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Profile] + def get_profile(request_options: {}) + response = @client.request( + method: :get, + path: "/sso/profile", + auth: true, + request_options: request_options + ) + result = WorkOS::Profile.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 - response = execute_request(request: request) + # Get a Profile and Token + # @param code [String] The authorization code received from the authorization callback. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::SSOTokenResponse] + def get_profile_and_token( + code:, + request_options: {} + ) + body = { + "grant_type" => "authorization_code", + "client_id" => request_options[:client_id] || @client.client_id, + "client_secret" => request_options[:api_key] || @client.api_key, + "code" => code + } + response = @client.request( + method: :post, + path: "/sso/token", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::SSOTokenResponse.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 - response.is_a? Net::HTTPSuccess + # @oagen-ignore-start — non-spec helpers (hand-maintained) + # H14 — Build an SSO authorization URL (client-side, no HTTP call). + # Overrides the generated method which incorrectly hits the API. + def get_authorization_url(redirect_uri:, client_id: nil, state: nil, connection: nil, + organization: nil, provider: nil, domain_hint: nil, + login_hint: nil, nonce: nil, provider_scopes: nil, + provider_query_params: nil, **) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required (set on Client or pass explicitly)" if cid.nil? || cid.empty? + params = { + "client_id" => cid, + "redirect_uri" => redirect_uri, + "response_type" => "code", + "state" => state, + "connection" => connection, + "organization" => organization, + "provider" => provider, + "domain_hint" => domain_hint, + "login_hint" => login_hint, + "nonce" => nonce + }.compact + params["provider_scopes"] = Array(provider_scopes).join(",") if provider_scopes + if provider_query_params.is_a?(Hash) && !provider_query_params.empty? + params["provider_query_params"] = JSON.generate(provider_query_params) end + build_url("/sso/authorize", params) + end - private - - def validate_authorization_url_arguments( - domain:, - provider:, - connection:, - organization: + # H15 — SSO authorization URL with auto-generated PKCE pair + state. + # Returns [url, code_verifier, state]. + def get_authorization_url_with_pkce(redirect_uri:, client_id: nil, **opts) + pair = WorkOS::PKCE.generate_pair + state = opts.delete(:state) || WorkOS::PKCE.generate_code_verifier + url = get_authorization_url( + redirect_uri: redirect_uri, + client_id: client_id, + state: state, + **opts ) - if [domain, provider, connection, organization].all?(&:nil?) - raise ArgumentError, 'Either connection, domain, ' \ - 'provider, or organization is required.' - end + url = append_query(url, {"code_challenge" => pair[:code_challenge], "code_challenge_method" => "S256"}) + [url, pair[:code_verifier], state] + end - return unless provider && !PROVIDERS.include?(provider) + # H16 — Exchange an SSO authorization code for a profile/token, with PKCE + # support for public clients (no client_secret). + def get_profile_and_token_with_pkce(code:, code_verifier:, client_id: nil, request_options: {}) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required" if cid.nil? || cid.empty? + body = { + "grant_type" => "authorization_code", + "client_id" => cid, + "code" => code, + "code_verifier" => code_verifier + } + response = @client.request(method: :post, path: "/sso/token", auth: false, body: body, request_options: request_options) + WorkOS::SSOTokenResponse.new(response.body) + end - raise ArgumentError, "#{provider} is not a valid value." \ - " `provider` must be in #{PROVIDERS}" - end + # H17 — Build the SSO logout redirect URL (no HTTP call). + def build_logout_url(token:) + build_url("/sso/logout", {"token" => token}) + end - def check_and_raise_profile_and_token_error(response:) - begin - body = JSON.parse(response.body) - return if body['access_token'] && body['profile'] + private - message = body['message'] - error = body['error'] - error_description = body['error_description'] - request_id = response['x-request-id'] - rescue StandardError - message = 'Something went wrong' - end + def build_url(path, params) + base = @client.base_url + uri = URI.join(base, path) + uri.query = URI.encode_www_form(params) + uri.to_s + end - raise APIError.new( - message: message, - error: error, - error_description: error_description, - http_status: nil, - request_id: request_id, - ) - end + def append_query(url, params) + uri = URI(url) + existing = URI.decode_www_form(uri.query || "") + merged = existing + params.to_a + uri.query = URI.encode_www_form(merged) + uri.to_s end + # @oagen-ignore-end end end diff --git a/lib/workos/sso/connection.rb b/lib/workos/sso/connection.rb new file mode 100644 index 00000000..77ac1b7a --- /dev/null +++ b/lib/workos/sso/connection.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Connection < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + connection_type: :connection_type, + name: :name, + state: :state, + status: :status, + domains: :domains, + options: :options, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + # @!attribute status + # @deprecated Deprecated. Use `state` instead. + + attr_accessor \ + :object, + :id, + :organization_id, + :connection_type, + :name, + :state, + :domains, + :options, + :created_at, + :updated_at + + def status + warn "[DEPRECATION] `status` is deprecated and will be removed in a future version.", uplevel: 1 + @status + end + + attr_writer :status + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @connection_type = hash[:connection_type] + @name = hash[:name] + @state = hash[:state] + @status = hash[:status] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::ConnectionDomain.new(item) : nil } + @options = hash[:options] ? WorkOS::ConnectionOption.new(hash[:options]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/sso/connection_activated.rb b/lib/workos/sso/connection_activated.rb new file mode 100644 index 00000000..f33f6af7 --- /dev/null +++ b/lib/workos/sso/connection_activated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionActivated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ConnectionActivatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso/connection_activated_data.rb b/lib/workos/sso/connection_activated_data.rb new file mode 100644 index 00000000..7fb4e19a --- /dev/null +++ b/lib/workos/sso/connection_activated_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionActivatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + state: :state, + name: :name, + connection_type: :connection_type, + organization_id: :organization_id, + created_at: :created_at, + updated_at: :updated_at, + external_key: :external_key, + status: :status, + domains: :domains + }.freeze + + attr_accessor \ + :object, + :id, + :state, + :name, + :connection_type, + :organization_id, + :created_at, + :updated_at, + :external_key, + :status, + :domains + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @state = hash[:state] + @name = hash[:name] + @connection_type = hash[:connection_type] + @organization_id = hash[:organization_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @external_key = hash[:external_key] + @status = hash[:status] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::ConnectionActivatedDataDomain.new(item) : nil } + end + end +end diff --git a/lib/workos/sso/connection_activated_data_domain.rb b/lib/workos/sso/connection_activated_data_domain.rb new file mode 100644 index 00000000..1ad05087 --- /dev/null +++ b/lib/workos/sso/connection_activated_data_domain.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionActivatedDataDomain < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + domain: :domain + }.freeze + + attr_accessor \ + :object, + :id, + :domain + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @domain = hash[:domain] + end + end +end diff --git a/lib/workos/sso/connection_deactivated.rb b/lib/workos/sso/connection_deactivated.rb new file mode 100644 index 00000000..00786d18 --- /dev/null +++ b/lib/workos/sso/connection_deactivated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionDeactivated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ConnectionDeactivatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso/connection_deactivated_data.rb b/lib/workos/sso/connection_deactivated_data.rb new file mode 100644 index 00000000..6e01165a --- /dev/null +++ b/lib/workos/sso/connection_deactivated_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionDeactivatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + state: :state, + name: :name, + connection_type: :connection_type, + organization_id: :organization_id, + created_at: :created_at, + updated_at: :updated_at, + external_key: :external_key, + status: :status, + domains: :domains + }.freeze + + attr_accessor \ + :object, + :id, + :state, + :name, + :connection_type, + :organization_id, + :created_at, + :updated_at, + :external_key, + :status, + :domains + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @state = hash[:state] + @name = hash[:name] + @connection_type = hash[:connection_type] + @organization_id = hash[:organization_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @external_key = hash[:external_key] + @status = hash[:status] + @domains = (hash[:domains] || []).map { |item| item ? WorkOS::ConnectionDeactivatedDataDomain.new(item) : nil } + end + end +end diff --git a/lib/workos/sso/connection_deactivated_data_domain.rb b/lib/workos/sso/connection_deactivated_data_domain.rb new file mode 100644 index 00000000..5be82d83 --- /dev/null +++ b/lib/workos/sso/connection_deactivated_data_domain.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ConnectionDeactivatedDataDomain = ConnectionActivatedDataDomain +end diff --git a/lib/workos/sso/connection_deleted.rb b/lib/workos/sso/connection_deleted.rb new file mode 100644 index 00000000..6b30064a --- /dev/null +++ b/lib/workos/sso/connection_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ConnectionDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso/connection_deleted_data.rb b/lib/workos/sso/connection_deleted_data.rb new file mode 100644 index 00000000..62a59787 --- /dev/null +++ b/lib/workos/sso/connection_deleted_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + state: :state, + name: :name, + connection_type: :connection_type, + organization_id: :organization_id, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :state, + :name, + :connection_type, + :organization_id, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @state = hash[:state] + @name = hash[:name] + @connection_type = hash[:connection_type] + @organization_id = hash[:organization_id] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/sso/connection_domain.rb b/lib/workos/sso/connection_domain.rb new file mode 100644 index 00000000..f934d882 --- /dev/null +++ b/lib/workos/sso/connection_domain.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ConnectionDomain = ConnectionActivatedDataDomain +end diff --git a/lib/workos/sso/connection_option.rb b/lib/workos/sso/connection_option.rb new file mode 100644 index 00000000..c724bcb5 --- /dev/null +++ b/lib/workos/sso/connection_option.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionOption < WorkOS::Types::BaseModel + HASH_ATTRS = { + signing_cert: :signing_cert + }.freeze + + attr_accessor :signing_cert + + def initialize(json) + hash = self.class.normalize(json) + @signing_cert = hash[:signing_cert] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewal_required.rb b/lib/workos/sso/connection_saml_certificate_renewal_required.rb new file mode 100644 index 00000000..441b8cfd --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewal_required.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewalRequired < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ConnectionSAMLCertificateRenewalRequiredData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewal_required_data.rb b/lib/workos/sso/connection_saml_certificate_renewal_required_data.rb new file mode 100644 index 00000000..92b64169 --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewal_required_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredData < WorkOS::Types::BaseModel + HASH_ATTRS = { + connection: :connection, + certificate: :certificate, + days_until_expiry: :days_until_expiry + }.freeze + + attr_accessor \ + :connection, + :certificate, + :days_until_expiry + + def initialize(json) + hash = self.class.normalize(json) + @connection = hash[:connection] ? WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection.new(hash[:connection]) : nil + @certificate = hash[:certificate] ? WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate.new(hash[:certificate]) : nil + @days_until_expiry = hash[:days_until_expiry] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb b/lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb new file mode 100644 index 00000000..f7b3903b --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewal_required_data_certificate.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredDataCertificate < WorkOS::Types::BaseModel + HASH_ATTRS = { + certificate_type: :certificate_type, + expiry_date: :expiry_date, + is_expired: :is_expired + }.freeze + + attr_accessor \ + :certificate_type, + :expiry_date, + :is_expired + + def initialize(json) + hash = self.class.normalize(json) + @certificate_type = hash[:certificate_type] + @expiry_date = hash[:expiry_date] + @is_expired = hash[:is_expired] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb b/lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb new file mode 100644 index 00000000..371a6a83 --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewal_required_data_connection.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredDataConnection < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :id, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewed.rb b/lib/workos/sso/connection_saml_certificate_renewed.rb new file mode 100644 index 00000000..42522d1a --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ConnectionSAMLCertificateRenewedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewed_data.rb b/lib/workos/sso/connection_saml_certificate_renewed_data.rb new file mode 100644 index 00000000..b3a0723f --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewed_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + connection: :connection, + certificate: :certificate, + renewed_at: :renewed_at + }.freeze + + attr_accessor \ + :connection, + :certificate, + :renewed_at + + def initialize(json) + hash = self.class.normalize(json) + @connection = hash[:connection] ? WorkOS::ConnectionSAMLCertificateRenewedDataConnection.new(hash[:connection]) : nil + @certificate = hash[:certificate] ? WorkOS::ConnectionSAMLCertificateRenewedDataCertificate.new(hash[:certificate]) : nil + @renewed_at = hash[:renewed_at] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb b/lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb new file mode 100644 index 00000000..f67edf22 --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewed_data_certificate.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConnectionSAMLCertificateRenewedDataCertificate < WorkOS::Types::BaseModel + HASH_ATTRS = { + certificate_type: :certificate_type, + expiry_date: :expiry_date + }.freeze + + attr_accessor \ + :certificate_type, + :expiry_date + + def initialize(json) + hash = self.class.normalize(json) + @certificate_type = hash[:certificate_type] + @expiry_date = hash[:expiry_date] + end + end +end diff --git a/lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb b/lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb new file mode 100644 index 00000000..f38d74b9 --- /dev/null +++ b/lib/workos/sso/connection_saml_certificate_renewed_data_connection.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ConnectionSAMLCertificateRenewedDataConnection = ConnectionSAMLCertificateRenewalRequiredDataConnection +end diff --git a/lib/workos/sso/profile.rb b/lib/workos/sso/profile.rb new file mode 100644 index 00000000..ba35eeb5 --- /dev/null +++ b/lib/workos/sso/profile.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Profile < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + connection_id: :connection_id, + connection_type: :connection_type, + idp_id: :idp_id, + email: :email, + first_name: :first_name, + last_name: :last_name, + name: :name, + role: :role, + roles: :roles, + groups: :groups, + custom_attributes: :custom_attributes, + raw_attributes: :raw_attributes + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :connection_id, + :connection_type, + :idp_id, + :email, + :first_name, + :last_name, + :name, + :role, + :roles, + :groups, + :custom_attributes, + :raw_attributes + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @connection_id = hash[:connection_id] + @connection_type = hash[:connection_type] + @idp_id = hash[:idp_id] + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @name = hash[:name] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @roles = (hash[:roles] || []).map { |item| item ? WorkOS::SlimRole.new(item) : nil } + @groups = hash[:groups] || [] + @custom_attributes = hash[:custom_attributes] || {} + @raw_attributes = hash[:raw_attributes] || {} + end + end +end diff --git a/lib/workos/sso/sso_authorize_url_response.rb b/lib/workos/sso/sso_authorize_url_response.rb new file mode 100644 index 00000000..556d40e2 --- /dev/null +++ b/lib/workos/sso/sso_authorize_url_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSOAuthorizeUrlResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + url: :url + }.freeze + + attr_accessor :url + + def initialize(json) + hash = self.class.normalize(json) + @url = hash[:url] + end + end +end diff --git a/lib/workos/sso/sso_logout_authorize_request.rb b/lib/workos/sso/sso_logout_authorize_request.rb new file mode 100644 index 00000000..ba75fea3 --- /dev/null +++ b/lib/workos/sso/sso_logout_authorize_request.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSOLogoutAuthorizeRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + profile_id: :profile_id + }.freeze + + attr_accessor :profile_id + + def initialize(json) + hash = self.class.normalize(json) + @profile_id = hash[:profile_id] + end + end +end diff --git a/lib/workos/sso/sso_logout_authorize_response.rb b/lib/workos/sso/sso_logout_authorize_response.rb new file mode 100644 index 00000000..00ac8da5 --- /dev/null +++ b/lib/workos/sso/sso_logout_authorize_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSOLogoutAuthorizeResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + logout_url: :logout_url, + logout_token: :logout_token + }.freeze + + attr_accessor \ + :logout_url, + :logout_token + + def initialize(json) + hash = self.class.normalize(json) + @logout_url = hash[:logout_url] + @logout_token = hash[:logout_token] + end + end +end diff --git a/lib/workos/sso/sso_token_response.rb b/lib/workos/sso/sso_token_response.rb new file mode 100644 index 00000000..5ddd9838 --- /dev/null +++ b/lib/workos/sso/sso_token_response.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSOTokenResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + token_type: :token_type, + access_token: :access_token, + expires_in: :expires_in, + profile: :profile, + oauth_tokens: :oauth_tokens + }.freeze + + attr_accessor \ + :token_type, + :access_token, + :expires_in, + :profile, + :oauth_tokens + + def initialize(json) + hash = self.class.normalize(json) + @token_type = hash[:token_type] + @access_token = hash[:access_token] + @expires_in = hash[:expires_in] + @profile = hash[:profile] ? WorkOS::Profile.new(hash[:profile]) : nil + @oauth_tokens = hash[:oauth_tokens] ? WorkOS::SSOTokenResponseOAuthToken.new(hash[:oauth_tokens]) : nil + end + end +end diff --git a/lib/workos/sso/sso_token_response_oauth_token.rb b/lib/workos/sso/sso_token_response_oauth_token.rb new file mode 100644 index 00000000..d09b2278 --- /dev/null +++ b/lib/workos/sso/sso_token_response_oauth_token.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + SSOTokenResponseOAuthToken = AuthenticateResponseOAuthToken +end diff --git a/lib/workos/sso/token_query.rb b/lib/workos/sso/token_query.rb new file mode 100644 index 00000000..4ee27dcc --- /dev/null +++ b/lib/workos/sso/token_query.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class TokenQuery < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + code: :code, + grant_type: :grant_type + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :code, + :grant_type + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @code = hash[:code] + @grant_type = hash[:grant_type] + end + end +end diff --git a/lib/workos/types.rb b/lib/workos/types.rb deleted file mode 100644 index e912eaac..00000000 --- a/lib/workos/types.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # Types contains a few structs wrapping up common data structures. - module Types - autoload :Provider, 'workos/types/provider' - autoload :Intent, 'workos/types/intent' - autoload :ListStruct, 'workos/types/list_struct' - autoload :PasswordlessSessionStruct, 'workos/types/passwordless_session_struct' - end -end diff --git a/lib/workos/types/api_response.rb b/lib/workos/types/api_response.rb new file mode 100644 index 00000000..d1bcee13 --- /dev/null +++ b/lib/workos/types/api_response.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +module WorkOS + module Types + # Lightweight wrapper around the raw HTTP response, exposing status, + # headers, and request-id for observability without leaking Net::HTTP. + ApiResponse = Data.define(:http_status, :http_headers, :request_id) + end +end diff --git a/lib/workos/types/audit_log_configuration_log_stream_state.rb b/lib/workos/types/audit_log_configuration_log_stream_state.rb new file mode 100644 index 00000000..8bb178fd --- /dev/null +++ b/lib/workos/types/audit_log_configuration_log_stream_state.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuditLogConfigurationLogStreamState + ACTIVE = "active" + INACTIVE = "inactive" + ERROR = "error" + INVALID = "invalid" + ALL = [ACTIVE, INACTIVE, ERROR, INVALID].freeze + end + end +end diff --git a/lib/workos/types/audit_log_configuration_log_stream_type.rb b/lib/workos/types/audit_log_configuration_log_stream_type.rb new file mode 100644 index 00000000..4cfaa09a --- /dev/null +++ b/lib/workos/types/audit_log_configuration_log_stream_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuditLogConfigurationLogStreamType + AZURE_SENTINEL = "AzureSentinel" + DATADOG = "Datadog" + GENERIC_HTTPS = "GenericHttps" + GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" + S_3 = "S3" + SPLUNK = "Splunk" + ALL = [AZURE_SENTINEL, DATADOG, GENERIC_HTTPS, GOOGLE_CLOUD_STORAGE, S_3, SPLUNK].freeze + end + end +end diff --git a/lib/workos/types/audit_log_configuration_state.rb b/lib/workos/types/audit_log_configuration_state.rb new file mode 100644 index 00000000..dd2c59b5 --- /dev/null +++ b/lib/workos/types/audit_log_configuration_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuditLogConfigurationState + ACTIVE = "active" + INACTIVE = "inactive" + DISABLED = "disabled" + ALL = [ACTIVE, INACTIVE, DISABLED].freeze + end + end +end diff --git a/lib/workos/types/audit_log_export_json_state.rb b/lib/workos/types/audit_log_export_json_state.rb new file mode 100644 index 00000000..a3ddd394 --- /dev/null +++ b/lib/workos/types/audit_log_export_json_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuditLogExportJsonState + PENDING = "pending" + READY = "ready" + ERROR = "error" + ALL = [PENDING, READY, ERROR].freeze + end + end +end diff --git a/lib/workos/types/audit_log_export_state.rb b/lib/workos/types/audit_log_export_state.rb new file mode 100644 index 00000000..e3943091 --- /dev/null +++ b/lib/workos/types/audit_log_export_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuditLogExportState + PENDING = "pending" + READY = "ready" + ERROR = "error" + ALL = [PENDING, READY, ERROR].freeze + end + end +end diff --git a/lib/workos/types/authenticate_response_authentication_method.rb b/lib/workos/types/authenticate_response_authentication_method.rb new file mode 100644 index 00000000..893679bc --- /dev/null +++ b/lib/workos/types/authenticate_response_authentication_method.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuthenticateResponseAuthenticationMethod + SSO = "SSO" + PASSWORD = "Password" + PASSKEY = "Passkey" + APPLE_OAUTH = "AppleOAuth" + BITBUCKET_OAUTH = "BitbucketOAuth" + CROSS_APP_AUTH = "CrossAppAuth" + DISCORD_OAUTH = "DiscordOAuth" + EXTERNAL_AUTH = "ExternalAuth" + GIT_HUB_OAUTH = "GitHubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + INTUIT_OAUTH = "IntuitOAuth" + LINKED_IN_OAUTH = "LinkedInOAuth" + MICROSOFT_OAUTH = "MicrosoftOAuth" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + XERO_OAUTH = "XeroOAuth" + MAGIC_AUTH = "MagicAuth" + IMPERSONATION = "Impersonation" + MIGRATED_SESSION = "MigratedSession" + ALL = [SSO, PASSWORD, PASSKEY, APPLE_OAUTH, BITBUCKET_OAUTH, CROSS_APP_AUTH, DISCORD_OAUTH, EXTERNAL_AUTH, GIT_HUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, INTUIT_OAUTH, LINKED_IN_OAUTH, MICROSOFT_OAUTH, SALESFORCE_OAUTH, SLACK_OAUTH, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, XERO_OAUTH, MAGIC_AUTH, IMPERSONATION, MIGRATED_SESSION].freeze + end + end +end diff --git a/lib/workos/types/authentication_factor_enrolled_type.rb b/lib/workos/types/authentication_factor_enrolled_type.rb new file mode 100644 index 00000000..788d3750 --- /dev/null +++ b/lib/workos/types/authentication_factor_enrolled_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuthenticationFactorEnrolledType + GENERIC_OTP = "generic_otp" + SMS = "sms" + TOTP = "totp" + WEBAUTHN = "webauthn" + ALL = [GENERIC_OTP, SMS, TOTP, WEBAUTHN].freeze + end + end +end diff --git a/lib/workos/types/authentication_factor_type.rb b/lib/workos/types/authentication_factor_type.rb new file mode 100644 index 00000000..06d4d032 --- /dev/null +++ b/lib/workos/types/authentication_factor_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + AuthenticationFactorType = AuthenticationFactorEnrolledType + end +end diff --git a/lib/workos/types/authentication_factors_create_request_type.rb b/lib/workos/types/authentication_factors_create_request_type.rb new file mode 100644 index 00000000..bc32ddd0 --- /dev/null +++ b/lib/workos/types/authentication_factors_create_request_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuthenticationFactorsCreateRequestType + GENERIC_OTP = "generic_otp" + SMS = "sms" + TOTP = "totp" + ALL = [GENERIC_OTP, SMS, TOTP].freeze + end + end +end diff --git a/lib/workos/types/authentication_radar_risk_detected_data_action.rb b/lib/workos/types/authentication_radar_risk_detected_data_action.rb new file mode 100644 index 00000000..8d446618 --- /dev/null +++ b/lib/workos/types/authentication_radar_risk_detected_data_action.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuthenticationRadarRiskDetectedDataAction + SIGNUP = "signup" + LOGIN = "login" + ALL = [SIGNUP, LOGIN].freeze + end + end +end diff --git a/lib/workos/types/authorization_assignment.rb b/lib/workos/types/authorization_assignment.rb new file mode 100644 index 00000000..1c15d6cd --- /dev/null +++ b/lib/workos/types/authorization_assignment.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class AuthorizationAssignment + DIRECT = "direct" + INDIRECT = "indirect" + ALL = [DIRECT, INDIRECT].freeze + end + end +end diff --git a/lib/workos/types/base_model.rb b/lib/workos/types/base_model.rb new file mode 100644 index 00000000..accc8126 --- /dev/null +++ b/lib/workos/types/base_model.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +require "json" + +module WorkOS + module Types + # Shared base class for all generated model classes. + # + # Provides: + # - HashProvider mixin for to_h / to_json / inspect + # - normalize(input) for JSON-vs-hash / string-vs-symbol normalization + # + # Subclasses declare HASH_ATTRS for serialization and implement their + # own initialize(json) using normalize to parse input. + class BaseModel + include HashProvider + + # The raw HTTP response metadata for this object, if available. + # Populated automatically by service methods that return models. + # @return [WorkOS::Types::ApiResponse, nil] + attr_accessor :last_response + + # Normalize an input value (JSON string or Hash) into a Hash with + # symbolized keys. Safe for already-symbolized hashes (no-op). + # + # @param json [String, Hash] JSON string or hash to normalize. + # @return [Hash{Symbol => Object}] + def self.normalize(json) + hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true) + hash.transform_keys(&:to_sym) + end + end + end +end diff --git a/lib/workos/types/connected_account_state.rb b/lib/workos/types/connected_account_state.rb new file mode 100644 index 00000000..766f6c5a --- /dev/null +++ b/lib/workos/types/connected_account_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectedAccountState + CONNECTED = "connected" + NEEDS_REAUTHORIZATION = "needs_reauthorization" + DISCONNECTED = "disconnected" + ALL = [CONNECTED, NEEDS_REAUTHORIZATION, DISCONNECTED].freeze + end + end +end diff --git a/lib/workos/types/connection_activated_data_connection_type.rb b/lib/workos/types/connection_activated_data_connection_type.rb new file mode 100644 index 00000000..bc9da6ec --- /dev/null +++ b/lib/workos/types/connection_activated_data_connection_type.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionActivatedDataConnectionType + ADFSSAML = "ADFSSAML" + ADP_OIDC = "AdpOidc" + APPLE_OAUTH = "AppleOAuth" + AUTH_0_MIGRATION = "Auth0Migration" + AUTH_0_SAML = "Auth0SAML" + AZURE_SAML = "AzureSAML" + BITBUCKET_OAUTH = "BitbucketOAuth" + CAS_SAML = "CasSAML" + CLASS_LINK_SAML = "ClassLinkSAML" + CLEVER_OIDC = "CleverOIDC" + CLOUDFLARE_SAML = "CloudflareSAML" + CYBER_ARK_SAML = "CyberArkSAML" + DISCORD_OAUTH = "DiscordOAuth" + DUO_SAML = "DuoSAML" + ENTRA_ID_OIDC = "EntraIdOIDC" + GENERIC_OIDC = "GenericOIDC" + GENERIC_SAML = "GenericSAML" + GIT_HUB_OAUTH = "GitHubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + GOOGLE_OIDC = "GoogleOIDC" + GOOGLE_SAML = "GoogleSAML" + INTUIT_OAUTH = "IntuitOAuth" + JUMP_CLOUD_SAML = "JumpCloudSAML" + KEYCLOAK_SAML = "KeycloakSAML" + LAST_PASS_SAML = "LastPassSAML" + LINKED_IN_OAUTH = "LinkedInOAuth" + LOGIN_GOV_OIDC = "LoginGovOidc" + MAGIC_LINK = "MagicLink" + MICROSOFT_OAUTH = "MicrosoftOAuth" + MINI_ORANGE_SAML = "MiniOrangeSAML" + NET_IQ_SAML = "NetIqSAML" + OKTA_OIDC = "OktaOIDC" + OKTA_SAML = "OktaSAML" + ONE_LOGIN_SAML = "OneLoginSAML" + ORACLE_SAML = "OracleSAML" + PING_FEDERATE_SAML = "PingFederateSAML" + PING_ONE_SAML = "PingOneSAML" + RIPPLING_SAML = "RipplingSAML" + SALESFORCE_SAML = "SalesforceSAML" + SHIBBOLETH_GENERIC_SAML = "ShibbolethGenericSAML" + SHIBBOLETH_SAML = "ShibbolethSAML" + SIMPLE_SAML_PHP_SAML = "SimpleSamlPhpSAML" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + TEST_IDP = "TestIdp" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + V_MWARE_SAML = "VMwareSAML" + XERO_OAUTH = "XeroOAuth" + ALL = [ADFSSAML, ADP_OIDC, APPLE_OAUTH, AUTH_0_MIGRATION, AUTH_0_SAML, AZURE_SAML, BITBUCKET_OAUTH, CAS_SAML, CLASS_LINK_SAML, CLEVER_OIDC, CLOUDFLARE_SAML, CYBER_ARK_SAML, DISCORD_OAUTH, DUO_SAML, ENTRA_ID_OIDC, GENERIC_OIDC, GENERIC_SAML, GIT_HUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, GOOGLE_OIDC, GOOGLE_SAML, INTUIT_OAUTH, JUMP_CLOUD_SAML, KEYCLOAK_SAML, LAST_PASS_SAML, LINKED_IN_OAUTH, LOGIN_GOV_OIDC, MAGIC_LINK, MICROSOFT_OAUTH, MINI_ORANGE_SAML, NET_IQ_SAML, OKTA_OIDC, OKTA_SAML, ONE_LOGIN_SAML, ORACLE_SAML, PING_FEDERATE_SAML, PING_ONE_SAML, RIPPLING_SAML, SALESFORCE_SAML, SHIBBOLETH_GENERIC_SAML, SHIBBOLETH_SAML, SIMPLE_SAML_PHP_SAML, SALESFORCE_OAUTH, SLACK_OAUTH, TEST_IDP, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, V_MWARE_SAML, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/connection_activated_data_state.rb b/lib/workos/types/connection_activated_data_state.rb new file mode 100644 index 00000000..e2f8859d --- /dev/null +++ b/lib/workos/types/connection_activated_data_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionActivatedDataState + DRAFT = "draft" + ACTIVE = "active" + VALIDATING = "validating" + INACTIVE = "inactive" + DELETING = "deleting" + ALL = [DRAFT, ACTIVE, VALIDATING, INACTIVE, DELETING].freeze + end + end +end diff --git a/lib/workos/types/connection_activated_data_status.rb b/lib/workos/types/connection_activated_data_status.rb new file mode 100644 index 00000000..0c76fca0 --- /dev/null +++ b/lib/workos/types/connection_activated_data_status.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionActivatedDataStatus + LINKED = "linked" + UNLINKED = "unlinked" + ALL = [LINKED, UNLINKED].freeze + end + end +end diff --git a/lib/workos/types/connection_deactivated_data_connection_type.rb b/lib/workos/types/connection_deactivated_data_connection_type.rb new file mode 100644 index 00000000..6c92eb99 --- /dev/null +++ b/lib/workos/types/connection_deactivated_data_connection_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionDeactivatedDataConnectionType = ConnectionActivatedDataConnectionType + end +end diff --git a/lib/workos/types/connection_deactivated_data_state.rb b/lib/workos/types/connection_deactivated_data_state.rb new file mode 100644 index 00000000..4e5b6724 --- /dev/null +++ b/lib/workos/types/connection_deactivated_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionDeactivatedDataState = ConnectionActivatedDataState + end +end diff --git a/lib/workos/types/connection_deactivated_data_status.rb b/lib/workos/types/connection_deactivated_data_status.rb new file mode 100644 index 00000000..dfb61ac9 --- /dev/null +++ b/lib/workos/types/connection_deactivated_data_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionDeactivatedDataStatus = ConnectionActivatedDataStatus + end +end diff --git a/lib/workos/types/connection_deleted_data_connection_type.rb b/lib/workos/types/connection_deleted_data_connection_type.rb new file mode 100644 index 00000000..20105452 --- /dev/null +++ b/lib/workos/types/connection_deleted_data_connection_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionDeletedDataConnectionType = ConnectionActivatedDataConnectionType + end +end diff --git a/lib/workos/types/connection_deleted_data_state.rb b/lib/workos/types/connection_deleted_data_state.rb new file mode 100644 index 00000000..f2c44904 --- /dev/null +++ b/lib/workos/types/connection_deleted_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionDeletedDataState = ConnectionActivatedDataState + end +end diff --git a/lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb b/lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb new file mode 100644 index 00000000..9aed8144 --- /dev/null +++ b/lib/workos/types/connection_saml_certificate_renewal_required_data_certificate_certificate_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionSAMLCertificateRenewalRequiredDataCertificateCertificateType + RESPONSE_SIGNING = "ResponseSigning" + REQUEST_SIGNING = "RequestSigning" + RESPONSE_ENCRYPTION = "ResponseEncryption" + ALL = [RESPONSE_SIGNING, REQUEST_SIGNING, RESPONSE_ENCRYPTION].freeze + end + end +end diff --git a/lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb b/lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb new file mode 100644 index 00000000..4caf9619 --- /dev/null +++ b/lib/workos/types/connection_saml_certificate_renewed_data_certificate_certificate_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionSAMLCertificateRenewedDataCertificateCertificateType = ConnectionSAMLCertificateRenewalRequiredDataCertificateCertificateType + end +end diff --git a/lib/workos/types/connection_state.rb b/lib/workos/types/connection_state.rb new file mode 100644 index 00000000..27ca264d --- /dev/null +++ b/lib/workos/types/connection_state.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionState + REQUIRES_TYPE = "requires_type" + DRAFT = "draft" + ACTIVE = "active" + VALIDATING = "validating" + INACTIVE = "inactive" + DELETING = "deleting" + ALL = [REQUIRES_TYPE, DRAFT, ACTIVE, VALIDATING, INACTIVE, DELETING].freeze + end + end +end diff --git a/lib/workos/types/connection_status.rb b/lib/workos/types/connection_status.rb new file mode 100644 index 00000000..f2168764 --- /dev/null +++ b/lib/workos/types/connection_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ConnectionStatus = ConnectionActivatedDataStatus + end +end diff --git a/lib/workos/types/connection_type.rb b/lib/workos/types/connection_type.rb new file mode 100644 index 00000000..c377e7f3 --- /dev/null +++ b/lib/workos/types/connection_type.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionType + PENDING = "Pending" + ADFSSAML = "ADFSSAML" + ADP_OIDC = "AdpOidc" + APPLE_OAUTH = "AppleOAuth" + AUTH_0_MIGRATION = "Auth0Migration" + AUTH_0_SAML = "Auth0SAML" + AZURE_SAML = "AzureSAML" + BITBUCKET_OAUTH = "BitbucketOAuth" + CAS_SAML = "CasSAML" + CLASS_LINK_SAML = "ClassLinkSAML" + CLEVER_OIDC = "CleverOIDC" + CLOUDFLARE_SAML = "CloudflareSAML" + CYBER_ARK_SAML = "CyberArkSAML" + DISCORD_OAUTH = "DiscordOAuth" + DUO_SAML = "DuoSAML" + ENTRA_ID_OIDC = "EntraIdOIDC" + GENERIC_OIDC = "GenericOIDC" + GENERIC_SAML = "GenericSAML" + GIT_HUB_OAUTH = "GitHubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + GOOGLE_OIDC = "GoogleOIDC" + GOOGLE_SAML = "GoogleSAML" + INTUIT_OAUTH = "IntuitOAuth" + JUMP_CLOUD_SAML = "JumpCloudSAML" + KEYCLOAK_SAML = "KeycloakSAML" + LAST_PASS_SAML = "LastPassSAML" + LINKED_IN_OAUTH = "LinkedInOAuth" + LOGIN_GOV_OIDC = "LoginGovOidc" + MAGIC_LINK = "MagicLink" + MICROSOFT_OAUTH = "MicrosoftOAuth" + MINI_ORANGE_SAML = "MiniOrangeSAML" + NET_IQ_SAML = "NetIqSAML" + OKTA_OIDC = "OktaOIDC" + OKTA_SAML = "OktaSAML" + ONE_LOGIN_SAML = "OneLoginSAML" + ORACLE_SAML = "OracleSAML" + PING_FEDERATE_SAML = "PingFederateSAML" + PING_ONE_SAML = "PingOneSAML" + RIPPLING_SAML = "RipplingSAML" + SALESFORCE_SAML = "SalesforceSAML" + SHIBBOLETH_GENERIC_SAML = "ShibbolethGenericSAML" + SHIBBOLETH_SAML = "ShibbolethSAML" + SIMPLE_SAML_PHP_SAML = "SimpleSamlPhpSAML" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + TEST_IDP = "TestIdp" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + V_MWARE_SAML = "VMwareSAML" + XERO_OAUTH = "XeroOAuth" + ALL = [PENDING, ADFSSAML, ADP_OIDC, APPLE_OAUTH, AUTH_0_MIGRATION, AUTH_0_SAML, AZURE_SAML, BITBUCKET_OAUTH, CAS_SAML, CLASS_LINK_SAML, CLEVER_OIDC, CLOUDFLARE_SAML, CYBER_ARK_SAML, DISCORD_OAUTH, DUO_SAML, ENTRA_ID_OIDC, GENERIC_OIDC, GENERIC_SAML, GIT_HUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, GOOGLE_OIDC, GOOGLE_SAML, INTUIT_OAUTH, JUMP_CLOUD_SAML, KEYCLOAK_SAML, LAST_PASS_SAML, LINKED_IN_OAUTH, LOGIN_GOV_OIDC, MAGIC_LINK, MICROSOFT_OAUTH, MINI_ORANGE_SAML, NET_IQ_SAML, OKTA_OIDC, OKTA_SAML, ONE_LOGIN_SAML, ORACLE_SAML, PING_FEDERATE_SAML, PING_ONE_SAML, RIPPLING_SAML, SALESFORCE_SAML, SHIBBOLETH_GENERIC_SAML, SHIBBOLETH_SAML, SIMPLE_SAML_PHP_SAML, SALESFORCE_OAUTH, SLACK_OAUTH, TEST_IDP, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, V_MWARE_SAML, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/connections_connection_type.rb b/lib/workos/types/connections_connection_type.rb new file mode 100644 index 00000000..8854a289 --- /dev/null +++ b/lib/workos/types/connections_connection_type.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectionsConnectionType + ADFSSAML = "ADFSSAML" + ADP_OIDC = "AdpOidc" + APPLE_OAUTH = "AppleOAuth" + AUTH_0_SAML = "Auth0SAML" + AZURE_SAML = "AzureSAML" + BITBUCKET_OAUTH = "BitbucketOAuth" + CAS_SAML = "CasSAML" + CLOUDFLARE_SAML = "CloudflareSAML" + CLASS_LINK_SAML = "ClassLinkSAML" + CLEVER_OIDC = "CleverOIDC" + CYBER_ARK_SAML = "CyberArkSAML" + DISCORD_OAUTH = "DiscordOAuth" + DUO_SAML = "DuoSAML" + ENTRA_ID_OIDC = "EntraIdOIDC" + GENERIC_OIDC = "GenericOIDC" + GENERIC_SAML = "GenericSAML" + GITHUB_OAUTH = "GithubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + GOOGLE_OIDC = "GoogleOIDC" + GOOGLE_SAML = "GoogleSAML" + INTUIT_OAUTH = "IntuitOAuth" + JUMP_CLOUD_SAML = "JumpCloudSAML" + KEYCLOAK_SAML = "KeycloakSAML" + LAST_PASS_SAML = "LastPassSAML" + LINKED_IN_OAUTH = "LinkedInOAuth" + LOGIN_GOV_OIDC = "LoginGovOidc" + MAGIC_LINK = "MagicLink" + MICROSOFT_OAUTH = "MicrosoftOAuth" + MINI_ORANGE_SAML = "MiniOrangeSAML" + NET_IQ_SAML = "NetIqSAML" + OKTA_OIDC = "OktaOIDC" + OKTA_SAML = "OktaSAML" + ONE_LOGIN_SAML = "OneLoginSAML" + ORACLE_SAML = "OracleSAML" + PING_FEDERATE_SAML = "PingFederateSAML" + PING_ONE_SAML = "PingOneSAML" + RIPPLING_SAML = "RipplingSAML" + SALESFORCE_SAML = "SalesforceSAML" + SHIBBOLETH_GENERIC_SAML = "ShibbolethGenericSAML" + SHIBBOLETH_SAML = "ShibbolethSAML" + SIMPLE_SAML_PHP_SAML = "SimpleSamlPhpSAML" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + V_MWARE_SAML = "VMwareSAML" + XERO_OAUTH = "XeroOAuth" + ALL = [ADFSSAML, ADP_OIDC, APPLE_OAUTH, AUTH_0_SAML, AZURE_SAML, BITBUCKET_OAUTH, CAS_SAML, CLOUDFLARE_SAML, CLASS_LINK_SAML, CLEVER_OIDC, CYBER_ARK_SAML, DISCORD_OAUTH, DUO_SAML, ENTRA_ID_OIDC, GENERIC_OIDC, GENERIC_SAML, GITHUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, GOOGLE_OIDC, GOOGLE_SAML, INTUIT_OAUTH, JUMP_CLOUD_SAML, KEYCLOAK_SAML, LAST_PASS_SAML, LINKED_IN_OAUTH, LOGIN_GOV_OIDC, MAGIC_LINK, MICROSOFT_OAUTH, MINI_ORANGE_SAML, NET_IQ_SAML, OKTA_OIDC, OKTA_SAML, ONE_LOGIN_SAML, ORACLE_SAML, PING_FEDERATE_SAML, PING_ONE_SAML, RIPPLING_SAML, SALESFORCE_SAML, SHIBBOLETH_GENERIC_SAML, SHIBBOLETH_SAML, SIMPLE_SAML_PHP_SAML, SALESFORCE_OAUTH, SLACK_OAUTH, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, V_MWARE_SAML, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/create_user_invite_options_locale.rb b/lib/workos/types/create_user_invite_options_locale.rb new file mode 100644 index 00000000..1c367723 --- /dev/null +++ b/lib/workos/types/create_user_invite_options_locale.rb @@ -0,0 +1,101 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class CreateUserInviteOptionsLocale + AF = "af" + AM = "am" + AR = "ar" + BG = "bg" + BN = "bn" + BS = "bs" + CA = "ca" + CS = "cs" + DA = "da" + DE = "de" + DE_DE = "de-DE" + EL = "el" + EN = "en" + EN_AU = "en-AU" + EN_CA = "en-CA" + EN_GB = "en-GB" + EN_US = "en-US" + ES = "es" + ES_419 = "es-419" + ES_ES = "es-ES" + ES_US = "es-US" + ET = "et" + FA = "fa" + FI = "fi" + FIL = "fil" + FR = "fr" + FR_BE = "fr-BE" + FR_CA = "fr-CA" + FR_FR = "fr-FR" + FY = "fy" + GL = "gl" + GU = "gu" + HA = "ha" + HE = "he" + HI = "hi" + HR = "hr" + HU = "hu" + HY = "hy" + ID = "id" + IS = "is" + IT = "it" + IT_IT = "it-IT" + JA = "ja" + JV = "jv" + KA = "ka" + KK = "kk" + KM = "km" + KN = "kn" + KO = "ko" + LT = "lt" + LV = "lv" + MK = "mk" + ML = "ml" + MN = "mn" + MR = "mr" + MS = "ms" + MY = "my" + NB = "nb" + NE = "ne" + NL = "nl" + NL_BE = "nl-BE" + NL_NL = "nl-NL" + NN = "nn" + NO = "no" + PA = "pa" + PL = "pl" + PT = "pt" + PT_BR = "pt-BR" + PT_PT = "pt-PT" + RO = "ro" + RU = "ru" + SK = "sk" + SL = "sl" + SQ = "sq" + SR = "sr" + SV = "sv" + SW = "sw" + TA = "ta" + TE = "te" + TH = "th" + TR = "tr" + UK = "uk" + UR = "ur" + UZ = "uz" + VI = "vi" + ZH = "zh" + ZH_CN = "zh-CN" + ZH_HK = "zh-HK" + ZH_TW = "zh-TW" + ZU = "zu" + ALL = [AF, AM, AR, BG, BN, BS, CA, CS, DA, DE, DE_DE, EL, EN, EN_AU, EN_CA, EN_GB, EN_US, ES, ES_419, ES_ES, ES_US, ET, FA, FI, FIL, FR, FR_BE, FR_CA, FR_FR, FY, GL, GU, HA, HE, HI, HR, HU, HY, ID, IS, IT, IT_IT, JA, JV, KA, KK, KM, KN, KO, LT, LV, MK, ML, MN, MR, MS, MY, NB, NE, NL, NL_BE, NL_NL, NN, NO, PA, PL, PT, PT_BR, PT_PT, RO, RU, SK, SL, SQ, SR, SV, SW, TA, TE, TH, TR, UK, UR, UZ, VI, ZH, ZH_CN, ZH_HK, ZH_TW, ZU].freeze + end + end +end diff --git a/lib/workos/types/create_user_password_hash_type.rb b/lib/workos/types/create_user_password_hash_type.rb new file mode 100644 index 00000000..03935620 --- /dev/null +++ b/lib/workos/types/create_user_password_hash_type.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class CreateUserPasswordHashType + BCRYPT = "bcrypt" + FIREBASE_SCRYPT = "firebase-scrypt" + SSHA = "ssha" + SCRYPT = "scrypt" + PBKDF_2 = "pbkdf2" + ARGON_2 = "argon2" + ALL = [BCRYPT, FIREBASE_SCRYPT, SSHA, SCRYPT, PBKDF_2, ARGON_2].freeze + end + end +end diff --git a/lib/workos/types/create_webhook_endpoint_events.rb b/lib/workos/types/create_webhook_endpoint_events.rb new file mode 100644 index 00000000..8b323a9f --- /dev/null +++ b/lib/workos/types/create_webhook_endpoint_events.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class CreateWebhookEndpointEvents + AUTHENTICATION_EMAIL_VERIFICATION_SUCCEEDED = "authentication.email_verification_succeeded" + AUTHENTICATION_MAGIC_AUTH_FAILED = "authentication.magic_auth_failed" + AUTHENTICATION_MAGIC_AUTH_SUCCEEDED = "authentication.magic_auth_succeeded" + AUTHENTICATION_MFA_SUCCEEDED = "authentication.mfa_succeeded" + AUTHENTICATION_OAUTH_FAILED = "authentication.oauth_failed" + AUTHENTICATION_OAUTH_SUCCEEDED = "authentication.oauth_succeeded" + AUTHENTICATION_PASSWORD_FAILED = "authentication.password_failed" + AUTHENTICATION_PASSWORD_SUCCEEDED = "authentication.password_succeeded" + AUTHENTICATION_PASSKEY_FAILED = "authentication.passkey_failed" + AUTHENTICATION_PASSKEY_SUCCEEDED = "authentication.passkey_succeeded" + AUTHENTICATION_SSO_FAILED = "authentication.sso_failed" + AUTHENTICATION_SSO_STARTED = "authentication.sso_started" + AUTHENTICATION_SSO_SUCCEEDED = "authentication.sso_succeeded" + AUTHENTICATION_SSO_TIMED_OUT = "authentication.sso_timed_out" + AUTHENTICATION_RADAR_RISK_DETECTED = "authentication.radar_risk_detected" + API_KEY_CREATED = "api_key.created" + API_KEY_REVOKED = "api_key.revoked" + CONNECTION_ACTIVATED = "connection.activated" + CONNECTION_DEACTIVATED = "connection.deactivated" + CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED = "connection.saml_certificate_renewal_required" + CONNECTION_SAML_CERTIFICATE_RENEWED = "connection.saml_certificate_renewed" + CONNECTION_DELETED = "connection.deleted" + DSYNC_ACTIVATED = "dsync.activated" + DSYNC_DELETED = "dsync.deleted" + DSYNC_GROUP_CREATED = "dsync.group.created" + DSYNC_GROUP_DELETED = "dsync.group.deleted" + DSYNC_GROUP_UPDATED = "dsync.group.updated" + DSYNC_GROUP_USER_ADDED = "dsync.group.user_added" + DSYNC_GROUP_USER_REMOVED = "dsync.group.user_removed" + DSYNC_USER_CREATED = "dsync.user.created" + DSYNC_USER_DELETED = "dsync.user.deleted" + DSYNC_USER_UPDATED = "dsync.user.updated" + EMAIL_VERIFICATION_CREATED = "email_verification.created" + GROUP_CREATED = "group.created" + GROUP_DELETED = "group.deleted" + GROUP_MEMBER_ADDED = "group.member_added" + GROUP_MEMBER_REMOVED = "group.member_removed" + GROUP_UPDATED = "group.updated" + FLAG_CREATED = "flag.created" + FLAG_DELETED = "flag.deleted" + FLAG_UPDATED = "flag.updated" + FLAG_RULE_UPDATED = "flag.rule_updated" + INVITATION_ACCEPTED = "invitation.accepted" + INVITATION_CREATED = "invitation.created" + INVITATION_RESENT = "invitation.resent" + INVITATION_REVOKED = "invitation.revoked" + MAGIC_AUTH_CREATED = "magic_auth.created" + ORGANIZATION_CREATED = "organization.created" + ORGANIZATION_DELETED = "organization.deleted" + ORGANIZATION_UPDATED = "organization.updated" + ORGANIZATION_DOMAIN_CREATED = "organization_domain.created" + ORGANIZATION_DOMAIN_DELETED = "organization_domain.deleted" + ORGANIZATION_DOMAIN_UPDATED = "organization_domain.updated" + ORGANIZATION_DOMAIN_VERIFIED = "organization_domain.verified" + ORGANIZATION_DOMAIN_VERIFICATION_FAILED = "organization_domain.verification_failed" + PASSWORD_RESET_CREATED = "password_reset.created" + PASSWORD_RESET_SUCCEEDED = "password_reset.succeeded" + USER_CREATED = "user.created" + USER_UPDATED = "user.updated" + USER_DELETED = "user.deleted" + ORGANIZATION_MEMBERSHIP_CREATED = "organization_membership.created" + ORGANIZATION_MEMBERSHIP_DELETED = "organization_membership.deleted" + ORGANIZATION_MEMBERSHIP_UPDATED = "organization_membership.updated" + ROLE_CREATED = "role.created" + ROLE_DELETED = "role.deleted" + ROLE_UPDATED = "role.updated" + ORGANIZATION_ROLE_CREATED = "organization_role.created" + ORGANIZATION_ROLE_DELETED = "organization_role.deleted" + ORGANIZATION_ROLE_UPDATED = "organization_role.updated" + PERMISSION_CREATED = "permission.created" + PERMISSION_DELETED = "permission.deleted" + PERMISSION_UPDATED = "permission.updated" + SESSION_CREATED = "session.created" + SESSION_REVOKED = "session.revoked" + WAITLIST_USER_APPROVED = "waitlist_user.approved" + WAITLIST_USER_CREATED = "waitlist_user.created" + WAITLIST_USER_DENIED = "waitlist_user.denied" + ALL = [AUTHENTICATION_EMAIL_VERIFICATION_SUCCEEDED, AUTHENTICATION_MAGIC_AUTH_FAILED, AUTHENTICATION_MAGIC_AUTH_SUCCEEDED, AUTHENTICATION_MFA_SUCCEEDED, AUTHENTICATION_OAUTH_FAILED, AUTHENTICATION_OAUTH_SUCCEEDED, AUTHENTICATION_PASSWORD_FAILED, AUTHENTICATION_PASSWORD_SUCCEEDED, AUTHENTICATION_PASSKEY_FAILED, AUTHENTICATION_PASSKEY_SUCCEEDED, AUTHENTICATION_SSO_FAILED, AUTHENTICATION_SSO_STARTED, AUTHENTICATION_SSO_SUCCEEDED, AUTHENTICATION_SSO_TIMED_OUT, AUTHENTICATION_RADAR_RISK_DETECTED, API_KEY_CREATED, API_KEY_REVOKED, CONNECTION_ACTIVATED, CONNECTION_DEACTIVATED, CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED, CONNECTION_SAML_CERTIFICATE_RENEWED, CONNECTION_DELETED, DSYNC_ACTIVATED, DSYNC_DELETED, DSYNC_GROUP_CREATED, DSYNC_GROUP_DELETED, DSYNC_GROUP_UPDATED, DSYNC_GROUP_USER_ADDED, DSYNC_GROUP_USER_REMOVED, DSYNC_USER_CREATED, DSYNC_USER_DELETED, DSYNC_USER_UPDATED, EMAIL_VERIFICATION_CREATED, GROUP_CREATED, GROUP_DELETED, GROUP_MEMBER_ADDED, GROUP_MEMBER_REMOVED, GROUP_UPDATED, FLAG_CREATED, FLAG_DELETED, FLAG_UPDATED, FLAG_RULE_UPDATED, INVITATION_ACCEPTED, INVITATION_CREATED, INVITATION_RESENT, INVITATION_REVOKED, MAGIC_AUTH_CREATED, ORGANIZATION_CREATED, ORGANIZATION_DELETED, ORGANIZATION_UPDATED, ORGANIZATION_DOMAIN_CREATED, ORGANIZATION_DOMAIN_DELETED, ORGANIZATION_DOMAIN_UPDATED, ORGANIZATION_DOMAIN_VERIFIED, ORGANIZATION_DOMAIN_VERIFICATION_FAILED, PASSWORD_RESET_CREATED, PASSWORD_RESET_SUCCEEDED, USER_CREATED, USER_UPDATED, USER_DELETED, ORGANIZATION_MEMBERSHIP_CREATED, ORGANIZATION_MEMBERSHIP_DELETED, ORGANIZATION_MEMBERSHIP_UPDATED, ROLE_CREATED, ROLE_DELETED, ROLE_UPDATED, ORGANIZATION_ROLE_CREATED, ORGANIZATION_ROLE_DELETED, ORGANIZATION_ROLE_UPDATED, PERMISSION_CREATED, PERMISSION_DELETED, PERMISSION_UPDATED, SESSION_CREATED, SESSION_REVOKED, WAITLIST_USER_APPROVED, WAITLIST_USER_CREATED, WAITLIST_USER_DENIED].freeze + end + end +end diff --git a/lib/workos/types/data_integration_access_token_response_error.rb b/lib/workos/types/data_integration_access_token_response_error.rb new file mode 100644 index 00000000..c3b9b57c --- /dev/null +++ b/lib/workos/types/data_integration_access_token_response_error.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DataIntegrationAccessTokenResponseError + NEEDS_REAUTHORIZATION = "needs_reauthorization" + NOT_INSTALLED = "not_installed" + ALL = [NEEDS_REAUTHORIZATION, NOT_INSTALLED].freeze + end + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb b/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb new file mode 100644 index 00000000..5cb4e2e9 --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_connected_account_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsListResponseDataConnectedAccountState = ConnectedAccountState + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_ownership.rb b/lib/workos/types/data_integrations_list_response_data_ownership.rb new file mode 100644 index 00000000..ebf0a7c2 --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_ownership.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DataIntegrationsListResponseDataOwnership + USERLAND_USER = "userland_user" + ORGANIZATION = "organization" + ALL = [USERLAND_USER, ORGANIZATION].freeze + end + end +end diff --git a/lib/workos/types/directory_state.rb b/lib/workos/types/directory_state.rb new file mode 100644 index 00000000..728039d3 --- /dev/null +++ b/lib/workos/types/directory_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DirectoryState + LINKED = "linked" + VALIDATING = "validating" + INVALID_CREDENTIALS = "invalid_credentials" + UNLINKED = "unlinked" + DELETING = "deleting" + ALL = [LINKED, VALIDATING, INVALID_CREDENTIALS, UNLINKED, DELETING].freeze + end + end +end diff --git a/lib/workos/types/directory_type.rb b/lib/workos/types/directory_type.rb new file mode 100644 index 00000000..68de73d1 --- /dev/null +++ b/lib/workos/types/directory_type.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DirectoryType + AZURE_SCIM_V_2_0 = "azure scim v2.0" + BAMBOOHR = "bamboohr" + BREATHE_HR = "breathe hr" + CEZANNE_HR = "cezanne hr" + CYBERARK_SCIM_V_2_0 = "cyberark scim v2.0" + FOURTH_HR = "fourth hr" + GENERIC_SCIM_V_2_0 = "generic scim v2.0" + GSUITE_DIRECTORY = "gsuite directory" + HIBOB = "hibob" + SAILPOINT_SCIM_V_2_0 = "sailpoint scim v2.0" + JUMP_CLOUD_SCIM_V_2_0 = "jump cloud scim v2.0" + OKTA_SCIM_V_2_0 = "okta scim v2.0" + ONELOGIN_SCIM_V_2_0 = "onelogin scim v2.0" + PEOPLE_HR = "people hr" + PERSONIO = "personio" + PINGFEDERATE_SCIM_V_2_0 = "pingfederate scim v2.0" + RIPPLING_SCIM_V_2_0 = "rippling scim v2.0" + S_3 = "s3" + SFTP = "sftp" + SFTP_WORKDAY = "sftp workday" + WORKDAY = "workday" + ALL = [AZURE_SCIM_V_2_0, BAMBOOHR, BREATHE_HR, CEZANNE_HR, CYBERARK_SCIM_V_2_0, FOURTH_HR, GENERIC_SCIM_V_2_0, GSUITE_DIRECTORY, HIBOB, SAILPOINT_SCIM_V_2_0, JUMP_CLOUD_SCIM_V_2_0, OKTA_SCIM_V_2_0, ONELOGIN_SCIM_V_2_0, PEOPLE_HR, PERSONIO, PINGFEDERATE_SCIM_V_2_0, RIPPLING_SCIM_V_2_0, S_3, SFTP, SFTP_WORKDAY, WORKDAY].freeze + end + end +end diff --git a/lib/workos/types/directory_user_state.rb b/lib/workos/types/directory_user_state.rb new file mode 100644 index 00000000..abc76c0d --- /dev/null +++ b/lib/workos/types/directory_user_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DirectoryUserState + ACTIVE = "active" + SUSPENDED = "suspended" + INACTIVE = "inactive" + ALL = [ACTIVE, SUSPENDED, INACTIVE].freeze + end + end +end diff --git a/lib/workos/types/directory_user_with_groups_state.rb b/lib/workos/types/directory_user_with_groups_state.rb new file mode 100644 index 00000000..7260fd6b --- /dev/null +++ b/lib/workos/types/directory_user_with_groups_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DirectoryUserWithGroupsState = DirectoryUserState + end +end diff --git a/lib/workos/types/dsync_activated_data_state.rb b/lib/workos/types/dsync_activated_data_state.rb new file mode 100644 index 00000000..2e7d4d87 --- /dev/null +++ b/lib/workos/types/dsync_activated_data_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DsyncActivatedDataState + ACTIVE = "active" + VALIDATING = "validating" + INVALID_CREDENTIALS = "invalid_credentials" + INACTIVE = "inactive" + DELETING = "deleting" + ALL = [ACTIVE, VALIDATING, INVALID_CREDENTIALS, INACTIVE, DELETING].freeze + end + end +end diff --git a/lib/workos/types/dsync_activated_data_type.rb b/lib/workos/types/dsync_activated_data_type.rb new file mode 100644 index 00000000..6e2949dd --- /dev/null +++ b/lib/workos/types/dsync_activated_data_type.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DsyncActivatedDataType + AZURE_SCIM_V_2_0 = "azure scim v2.0" + BAMBOOHR = "bamboohr" + BREATHE_HR = "breathe hr" + CEZANNE_HR = "cezanne hr" + CYBERARK_SCIM_V_2_0 = "cyberark scim v2.0" + FOURTH_HR = "fourth hr" + GENERIC_SCIM_V_2_0 = "generic scim v2.0" + GSUITE_DIRECTORY = "gsuite directory" + GUSTO = "gusto" + HIBOB = "hibob" + JUMP_CLOUD_SCIM_V_2_0 = "jump cloud scim v2.0" + OKTA_SCIM_V_2_0 = "okta scim v2.0" + ONELOGIN_SCIM_V_2_0 = "onelogin scim v2.0" + PEOPLE_HR = "people hr" + PERSONIO = "personio" + PINGFEDERATE_SCIM_V_2_0 = "pingfederate scim v2.0" + RIPPLING_SCIM_V_2_0 = "rippling scim v2.0" + RIPPLING = "rippling" + SAILPOINT_SCIM_V_2_0 = "sailpoint scim v2.0" + S_3 = "s3" + SFTP = "sftp" + SFTP_WORKDAY = "sftp workday" + WORKDAY = "workday" + ALL = [AZURE_SCIM_V_2_0, BAMBOOHR, BREATHE_HR, CEZANNE_HR, CYBERARK_SCIM_V_2_0, FOURTH_HR, GENERIC_SCIM_V_2_0, GSUITE_DIRECTORY, GUSTO, HIBOB, JUMP_CLOUD_SCIM_V_2_0, OKTA_SCIM_V_2_0, ONELOGIN_SCIM_V_2_0, PEOPLE_HR, PERSONIO, PINGFEDERATE_SCIM_V_2_0, RIPPLING_SCIM_V_2_0, RIPPLING, SAILPOINT_SCIM_V_2_0, S_3, SFTP, SFTP_WORKDAY, WORKDAY].freeze + end + end +end diff --git a/lib/workos/types/dsync_deactivated_data_state.rb b/lib/workos/types/dsync_deactivated_data_state.rb new file mode 100644 index 00000000..33e4814e --- /dev/null +++ b/lib/workos/types/dsync_deactivated_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DsyncDeactivatedDataState = DsyncActivatedDataState + end +end diff --git a/lib/workos/types/dsync_deactivated_data_type.rb b/lib/workos/types/dsync_deactivated_data_type.rb new file mode 100644 index 00000000..3ca02e36 --- /dev/null +++ b/lib/workos/types/dsync_deactivated_data_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DsyncDeactivatedDataType = DsyncActivatedDataType + end +end diff --git a/lib/workos/types/dsync_deleted_data_state.rb b/lib/workos/types/dsync_deleted_data_state.rb new file mode 100644 index 00000000..7a836522 --- /dev/null +++ b/lib/workos/types/dsync_deleted_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DsyncDeletedDataState = DsyncActivatedDataState + end +end diff --git a/lib/workos/types/dsync_deleted_data_type.rb b/lib/workos/types/dsync_deleted_data_type.rb new file mode 100644 index 00000000..6c074cc1 --- /dev/null +++ b/lib/workos/types/dsync_deleted_data_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DsyncDeletedDataType = DsyncActivatedDataType + end +end diff --git a/lib/workos/types/dsync_user_updated_data_state.rb b/lib/workos/types/dsync_user_updated_data_state.rb new file mode 100644 index 00000000..152efeb5 --- /dev/null +++ b/lib/workos/types/dsync_user_updated_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DsyncUserUpdatedDataState = DirectoryUserState + end +end diff --git a/lib/workos/types/event_context_actor_source.rb b/lib/workos/types/event_context_actor_source.rb new file mode 100644 index 00000000..d49ea597 --- /dev/null +++ b/lib/workos/types/event_context_actor_source.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class EventContextActorSource + API = "api" + DASHBOARD = "dashboard" + ADMIN_PORTAL = "admin_portal" + SYSTEM = "system" + ALL = [API, DASHBOARD, ADMIN_PORTAL, SYSTEM].freeze + end + end +end diff --git a/lib/workos/types/flag_created_context_actor_source.rb b/lib/workos/types/flag_created_context_actor_source.rb new file mode 100644 index 00000000..18965b97 --- /dev/null +++ b/lib/workos/types/flag_created_context_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + FlagCreatedContextActorSource = EventContextActorSource + end +end diff --git a/lib/workos/types/flag_deleted_context_actor_source.rb b/lib/workos/types/flag_deleted_context_actor_source.rb new file mode 100644 index 00000000..7163e414 --- /dev/null +++ b/lib/workos/types/flag_deleted_context_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + FlagDeletedContextActorSource = EventContextActorSource + end +end diff --git a/lib/workos/types/flag_rule_updated_context_access_type.rb b/lib/workos/types/flag_rule_updated_context_access_type.rb new file mode 100644 index 00000000..79eaff86 --- /dev/null +++ b/lib/workos/types/flag_rule_updated_context_access_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class FlagRuleUpdatedContextAccessType + NONE = "none" + SOME = "some" + VALUE_ALL = "all" + ALL = [NONE, SOME, VALUE_ALL].freeze + end + end +end diff --git a/lib/workos/types/flag_rule_updated_context_actor_source.rb b/lib/workos/types/flag_rule_updated_context_actor_source.rb new file mode 100644 index 00000000..d1b982a9 --- /dev/null +++ b/lib/workos/types/flag_rule_updated_context_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + FlagRuleUpdatedContextActorSource = EventContextActorSource + end +end diff --git a/lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb b/lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb new file mode 100644 index 00000000..ee9b27f9 --- /dev/null +++ b/lib/workos/types/flag_rule_updated_context_previous_attribute_context_access_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + FlagRuleUpdatedContextPreviousAttributeContextAccessType = FlagRuleUpdatedContextAccessType + end +end diff --git a/lib/workos/types/flag_updated_context_actor_source.rb b/lib/workos/types/flag_updated_context_actor_source.rb new file mode 100644 index 00000000..ce360bdf --- /dev/null +++ b/lib/workos/types/flag_updated_context_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + FlagUpdatedContextActorSource = EventContextActorSource + end +end diff --git a/lib/workos/types/generate_link_intent.rb b/lib/workos/types/generate_link_intent.rb new file mode 100644 index 00000000..3f0613ab --- /dev/null +++ b/lib/workos/types/generate_link_intent.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class GenerateLinkIntent + SSO = "sso" + DSYNC = "dsync" + AUDIT_LOGS = "audit_logs" + LOG_STREAMS = "log_streams" + DOMAIN_VERIFICATION = "domain_verification" + CERTIFICATE_RENEWAL = "certificate_renewal" + BRING_YOUR_OWN_KEY = "bring_your_own_key" + ALL = [SSO, DSYNC, AUDIT_LOGS, LOG_STREAMS, DOMAIN_VERIFICATION, CERTIFICATE_RENEWAL, BRING_YOUR_OWN_KEY].freeze + end + end +end diff --git a/lib/workos/types/intent.rb b/lib/workos/types/intent.rb deleted file mode 100644 index 810e6040..00000000 --- a/lib/workos/types/intent.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - module Types - # The Intent constants are declarations of a fixed set of values for - # intents while generating an Admin Portal link. - module Intent - AUDIT_LOGS = 'audit_logs' - DSYNC = 'dsync' - LOG_STREAMS = 'log_streams' - SSO = 'sso' - - ALL = [AUDIT_LOGS, DSYNC, LOG_STREAMS, SSO].freeze - end - end -end diff --git a/lib/workos/types/invitation_accepted_data_state.rb b/lib/workos/types/invitation_accepted_data_state.rb new file mode 100644 index 00000000..23a31066 --- /dev/null +++ b/lib/workos/types/invitation_accepted_data_state.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class InvitationAcceptedDataState + PENDING = "pending" + ACCEPTED = "accepted" + EXPIRED = "expired" + REVOKED = "revoked" + ALL = [PENDING, ACCEPTED, EXPIRED, REVOKED].freeze + end + end +end diff --git a/lib/workos/types/invitation_created_data_state.rb b/lib/workos/types/invitation_created_data_state.rb new file mode 100644 index 00000000..51a03f2c --- /dev/null +++ b/lib/workos/types/invitation_created_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + InvitationCreatedDataState = InvitationAcceptedDataState + end +end diff --git a/lib/workos/types/invitation_resent_data_state.rb b/lib/workos/types/invitation_resent_data_state.rb new file mode 100644 index 00000000..b55a3484 --- /dev/null +++ b/lib/workos/types/invitation_resent_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + InvitationResentDataState = InvitationAcceptedDataState + end +end diff --git a/lib/workos/types/invitation_revoked_data_state.rb b/lib/workos/types/invitation_revoked_data_state.rb new file mode 100644 index 00000000..df851c52 --- /dev/null +++ b/lib/workos/types/invitation_revoked_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + InvitationRevokedDataState = InvitationAcceptedDataState + end +end diff --git a/lib/workos/types/invitation_state.rb b/lib/workos/types/invitation_state.rb new file mode 100644 index 00000000..f3515097 --- /dev/null +++ b/lib/workos/types/invitation_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + InvitationState = InvitationAcceptedDataState + end +end diff --git a/lib/workos/types/list_struct.rb b/lib/workos/types/list_struct.rb index e03ece66..9f3c772d 100644 --- a/lib/workos/types/list_struct.rb +++ b/lib/workos/types/list_struct.rb @@ -1,15 +1,131 @@ # frozen_string_literal: true +# @oagen-ignore-file — hand-maintained runtime module WorkOS module Types - # ListStruct acts as an interface to expose lists of data and related - # metadata + # Paginated response wrapper with auto-pagination support. + # + # result = @client.organizations.list_organizations(limit: 10) + # result.data # => [WorkOS::Organization, ...] + # result.list_metadata # => { "before" => nil, "after" => "org_..." } + # result.auto_paging_each { |org| puts org.id } class ListStruct - attr_accessor :data, :list_metadata + include Enumerable - def initialize(data:, list_metadata:) - @data = data - @list_metadata = list_metadata + attr_accessor :data, :list_metadata, :fetch_next, :fetch_previous, :filters, :last_response + + def initialize(data:, list_metadata:, fetch_next: nil, fetch_previous: nil, filters: {}) + @data = data || [] + @list_metadata = list_metadata || {} + @fetch_next = fetch_next + @fetch_previous = fetch_previous + @filters = filters + end + + # Build a ListStruct from a raw HTTP response, mapping items through + # an optional model class and wiring cursor-based auto-pagination. + # + # @param response [Net::HTTPResponse] Raw HTTP response with JSON body. + # `model.new` accepts a JSON String or a Hash (see {BaseModel.normalize}). + # @param model [Class, nil] Model class whose `.new` accepts a Hash. + # When nil, items are returned as raw Hashes. + # @param filters [Hash] Filter state forwarded to the next page. + # @param fetch_next [Proc, nil] Proc called to fetch the next page given + # the current page's `after` cursor. + # @param fetch_previous [Proc, nil] Proc called to fetch the previous page + # given the current page's `before` cursor. + # @return [ListStruct] + def self.from_response(response, model: nil, filters: {}, fetch_next: nil, fetch_previous: nil) + parsed = JSON.parse(response.body) + items = parsed["data"] || [] + items = items.map { |item| model.new(item) } if model + result = new( + data: items, + list_metadata: parsed["list_metadata"], + filters: filters, + fetch_next: fetch_next, + fetch_previous: fetch_previous + ) + result.last_response = ApiResponse.new( + http_status: response.code.to_i, + http_headers: response.each_header.to_h, + request_id: response["x-request-id"] + ) + result + end + + # Iterates the current page only. Use `auto_paging_each` to span pages. + # + # @return [Enumerator] + def each(&block) + @data.each(&block) + end + + def has_more? + cursor = @list_metadata.is_a?(Hash) ? (@list_metadata["after"] || @list_metadata[:after]) : nil + !cursor.nil? && !cursor.to_s.empty? + end + + # Fetch the next page when an `after` cursor is present. + # + # @return [ListStruct, nil] + def next_page + cursor = @list_metadata.is_a?(Hash) ? (@list_metadata["after"] || @list_metadata[:after]) : nil + return nil if cursor.nil? || cursor.to_s.empty? + return nil unless @fetch_next + + @fetch_next.call(cursor) + end + + # Fetch the previous page when a `before` cursor is present. + # + # @return [ListStruct, nil] + def previous_page + cursor = @list_metadata.is_a?(Hash) ? (@list_metadata["before"] || @list_metadata[:before]) : nil + return nil if cursor.nil? || cursor.to_s.empty? + return nil unless @fetch_previous + + @fetch_previous.call(cursor) + end + + # Iterate over every item across pages. + # + # Requires a fetch_next proc wired at construction time. The generator + # emits this automatically for list endpoints whose spec includes a + # cursor pagination parameter. + def auto_paging_each + return enum_for(:auto_paging_each) unless block_given? + + page = self + loop do + page.data.each { |item| yield item } + next_page = page.next_page + break if next_page.nil? + break unless next_page.is_a?(ListStruct) + break if next_page.data.nil? || next_page.data.empty? + + page = next_page + end + end + + # Iterate one page at a time across all pages. + # + # result.each_page do |page| + # page.data.each { |item| bulk_insert(item) } + # end + def each_page + return enum_for(:each_page) unless block_given? + + page = self + loop do + yield page + next_page = page.next_page + break if next_page.nil? + break unless next_page.is_a?(ListStruct) + break if next_page.data.nil? || next_page.data.empty? + + page = next_page + end end end end diff --git a/lib/workos/types/organization_created_data_domain_state.rb b/lib/workos/types/organization_created_data_domain_state.rb new file mode 100644 index 00000000..3912e632 --- /dev/null +++ b/lib/workos/types/organization_created_data_domain_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class OrganizationCreatedDataDomainState + FAILED = "failed" + LEGACY_VERIFIED = "legacy_verified" + PENDING = "pending" + UNVERIFIED = "unverified" + VERIFIED = "verified" + ALL = [FAILED, LEGACY_VERIFIED, PENDING, UNVERIFIED, VERIFIED].freeze + end + end +end diff --git a/lib/workos/types/organization_created_data_domain_verification_strategy.rb b/lib/workos/types/organization_created_data_domain_verification_strategy.rb new file mode 100644 index 00000000..f6f7f850 --- /dev/null +++ b/lib/workos/types/organization_created_data_domain_verification_strategy.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class OrganizationCreatedDataDomainVerificationStrategy + DNS = "dns" + MANUAL = "manual" + ALL = [DNS, MANUAL].freeze + end + end +end diff --git a/lib/workos/types/organization_deleted_data_domain_state.rb b/lib/workos/types/organization_deleted_data_domain_state.rb new file mode 100644 index 00000000..67a51231 --- /dev/null +++ b/lib/workos/types/organization_deleted_data_domain_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDeletedDataDomainState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_deleted_data_domain_verification_strategy.rb b/lib/workos/types/organization_deleted_data_domain_verification_strategy.rb new file mode 100644 index 00000000..3ce2fc4a --- /dev/null +++ b/lib/workos/types/organization_deleted_data_domain_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDeletedDataDomainVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_created_data_state.rb b/lib/workos/types/organization_domain_created_data_state.rb new file mode 100644 index 00000000..fad7dae6 --- /dev/null +++ b/lib/workos/types/organization_domain_created_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainCreatedDataState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_created_data_verification_strategy.rb b/lib/workos/types/organization_domain_created_data_verification_strategy.rb new file mode 100644 index 00000000..9d9ff25b --- /dev/null +++ b/lib/workos/types/organization_domain_created_data_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainCreatedDataVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_data_state.rb b/lib/workos/types/organization_domain_data_state.rb new file mode 100644 index 00000000..a790e62b --- /dev/null +++ b/lib/workos/types/organization_domain_data_state.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class OrganizationDomainDataState + PENDING = "pending" + VERIFIED = "verified" + ALL = [PENDING, VERIFIED].freeze + end + end +end diff --git a/lib/workos/types/organization_domain_deleted_data_state.rb b/lib/workos/types/organization_domain_deleted_data_state.rb new file mode 100644 index 00000000..cca3448b --- /dev/null +++ b/lib/workos/types/organization_domain_deleted_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainDeletedDataState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_deleted_data_verification_strategy.rb b/lib/workos/types/organization_domain_deleted_data_verification_strategy.rb new file mode 100644 index 00000000..8c20c5be --- /dev/null +++ b/lib/workos/types/organization_domain_deleted_data_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainDeletedDataVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_stand_alone_state.rb b/lib/workos/types/organization_domain_stand_alone_state.rb new file mode 100644 index 00000000..c3b8fb81 --- /dev/null +++ b/lib/workos/types/organization_domain_stand_alone_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainStandAloneState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_stand_alone_verification_strategy.rb b/lib/workos/types/organization_domain_stand_alone_verification_strategy.rb new file mode 100644 index 00000000..bd05d21b --- /dev/null +++ b/lib/workos/types/organization_domain_stand_alone_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainStandAloneVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_state.rb b/lib/workos/types/organization_domain_state.rb new file mode 100644 index 00000000..62a30702 --- /dev/null +++ b/lib/workos/types/organization_domain_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_updated_data_state.rb b/lib/workos/types/organization_domain_updated_data_state.rb new file mode 100644 index 00000000..8957d295 --- /dev/null +++ b/lib/workos/types/organization_domain_updated_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainUpdatedDataState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_updated_data_verification_strategy.rb b/lib/workos/types/organization_domain_updated_data_verification_strategy.rb new file mode 100644 index 00000000..f19b6545 --- /dev/null +++ b/lib/workos/types/organization_domain_updated_data_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainUpdatedDataVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb b/lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb new file mode 100644 index 00000000..b36fb81d --- /dev/null +++ b/lib/workos/types/organization_domain_verification_failed_data_organization_domain_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainVerificationFailedDataOrganizationDomainState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb b/lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb new file mode 100644 index 00000000..65b22801 --- /dev/null +++ b/lib/workos/types/organization_domain_verification_failed_data_organization_domain_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainVerificationFailedDataOrganizationDomainVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_verification_failed_data_reason.rb b/lib/workos/types/organization_domain_verification_failed_data_reason.rb new file mode 100644 index 00000000..c68a815d --- /dev/null +++ b/lib/workos/types/organization_domain_verification_failed_data_reason.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class OrganizationDomainVerificationFailedDataReason + DOMAIN_VERIFICATION_PERIOD_EXPIRED = "domain_verification_period_expired" + DOMAIN_VERIFIED_BY_OTHER_ORGANIZATION = "domain_verified_by_other_organization" + ALL = [DOMAIN_VERIFICATION_PERIOD_EXPIRED, DOMAIN_VERIFIED_BY_OTHER_ORGANIZATION].freeze + end + end +end diff --git a/lib/workos/types/organization_domain_verification_strategy.rb b/lib/workos/types/organization_domain_verification_strategy.rb new file mode 100644 index 00000000..d50b88f8 --- /dev/null +++ b/lib/workos/types/organization_domain_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_domain_verified_data_state.rb b/lib/workos/types/organization_domain_verified_data_state.rb new file mode 100644 index 00000000..05d12ccc --- /dev/null +++ b/lib/workos/types/organization_domain_verified_data_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainVerifiedDataState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_domain_verified_data_verification_strategy.rb b/lib/workos/types/organization_domain_verified_data_verification_strategy.rb new file mode 100644 index 00000000..79bf9ad5 --- /dev/null +++ b/lib/workos/types/organization_domain_verified_data_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationDomainVerifiedDataVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/organization_membership_created_data_status.rb b/lib/workos/types/organization_membership_created_data_status.rb new file mode 100644 index 00000000..ba9baa58 --- /dev/null +++ b/lib/workos/types/organization_membership_created_data_status.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class OrganizationMembershipCreatedDataStatus + ACTIVE = "active" + INACTIVE = "inactive" + PENDING = "pending" + ALL = [ACTIVE, INACTIVE, PENDING].freeze + end + end +end diff --git a/lib/workos/types/organization_membership_deleted_data_status.rb b/lib/workos/types/organization_membership_deleted_data_status.rb new file mode 100644 index 00000000..1105bede --- /dev/null +++ b/lib/workos/types/organization_membership_deleted_data_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationMembershipDeletedDataStatus = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/organization_membership_status.rb b/lib/workos/types/organization_membership_status.rb new file mode 100644 index 00000000..4fd1d9b0 --- /dev/null +++ b/lib/workos/types/organization_membership_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationMembershipStatus = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/organization_membership_updated_data_status.rb b/lib/workos/types/organization_membership_updated_data_status.rb new file mode 100644 index 00000000..3062a6f2 --- /dev/null +++ b/lib/workos/types/organization_membership_updated_data_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationMembershipUpdatedDataStatus = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/organization_updated_data_domain_state.rb b/lib/workos/types/organization_updated_data_domain_state.rb new file mode 100644 index 00000000..176ba64a --- /dev/null +++ b/lib/workos/types/organization_updated_data_domain_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationUpdatedDataDomainState = OrganizationCreatedDataDomainState + end +end diff --git a/lib/workos/types/organization_updated_data_domain_verification_strategy.rb b/lib/workos/types/organization_updated_data_domain_verification_strategy.rb new file mode 100644 index 00000000..186792b2 --- /dev/null +++ b/lib/workos/types/organization_updated_data_domain_verification_strategy.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + OrganizationUpdatedDataDomainVerificationStrategy = OrganizationCreatedDataDomainVerificationStrategy + end +end diff --git a/lib/workos/types/pagination_order.rb b/lib/workos/types/pagination_order.rb new file mode 100644 index 00000000..b85f0705 --- /dev/null +++ b/lib/workos/types/pagination_order.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class PaginationOrder + NORMAL = "normal" + DESC = "desc" + ASC = "asc" + ALL = [NORMAL, DESC, ASC].freeze + end + end +end diff --git a/lib/workos/types/passwordless_session_struct.rb b/lib/workos/types/passwordless_session_struct.rb deleted file mode 100644 index 7c082cdd..00000000 --- a/lib/workos/types/passwordless_session_struct.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - module Types - # This PasswordlessSessionStruct acts as an interface - # for the Passwordless class - class PasswordlessSessionStruct - attr_accessor :id, :email, :expires_at, :link - - def initialize(id:, email:, expires_at:, link:) - @id = id - @email = email - @expires_at = expires_at - @link = link - end - end - end -end diff --git a/lib/workos/types/profile_connection_type.rb b/lib/workos/types/profile_connection_type.rb new file mode 100644 index 00000000..6886fda4 --- /dev/null +++ b/lib/workos/types/profile_connection_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ProfileConnectionType = ConnectionType + end +end diff --git a/lib/workos/types/provider.rb b/lib/workos/types/provider.rb deleted file mode 100644 index 1c8e4018..00000000 --- a/lib/workos/types/provider.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - module Types - # The Provider constants are declarations of a - # fixed set of values for SSO Providers. - module Provider - GitHub = 'GitHubOAuth' - Google = 'GoogleOAuth' - Microsoft = 'MicrosoftOAuth' - - ALL = [GitHub, Google, Microsoft].freeze - end - end -end diff --git a/lib/workos/types/radar_action.rb b/lib/workos/types/radar_action.rb new file mode 100644 index 00000000..9f3edc38 --- /dev/null +++ b/lib/workos/types/radar_action.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarAction + BLOCK = "block" + ALLOW = "allow" + ALL = [BLOCK, ALLOW].freeze + end + end +end diff --git a/lib/workos/types/radar_standalone_assess_request_action.rb b/lib/workos/types/radar_standalone_assess_request_action.rb new file mode 100644 index 00000000..03a70a54 --- /dev/null +++ b/lib/workos/types/radar_standalone_assess_request_action.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarStandaloneAssessRequestAction + LOGIN = "login" + SIGNUP = "signup" + SIGN_UP = "sign-up" + SIGN_IN = "sign-in" + SIGN_UP_2 = "sign_up" + SIGN_IN_2 = "sign_in" + SIGN_IN_3 = "sign in" + SIGN_UP_3 = "sign up" + ALL = [LOGIN, SIGNUP, SIGN_UP, SIGN_IN, SIGN_UP_2, SIGN_IN_2, SIGN_IN_3, SIGN_UP_3].freeze + end + end +end diff --git a/lib/workos/types/radar_standalone_assess_request_auth_method.rb b/lib/workos/types/radar_standalone_assess_request_auth_method.rb new file mode 100644 index 00000000..c5694a28 --- /dev/null +++ b/lib/workos/types/radar_standalone_assess_request_auth_method.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarStandaloneAssessRequestAuthMethod + PASSWORD = "Password" + PASSKEY = "Passkey" + AUTHENTICATOR = "Authenticator" + SMS_OTP = "SMS_OTP" + EMAIL_OTP = "Email_OTP" + SOCIAL = "Social" + SSO = "SSO" + OTHER = "Other" + ALL = [PASSWORD, PASSKEY, AUTHENTICATOR, SMS_OTP, EMAIL_OTP, SOCIAL, SSO, OTHER].freeze + end + end +end diff --git a/lib/workos/types/radar_standalone_response_blocklist_type.rb b/lib/workos/types/radar_standalone_response_blocklist_type.rb new file mode 100644 index 00000000..4301d9bf --- /dev/null +++ b/lib/workos/types/radar_standalone_response_blocklist_type.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarStandaloneResponseBlocklistType + IP_ADDRESS = "ip_address" + DOMAIN = "domain" + EMAIL = "email" + DEVICE = "device" + USER_AGENT = "user_agent" + DEVICE_FINGERPRINT = "device_fingerprint" + COUNTRY = "country" + ALL = [IP_ADDRESS, DOMAIN, EMAIL, DEVICE, USER_AGENT, DEVICE_FINGERPRINT, COUNTRY].freeze + end + end +end diff --git a/lib/workos/types/radar_standalone_response_control.rb b/lib/workos/types/radar_standalone_response_control.rb new file mode 100644 index 00000000..d4dd7852 --- /dev/null +++ b/lib/workos/types/radar_standalone_response_control.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarStandaloneResponseControl + BOT_DETECTION = "bot_detection" + BRUTE_FORCE_ATTACK = "brute_force_attack" + CREDENTIAL_STUFFING = "credential_stuffing" + DOMAIN_SIGN_UP_RATE_LIMIT = "domain_sign_up_rate_limit" + IP_SIGN_UP_RATE_LIMIT = "ip_sign_up_rate_limit" + IMPOSSIBLE_TRAVEL = "impossible_travel" + REPEAT_SIGN_UP = "repeat_sign_up" + STALE_ACCOUNT = "stale_account" + UNRECOGNIZED_DEVICE = "unrecognized_device" + RESTRICTION = "restriction" + ALL = [BOT_DETECTION, BRUTE_FORCE_ATTACK, CREDENTIAL_STUFFING, DOMAIN_SIGN_UP_RATE_LIMIT, IP_SIGN_UP_RATE_LIMIT, IMPOSSIBLE_TRAVEL, REPEAT_SIGN_UP, STALE_ACCOUNT, UNRECOGNIZED_DEVICE, RESTRICTION].freeze + end + end +end diff --git a/lib/workos/types/radar_standalone_response_verdict.rb b/lib/workos/types/radar_standalone_response_verdict.rb new file mode 100644 index 00000000..a22978e0 --- /dev/null +++ b/lib/workos/types/radar_standalone_response_verdict.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RadarStandaloneResponseVerdict + ALLOW = "allow" + BLOCK = "block" + CHALLENGE = "challenge" + ALL = [ALLOW, BLOCK, CHALLENGE].freeze + end + end +end diff --git a/lib/workos/types/radar_type.rb b/lib/workos/types/radar_type.rb new file mode 100644 index 00000000..7e17d9c6 --- /dev/null +++ b/lib/workos/types/radar_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + RadarType = RadarStandaloneResponseBlocklistType + end +end diff --git a/lib/workos/types/request_options.rb b/lib/workos/types/request_options.rb new file mode 100644 index 00000000..74fb98ea --- /dev/null +++ b/lib/workos/types/request_options.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime + +module WorkOS + module Types + # Documentation-only class describing the per-request override keys + # accepted by every generated service method via the `request_options` + # keyword argument. + # + # @!attribute [r] api_key + # @return [String, nil] Override the client-level API key for this request. + # + # @!attribute [r] timeout + # @return [Integer, nil] Override the HTTP timeout (seconds) for this request. + # + # @!attribute [r] base_url + # @return [String, nil] Override the base URL for this request. + # + # @!attribute [r] max_retries + # @return [Integer, nil] Override the maximum number of retries for this request. + # + # @!attribute [r] idempotency_key + # @return [String, nil] Set a custom Idempotency-Key header for this request. + # + # @!attribute [r] extra_headers + # @return [Hash{String => String}, nil] Additional HTTP headers to send with this request. + class RequestOptions + # This class is never instantiated — it exists solely for YARD + # documentation. Service methods accept a plain Hash. + end + end +end diff --git a/lib/workos/types/resend_user_invite_options_locale.rb b/lib/workos/types/resend_user_invite_options_locale.rb new file mode 100644 index 00000000..b86e2747 --- /dev/null +++ b/lib/workos/types/resend_user_invite_options_locale.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + ResendUserInviteOptionsLocale = CreateUserInviteOptionsLocale + end +end diff --git a/lib/workos/types/role_type.rb b/lib/workos/types/role_type.rb new file mode 100644 index 00000000..c99d137b --- /dev/null +++ b/lib/workos/types/role_type.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class RoleType + ENVIRONMENT_ROLE = "EnvironmentRole" + ORGANIZATION_ROLE = "OrganizationRole" + ALL = [ENVIRONMENT_ROLE, ORGANIZATION_ROLE].freeze + end + end +end diff --git a/lib/workos/types/session_created_data_auth_method.rb b/lib/workos/types/session_created_data_auth_method.rb new file mode 100644 index 00000000..1ab6204c --- /dev/null +++ b/lib/workos/types/session_created_data_auth_method.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class SessionCreatedDataAuthMethod + CROSS_APP_AUTH = "cross_app_auth" + EXTERNAL_AUTH = "external_auth" + IMPERSONATION = "impersonation" + MAGIC_CODE = "magic_code" + MIGRATED_SESSION = "migrated_session" + OAUTH = "oauth" + PASSKEY = "passkey" + PASSWORD = "password" + SSO = "sso" + UNKNOWN = "unknown" + ALL = [CROSS_APP_AUTH, EXTERNAL_AUTH, IMPERSONATION, MAGIC_CODE, MIGRATED_SESSION, OAUTH, PASSKEY, PASSWORD, SSO, UNKNOWN].freeze + end + end +end diff --git a/lib/workos/types/session_created_data_status.rb b/lib/workos/types/session_created_data_status.rb new file mode 100644 index 00000000..61e58218 --- /dev/null +++ b/lib/workos/types/session_created_data_status.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class SessionCreatedDataStatus + ACTIVE = "active" + EXPIRED = "expired" + REVOKED = "revoked" + ALL = [ACTIVE, EXPIRED, REVOKED].freeze + end + end +end diff --git a/lib/workos/types/session_revoked_data_auth_method.rb b/lib/workos/types/session_revoked_data_auth_method.rb new file mode 100644 index 00000000..6834cd86 --- /dev/null +++ b/lib/workos/types/session_revoked_data_auth_method.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + SessionRevokedDataAuthMethod = SessionCreatedDataAuthMethod + end +end diff --git a/lib/workos/types/session_revoked_data_status.rb b/lib/workos/types/session_revoked_data_status.rb new file mode 100644 index 00000000..b9e1d357 --- /dev/null +++ b/lib/workos/types/session_revoked_data_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + SessionRevokedDataStatus = SessionCreatedDataStatus + end +end diff --git a/lib/workos/types/sso_provider.rb b/lib/workos/types/sso_provider.rb new file mode 100644 index 00000000..46c71f8f --- /dev/null +++ b/lib/workos/types/sso_provider.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class SSOProvider + APPLE_OAUTH = "AppleOAuth" + BITBUCKET_OAUTH = "BitbucketOAuth" + GIT_HUB_OAUTH = "GitHubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + INTUIT_OAUTH = "IntuitOAuth" + LINKED_IN_OAUTH = "LinkedInOAuth" + MICROSOFT_OAUTH = "MicrosoftOAuth" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + XERO_OAUTH = "XeroOAuth" + ALL = [APPLE_OAUTH, BITBUCKET_OAUTH, GIT_HUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, INTUIT_OAUTH, LINKED_IN_OAUTH, MICROSOFT_OAUTH, SALESFORCE_OAUTH, SLACK_OAUTH, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/update_user_password_hash_type.rb b/lib/workos/types/update_user_password_hash_type.rb new file mode 100644 index 00000000..da79c65a --- /dev/null +++ b/lib/workos/types/update_user_password_hash_type.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UpdateUserPasswordHashType = CreateUserPasswordHashType + end +end diff --git a/lib/workos/types/update_webhook_endpoint_events.rb b/lib/workos/types/update_webhook_endpoint_events.rb new file mode 100644 index 00000000..37996b4e --- /dev/null +++ b/lib/workos/types/update_webhook_endpoint_events.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UpdateWebhookEndpointEvents = CreateWebhookEndpointEvents + end +end diff --git a/lib/workos/types/update_webhook_endpoint_status.rb b/lib/workos/types/update_webhook_endpoint_status.rb new file mode 100644 index 00000000..d56593e1 --- /dev/null +++ b/lib/workos/types/update_webhook_endpoint_status.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class UpdateWebhookEndpointStatus + ENABLED = "enabled" + DISABLED = "disabled" + ALL = [ENABLED, DISABLED].freeze + end + end +end diff --git a/lib/workos/types/user_identities_get_item_provider.rb b/lib/workos/types/user_identities_get_item_provider.rb new file mode 100644 index 00000000..bfdedd34 --- /dev/null +++ b/lib/workos/types/user_identities_get_item_provider.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class UserIdentitiesGetItemProvider + APPLE_OAUTH = "AppleOAuth" + BITBUCKET_OAUTH = "BitbucketOAuth" + DISCORD_OAUTH = "DiscordOAuth" + GITHUB_OAUTH = "GithubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + INTUIT_OAUTH = "IntuitOAuth" + LINKED_IN_OAUTH = "LinkedInOAuth" + MICROSOFT_OAUTH = "MicrosoftOAuth" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + XERO_OAUTH = "XeroOAuth" + ALL = [APPLE_OAUTH, BITBUCKET_OAUTH, DISCORD_OAUTH, GITHUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, INTUIT_OAUTH, LINKED_IN_OAUTH, MICROSOFT_OAUTH, SALESFORCE_OAUTH, SLACK_OAUTH, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/user_invite_state.rb b/lib/workos/types/user_invite_state.rb new file mode 100644 index 00000000..fce1c6c5 --- /dev/null +++ b/lib/workos/types/user_invite_state.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserInviteState = InvitationAcceptedDataState + end +end diff --git a/lib/workos/types/user_management_authentication_provider.rb b/lib/workos/types/user_management_authentication_provider.rb new file mode 100644 index 00000000..f9d31423 --- /dev/null +++ b/lib/workos/types/user_management_authentication_provider.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class UserManagementAuthenticationProvider + AUTHKIT = "authkit" + APPLE_OAUTH = "AppleOAuth" + BITBUCKET_OAUTH = "BitbucketOAuth" + GIT_HUB_OAUTH = "GitHubOAuth" + GIT_LAB_OAUTH = "GitLabOAuth" + GOOGLE_OAUTH = "GoogleOAuth" + INTUIT_OAUTH = "IntuitOAuth" + LINKED_IN_OAUTH = "LinkedInOAuth" + MICROSOFT_OAUTH = "MicrosoftOAuth" + SALESFORCE_OAUTH = "SalesforceOAuth" + SLACK_OAUTH = "SlackOAuth" + VERCEL_MARKETPLACE_OAUTH = "VercelMarketplaceOAuth" + VERCEL_OAUTH = "VercelOAuth" + XERO_OAUTH = "XeroOAuth" + ALL = [AUTHKIT, APPLE_OAUTH, BITBUCKET_OAUTH, GIT_HUB_OAUTH, GIT_LAB_OAUTH, GOOGLE_OAUTH, INTUIT_OAUTH, LINKED_IN_OAUTH, MICROSOFT_OAUTH, SALESFORCE_OAUTH, SLACK_OAUTH, VERCEL_MARKETPLACE_OAUTH, VERCEL_OAUTH, XERO_OAUTH].freeze + end + end +end diff --git a/lib/workos/types/user_management_authentication_screen_hint.rb b/lib/workos/types/user_management_authentication_screen_hint.rb new file mode 100644 index 00000000..b5c2cf5b --- /dev/null +++ b/lib/workos/types/user_management_authentication_screen_hint.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class UserManagementAuthenticationScreenHint + SIGN_UP = "sign-up" + SIGN_IN = "sign-in" + ALL = [SIGN_UP, SIGN_IN].freeze + end + end +end diff --git a/lib/workos/types/user_management_organization_membership_statuses.rb b/lib/workos/types/user_management_organization_membership_statuses.rb new file mode 100644 index 00000000..810af00a --- /dev/null +++ b/lib/workos/types/user_management_organization_membership_statuses.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserManagementOrganizationMembershipStatuses = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/user_organization_membership_base_list_data_status.rb b/lib/workos/types/user_organization_membership_base_list_data_status.rb new file mode 100644 index 00000000..4204b56c --- /dev/null +++ b/lib/workos/types/user_organization_membership_base_list_data_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserOrganizationMembershipBaseListDataStatus = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/user_organization_membership_status.rb b/lib/workos/types/user_organization_membership_status.rb new file mode 100644 index 00000000..4fa9faee --- /dev/null +++ b/lib/workos/types/user_organization_membership_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserOrganizationMembershipStatus = OrganizationMembershipCreatedDataStatus + end +end diff --git a/lib/workos/types/user_sessions_auth_method.rb b/lib/workos/types/user_sessions_auth_method.rb new file mode 100644 index 00000000..80e749d7 --- /dev/null +++ b/lib/workos/types/user_sessions_auth_method.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserSessionsAuthMethod = SessionCreatedDataAuthMethod + end +end diff --git a/lib/workos/types/user_sessions_status.rb b/lib/workos/types/user_sessions_status.rb new file mode 100644 index 00000000..0d7e0642 --- /dev/null +++ b/lib/workos/types/user_sessions_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + UserSessionsStatus = SessionCreatedDataStatus + end +end diff --git a/lib/workos/types/vault_byok_key_provider.rb b/lib/workos/types/vault_byok_key_provider.rb new file mode 100644 index 00000000..7061c81f --- /dev/null +++ b/lib/workos/types/vault_byok_key_provider.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class VaultByokKeyProvider + AWS_KMS = "AWS_KMS" + GCP_KMS = "GCP_KMS" + AZURE_KEY_VAULT = "AZURE_KEY_VAULT" + ALL = [AWS_KMS, GCP_KMS, AZURE_KEY_VAULT].freeze + end + end +end diff --git a/lib/workos/types/vault_data_created_data_actor_source.rb b/lib/workos/types/vault_data_created_data_actor_source.rb new file mode 100644 index 00000000..000aebb9 --- /dev/null +++ b/lib/workos/types/vault_data_created_data_actor_source.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class VaultDataCreatedDataActorSource + API = "api" + DASHBOARD = "dashboard" + ALL = [API, DASHBOARD].freeze + end + end +end diff --git a/lib/workos/types/vault_data_deleted_data_actor_source.rb b/lib/workos/types/vault_data_deleted_data_actor_source.rb new file mode 100644 index 00000000..9c51bcbc --- /dev/null +++ b/lib/workos/types/vault_data_deleted_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultDataDeletedDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_data_read_data_actor_source.rb b/lib/workos/types/vault_data_read_data_actor_source.rb new file mode 100644 index 00000000..af5db407 --- /dev/null +++ b/lib/workos/types/vault_data_read_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultDataReadDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_data_updated_data_actor_source.rb b/lib/workos/types/vault_data_updated_data_actor_source.rb new file mode 100644 index 00000000..085a659f --- /dev/null +++ b/lib/workos/types/vault_data_updated_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultDataUpdatedDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_dek_decrypted_data_actor_source.rb b/lib/workos/types/vault_dek_decrypted_data_actor_source.rb new file mode 100644 index 00000000..be978084 --- /dev/null +++ b/lib/workos/types/vault_dek_decrypted_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultDekDecryptedDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_dek_read_data_actor_source.rb b/lib/workos/types/vault_dek_read_data_actor_source.rb new file mode 100644 index 00000000..80c10a36 --- /dev/null +++ b/lib/workos/types/vault_dek_read_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultDekReadDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_kek_created_data_actor_source.rb b/lib/workos/types/vault_kek_created_data_actor_source.rb new file mode 100644 index 00000000..cd1f6981 --- /dev/null +++ b/lib/workos/types/vault_kek_created_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultKekCreatedDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_metadata_read_data_actor_source.rb b/lib/workos/types/vault_metadata_read_data_actor_source.rb new file mode 100644 index 00000000..51568292 --- /dev/null +++ b/lib/workos/types/vault_metadata_read_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultMetadataReadDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/vault_names_listed_data_actor_source.rb b/lib/workos/types/vault_names_listed_data_actor_source.rb new file mode 100644 index 00000000..9d4e6a27 --- /dev/null +++ b/lib/workos/types/vault_names_listed_data_actor_source.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + VaultNamesListedDataActorSource = VaultDataCreatedDataActorSource + end +end diff --git a/lib/workos/types/waitlist_user_state.rb b/lib/workos/types/waitlist_user_state.rb new file mode 100644 index 00000000..ac6e2501 --- /dev/null +++ b/lib/workos/types/waitlist_user_state.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class WaitlistUserState + PENDING = "pending" + APPROVED = "approved" + DENIED = "denied" + ALL = [PENDING, APPROVED, DENIED].freeze + end + end +end diff --git a/lib/workos/types/webhook_endpoint_json_status.rb b/lib/workos/types/webhook_endpoint_json_status.rb new file mode 100644 index 00000000..1403fbee --- /dev/null +++ b/lib/workos/types/webhook_endpoint_json_status.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + WebhookEndpointJsonStatus = UpdateWebhookEndpointStatus + end +end diff --git a/lib/workos/types/webhook_endpoint_status.rb b/lib/workos/types/webhook_endpoint_status.rb new file mode 100644 index 00000000..d44d79c0 --- /dev/null +++ b/lib/workos/types/webhook_endpoint_status.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class WebhookEndpointStatus + ENABLED = "enabled" + DISABLED = "disabled" + ALL = [ENABLED, DISABLED].freeze + end + end +end diff --git a/lib/workos/types/widget_session_token_scopes.rb b/lib/workos/types/widget_session_token_scopes.rb new file mode 100644 index 00000000..996131d8 --- /dev/null +++ b/lib/workos/types/widget_session_token_scopes.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class WidgetSessionTokenScopes + WIDGETS_USERS_TABLE_MANAGE = "widgets:users-table:manage" + WIDGETS_DOMAIN_VERIFICATION_MANAGE = "widgets:domain-verification:manage" + WIDGETS_SSO_MANAGE = "widgets:sso:manage" + WIDGETS_API_KEYS_MANAGE = "widgets:api-keys:manage" + WIDGETS_DSYNC_MANAGE = "widgets:dsync:manage" + WIDGETS_AUDIT_LOG_STREAMING_MANAGE = "widgets:audit-log-streaming:manage" + ALL = [WIDGETS_USERS_TABLE_MANAGE, WIDGETS_DOMAIN_VERIFICATION_MANAGE, WIDGETS_SSO_MANAGE, WIDGETS_API_KEYS_MANAGE, WIDGETS_DSYNC_MANAGE, WIDGETS_AUDIT_LOG_STREAMING_MANAGE].freeze + end + end +end diff --git a/lib/workos/user.rb b/lib/workos/user.rb deleted file mode 100644 index 28f11504..00000000 --- a/lib/workos/user.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The User class provides a lightweight wrapper around a WorkOS User - # resource. This class is not meant to be instantiated in a user space, - # and is instantiated internally but exposed. - class User - include HashProvider - - attr_accessor :id, :email, :first_name, :last_name, :email_verified, - :profile_picture_url, :created_at, :updated_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @email = hash[:email] - @first_name = hash[:first_name] - @last_name = hash[:last_name] - @email_verified = hash[:email_verified] - @profile_picture_url = hash[:profile_picture_url] - @created_at = hash[:created_at] - @updated_at = hash[:updated_at] - end - - def to_json(*) - { - id: id, - email: email, - first_name: first_name, - last_name: last_name, - email_verified: email_verified, - profile_picture_url: profile_picture_url, - created_at: created_at, - updated_at: updated_at, - } - end - end -end diff --git a/lib/workos/user_and_token.rb b/lib/workos/user_and_token.rb deleted file mode 100644 index 75a20aa9..00000000 --- a/lib/workos/user_and_token.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The UserAndToken class represents a User and a corresponding Token. This - # class is not meant to be instantiated in user space, and is instantiated - # internally but exposed. - class UserAndToken - include HashProvider - - attr_accessor :token, :user - - def initialize(user_and_token_json) - json = JSON.parse(user_and_token_json, symbolize_names: true) - - @token = json[:token] - @user = WorkOS::User.new(json[:user].to_json) - end - - def to_json(*) - { - token: token, - user: user.to_json, - } - end - end -end diff --git a/lib/workos/user_management.rb b/lib/workos/user_management.rb index 53472c2b..d6a7e012 100644 --- a/lib/workos/user_management.rb +++ b/lib/workos/user_management.rb @@ -1,903 +1,1715 @@ # frozen_string_literal: true -require 'net/http' -require 'uri' +# This file is auto-generated by oagen. Do not edit. -module WorkOS - # The UserManagement module provides convenience methods for working with the - # WorkOS User platform. You'll need a valid API key. - - # rubocop:disable Metrics/ModuleLength - module UserManagement - module Types - # The ProviderEnum is a declaration of a - # fixed set of values for User Management Providers. - class Provider - GitHub = 'GitHubOAuth' - Google = 'GoogleOAuth' - Microsoft = 'MicrosoftOAuth' - AuthKit = 'authkit' - - ALL = [GitHub, Google, Microsoft, AuthKit].freeze - end +require "json" - # The AuthFactorType is a declaration of a - # fixed set of factor values to enroll - class AuthFactorType - Totp = 'totp' - - ALL = [Totp].freeze - end +module WorkOS + class UserManagement + # Identifies the password (plaintext variant). + # + # @!attribute [r] password + # @return [String] + PasswordPlaintext = Data.define(:password) + + # Identifies the password (hashed variant). + # + # @!attribute [r] password_hash + # @return [String] + # @!attribute [r] password_hash_type + # @return [WorkOS::Types::CreateUserPasswordHashType] + PasswordHashed = Data.define(:password_hash, :password_hash_type) + + # Identifies the role (single variant). + # + # @!attribute [r] role_slug + # @return [String] + RoleSingle = Data.define(:role_slug) + + # Identifies the role (multiple variant). + # + # @!attribute [r] role_slugs + # @return [Array] + RoleMultiple = Data.define(:role_slugs) + + def initialize(client) + @client = client end - class << self - include Client - - PROVIDERS = WorkOS::UserManagement::Types::Provider::ALL - AUTH_FACTOR_TYPES = WorkOS::UserManagement::Types::AuthFactorType::ALL - - # Generate an OAuth 2.0 authorization URL that automatically directs a user - # to their Identity Provider. - # - # @param [String] redirect_uri The URI where users are directed - # after completing the authentication step. Must match a - # configured redirect URI on your WorkOS dashboard. - # @param [String] client_id This value can be obtained from the API Keys page in the WorkOS dashboard. - # @param [String] provider A provider name is used to initiate SSO using an - # OAuth-compatible provider. Only 'authkit ,'GoogleOAuth' and 'MicrosoftOAuth' are supported. - # @param [String] connection_id The ID for a Connection configured on - # WorkOS. - # @param [String] organization_id The organization_id selector is used to - # initiate SSO for an Organization. - # @param [String] state An arbitrary state object - # that is preserved and available to the client in the response. - # @param [String] login_hint Can be used to pre-fill the username/email address - # field of the IdP sign-in page for the user, if you know their username ahead of time. - # @param [String] domain_hint Can be used to pre-fill the domain field when - # initiating authentication with Microsoft OAuth, or with a GoogleSAML connection type. - # @example - # WorkOS::UserManagement.authorization_url( - # connection_id: 'conn_123', - # client_id: 'project_01DG5TGK363GRVXP3ZS40WNGEZ', - # redirect_uri: 'https://your-app.com/callback', - # state: { - # next_page: '/docs' - # }.to_s - # ) - # - # => "https://api.workos.com/user_management/authorize?connection_id=conn_123" \ - # "&client_id=project_01DG5TGK363GRVXP3ZS40WNGEZ" \ - # "&redirect_uri=https%3A%2F%2Fyour-app.com%2Fcallback&" \ - # "response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdocs%22%7D" - # - # @return [String] - # rubocop:disable Metrics/ParameterLists - def authorization_url( - redirect_uri:, - client_id: nil, - domain_hint: nil, - login_hint: nil, - provider: nil, - connection_id: nil, - organization_id: nil, - state: '' - ) - - validate_authorization_url_arguments( - provider: provider, - connection_id: connection_id, - organization_id: organization_id, - ) - - query = URI.encode_www_form({ - client_id: client_id, - redirect_uri: redirect_uri, - response_type: 'code', - state: state, - domain_hint: domain_hint, - login_hint: login_hint, - provider: provider, - connection_id: connection_id, - organization_id: organization_id, - }.compact) - - "https://#{WorkOS.config.api_hostname}/user_management/authorize?#{query}" - end - # rubocop:enable Metrics/ParameterLists - - # Get a User - # - # @param [String] id The unique ID of the User. - # - # @return WorkOS::User - def get_user(id:) - response = execute_request( - request: get_request( - path: "/user_management/users/#{id}", - auth: true, - ), - ) - - WorkOS::User.new(response.body) - end - - # Retrieve a list of users. - # - # @param [Hash] options - # @option options [String] email Filter Users by their email. - # @option options [String] organization_id Filter Users by the organization they are members of. - # @option options [String] limit Maximum number of records to return. - # @option options [String] order The order in which to paginate records - # @option options [String] before Pagination cursor to receive records - # before a provided User ID. - # @option options [String] after Pagination cursor to receive records - # before a provided User ID. - # - # @return [WorkOS::User] - def list_users(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/user_management/users', - auth: true, - params: options, - ), - ) - - parsed_response = JSON.parse(response.body) - - users = parsed_response['data'].map do |user| - ::WorkOS::User.new(user.to_json) - end - - WorkOS::Types::ListStruct.new( - data: users, - list_metadata: parsed_response['list_metadata'], - ) - end - - # Create a user - # - # @param [String] email The email address of the user. - # @param [String] password The password to set for the user. - # @param [String] first_name The user's first name. - # @param [String] last_name The user's last name. - # @param [Boolean] email_verified Whether the user's email address was previously verified. - # @param [String] password_hash The user's hashed password. - # @option [String] password_hash_type The algorithm originally used to hash the password. - # - # @return [WorkOS::User] - # rubocop:disable Metrics/ParameterLists - def create_user( - email:, - password: nil, - first_name: nil, - last_name: nil, - email_verified: nil, - password_hash: nil, - password_hash_type: nil - ) - request = post_request( - path: '/user_management/users', - body: { - email: email, - password: password, - first_name: first_name, - last_name: last_name, - email_verified: email_verified, - password_hash: password_hash, - password_hash_type: password_hash_type, - }, - auth: true, - ) - - response = execute_request(request: request) - - WorkOS::User.new(response.body) - end - - # Update a user - # - # @param [String] id of the user. - # @param [String] first_name The user's first name. - # @param [String] last_name The user's last name. - # @param [Boolean] email_verified Whether the user's email address was previously verified. - # @param [String] password The user's password. - # @param [String] password_hash The user's hashed password. - # @option [String] password_hash_type The algorithm originally used to hash the password. - # Valid values are bcrypt. - # - # @return [WorkOS::User] - def update_user( - id:, - first_name: nil, - last_name: nil, - email_verified: nil, - password: nil, - password_hash: nil, - password_hash_type: nil - ) - request = put_request( - path: "/user_management/users/#{id}", - body: { - first_name: first_name, - last_name: last_name, - email_verified: email_verified, - password: password, - password_hash: password_hash, - password_hash_type: password_hash_type, - }, - auth: true, - ) - - response = execute_request(request: request) - - WorkOS::User.new(response.body) - end - # rubocop:enable Metrics/ParameterLists - - # Delete a User - # - # @param [String] id The unique ID of the User. - # - # @return [Bool] - returns `true` if successful - def delete_user(id:) - response = execute_request( - request: delete_request( - path: "/user_management/users/#{id}", - auth: true, - ), - ) + # Get JWKS + # @param client_id [String] Identifies the application making the request to the WorkOS server. You can obtain your client ID from the [API Keys](https://dashboard.workos.com/api-keys) page in the dashboard. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::JwksResponse] + def get_jwks( + client_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/sso/jwks/#{WorkOS::Util.encode_path(client_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::JwksResponse.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 - response.is_a? Net::HTTPSuccess - end + # Authenticate + # @param client_id [String] The client ID of the application. + # @param client_secret [String, nil] The client secret of the application. + # @param grant_type [String] + # @param code [String, nil] The authorization code received from the redirect. + # @param code_verifier [String, nil] The PKCE code verifier used to derive the code challenge passed to the authorization URL. + # @param invitation_token [String, nil] An invitation token to accept during authentication. + # @param ip_address [String, nil] The IP address of the user's request. + # @param device_id [String, nil] A unique identifier for the device. + # @param user_agent [String, nil] The user agent string from the user's browser. + # @param email [String, nil] The user's email address. + # @param password [String, nil] The user's password. + # @param refresh_token [String, nil] The refresh token to exchange for new tokens. + # @param organization_id [String, nil] The ID of the organization to scope the session to. + # @param pending_authentication_token [String, nil] The pending authentication token from a previous authentication attempt. + # @param authentication_challenge_id [String, nil] The ID of the MFA authentication challenge. + # @param device_code [String, nil] The device verification code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::AuthenticateResponse] + def create_authenticate( + client_id:, + grant_type:, + client_secret: nil, + code: nil, + code_verifier: nil, + invitation_token: nil, + ip_address: nil, + device_id: nil, + user_agent: nil, + email: nil, + password: nil, + refresh_token: nil, + organization_id: nil, + pending_authentication_token: nil, + authentication_challenge_id: nil, + device_code: nil, + request_options: {} + ) + body = { + "client_id" => client_id, + "client_secret" => client_secret, + "grant_type" => grant_type, + "code" => code, + "code_verifier" => code_verifier, + "invitation_token" => invitation_token, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent, + "email" => email, + "password" => password, + "refresh_token" => refresh_token, + "organization_id" => organization_id, + "pending_authentication_token" => pending_authentication_token, + "authentication_challenge_id" => authentication_challenge_id, + "device_code" => device_code + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::AuthenticateResponse.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 - # Authenticates user by email and password. - # - # @param [String] email The email address of the user. - # @param [String] password The password for the user. - # @param [String] client_id The WorkOS client ID for the environment - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_password(email:, password:, client_id:, ip_address: nil, user_agent: nil) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - client_id: client_id, - client_secret: WorkOS.config.key!, - email: email, - password: password, - ip_address: ip_address, - user_agent: user_agent, - grant_type: 'password', - }, - ), - ) + # Authenticate with password. + # @param email [String] + # @param password [String] + # @param invitation_token [String, nil] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_password( + email:, + password:, + invitation_token: nil, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "password", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "email" => email, + "password" => password, + "invitation_token" => invitation_token, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - WorkOS::AuthenticationResponse.new(response.body) - end + # Authenticate with code. + # @param code [String] + # @param code_verifier [String, nil] + # @param invitation_token [String, nil] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_code( + code:, + code_verifier: nil, + invitation_token: nil, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "authorization_code", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "code" => code, + "code_verifier" => code_verifier, + "invitation_token" => invitation_token, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - # Authenticate a user using OAuth or an organization's SSO connection. - # - # @param [String] code The authorization value which was passed back as a - # query parameter in the callback to the Redirect URI. - # @param [String] client_id The WorkOS client ID for the environment - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_code( - code:, - client_id:, - ip_address: nil, - user_agent: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - code: code, - client_id: client_id, - client_secret: WorkOS.config.key!, - ip_address: ip_address, - user_agent: user_agent, - grant_type: 'authorization_code', - }, - ), - ) + # Authenticate with refresh token. + # @param refresh_token [String] + # @param organization_id [String, nil] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_refresh_token( + refresh_token:, + organization_id: nil, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "refresh_token", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "refresh_token" => refresh_token, + "organization_id" => organization_id, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - WorkOS::AuthenticationResponse.new(response.body) - end + # Authenticate with magic auth. + # @param code [String] + # @param email [String] + # @param invitation_token [String, nil] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_magic_auth( + code:, + email:, + invitation_token: nil, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "urn:workos:oauth:grant-type:magic-auth:code", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "code" => code, + "email" => email, + "invitation_token" => invitation_token, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - # Authenticate a user using a refresh token. - # - # @param [String] refresh_token The refresh token previously obtained from a successful authentication call - # @param [String] client_id The WorkOS client ID for the environment - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::RefreshAuthenticationResponse - def authenticate_with_refresh_token( - refresh_token:, - client_id:, - ip_address: nil, - user_agent: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - refresh_token: refresh_token, - client_id: client_id, - client_secret: WorkOS.config.key!, - ip_address: ip_address, - user_agent: user_agent, - grant_type: 'refresh_token', - }, - ), - ) + # Authenticate with email verification. + # @param code [String] + # @param pending_authentication_token [String] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_email_verification( + code:, + pending_authentication_token:, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "urn:workos:oauth:grant-type:email-verification:code", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "code" => code, + "pending_authentication_token" => pending_authentication_token, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - WorkOS::RefreshAuthenticationResponse.new(response.body) - end + # Authenticate with totp. + # @param code [String] + # @param pending_authentication_token [String] + # @param authentication_challenge_id [String] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_totp( + code:, + pending_authentication_token:, + authentication_challenge_id:, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "urn:workos:oauth:grant-type:mfa-totp", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "code" => code, + "pending_authentication_token" => pending_authentication_token, + "authentication_challenge_id" => authentication_challenge_id, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - # Authenticate user by Magic Auth Code. - # - # @param [String] code The one-time code that was emailed to the user. - # @param [String] email The email address of the user. - # @param [String] client_id The WorkOS client ID for the environment. - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] link_authorization_code Used to link an OAuth profile to an existing user, - # after having completed a Magic Code challenge. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_magic_auth( - code:, - email:, - client_id:, - ip_address: nil, - user_agent: nil, - link_authorization_code: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - code: code, - email: email, - client_id: client_id, - client_secret: WorkOS.config.key!, - ip_address: ip_address, - user_agent: user_agent, - grant_type: 'urn:workos:oauth:grant-type:magic-auth:code', - link_authorization_code: link_authorization_code, - }, - ), - ) + # Authenticate with organization selection. + # @param pending_authentication_token [String] + # @param organization_id [String] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_organization_selection( + pending_authentication_token:, + organization_id:, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "urn:workos:oauth:grant-type:organization-selection", + "client_id" => @client.client_id, + "client_secret" => @client.api_key, + "pending_authentication_token" => pending_authentication_token, + "organization_id" => organization_id, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - WorkOS::AuthenticationResponse.new(response.body) - end + # Authenticate with device code. + # @param device_code [String] + # @param ip_address [String, nil] + # @param device_id [String, nil] + # @param user_agent [String, nil] + # @param request_options [Hash] Per-request overrides. + # @return [WorkOS::AuthenticateResponse] + def authenticate_with_device_code( + device_code:, + ip_address: nil, + device_id: nil, + user_agent: nil, + request_options: {} + ) + body = { + "grant_type" => "urn:ietf:params:oauth:grant-type:device_code", + "client_id" => @client.client_id, + "device_code" => device_code, + "ip_address" => ip_address, + "device_id" => device_id, + "user_agent" => user_agent + }.compact + response = @client.request( + method: :post, + path: "/user_management/authenticate", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::AuthenticateResponse.new(response.body) + end - # Authenticate a user into an organization they are a member of. - # - # @param [String] client_id The WorkOS client ID for the environment. - # @param [String] organization_id The organization ID the user selected to sign in to. - # @param [String] pending_authentication_token The pending authentication token - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_organization_selection( - client_id:, - organization_id:, - pending_authentication_token:, - ip_address: nil, - user_agent: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - client_id: client_id, - client_secret: WorkOS.config.key!, - ip_address: ip_address, - user_agent: user_agent, - grant_type: 'urn:workos:oauth:grant-type:organization-selection', - organization_id: organization_id, - pending_authentication_token: pending_authentication_token, - }, - ), - ) + # Get device authorization URL + # @param client_id [String] The WorkOS client ID for your application. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DeviceAuthorizationResponse] + def create_device( + client_id:, + request_options: {} + ) + body = { + "client_id" => client_id + } + response = @client.request( + method: :post, + path: "/user_management/authorize/device", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::DeviceAuthorizationResponse.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 - WorkOS::AuthenticationResponse.new(response.body) - end + # Revoke Session + # @param session_id [String] The ID of the session to revoke. This can be extracted from the `sid` claim of the access token. + # @param return_to [String, nil] The URL to redirect the user to after session revocation. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def revoke_session( + session_id:, + return_to: nil, + request_options: {} + ) + body = { + "session_id" => session_id, + "return_to" => return_to + }.compact + @client.request( + method: :post, + path: "/user_management/sessions/revoke", + auth: true, + body: body, + request_options: request_options + ) + nil + end - # Authenticate a user using TOTP. - # - # @param [String] code The one-time code that was emailed to the user. - # @param [String] client_id The WorkOS client ID for the environment - # @param [String] pending_authentication_token The pending authentication token - # from the initial authentication request. - # @param [String] authentication_challenge_id The authentication challenge ID for the - # authentication request. - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_totp( - code:, - client_id:, - pending_authentication_token:, - authentication_challenge_id:, - ip_address: nil, - user_agent: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - code: code, - client_id: client_id, - client_secret: WorkOS.config.key!, - pending_authentication_token: pending_authentication_token, - grant_type: 'urn:workos:oauth:grant-type:mfa-totp', - authentication_challenge_id: authentication_challenge_id, - ip_address: ip_address, - user_agent: user_agent, - }, - ), - ) + # Create a CORS origin + # @param origin [String] The origin URL to allow for CORS requests. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::CORSOriginResponse] + def create_cors_origin( + origin:, + request_options: {} + ) + body = { + "origin" => origin + } + response = @client.request( + method: :post, + path: "/user_management/cors_origins", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::CORSOriginResponse.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 - WorkOS::AuthenticationResponse.new(response.body) - end + # Get an email verification code + # @param id [String] The ID of the email verification code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::EmailVerification] + def get_email_verification( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/email_verification/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::EmailVerification.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 - # Authenticate a user using Email Verification Code. - # - # @param [String] code The one-time code that was emailed to the user. - # @param [String] client_id The WorkOS client ID for the environment - # @param [String] pending_authentication_token The token returned from a failed email/password or OAuth - # authentication attempt due to an unverified email address. - # @param [String] ip_address The IP address of the request from the user who is attempting to authenticate. - # @param [String] user_agent The user agent of the request from the user who is attempting to authenticate. - # - # @return WorkOS::AuthenticationResponse - def authenticate_with_email_verification( - code:, - client_id:, - pending_authentication_token:, - ip_address: nil, - user_agent: nil - ) - response = execute_request( - request: post_request( - path: '/user_management/authenticate', - body: { - code: code, - client_id: client_id, - pending_authentication_token: pending_authentication_token, - client_secret: WorkOS.config.key!, - grant_type: 'urn:workos:oauth:grant-type:email-verification:code', - ip_address: ip_address, - user_agent: user_agent, - }, - ), - ) + # Create a password reset token + # @param email [String] The email address of the user requesting a password reset. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::PasswordReset] + def reset_password( + email:, + request_options: {} + ) + body = { + "email" => email + } + response = @client.request( + method: :post, + path: "/user_management/password_reset", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::PasswordReset.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 - WorkOS::AuthenticationResponse.new(response.body) - end + # Reset the password + # @param token [String] The password reset token. + # @param new_password [String] The new password to set for the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ResetPasswordResponse] + def confirm_password_reset( + token:, + new_password:, + request_options: {} + ) + body = { + "token" => token, + "new_password" => new_password + } + response = @client.request( + method: :post, + path: "/user_management/password_reset/confirm", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ResetPasswordResponse.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 - # Get the logout URL for a session - # - # The user's browser should be navigated to this URL - # - # @param [String] session_id The session ID can be found in the `sid` - # claim of the access token - # - # @return String - def get_logout_url(session_id:) - URI::HTTPS.build( - host: WorkOS.config.api_hostname, - path: '/user_management/sessions/logout', - query: "session_id=#{session_id}", - ).to_s - end + # Get a password reset token + # @param id [String] The ID of the password reset token. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::PasswordReset] + def get_password_reset( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/password_reset/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::PasswordReset.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 - # Revokes a session - # - # @param [String] session_id The session ID can be found in the `sid` - # claim of the access token - def revoke_session(session_id:) - response = execute_request( - request: post_request( - path: '/user_management/sessions/revoke', - body: { - session_id: session_id, - }, - auth: true, - ), + # List users + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param organization [String, nil] (deprecated) Filter users by the organization they are a member of. Deprecated in favor of `organization_id`. + # @param organization_id [String, nil] Filter users by the organization they are a member of. + # @param email [String, nil] Filter users by their email address. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_users( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization: nil, + organization_id: nil, + email: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization" => organization, + "organization_id" => organization_id, + "email" => email + }.compact + response = @client.request( + method: :get, + path: "/user_management/users", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_users( + before: before, + after: cursor, + limit: limit, + order: order, + organization: organization, + organization_id: organization_id, + email: email, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::User, + filters: {before: before, limit: limit, order: order, organization: organization, organization_id: organization_id, email: email}, + fetch_next: fetch_next + ) + end - response.is_a? Net::HTTPSuccess + # Create a user + # @param email [String] The email address of the user. + # @param first_name [String, nil] The first name of the user. + # @param last_name [String, nil] The last name of the user. + # @param email_verified [Boolean, nil] Whether the user's email has been verified. + # @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user. + # @param external_id [String, nil] The external ID of the user. + # @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::User] + def create_user( + email:, + first_name: nil, + last_name: nil, + email_verified: nil, + metadata: nil, + external_id: nil, + password: nil, + request_options: {} + ) + body = { + "email" => email, + "first_name" => first_name, + "last_name" => last_name, + "email_verified" => email_verified, + "metadata" => metadata, + "external_id" => external_id + }.compact + if password + case password + when WorkOS::UserManagement::PasswordPlaintext + body["password"] = password.password + when WorkOS::UserManagement::PasswordHashed + body["password_hash"] = password.password_hash + body["password_hash_type"] = password.password_hash_type + else + raise ArgumentError, "expected password to be one of: WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, got #{password.class}" + end end + response = @client.request( + method: :post, + path: "/user_management/users", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::User.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 - # Get the JWKS URL - # - # The JWKS can be used to validate the access token returned upon successful authentication - # - # @param [String] client_id The WorkOS client ID for the environment - # - # @return String - def get_jwks_url(client_id) - URI::HTTPS.build( - host: WorkOS.config.api_hostname, - path: "/sso/jwks/#{client_id}", - ).to_s - end + # Get a user by external ID + # @param external_id [String] The external ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::User] + def get_user_by_external_id( + external_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/users/external_id/#{WorkOS::Util.encode_path(external_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::User.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 - # Create a one-time Magic Auth code and emails it to the user. - # - # @param [String] email The email address the one-time code will be sent to. - # - # @return Boolean - def send_magic_auth_code(email:) - response = execute_request( - request: post_request( - path: '/user_management/magic_auth/send', - body: { - email: email, - }, - auth: true, - ), - ) + # Get a user + # @param id [String] The unique ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::User] + def get_user( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::User.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 - response.is_a? Net::HTTPSuccess + # Update a user + # @param id [String] The unique ID of the user. + # @param email [String, nil] The email address of the user. + # @param first_name [String, nil] The first name of the user. + # @param last_name [String, nil] The last name of the user. + # @param email_verified [Boolean, nil] Whether the user's email has been verified. + # @param metadata [Hash{String => String}, nil] Object containing metadata key/value pairs associated with the user. + # @param external_id [String, nil] The external ID of the user. + # @param locale [String, nil] The user's preferred locale. + # @param password [WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, nil] Identifies the password. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::User] + def update_user( + id:, + email: nil, + first_name: nil, + last_name: nil, + email_verified: nil, + metadata: nil, + external_id: nil, + locale: nil, + password: nil, + request_options: {} + ) + body = { + "email" => email, + "first_name" => first_name, + "last_name" => last_name, + "email_verified" => email_verified, + "metadata" => metadata, + "external_id" => external_id, + "locale" => locale + }.compact + if password + case password + when WorkOS::UserManagement::PasswordPlaintext + body["password"] = password.password + when WorkOS::UserManagement::PasswordHashed + body["password_hash"] = password.password_hash + body["password_hash_type"] = password.password_hash_type + else + raise ArgumentError, "expected password to be one of: WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed, got #{password.class}" + end end + response = @client.request( + method: :put, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::User.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 - # Enroll a user into an authentication factor. - # - # @param [String] user_id The id for the user. - # @param [String] type The type of the factor to enroll. Only option available is totp. - # @param [String] totp_issuer For totp factors. Typically your application - # or company name, this helps users distinguish between factors in authenticator apps. - # @param [String] totp_user For totp factors. Used as the account name in authenticator apps. - # - # @return WorkOS::AuthenticationFactorAndChallenge - def enroll_auth_factor(user_id:, type:, totp_issuer: nil, totp_user: nil) - validate_auth_factor_type( - type: type, - ) + # Delete a user + # @param id [String] The unique ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_user( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - response = execute_request( - request: post_request( - path: "/user_management/users/#{user_id}/auth_factors", - body: { - type: type, - totp_issuer: totp_issuer, - totp_user: totp_user, - }, - auth: true, - ), - ) + # Confirm email change + # @param id [String] The unique ID of the user. + # @param code [String] The one-time code used to confirm the email change. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::EmailChangeConfirmation] + def confirm_email_change( + id:, + code:, + request_options: {} + ) + body = { + "code" => code + } + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_change/confirm", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::EmailChangeConfirmation.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 - WorkOS::AuthenticationFactorAndChallenge.new(response.body) - end + # Send email change code + # @param id [String] The unique ID of the user. + # @param new_email [String] The new email address to change to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::EmailChange] + def send_email_change( + id:, + new_email:, + request_options: {} + ) + body = { + "new_email" => new_email + } + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_change/send", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::EmailChange.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 - # Get all auth factors for a user - # - # @param [String] user_id The id for the user. - # - # @return WorkOS::ListStruct - def list_auth_factors(user_id:) - response = execute_request( - request: get_request( - path: "/user_management/users/#{user_id}/auth_factors", - auth: true, - ), - ) + # Verify email + # @param id [String] The ID of the user. + # @param code [String] The one-time email verification code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::VerifyEmailResponse] + def verify_email( + id:, + code:, + request_options: {} + ) + body = { + "code" => code + } + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_verification/confirm", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::VerifyEmailResponse.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 - parsed_response = JSON.parse(response.body) + # Send verification email + # @param id [String] The ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::SendVerificationEmailResponse] + def send_verification_email( + id:, + request_options: {} + ) + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/email_verification/send", + auth: true, + request_options: request_options + ) + result = WorkOS::SendVerificationEmailResponse.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 - auth_factors = parsed_response['data'].map do |auth_factor| - ::WorkOS::Factor.new(auth_factor.to_json) - end + # Get user identities + # @param id [String] The unique ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [Array] + def get_user_identities( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/identities", + auth: true, + request_options: request_options + ) + parsed = JSON.parse(response.body) + (parsed || []).map { |item| WorkOS::UserIdentitiesGetItem.new(item) } + end - WorkOS::Types::ListStruct.new( - data: auth_factors, - list_metadata: parsed_response['list_metadata'], + # List sessions + # @param id [String] The ID of the user. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_sessions( + id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(id)}/sessions", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_sessions( + id: id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options ) - end + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserSessionsListItem, + filters: {id: id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end - # Sends a verification email to the provided user. - # - # @param [String] user_id The unique ID of the User whose email address will be verified. - # - # @return WorkOS::UserResponse - def send_verification_email(user_id:) - response = execute_request( - request: post_request( - path: "/user_management/users/#{user_id}/email_verification/send", - auth: true, - ), + # List invitations + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join. + # @param email [String, nil] The email address of the recipient. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_invitations( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + email: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id, + "email" => email + }.compact + response = @client.request( + method: :get, + path: "/user_management/invitations", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_invitations( + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + email: email, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserInvite, + filters: {before: before, limit: limit, order: order, organization_id: organization_id, email: email}, + fetch_next: fetch_next + ) + end - WorkOS::UserResponse.new(response.body) - end + # Send an invitation + # @param email [String] The email address of the recipient. + # @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) that the recipient will join. + # @param role_slug [String, nil] The [role](https://workos.com/docs/authkit/roles) that the recipient will receive when they join the organization in the invitation. + # @param expires_in_days [Integer, nil] How many days the invitations will be valid for. Must be between 1 and 30 days. Defaults to 7 days if not specified. + # @param inviter_user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user) who invites the recipient. The invitation email will mention the name of this user. + # @param locale [WorkOS::Types::CreateUserInviteOptionsLocale, nil] The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization). + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserInvite] + def send_invitation( + email:, + organization_id: nil, + role_slug: nil, + expires_in_days: nil, + inviter_user_id: nil, + locale: nil, + request_options: {} + ) + body = { + "email" => email, + "organization_id" => organization_id, + "role_slug" => role_slug, + "expires_in_days" => expires_in_days, + "inviter_user_id" => inviter_user_id, + "locale" => locale + }.compact + response = @client.request( + method: :post, + path: "/user_management/invitations", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserInvite.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 - # Verifiy user email using one-time code that was sent to the user. - # - # @param [String] user_id The unique ID of the User whose email address will be verified. - # @param [String] code The one-time code emailed to the user. - # - # @return WorkOS::UserResponse - def verify_email(user_id:, code:) - response = execute_request( - request: post_request( - path: "/user_management/users/#{user_id}/email_verification/confirm", - body: { - code: code, - }, - auth: true, - ), - ) + # Find an invitation by token + # @param token [String] The token used to accept the invitation. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserInvite] + def find_invitation_by_token( + token:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/invitations/by_token/#{WorkOS::Util.encode_path(token)}", + auth: true, + request_options: request_options + ) + result = WorkOS::UserInvite.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 - WorkOS::UserResponse.new(response.body) - end + # Get an invitation + # @param id [String] The unique ID of the invitation. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserInvite] + def get_invitation( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::UserInvite.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 - # Create a password reset challenge and emails a password reset link to a user. - # - # @param [String] email The email of the user that wishes to reset their password. - # @param [String] password_reset_url The URL that will be linked to in the email. - # - # @return [Bool] - returns `true` if successful - def send_password_reset_email(email:, password_reset_url:) - request = post_request( - path: '/user_management/password_reset/send', - body: { - email: email, - password_reset_url: password_reset_url, - }, - auth: true, - ) + # Accept an invitation + # @param id [String] The unique ID of the invitation. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Invitation] + def accept_invitation( + id:, + request_options: {} + ) + response = @client.request( + method: :post, + path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/accept", + auth: true, + request_options: request_options + ) + result = WorkOS::Invitation.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 - response = execute_request(request: request) + # Resend an invitation + # @param id [String] The unique ID of the invitation. + # @param locale [WorkOS::Types::ResendUserInviteOptionsLocale, nil] The locale to use when rendering the invitation email. See [supported locales](https://workos.com/docs/authkit/hosted-ui/localization). + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserInvite] + def resend_invitation( + id:, + locale: nil, + request_options: {} + ) + body = { + "locale" => locale + }.compact + response = @client.request( + method: :post, + path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/resend", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserInvite.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 - response.is_a? Net::HTTPSuccess - end + # Revoke an invitation + # @param id [String] The unique ID of the invitation. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Invitation] + def revoke_invitation( + id:, + request_options: {} + ) + response = @client.request( + method: :post, + path: "/user_management/invitations/#{WorkOS::Util.encode_path(id)}/revoke", + auth: true, + request_options: request_options + ) + result = WorkOS::Invitation.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 - # Reset user password using token that was sent to the user. - # - # @param [String] token The token that was sent to the user. - # @param [String] new_password The new password to set for the user. - # - # @return WorkOS::User - def reset_password(token:, new_password:) - response = execute_request( - request: post_request( - path: '/user_management/password_reset/confirm', - body: { - token: token, - new_password: new_password, - }, - auth: true, - ), - ) + # Get JWT template + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::JWTTemplateResponse] + def list_jwt_template(request_options: {}) + response = @client.request( + method: :get, + path: "/user_management/jwt_template", + auth: true, + request_options: request_options + ) + result = WorkOS::JWTTemplateResponse.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 - WorkOS::User.new(response.body) - end + # Update JWT template + # @param content [String] The JWT template content as a Liquid template string. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::JWTTemplateResponse] + def update_jwt_template( + content:, + request_options: {} + ) + body = { + "content" => content + } + response = @client.request( + method: :put, + path: "/user_management/jwt_template", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::JWTTemplateResponse.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 - # Get an Organization Membership - # - # @param [String] id The unique ID of the Organization Membership. - # - # @return WorkOS::OrganizationMembership - def get_organization_membership(id:) - response = execute_request( - request: get_request( - path: "/user_management/organization_memberships/#{id}", - auth: true, - ), - ) + # Create a Magic Auth code + # @param email [String] The email address to send the magic code to. + # @param invitation_token [String, nil] The invitation token to associate with this magic code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::MagicAuth] + def create_magic_auth( + email:, + invitation_token: nil, + request_options: {} + ) + body = { + "email" => email, + "invitation_token" => invitation_token + }.compact + response = @client.request( + method: :post, + path: "/user_management/magic_auth", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::MagicAuth.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 - WorkOS::OrganizationMembership.new(response.body) - end + # Get Magic Auth code details + # @param id [String] The unique ID of the Magic Auth code. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::MagicAuth] + def get_magic_auth( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/magic_auth/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::MagicAuth.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 - # Retrieve a list of Organization Memberships. - # - # @param [Hash] options - # @option options [String] user_id The ID of the User. - # @option options [String] organization_id Filter Users by the organization they are members of. - # @option options [String] limit Maximum number of records to return. - # @option options [String] order The order in which to paginate records - # @option options [String] before Pagination cursor to receive records - # before a provided User ID. - # @option options [String] after Pagination cursor to receive records - # before a provided User ID. - # - # @return [WorkOS::OrganizationMembership] - def list_organization_memberships(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/user_management/organization_memberships', - auth: true, - params: options, - ), + # List organization memberships + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param organization_id [String, nil] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to. + # @param statuses [Array, nil] Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`. + # @param user_id [String, nil] The ID of the [user](https://workos.com/docs/reference/authkit/user). + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organization_memberships( + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + statuses: nil, + user_id: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id, + "statuses" => statuses, + "user_id" => user_id + }.compact + response = @client.request( + method: :get, + path: "/user_management/organization_memberships", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organization_memberships( + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + statuses: statuses, + user_id: user_id, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserOrganizationMembership, + filters: {before: before, limit: limit, order: order, organization_id: organization_id, statuses: statuses, user_id: user_id}, + fetch_next: fetch_next + ) + end - parsed_response = JSON.parse(response.body) - - organization_memberships = parsed_response['data'].map do |organization_membership| - ::WorkOS::OrganizationMembership.new(organization_membership.to_json) + # Create an organization membership + # @param user_id [String] The ID of the [user](https://workos.com/docs/reference/authkit/user). + # @param organization_id [String] The ID of the [organization](https://workos.com/docs/reference/organization) which the user belongs to. + # @param role [WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, nil] Identifies the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationMembership] + def create_organization_membership( + user_id:, + organization_id:, + role: nil, + request_options: {} + ) + body = { + "user_id" => user_id, + "organization_id" => organization_id + } + if role + case role + when WorkOS::UserManagement::RoleSingle + body["role_slug"] = role.role_slug + when WorkOS::UserManagement::RoleMultiple + body["role_slugs"] = role.role_slugs + else + raise ArgumentError, "expected role to be one of: WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, got #{role.class}" end - - WorkOS::Types::ListStruct.new( - data: organization_memberships, - list_metadata: parsed_response['list_metadata'], - ) - end - - # Create an Organization Membership - # - # @param [String] user_id The ID of the User. - # @param [String] organization_id The ID of the Organization to which the user belongs to. - # - # @return [WorkOS::OrganizationMembership] - def create_organization_membership(user_id:, organization_id:) - request = post_request( - path: '/user_management/organization_memberships', - body: { - user_id: user_id, - organization_id: organization_id, - }, - auth: true, - ) - - response = execute_request(request: request) - - WorkOS::OrganizationMembership.new(response.body) - end - - # Delete an Organization Membership - # - # @param [String] id The unique ID of the Organization Membership. - # - # @return [Bool] - returns `true` if successful - def delete_organization_membership(id:) - response = execute_request( - request: delete_request( - path: "/user_management/organization_memberships/#{id}", - auth: true, - ), - ) - - response.is_a? Net::HTTPSuccess end + response = @client.request( + method: :post, + path: "/user_management/organization_memberships", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::OrganizationMembership.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 - # Gets an Invitation - # - # @param [String] id The unique ID of the Invitation. - # - # @return WorkOS::Invitation - def get_invitation(id:) - response = execute_request( - request: get_request( - path: "/user_management/invitations/#{id}", - auth: true, - ), - ) + # Get an organization membership + # @param id [String] The unique ID of the organization membership. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserOrganizationMembership] + def get_organization_membership( + id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::UserOrganizationMembership.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 - WorkOS::Invitation.new(response.body) + # Update an organization membership + # @param id [String] The unique ID of the organization membership. + # @param role [WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, nil] Identifies the role. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserOrganizationMembership] + def update_organization_membership( + id:, + role: nil, + request_options: {} + ) + body = {} + if role + case role + when WorkOS::UserManagement::RoleSingle + body["role_slug"] = role.role_slug + when WorkOS::UserManagement::RoleMultiple + body["role_slugs"] = role.role_slugs + else + raise ArgumentError, "expected role to be one of: WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple, got #{role.class}" + end end + response = @client.request( + method: :put, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserOrganizationMembership.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 - # Retrieve a list of invitations. - # - # @param [Hash] options - # @option options [String] email The email address of a recipient. - # @option options [String] organization_id The ID of the Organization that the recipient was invited to join. - # @option options [String] limit Maximum number of records to return. - # @option options [String] order The order in which to paginate records - # @option options [String] before Pagination cursor to receive records - # before a provided User ID. - # @option options [String] after Pagination cursor to receive records - # before a provided User ID. - # - # @return [WorkOS::Invitation] - def list_invitations(options = {}) - options[:order] ||= 'desc' - response = execute_request( - request: get_request( - path: '/user_management/invitations', - auth: true, - params: options, - ), - ) + # Delete an organization membership + # @param id [String] The unique ID of the organization membership. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_organization_membership( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - parsed_response = JSON.parse(response.body) + # Deactivate an organization membership + # @param id [String] The unique ID of the organization membership. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::OrganizationMembership] + def deactivate_organization_membership( + id:, + request_options: {} + ) + response = @client.request( + method: :put, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/deactivate", + auth: true, + request_options: request_options + ) + result = WorkOS::OrganizationMembership.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 - invitations = parsed_response['data'].map do |invitation| - ::WorkOS::Invitation.new(invitation.to_json) - end + # Reactivate an organization membership + # @param id [String] The unique ID of the organization membership. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserOrganizationMembership] + def reactivate_organization_membership( + id:, + request_options: {} + ) + response = @client.request( + method: :put, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(id)}/reactivate", + auth: true, + request_options: request_options + ) + result = WorkOS::UserOrganizationMembership.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 - WorkOS::Types::ListStruct.new( - data: invitations, - list_metadata: parsed_response['list_metadata'], - ) - end + # Create a redirect URI + # @param uri [String] The redirect URI to create. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::RedirectUri] + def create_redirect_uri( + uri:, + request_options: {} + ) + body = { + "uri" => uri + } + response = @client.request( + method: :post, + path: "/user_management/redirect_uris", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::RedirectUri.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 - # Sends an Invitation to a recipient. - # - # @param [String] email The email address of the recipient. - # @param [String] organization_id The ID of the Organization to which the recipient is being invited. - # @param [Integer] expires_in_days The number of days the invitations will be valid for. - # Must be between 1 and 30, defaults to 7 if not specified. - # @param [String] inviter_user_id The ID of the User sending the invitation. - # @param [String] role_slug The slug of the role to assign to the user upon invitation. - # - # @return WorkOS::Invitation - def send_invitation(email:, organization_id: nil, expires_in_days: nil, inviter_user_id: nil, role_slug: nil) - response = execute_request( - request: post_request( - path: '/user_management/invitations', - body: { - email: email, - organization_id: organization_id, - expires_in_days: expires_in_days, - inviter_user_id: inviter_user_id, - role_slug: role_slug, - }, - auth: true, - ), + # List authorized applications + # @param user_id [String] The ID of the user. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_user_authorized_applications( + user_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/authorized_applications", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_user_authorized_applications( + user_id: user_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::AuthorizedConnectApplicationListData, + filters: {user_id: user_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end - WorkOS::Invitation.new(response.body) - end + # Delete an authorized application + # @param application_id [String] The ID or client ID of the application. + # @param user_id [String] The ID of the user. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_user_authorized_application( + application_id:, + user_id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/authorized_applications/#{WorkOS::Util.encode_path(application_id)}", + auth: true, + request_options: request_options + ) + nil + end - # Revokes an existing Invitation. - # - # @param [String] id The unique ID of the Invitation. - # - # @return WorkOS::Invitation - def revoke_invitation(id:) - request = post_request( - path: "/user_management/invitations/#{id}/revoke", - auth: true, + # List API keys for a user + # @param user_id [String] Unique identifier of the user. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. + # @param organization_id [String, nil] The ID of the organization to filter user API keys by. When provided, only API keys created against that organization membership are returned. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_user_api_keys( + user_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + organization_id: nil, + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order, + "organization_id" => organization_id + }.compact + response = @client.request( + method: :get, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/api_keys", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_user_api_keys( + user_id: user_id, + before: before, + after: cursor, + limit: limit, + order: order, + organization_id: organization_id, + request_options: request_options ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::UserApiKey, + filters: {user_id: user_id, before: before, limit: limit, order: order, organization_id: organization_id}, + fetch_next: fetch_next + ) + end - response = execute_request(request: request) + # Create an API key for a user + # @param user_id [String] Unique identifier of the user. + # @param name [String] A descriptive name for the API key. + # @param organization_id [String] The ID of the organization the user API key is associated with. The user must have an active membership in this organization. + # @param permissions [Array, nil] The permission slugs to assign to the API key. Each permission must be enabled for user API keys. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::UserApiKeyWithValue] + def create_user_api_key( + user_id:, + name:, + organization_id:, + permissions: nil, + request_options: {} + ) + body = { + "name" => name, + "organization_id" => organization_id, + "permissions" => permissions + }.compact + response = @client.request( + method: :post, + path: "/user_management/users/#{WorkOS::Util.encode_path(user_id)}/api_keys", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::UserApiKeyWithValue.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 - WorkOS::Invitation.new(response.body) - end + # @oagen-ignore-start — non-spec helpers (hand-maintained) + # H13 — Build the JWKS URL for a given client_id (no HTTP call). + # Pair with #get_jwks (generated) to fetch the keyset. + def get_jwks_url(client_id: nil) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required" if cid.nil? || cid.empty? + base = @client.base_url + URI.join(base, "/sso/jwks/#{WorkOS::Util.encode_path(cid)}").to_s + end - private + # H09 — Build an AuthKit authorization URL (client-side, no HTTP call). + # Overrides the generated get_authorization_url which hits the API. + def get_authorization_url(redirect_uri:, client_id: nil, provider: nil, connection_id: nil, + organization_id: nil, domain_hint: nil, login_hint: nil, + state: nil, screen_hint: nil, code_challenge: nil, + code_challenge_method: nil, prompt: nil, **) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required (set on Client or pass explicitly)" if cid.nil? || cid.empty? + raise ArgumentError, "provider, connection_id, or organization_id required" if provider.nil? && connection_id.nil? && organization_id.nil? + params = { + "client_id" => cid, + "redirect_uri" => redirect_uri, + "response_type" => "code", + "provider" => provider, + "connection_id" => connection_id, + "organization_id" => organization_id, + "domain_hint" => domain_hint, + "login_hint" => login_hint, + "state" => state, + "screen_hint" => screen_hint, + "code_challenge" => code_challenge, + "code_challenge_method" => code_challenge_method, + "prompt" => prompt + }.compact + build_url("/user_management/authorize", params) + end - def validate_authorization_url_arguments( - provider:, - connection_id:, - organization_id: + # H10 — AuthKit authorization URL with auto-generated PKCE + state. + # Returns [url, code_verifier, state]. + def get_authorization_url_with_pkce(redirect_uri:, client_id: nil, **opts) + pair = WorkOS::PKCE.generate_pair + state = opts.delete(:state) || WorkOS::PKCE.generate_code_verifier + # Strip caller-supplied PKCE params: this helper exists specifically + # to generate them, so a caller-provided value would either silently + # override our freshly-generated challenge (defeating the helper) or + # collide with the keyword args below and raise. Mirror the existing + # opts.delete(:state) pattern. + opts.delete(:code_challenge) + opts.delete(:code_challenge_method) + url = get_authorization_url( + redirect_uri: redirect_uri, + client_id: client_id, + state: state, + code_challenge: pair[:code_challenge], + code_challenge_method: "S256", + **opts ) - if [provider, connection_id, organization_id].all?(&:nil?) - raise ArgumentError, 'Either connection ID, organization ID,' \ - ' or provider is required.' - end + [url, pair[:code_verifier], state] + end - return unless provider && !PROVIDERS.include?(provider) + # H11 — Exchange a code for tokens with PKCE support (public client; no secret). + # NOTE: Unlike the other authenticate_with_* helpers, this does NOT delegate to + # create_authenticate because PKCE is a public-client flow that requires + # auth: false (no Bearer token / API key in the Authorization header). + def authenticate_with_code_pkce(code:, code_verifier:, client_id: nil, ip_address: nil, user_agent: nil, request_options: {}) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required" if cid.nil? || cid.empty? + body = { + "grant_type" => "authorization_code", + "client_id" => cid, + "code" => code, + "code_verifier" => code_verifier, + "ip_address" => ip_address, + "user_agent" => user_agent + }.compact + response = @client.request(method: :post, path: "/user_management/authenticate", auth: false, body: body, request_options: request_options) + WorkOS::AuthenticateResponse.new(response.body) + end - raise ArgumentError, "#{provider} is not a valid value." \ - " `provider` must be in #{PROVIDERS}" - end + # H12 — Initiate the OAuth 2.0 device authorization flow. + # @return [WorkOS::DeviceAuthorizationResponse] + def authorize_device(client_id: nil, request_options: {}) + cid = client_id || @client.client_id + raise ArgumentError, "client_id is required" if cid.nil? || cid.empty? + body = {"client_id" => cid} + response = @client.request(method: :post, path: "/oauth2/device_authorization", auth: false, body: body, request_options: request_options) + WorkOS::DeviceAuthorizationResponse.new(response.body) + end - def validate_auth_factor_type( - type: - ) - return if AUTH_FACTOR_TYPES.include?(type) + # H12 device-code → token exchange is provided by the generated + # `authenticate_with_device_code` method (wraps /user_management/authenticate); + # no hand-maintained override is needed here. + + # Build the AuthKit logout redirect URL (client-side, no HTTP call). + # @param session_id [String] The session ID (from the `sid` claim of the access token). + # @param return_to [String, nil] URL to redirect the user to after session revocation. + # @return [String] + def get_logout_url(session_id:, return_to: nil) + params = {"session_id" => session_id} + params["return_to"] = return_to if return_to + build_url("/user_management/sessions/logout", params) + end - raise ArgumentError, "#{type} is not a valid value." \ - " `type` must be in #{AUTH_FACTOR_TYPES}" - end + private + + def build_url(path, params) + base = @client.base_url + uri = URI.join(base, path) + uri.query = URI.encode_www_form(params) + uri.to_s end + # @oagen-ignore-end end - # rubocop:enable Metrics/ModuleLength end diff --git a/lib/workos/user_management/action_authentication_denied.rb b/lib/workos/user_management/action_authentication_denied.rb new file mode 100644 index 00000000..3a9dc236 --- /dev/null +++ b/lib/workos/user_management/action_authentication_denied.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ActionAuthenticationDenied < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + context: :context, + created_at: :created_at, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :context, + :created_at, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ActionAuthenticationDeniedData.new(hash[:data]) : nil + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @created_at = hash[:created_at] + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/action_authentication_denied_data.rb b/lib/workos/user_management/action_authentication_denied_data.rb new file mode 100644 index 00000000..b25a8e86 --- /dev/null +++ b/lib/workos/user_management/action_authentication_denied_data.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ActionAuthenticationDeniedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + action_endpoint_id: :action_endpoint_id, + action_execution_id: :action_execution_id, + type: :type, + verdict: :verdict, + user_id: :user_id, + organization_id: :organization_id, + email: :email, + ip_address: :ip_address, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :action_endpoint_id, + :action_execution_id, + :type, + :verdict, + :user_id, + :organization_id, + :email, + :ip_address, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @action_endpoint_id = hash[:action_endpoint_id] + @action_execution_id = hash[:action_execution_id] + @type = hash[:type] + @verdict = hash[:verdict] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @email = hash[:email] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/action_user_registration_denied.rb b/lib/workos/user_management/action_user_registration_denied.rb new file mode 100644 index 00000000..0a9f39b0 --- /dev/null +++ b/lib/workos/user_management/action_user_registration_denied.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ActionUserRegistrationDenied < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + context: :context, + created_at: :created_at, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :context, + :created_at, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::ActionUserRegistrationDeniedData.new(hash[:data]) : nil + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @created_at = hash[:created_at] + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/action_user_registration_denied_data.rb b/lib/workos/user_management/action_user_registration_denied_data.rb new file mode 100644 index 00000000..0b5192d5 --- /dev/null +++ b/lib/workos/user_management/action_user_registration_denied_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ActionUserRegistrationDeniedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + action_endpoint_id: :action_endpoint_id, + action_execution_id: :action_execution_id, + type: :type, + verdict: :verdict, + organization_id: :organization_id, + email: :email, + ip_address: :ip_address, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :action_endpoint_id, + :action_execution_id, + :type, + :verdict, + :organization_id, + :email, + :ip_address, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @action_endpoint_id = hash[:action_endpoint_id] + @action_execution_id = hash[:action_execution_id] + @type = hash[:type] + @verdict = hash[:verdict] + @organization_id = hash[:organization_id] + @email = hash[:email] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/authenticate_response.rb b/lib/workos/user_management/authenticate_response.rb new file mode 100644 index 00000000..46a2d44b --- /dev/null +++ b/lib/workos/user_management/authenticate_response.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticateResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + user: :user, + organization_id: :organization_id, + authkit_authorization_code: :authkit_authorization_code, + access_token: :access_token, + refresh_token: :refresh_token, + authentication_method: :authentication_method, + impersonator: :impersonator, + oauth_tokens: :oauth_tokens + }.freeze + + attr_accessor \ + :user, + :organization_id, + :authkit_authorization_code, + :access_token, + :refresh_token, + :authentication_method, + :impersonator, + :oauth_tokens + + def initialize(json) + hash = self.class.normalize(json) + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + @organization_id = hash[:organization_id] + @authkit_authorization_code = hash[:authkit_authorization_code] + @access_token = hash[:access_token] + @refresh_token = hash[:refresh_token] + @authentication_method = hash[:authentication_method] + @impersonator = hash[:impersonator] ? WorkOS::AuthenticateResponseImpersonator.new(hash[:impersonator]) : nil + @oauth_tokens = hash[:oauth_tokens] ? WorkOS::AuthenticateResponseOAuthToken.new(hash[:oauth_tokens]) : nil + end + end +end diff --git a/lib/workos/user_management/authenticate_response_impersonator.rb b/lib/workos/user_management/authenticate_response_impersonator.rb new file mode 100644 index 00000000..a5bcda83 --- /dev/null +++ b/lib/workos/user_management/authenticate_response_impersonator.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticateResponseImpersonator < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + reason: :reason + }.freeze + + attr_accessor \ + :email, + :reason + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @reason = hash[:reason] + end + end +end diff --git a/lib/workos/user_management/authenticate_response_oauth_token.rb b/lib/workos/user_management/authenticate_response_oauth_token.rb new file mode 100644 index 00000000..80a3e093 --- /dev/null +++ b/lib/workos/user_management/authenticate_response_oauth_token.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticateResponseOAuthToken < WorkOS::Types::BaseModel + HASH_ATTRS = { + provider: :provider, + refresh_token: :refresh_token, + access_token: :access_token, + expires_at: :expires_at, + scopes: :scopes + }.freeze + + attr_accessor \ + :provider, + :refresh_token, + :access_token, + :expires_at, + :scopes + + def initialize(json) + hash = self.class.normalize(json) + @provider = hash[:provider] + @refresh_token = hash[:refresh_token] + @access_token = hash[:access_token] + @expires_at = hash[:expires_at] + @scopes = hash[:scopes] || [] + end + end +end diff --git a/lib/workos/user_management/authentication_email_verification_failed.rb b/lib/workos/user_management/authentication_email_verification_failed.rb new file mode 100644 index 00000000..20e6f964 --- /dev/null +++ b/lib/workos/user_management/authentication_email_verification_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationEmailVerificationFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationEmailVerificationFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_email_verification_failed_data.rb b/lib/workos/user_management/authentication_email_verification_failed_data.rb new file mode 100644 index 00000000..5ecbea54 --- /dev/null +++ b/lib/workos/user_management/authentication_email_verification_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationEmailVerificationFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationEmailVerificationFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_email_verification_failed_data_error.rb b/lib/workos/user_management/authentication_email_verification_failed_data_error.rb new file mode 100644 index 00000000..09151f5e --- /dev/null +++ b/lib/workos/user_management/authentication_email_verification_failed_data_error.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationEmailVerificationFailedDataError < WorkOS::Types::BaseModel + HASH_ATTRS = { + code: :code, + message: :message + }.freeze + + attr_accessor \ + :code, + :message + + def initialize(json) + hash = self.class.normalize(json) + @code = hash[:code] + @message = hash[:message] + end + end +end diff --git a/lib/workos/user_management/authentication_email_verification_succeeded.rb b/lib/workos/user_management/authentication_email_verification_succeeded.rb new file mode 100644 index 00000000..c8c57a98 --- /dev/null +++ b/lib/workos/user_management/authentication_email_verification_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationEmailVerificationSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationEmailVerificationSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_email_verification_succeeded_data.rb b/lib/workos/user_management/authentication_email_verification_succeeded_data.rb new file mode 100644 index 00000000..12a7bf7a --- /dev/null +++ b/lib/workos/user_management/authentication_email_verification_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationEmailVerificationSucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_magic_auth_failed.rb b/lib/workos/user_management/authentication_magic_auth_failed.rb new file mode 100644 index 00000000..38d2e6af --- /dev/null +++ b/lib/workos/user_management/authentication_magic_auth_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMagicAuthFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationMagicAuthFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_magic_auth_failed_data.rb b/lib/workos/user_management/authentication_magic_auth_failed_data.rb new file mode 100644 index 00000000..5b96e069 --- /dev/null +++ b/lib/workos/user_management/authentication_magic_auth_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMagicAuthFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationMagicAuthFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_magic_auth_failed_data_error.rb b/lib/workos/user_management/authentication_magic_auth_failed_data_error.rb new file mode 100644 index 00000000..d9743b46 --- /dev/null +++ b/lib/workos/user_management/authentication_magic_auth_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationMagicAuthFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_magic_auth_succeeded.rb b/lib/workos/user_management/authentication_magic_auth_succeeded.rb new file mode 100644 index 00000000..9016c31b --- /dev/null +++ b/lib/workos/user_management/authentication_magic_auth_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMagicAuthSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationMagicAuthSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_magic_auth_succeeded_data.rb b/lib/workos/user_management/authentication_magic_auth_succeeded_data.rb new file mode 100644 index 00000000..32cb2e82 --- /dev/null +++ b/lib/workos/user_management/authentication_magic_auth_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMagicAuthSucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_mfa_failed.rb b/lib/workos/user_management/authentication_mfa_failed.rb new file mode 100644 index 00000000..4e0a6f5a --- /dev/null +++ b/lib/workos/user_management/authentication_mfa_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMFAFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationMFAFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_mfa_failed_data.rb b/lib/workos/user_management/authentication_mfa_failed_data.rb new file mode 100644 index 00000000..11d997ca --- /dev/null +++ b/lib/workos/user_management/authentication_mfa_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMFAFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationMFAFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_mfa_failed_data_error.rb b/lib/workos/user_management/authentication_mfa_failed_data_error.rb new file mode 100644 index 00000000..5703be60 --- /dev/null +++ b/lib/workos/user_management/authentication_mfa_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationMFAFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_mfa_succeeded.rb b/lib/workos/user_management/authentication_mfa_succeeded.rb new file mode 100644 index 00000000..34177373 --- /dev/null +++ b/lib/workos/user_management/authentication_mfa_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMFASucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationMFASucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_mfa_succeeded_data.rb b/lib/workos/user_management/authentication_mfa_succeeded_data.rb new file mode 100644 index 00000000..bd06277a --- /dev/null +++ b/lib/workos/user_management/authentication_mfa_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationMFASucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_oauth_failed.rb b/lib/workos/user_management/authentication_oauth_failed.rb new file mode 100644 index 00000000..d76b5284 --- /dev/null +++ b/lib/workos/user_management/authentication_oauth_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationOAuthFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationOAuthFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_oauth_failed_data.rb b/lib/workos/user_management/authentication_oauth_failed_data.rb new file mode 100644 index 00000000..a143a971 --- /dev/null +++ b/lib/workos/user_management/authentication_oauth_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationOAuthFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationOAuthFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_oauth_failed_data_error.rb b/lib/workos/user_management/authentication_oauth_failed_data_error.rb new file mode 100644 index 00000000..d2207355 --- /dev/null +++ b/lib/workos/user_management/authentication_oauth_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationOAuthFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_oauth_succeeded.rb b/lib/workos/user_management/authentication_oauth_succeeded.rb new file mode 100644 index 00000000..c224dcb2 --- /dev/null +++ b/lib/workos/user_management/authentication_oauth_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationOAuthSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationOAuthSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_oauth_succeeded_data.rb b/lib/workos/user_management/authentication_oauth_succeeded_data.rb new file mode 100644 index 00000000..3291b4a7 --- /dev/null +++ b/lib/workos/user_management/authentication_oauth_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationOAuthSucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_passkey_failed.rb b/lib/workos/user_management/authentication_passkey_failed.rb new file mode 100644 index 00000000..35608fc2 --- /dev/null +++ b/lib/workos/user_management/authentication_passkey_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasskeyFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationPasskeyFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_passkey_failed_data.rb b/lib/workos/user_management/authentication_passkey_failed_data.rb new file mode 100644 index 00000000..69e8e55f --- /dev/null +++ b/lib/workos/user_management/authentication_passkey_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasskeyFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationPasskeyFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_passkey_failed_data_error.rb b/lib/workos/user_management/authentication_passkey_failed_data_error.rb new file mode 100644 index 00000000..ff5c38ab --- /dev/null +++ b/lib/workos/user_management/authentication_passkey_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationPasskeyFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_passkey_succeeded.rb b/lib/workos/user_management/authentication_passkey_succeeded.rb new file mode 100644 index 00000000..043610c9 --- /dev/null +++ b/lib/workos/user_management/authentication_passkey_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasskeySucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationPasskeySucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_passkey_succeeded_data.rb b/lib/workos/user_management/authentication_passkey_succeeded_data.rb new file mode 100644 index 00000000..63d253b6 --- /dev/null +++ b/lib/workos/user_management/authentication_passkey_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasskeySucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_password_failed.rb b/lib/workos/user_management/authentication_password_failed.rb new file mode 100644 index 00000000..de4efe20 --- /dev/null +++ b/lib/workos/user_management/authentication_password_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasswordFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationPasswordFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_password_failed_data.rb b/lib/workos/user_management/authentication_password_failed_data.rb new file mode 100644 index 00000000..66ac3776 --- /dev/null +++ b/lib/workos/user_management/authentication_password_failed_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasswordFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @error = hash[:error] ? WorkOS::AuthenticationPasswordFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_password_failed_data_error.rb b/lib/workos/user_management/authentication_password_failed_data_error.rb new file mode 100644 index 00000000..d2b41a39 --- /dev/null +++ b/lib/workos/user_management/authentication_password_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationPasswordFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_password_succeeded.rb b/lib/workos/user_management/authentication_password_succeeded.rb new file mode 100644 index 00000000..49dc4a18 --- /dev/null +++ b/lib/workos/user_management/authentication_password_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasswordSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationPasswordSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_password_succeeded_data.rb b/lib/workos/user_management/authentication_password_succeeded_data.rb new file mode 100644 index 00000000..a1aff8dd --- /dev/null +++ b/lib/workos/user_management/authentication_password_succeeded_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationPasswordSucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_radar_risk_detected.rb b/lib/workos/user_management/authentication_radar_risk_detected.rb new file mode 100644 index 00000000..02a6c9c0 --- /dev/null +++ b/lib/workos/user_management/authentication_radar_risk_detected.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationRadarRiskDetected < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationRadarRiskDetectedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_radar_risk_detected_data.rb b/lib/workos/user_management/authentication_radar_risk_detected_data.rb new file mode 100644 index 00000000..c2fc6c53 --- /dev/null +++ b/lib/workos/user_management/authentication_radar_risk_detected_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationRadarRiskDetectedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + auth_method: :auth_method, + action: :action, + control: :control, + blocklist_type: :blocklist_type, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email + }.freeze + + attr_accessor \ + :auth_method, + :action, + :control, + :blocklist_type, + :ip_address, + :user_agent, + :user_id, + :email + + def initialize(json) + hash = self.class.normalize(json) + @auth_method = hash[:auth_method] + @action = hash[:action] + @control = hash[:control] + @blocklist_type = hash[:blocklist_type] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_failed.rb b/lib/workos/user_management/authentication_sso_failed.rb new file mode 100644 index 00000000..52584c18 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_failed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOFailed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationSSOFailedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_failed_data.rb b/lib/workos/user_management/authentication_sso_failed_data.rb new file mode 100644 index 00000000..181894f9 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_failed_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOFailedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + sso: :sso, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :sso, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @sso = hash[:sso] ? WorkOS::AuthenticationSSOFailedDataSSO.new(hash[:sso]) : nil + @error = hash[:error] ? WorkOS::AuthenticationSSOFailedDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_sso_failed_data_error.rb b/lib/workos/user_management/authentication_sso_failed_data_error.rb new file mode 100644 index 00000000..69dfecd2 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_failed_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationSSOFailedDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_sso_failed_data_sso.rb b/lib/workos/user_management/authentication_sso_failed_data_sso.rb new file mode 100644 index 00000000..3cef0f7e --- /dev/null +++ b/lib/workos/user_management/authentication_sso_failed_data_sso.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOFailedDataSSO < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + connection_id: :connection_id, + session_id: :session_id + }.freeze + + attr_accessor \ + :organization_id, + :connection_id, + :session_id + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @connection_id = hash[:connection_id] + @session_id = hash[:session_id] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_started.rb b/lib/workos/user_management/authentication_sso_started.rb new file mode 100644 index 00000000..23dc9e54 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_started.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOStarted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationSSOStartedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_started_data.rb b/lib/workos/user_management/authentication_sso_started_data.rb new file mode 100644 index 00000000..8926caea --- /dev/null +++ b/lib/workos/user_management/authentication_sso_started_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOStartedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + sso: :sso + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :sso + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @sso = hash[:sso] ? WorkOS::AuthenticationSSOStartedDataSSO.new(hash[:sso]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_sso_started_data_sso.rb b/lib/workos/user_management/authentication_sso_started_data_sso.rb new file mode 100644 index 00000000..545a0c64 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_started_data_sso.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationSSOStartedDataSSO = AuthenticationSSOFailedDataSSO +end diff --git a/lib/workos/user_management/authentication_sso_succeeded.rb b/lib/workos/user_management/authentication_sso_succeeded.rb new file mode 100644 index 00000000..61e48f9b --- /dev/null +++ b/lib/workos/user_management/authentication_sso_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationSSOSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_succeeded_data.rb b/lib/workos/user_management/authentication_sso_succeeded_data.rb new file mode 100644 index 00000000..b2a37fd0 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_succeeded_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOSucceededData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + sso: :sso + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :sso + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @sso = hash[:sso] ? WorkOS::AuthenticationSSOSucceededDataSSO.new(hash[:sso]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_sso_succeeded_data_sso.rb b/lib/workos/user_management/authentication_sso_succeeded_data_sso.rb new file mode 100644 index 00000000..3bb3ae1a --- /dev/null +++ b/lib/workos/user_management/authentication_sso_succeeded_data_sso.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationSSOSucceededDataSSO = AuthenticationSSOFailedDataSSO +end diff --git a/lib/workos/user_management/authentication_sso_timed_out.rb b/lib/workos/user_management/authentication_sso_timed_out.rb new file mode 100644 index 00000000..cb52f547 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_timed_out.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOTimedOut < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::AuthenticationSSOTimedOutData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/authentication_sso_timed_out_data.rb b/lib/workos/user_management/authentication_sso_timed_out_data.rb new file mode 100644 index 00000000..906486ec --- /dev/null +++ b/lib/workos/user_management/authentication_sso_timed_out_data.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthenticationSSOTimedOutData < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + status: :status, + ip_address: :ip_address, + user_agent: :user_agent, + user_id: :user_id, + email: :email, + sso: :sso, + error: :error + }.freeze + + attr_accessor \ + :type, + :status, + :ip_address, + :user_agent, + :user_id, + :email, + :sso, + :error + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @status = hash[:status] + @ip_address = hash[:ip_address] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @email = hash[:email] + @sso = hash[:sso] ? WorkOS::AuthenticationSSOTimedOutDataSSO.new(hash[:sso]) : nil + @error = hash[:error] ? WorkOS::AuthenticationSSOTimedOutDataError.new(hash[:error]) : nil + end + end +end diff --git a/lib/workos/user_management/authentication_sso_timed_out_data_error.rb b/lib/workos/user_management/authentication_sso_timed_out_data_error.rb new file mode 100644 index 00000000..ef0123b5 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_timed_out_data_error.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationSSOTimedOutDataError = AuthenticationEmailVerificationFailedDataError +end diff --git a/lib/workos/user_management/authentication_sso_timed_out_data_sso.rb b/lib/workos/user_management/authentication_sso_timed_out_data_sso.rb new file mode 100644 index 00000000..888fbc25 --- /dev/null +++ b/lib/workos/user_management/authentication_sso_timed_out_data_sso.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + AuthenticationSSOTimedOutDataSSO = AuthenticationSSOFailedDataSSO +end diff --git a/lib/workos/user_management/authorization_code_session_authenticate_request.rb b/lib/workos/user_management/authorization_code_session_authenticate_request.rb new file mode 100644 index 00000000..76f02f11 --- /dev/null +++ b/lib/workos/user_management/authorization_code_session_authenticate_request.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthorizationCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + code: :code, + code_verifier: :code_verifier, + invitation_token: :invitation_token, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :code, + :code_verifier, + :invitation_token, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @code = hash[:code] + @code_verifier = hash[:code_verifier] + @invitation_token = hash[:invitation_token] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/authorized_connect_application_list_data.rb b/lib/workos/user_management/authorized_connect_application_list_data.rb new file mode 100644 index 00000000..0b3e62d8 --- /dev/null +++ b/lib/workos/user_management/authorized_connect_application_list_data.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class AuthorizedConnectApplicationListData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + granted_scopes: :granted_scopes, + oauth_resource: :oauth_resource, + application: :application + }.freeze + + attr_accessor \ + :object, + :id, + :granted_scopes, + :oauth_resource, + :application + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @granted_scopes = hash[:granted_scopes] || [] + @oauth_resource = hash[:oauth_resource] + @application = hash[:application] ? WorkOS::ConnectApplication.new(hash[:application]) : nil + end + end +end diff --git a/lib/workos/user_management/confirm_email_change.rb b/lib/workos/user_management/confirm_email_change.rb new file mode 100644 index 00000000..b8a6504e --- /dev/null +++ b/lib/workos/user_management/confirm_email_change.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ConfirmEmailChange = AuthenticationChallengesVerifyRequest +end diff --git a/lib/workos/user_management/cors_origin_response.rb b/lib/workos/user_management/cors_origin_response.rb new file mode 100644 index 00000000..868bff79 --- /dev/null +++ b/lib/workos/user_management/cors_origin_response.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CORSOriginResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + origin: :origin, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :origin, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @origin = hash[:origin] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/create_cors_origin.rb b/lib/workos/user_management/create_cors_origin.rb new file mode 100644 index 00000000..25136e48 --- /dev/null +++ b/lib/workos/user_management/create_cors_origin.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateCORSOrigin < WorkOS::Types::BaseModel + HASH_ATTRS = { + origin: :origin + }.freeze + + attr_accessor :origin + + def initialize(json) + hash = self.class.normalize(json) + @origin = hash[:origin] + end + end +end diff --git a/lib/workos/user_management/create_magic_code_and_return.rb b/lib/workos/user_management/create_magic_code_and_return.rb new file mode 100644 index 00000000..fcc683c9 --- /dev/null +++ b/lib/workos/user_management/create_magic_code_and_return.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateMagicCodeAndReturn < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + invitation_token: :invitation_token + }.freeze + + attr_accessor \ + :email, + :invitation_token + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @invitation_token = hash[:invitation_token] + end + end +end diff --git a/lib/workos/user_management/create_password_reset.rb b/lib/workos/user_management/create_password_reset.rb new file mode 100644 index 00000000..64bf3905 --- /dev/null +++ b/lib/workos/user_management/create_password_reset.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreatePasswordReset < WorkOS::Types::BaseModel + HASH_ATTRS = { + token: :token, + new_password: :new_password + }.freeze + + attr_accessor \ + :token, + :new_password + + def initialize(json) + hash = self.class.normalize(json) + @token = hash[:token] + @new_password = hash[:new_password] + end + end +end diff --git a/lib/workos/user_management/create_password_reset_token.rb b/lib/workos/user_management/create_password_reset_token.rb new file mode 100644 index 00000000..df036baa --- /dev/null +++ b/lib/workos/user_management/create_password_reset_token.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreatePasswordResetToken < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email + }.freeze + + attr_accessor :email + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + end + end +end diff --git a/lib/workos/user_management/create_redirect_uri.rb b/lib/workos/user_management/create_redirect_uri.rb new file mode 100644 index 00000000..dcc41fe1 --- /dev/null +++ b/lib/workos/user_management/create_redirect_uri.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateRedirectUri < WorkOS::Types::BaseModel + HASH_ATTRS = { + uri: :uri + }.freeze + + attr_accessor :uri + + def initialize(json) + hash = self.class.normalize(json) + @uri = hash[:uri] + end + end +end diff --git a/lib/workos/user_management/create_user.rb b/lib/workos/user_management/create_user.rb new file mode 100644 index 00000000..b729884f --- /dev/null +++ b/lib/workos/user_management/create_user.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + first_name: :first_name, + last_name: :last_name, + email_verified: :email_verified, + metadata: :metadata, + external_id: :external_id, + password: :password, + password_hash: :password_hash, + password_hash_type: :password_hash_type + }.freeze + + attr_accessor \ + :email, + :first_name, + :last_name, + :email_verified, + :metadata, + :external_id, + :password, + :password_hash, + :password_hash_type + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @email_verified = hash[:email_verified] + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @password = hash[:password] + @password_hash = hash[:password_hash] + @password_hash_type = hash[:password_hash_type] + end + end +end diff --git a/lib/workos/user_management/create_user_api_key.rb b/lib/workos/user_management/create_user_api_key.rb new file mode 100644 index 00000000..17cf44f5 --- /dev/null +++ b/lib/workos/user_management/create_user_api_key.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateUserApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + name: :name, + organization_id: :organization_id, + permissions: :permissions + }.freeze + + attr_accessor \ + :name, + :organization_id, + :permissions + + def initialize(json) + hash = self.class.normalize(json) + @name = hash[:name] + @organization_id = hash[:organization_id] + @permissions = hash[:permissions] || [] + end + end +end diff --git a/lib/workos/user_management/create_user_invite_options.rb b/lib/workos/user_management/create_user_invite_options.rb new file mode 100644 index 00000000..41e38f63 --- /dev/null +++ b/lib/workos/user_management/create_user_invite_options.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateUserInviteOptions < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + organization_id: :organization_id, + role_slug: :role_slug, + expires_in_days: :expires_in_days, + inviter_user_id: :inviter_user_id, + locale: :locale + }.freeze + + attr_accessor \ + :email, + :organization_id, + :role_slug, + :expires_in_days, + :inviter_user_id, + :locale + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @organization_id = hash[:organization_id] + @role_slug = hash[:role_slug] + @expires_in_days = hash[:expires_in_days] + @inviter_user_id = hash[:inviter_user_id] + @locale = hash[:locale] + end + end +end diff --git a/lib/workos/user_management/create_user_organization_membership.rb b/lib/workos/user_management/create_user_organization_membership.rb new file mode 100644 index 00000000..924a71dc --- /dev/null +++ b/lib/workos/user_management/create_user_organization_membership.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateUserOrganizationMembership < WorkOS::Types::BaseModel + HASH_ATTRS = { + user_id: :user_id, + organization_id: :organization_id, + role_slug: :role_slug, + role_slugs: :role_slugs + }.freeze + + attr_accessor \ + :user_id, + :organization_id, + :role_slug, + :role_slugs + + def initialize(json) + hash = self.class.normalize(json) + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @role_slug = hash[:role_slug] + @role_slugs = hash[:role_slugs] || [] + end + end +end diff --git a/lib/workos/user_management/device_authorization_response.rb b/lib/workos/user_management/device_authorization_response.rb new file mode 100644 index 00000000..b828c049 --- /dev/null +++ b/lib/workos/user_management/device_authorization_response.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DeviceAuthorizationResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + device_code: :device_code, + user_code: :user_code, + verification_uri: :verification_uri, + verification_uri_complete: :verification_uri_complete, + expires_in: :expires_in, + interval: :interval + }.freeze + + attr_accessor \ + :device_code, + :user_code, + :verification_uri, + :verification_uri_complete, + :expires_in, + :interval + + def initialize(json) + hash = self.class.normalize(json) + @device_code = hash[:device_code] + @user_code = hash[:user_code] + @verification_uri = hash[:verification_uri] + @verification_uri_complete = hash[:verification_uri_complete] + @expires_in = hash[:expires_in] + @interval = hash[:interval] + end + end +end diff --git a/lib/workos/user_management/device_code_session_authenticate_request.rb b/lib/workos/user_management/device_code_session_authenticate_request.rb new file mode 100644 index 00000000..de7c4b66 --- /dev/null +++ b/lib/workos/user_management/device_code_session_authenticate_request.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DeviceCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + grant_type: :grant_type, + device_code: :device_code, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :grant_type, + :device_code, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @grant_type = hash[:grant_type] + @device_code = hash[:device_code] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/email_change.rb b/lib/workos/user_management/email_change.rb new file mode 100644 index 00000000..e2b6f5a7 --- /dev/null +++ b/lib/workos/user_management/email_change.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailChange < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + user: :user, + new_email: :new_email, + expires_at: :expires_at, + created_at: :created_at + }.freeze + + attr_accessor \ + :object, + :user, + :new_email, + :expires_at, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + @new_email = hash[:new_email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/user_management/email_change_confirmation.rb b/lib/workos/user_management/email_change_confirmation.rb new file mode 100644 index 00000000..fc1609ce --- /dev/null +++ b/lib/workos/user_management/email_change_confirmation.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailChangeConfirmation < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + user: :user + }.freeze + + attr_accessor \ + :object, + :user + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @user = hash[:user] ? WorkOS::EmailChangeConfirmationUser.new(hash[:user]) : nil + end + end +end diff --git a/lib/workos/user_management/email_change_confirmation_user.rb b/lib/workos/user_management/email_change_confirmation_user.rb new file mode 100644 index 00000000..b6c0ac2c --- /dev/null +++ b/lib/workos/user_management/email_change_confirmation_user.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailChangeConfirmationUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + first_name: :first_name, + last_name: :last_name, + profile_picture_url: :profile_picture_url, + email: :email, + email_verified: :email_verified, + external_id: :external_id, + metadata: :metadata, + last_sign_in_at: :last_sign_in_at, + locale: :locale, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :first_name, + :last_name, + :profile_picture_url, + :email, + :email_verified, + :external_id, + :metadata, + :last_sign_in_at, + :locale, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @profile_picture_url = hash[:profile_picture_url] + @email = hash[:email] + @email_verified = hash[:email_verified] + @external_id = hash[:external_id] + @metadata = hash[:metadata] || {} + @last_sign_in_at = hash[:last_sign_in_at] + @locale = hash[:locale] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/email_verification.rb b/lib/workos/user_management/email_verification.rb new file mode 100644 index 00000000..7bf7312b --- /dev/null +++ b/lib/workos/user_management/email_verification.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailVerification < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at, + updated_at: :updated_at, + code: :code + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at, + :updated_at, + :code + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @code = hash[:code] + end + end +end diff --git a/lib/workos/user_management/email_verification_code_session_authenticate_request.rb b/lib/workos/user_management/email_verification_code_session_authenticate_request.rb new file mode 100644 index 00000000..4774a0b5 --- /dev/null +++ b/lib/workos/user_management/email_verification_code_session_authenticate_request.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailVerificationCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + code: :code, + pending_authentication_token: :pending_authentication_token, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :code, + :pending_authentication_token, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @code = hash[:code] + @pending_authentication_token = hash[:pending_authentication_token] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/email_verification_created.rb b/lib/workos/user_management/email_verification_created.rb new file mode 100644 index 00000000..c9472ad4 --- /dev/null +++ b/lib/workos/user_management/email_verification_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailVerificationCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::EmailVerificationCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/email_verification_created_data.rb b/lib/workos/user_management/email_verification_created_data.rb new file mode 100644 index 00000000..1bade3ee --- /dev/null +++ b/lib/workos/user_management/email_verification_created_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class EmailVerificationCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/invitation.rb b/lib/workos/user_management/invitation.rb new file mode 100644 index 00000000..c1ecd312 --- /dev/null +++ b/lib/workos/user_management/invitation.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class Invitation < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at, + token: :token, + accept_invitation_url: :accept_invitation_url + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at, + :token, + :accept_invitation_url + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @token = hash[:token] + @accept_invitation_url = hash[:accept_invitation_url] + end + end +end diff --git a/lib/workos/user_management/invitation_accepted.rb b/lib/workos/user_management/invitation_accepted.rb new file mode 100644 index 00000000..132f9bbe --- /dev/null +++ b/lib/workos/user_management/invitation_accepted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationAccepted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::InvitationAcceptedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/invitation_accepted_data.rb b/lib/workos/user_management/invitation_accepted_data.rb new file mode 100644 index 00000000..456726a4 --- /dev/null +++ b/lib/workos/user_management/invitation_accepted_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationAcceptedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/invitation_created.rb b/lib/workos/user_management/invitation_created.rb new file mode 100644 index 00000000..989bc023 --- /dev/null +++ b/lib/workos/user_management/invitation_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::InvitationCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/invitation_created_data.rb b/lib/workos/user_management/invitation_created_data.rb new file mode 100644 index 00000000..7720c1ce --- /dev/null +++ b/lib/workos/user_management/invitation_created_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/invitation_resent.rb b/lib/workos/user_management/invitation_resent.rb new file mode 100644 index 00000000..b89d7768 --- /dev/null +++ b/lib/workos/user_management/invitation_resent.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationResent < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::InvitationResentData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/invitation_resent_data.rb b/lib/workos/user_management/invitation_resent_data.rb new file mode 100644 index 00000000..7fa50c54 --- /dev/null +++ b/lib/workos/user_management/invitation_resent_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationResentData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/invitation_revoked.rb b/lib/workos/user_management/invitation_revoked.rb new file mode 100644 index 00000000..d0f28b55 --- /dev/null +++ b/lib/workos/user_management/invitation_revoked.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationRevoked < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::InvitationRevokedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/invitation_revoked_data.rb b/lib/workos/user_management/invitation_revoked_data.rb new file mode 100644 index 00000000..b7cd0c07 --- /dev/null +++ b/lib/workos/user_management/invitation_revoked_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class InvitationRevokedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/jwks_response.rb b/lib/workos/user_management/jwks_response.rb new file mode 100644 index 00000000..8b616313 --- /dev/null +++ b/lib/workos/user_management/jwks_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class JwksResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + keys: :keys + }.freeze + + attr_accessor :keys + + def initialize(json) + hash = self.class.normalize(json) + @keys = (hash[:keys] || []).map { |item| item ? WorkOS::JwksResponseKeys.new(item) : nil } + end + end +end diff --git a/lib/workos/user_management/jwks_response_keys.rb b/lib/workos/user_management/jwks_response_keys.rb new file mode 100644 index 00000000..e7486e9c --- /dev/null +++ b/lib/workos/user_management/jwks_response_keys.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class JwksResponseKeys < WorkOS::Types::BaseModel + HASH_ATTRS = { + :alg => :alg, + :kty => :kty, + :use => :use, + :x5c => :x_5_c, + :n => :n, + :e => :e, + :kid => :kid, + "x5t#S256" => :x_5_t_s_256 + }.freeze + + attr_accessor \ + :alg, + :kty, + :use, + :x_5_c, + :n, + :e, + :kid, + :x_5_t_s_256 + + def initialize(json) + hash = self.class.normalize(json) + @alg = hash[:alg] + @kty = hash[:kty] + @use = hash[:use] + @x_5_c = hash[:x5c] || [] + @n = hash[:n] + @e = hash[:e] + @kid = hash[:kid] + @x_5_t_s_256 = hash[:"x5t#S256"] + end + end +end diff --git a/lib/workos/user_management/jwt_template_response.rb b/lib/workos/user_management/jwt_template_response.rb new file mode 100644 index 00000000..5dc65b0d --- /dev/null +++ b/lib/workos/user_management/jwt_template_response.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class JWTTemplateResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + content: :content, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :content, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @content = hash[:content] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/magic_auth.rb b/lib/workos/user_management/magic_auth.rb new file mode 100644 index 00000000..00ae887a --- /dev/null +++ b/lib/workos/user_management/magic_auth.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class MagicAuth < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at, + updated_at: :updated_at, + code: :code + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at, + :updated_at, + :code + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @code = hash[:code] + end + end +end diff --git a/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb b/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb new file mode 100644 index 00000000..aad2df18 --- /dev/null +++ b/lib/workos/user_management/magic_auth_code_session_authenticate_request.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class MagicAuthCodeSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + code: :code, + email: :email, + invitation_token: :invitation_token, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :code, + :email, + :invitation_token, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @code = hash[:code] + @email = hash[:email] + @invitation_token = hash[:invitation_token] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/magic_auth_created.rb b/lib/workos/user_management/magic_auth_created.rb new file mode 100644 index 00000000..e356dd07 --- /dev/null +++ b/lib/workos/user_management/magic_auth_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class MagicAuthCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::MagicAuthCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/magic_auth_created_data.rb b/lib/workos/user_management/magic_auth_created_data.rb new file mode 100644 index 00000000..d9e0d970 --- /dev/null +++ b/lib/workos/user_management/magic_auth_created_data.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class MagicAuthCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/mfa_totp_session_authenticate_request.rb b/lib/workos/user_management/mfa_totp_session_authenticate_request.rb new file mode 100644 index 00000000..e05dc4a3 --- /dev/null +++ b/lib/workos/user_management/mfa_totp_session_authenticate_request.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class MFATotpSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + code: :code, + pending_authentication_token: :pending_authentication_token, + authentication_challenge_id: :authentication_challenge_id, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :code, + :pending_authentication_token, + :authentication_challenge_id, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @code = hash[:code] + @pending_authentication_token = hash[:pending_authentication_token] + @authentication_challenge_id = hash[:authentication_challenge_id] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/organization_membership.rb b/lib/workos/user_management/organization_membership.rb new file mode 100644 index 00000000..e73f24f3 --- /dev/null +++ b/lib/workos/user_management/organization_membership.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationMembership < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + directory_managed: :directory_managed, + organization_name: :organization_name, + custom_attributes: :custom_attributes, + created_at: :created_at, + updated_at: :updated_at, + role: :role, + user: :user + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :directory_managed, + :organization_name, + :custom_attributes, + :created_at, + :updated_at, + :role, + :user + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @directory_managed = hash[:directory_managed] + @organization_name = hash[:organization_name] + @custom_attributes = hash[:custom_attributes] || {} + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + end + end +end diff --git a/lib/workos/user_management/organization_selection_session_authenticate_request.rb b/lib/workos/user_management/organization_selection_session_authenticate_request.rb new file mode 100644 index 00000000..a2ed1857 --- /dev/null +++ b/lib/workos/user_management/organization_selection_session_authenticate_request.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class OrganizationSelectionSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + pending_authentication_token: :pending_authentication_token, + organization_id: :organization_id, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :pending_authentication_token, + :organization_id, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @pending_authentication_token = hash[:pending_authentication_token] + @organization_id = hash[:organization_id] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/password_reset.rb b/lib/workos/user_management/password_reset.rb new file mode 100644 index 00000000..f7398595 --- /dev/null +++ b/lib/workos/user_management/password_reset.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PasswordReset < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at, + password_reset_token: :password_reset_token, + password_reset_url: :password_reset_url + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at, + :password_reset_token, + :password_reset_url + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + @password_reset_token = hash[:password_reset_token] + @password_reset_url = hash[:password_reset_url] + end + end +end diff --git a/lib/workos/user_management/password_reset_created.rb b/lib/workos/user_management/password_reset_created.rb new file mode 100644 index 00000000..1ab44295 --- /dev/null +++ b/lib/workos/user_management/password_reset_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PasswordResetCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PasswordResetCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/password_reset_created_data.rb b/lib/workos/user_management/password_reset_created_data.rb new file mode 100644 index 00000000..85f551b9 --- /dev/null +++ b/lib/workos/user_management/password_reset_created_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PasswordResetCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + email: :email, + expires_at: :expires_at, + created_at: :created_at + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :email, + :expires_at, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @email = hash[:email] + @expires_at = hash[:expires_at] + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/user_management/password_reset_succeeded.rb b/lib/workos/user_management/password_reset_succeeded.rb new file mode 100644 index 00000000..7865b21b --- /dev/null +++ b/lib/workos/user_management/password_reset_succeeded.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PasswordResetSucceeded < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::PasswordResetSucceededData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/password_reset_succeeded_data.rb b/lib/workos/user_management/password_reset_succeeded_data.rb new file mode 100644 index 00000000..076bc8b3 --- /dev/null +++ b/lib/workos/user_management/password_reset_succeeded_data.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + PasswordResetSucceededData = PasswordResetCreatedData +end diff --git a/lib/workos/user_management/password_session_authenticate_request.rb b/lib/workos/user_management/password_session_authenticate_request.rb new file mode 100644 index 00000000..f43f7970 --- /dev/null +++ b/lib/workos/user_management/password_session_authenticate_request.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class PasswordSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + email: :email, + password: :password, + invitation_token: :invitation_token, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :email, + :password, + :invitation_token, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @email = hash[:email] + @password = hash[:password] + @invitation_token = hash[:invitation_token] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/redirect_uri.rb b/lib/workos/user_management/redirect_uri.rb new file mode 100644 index 00000000..a9e109f0 --- /dev/null +++ b/lib/workos/user_management/redirect_uri.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RedirectUri < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + uri: :uri, + default: :default, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :uri, + :default, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @uri = hash[:uri] + @default = hash[:default] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/refresh_token_session_authenticate_request.rb b/lib/workos/user_management/refresh_token_session_authenticate_request.rb new file mode 100644 index 00000000..d3d67524 --- /dev/null +++ b/lib/workos/user_management/refresh_token_session_authenticate_request.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RefreshTokenSessionAuthenticateRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id, + client_secret: :client_secret, + grant_type: :grant_type, + refresh_token: :refresh_token, + organization_id: :organization_id, + ip_address: :ip_address, + device_id: :device_id, + user_agent: :user_agent + }.freeze + + attr_accessor \ + :client_id, + :client_secret, + :grant_type, + :refresh_token, + :organization_id, + :ip_address, + :device_id, + :user_agent + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + @grant_type = hash[:grant_type] + @refresh_token = hash[:refresh_token] + @organization_id = hash[:organization_id] + @ip_address = hash[:ip_address] + @device_id = hash[:device_id] + @user_agent = hash[:user_agent] + end + end +end diff --git a/lib/workos/user_management/resend_user_invite_options.rb b/lib/workos/user_management/resend_user_invite_options.rb new file mode 100644 index 00000000..55493e40 --- /dev/null +++ b/lib/workos/user_management/resend_user_invite_options.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ResendUserInviteOptions < WorkOS::Types::BaseModel + HASH_ATTRS = { + locale: :locale + }.freeze + + attr_accessor :locale + + def initialize(json) + hash = self.class.normalize(json) + @locale = hash[:locale] + end + end +end diff --git a/lib/workos/user_management/reset_password_response.rb b/lib/workos/user_management/reset_password_response.rb new file mode 100644 index 00000000..31f6b916 --- /dev/null +++ b/lib/workos/user_management/reset_password_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ResetPasswordResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + user: :user + }.freeze + + attr_accessor :user + + def initialize(json) + hash = self.class.normalize(json) + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + end + end +end diff --git a/lib/workos/user_management/revoke_session.rb b/lib/workos/user_management/revoke_session.rb new file mode 100644 index 00000000..337432f5 --- /dev/null +++ b/lib/workos/user_management/revoke_session.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class RevokeSession < WorkOS::Types::BaseModel + HASH_ATTRS = { + session_id: :session_id, + return_to: :return_to + }.freeze + + attr_accessor \ + :session_id, + :return_to + + def initialize(json) + hash = self.class.normalize(json) + @session_id = hash[:session_id] + @return_to = hash[:return_to] + end + end +end diff --git a/lib/workos/user_management/send_email_change.rb b/lib/workos/user_management/send_email_change.rb new file mode 100644 index 00000000..afd95bfa --- /dev/null +++ b/lib/workos/user_management/send_email_change.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SendEmailChange < WorkOS::Types::BaseModel + HASH_ATTRS = { + new_email: :new_email + }.freeze + + attr_accessor :new_email + + def initialize(json) + hash = self.class.normalize(json) + @new_email = hash[:new_email] + end + end +end diff --git a/lib/workos/user_management/send_verification_email_response.rb b/lib/workos/user_management/send_verification_email_response.rb new file mode 100644 index 00000000..677a2cc6 --- /dev/null +++ b/lib/workos/user_management/send_verification_email_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + SendVerificationEmailResponse = ResetPasswordResponse +end diff --git a/lib/workos/user_management/session_created.rb b/lib/workos/user_management/session_created.rb new file mode 100644 index 00000000..452066ba --- /dev/null +++ b/lib/workos/user_management/session_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SessionCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::SessionCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/session_created_data.rb b/lib/workos/user_management/session_created_data.rb new file mode 100644 index 00000000..6a4c99d8 --- /dev/null +++ b/lib/workos/user_management/session_created_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SessionCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + impersonator: :impersonator, + ip_address: :ip_address, + organization_id: :organization_id, + user_agent: :user_agent, + user_id: :user_id, + auth_method: :auth_method, + status: :status, + expires_at: :expires_at, + ended_at: :ended_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :impersonator, + :ip_address, + :organization_id, + :user_agent, + :user_id, + :auth_method, + :status, + :expires_at, + :ended_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @impersonator = hash[:impersonator] ? WorkOS::SessionCreatedDataImpersonator.new(hash[:impersonator]) : nil + @ip_address = hash[:ip_address] + @organization_id = hash[:organization_id] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @auth_method = hash[:auth_method] + @status = hash[:status] + @expires_at = hash[:expires_at] + @ended_at = hash[:ended_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/session_created_data_impersonator.rb b/lib/workos/user_management/session_created_data_impersonator.rb new file mode 100644 index 00000000..5db89677 --- /dev/null +++ b/lib/workos/user_management/session_created_data_impersonator.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + SessionCreatedDataImpersonator = AuthenticateResponseImpersonator +end diff --git a/lib/workos/user_management/session_revoked.rb b/lib/workos/user_management/session_revoked.rb new file mode 100644 index 00000000..4e7c0338 --- /dev/null +++ b/lib/workos/user_management/session_revoked.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SessionRevoked < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::SessionRevokedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/session_revoked_data.rb b/lib/workos/user_management/session_revoked_data.rb new file mode 100644 index 00000000..88092132 --- /dev/null +++ b/lib/workos/user_management/session_revoked_data.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SessionRevokedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + impersonator: :impersonator, + ip_address: :ip_address, + organization_id: :organization_id, + user_agent: :user_agent, + user_id: :user_id, + auth_method: :auth_method, + status: :status, + expires_at: :expires_at, + ended_at: :ended_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :impersonator, + :ip_address, + :organization_id, + :user_agent, + :user_id, + :auth_method, + :status, + :expires_at, + :ended_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @impersonator = hash[:impersonator] ? WorkOS::SessionRevokedDataImpersonator.new(hash[:impersonator]) : nil + @ip_address = hash[:ip_address] + @organization_id = hash[:organization_id] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @auth_method = hash[:auth_method] + @status = hash[:status] + @expires_at = hash[:expires_at] + @ended_at = hash[:ended_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/session_revoked_data_impersonator.rb b/lib/workos/user_management/session_revoked_data_impersonator.rb new file mode 100644 index 00000000..31c0d83d --- /dev/null +++ b/lib/workos/user_management/session_revoked_data_impersonator.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + SessionRevokedDataImpersonator = AuthenticateResponseImpersonator +end diff --git a/lib/workos/user_management/sso_device_authorization_request.rb b/lib/workos/user_management/sso_device_authorization_request.rb new file mode 100644 index 00000000..a86cccbb --- /dev/null +++ b/lib/workos/user_management/sso_device_authorization_request.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class SSODeviceAuthorizationRequest < WorkOS::Types::BaseModel + HASH_ATTRS = { + client_id: :client_id + }.freeze + + attr_accessor :client_id + + def initialize(json) + hash = self.class.normalize(json) + @client_id = hash[:client_id] + end + end +end diff --git a/lib/workos/user_management/update_jwt_template.rb b/lib/workos/user_management/update_jwt_template.rb new file mode 100644 index 00000000..76dd4aa2 --- /dev/null +++ b/lib/workos/user_management/update_jwt_template.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateJWTTemplate < WorkOS::Types::BaseModel + HASH_ATTRS = { + content: :content + }.freeze + + attr_accessor :content + + def initialize(json) + hash = self.class.normalize(json) + @content = hash[:content] + end + end +end diff --git a/lib/workos/user_management/update_user.rb b/lib/workos/user_management/update_user.rb new file mode 100644 index 00000000..6dfb19c7 --- /dev/null +++ b/lib/workos/user_management/update_user.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateUser < WorkOS::Types::BaseModel + HASH_ATTRS = { + email: :email, + first_name: :first_name, + last_name: :last_name, + email_verified: :email_verified, + metadata: :metadata, + external_id: :external_id, + locale: :locale, + password: :password, + password_hash: :password_hash, + password_hash_type: :password_hash_type + }.freeze + + attr_accessor \ + :email, + :first_name, + :last_name, + :email_verified, + :metadata, + :external_id, + :locale, + :password, + :password_hash, + :password_hash_type + + def initialize(json) + hash = self.class.normalize(json) + @email = hash[:email] + @first_name = hash[:first_name] + @last_name = hash[:last_name] + @email_verified = hash[:email_verified] + @metadata = hash[:metadata] || {} + @external_id = hash[:external_id] + @locale = hash[:locale] + @password = hash[:password] + @password_hash = hash[:password_hash] + @password_hash_type = hash[:password_hash_type] + end + end +end diff --git a/lib/workos/user_management/update_user_organization_membership.rb b/lib/workos/user_management/update_user_organization_membership.rb new file mode 100644 index 00000000..e922b32c --- /dev/null +++ b/lib/workos/user_management/update_user_organization_membership.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateUserOrganizationMembership < WorkOS::Types::BaseModel + HASH_ATTRS = { + role_slug: :role_slug, + role_slugs: :role_slugs + }.freeze + + attr_accessor \ + :role_slug, + :role_slugs + + def initialize(json) + hash = self.class.normalize(json) + @role_slug = hash[:role_slug] + @role_slugs = hash[:role_slugs] || [] + end + end +end diff --git a/lib/workos/user_management/user.rb b/lib/workos/user_management/user.rb new file mode 100644 index 00000000..e48e0b4b --- /dev/null +++ b/lib/workos/user_management/user.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + User = EmailChangeConfirmationUser +end diff --git a/lib/workos/user_management/user_api_key.rb b/lib/workos/user_management/user_api_key.rb new file mode 100644 index 00000000..cd68aec5 --- /dev/null +++ b/lib/workos/user_management/user_api_key.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? WorkOS::UserApiKeyOwner.new(hash[:owner]) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/user_api_key_created_data_owner.rb b/lib/workos/user_management/user_api_key_created_data_owner.rb new file mode 100644 index 00000000..d1e1d25b --- /dev/null +++ b/lib/workos/user_management/user_api_key_created_data_owner.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserApiKeyCreatedDataOwner < WorkOS::Types::BaseModel + HASH_ATTRS = { + type: :type, + id: :id, + organization_id: :organization_id + }.freeze + + attr_accessor \ + :type, + :id, + :organization_id + + def initialize(json) + hash = self.class.normalize(json) + @type = hash[:type] + @id = hash[:id] + @organization_id = hash[:organization_id] + end + end +end diff --git a/lib/workos/user_management/user_api_key_owner.rb b/lib/workos/user_management/user_api_key_owner.rb new file mode 100644 index 00000000..9a9ce16f --- /dev/null +++ b/lib/workos/user_management/user_api_key_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UserApiKeyOwner = UserApiKeyCreatedDataOwner +end diff --git a/lib/workos/user_management/user_api_key_revoked_data_owner.rb b/lib/workos/user_management/user_api_key_revoked_data_owner.rb new file mode 100644 index 00000000..6482c3cc --- /dev/null +++ b/lib/workos/user_management/user_api_key_revoked_data_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UserApiKeyRevokedDataOwner = UserApiKeyCreatedDataOwner +end diff --git a/lib/workos/user_management/user_api_key_with_value.rb b/lib/workos/user_management/user_api_key_with_value.rb new file mode 100644 index 00000000..6016ae72 --- /dev/null +++ b/lib/workos/user_management/user_api_key_with_value.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserApiKeyWithValue < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at, + value: :value + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :permissions, + :created_at, + :updated_at, + :value + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @owner = hash[:owner] ? WorkOS::UserApiKeyWithValueOwner.new(hash[:owner]) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @value = hash[:value] + end + end +end diff --git a/lib/workos/user_management/user_api_key_with_value_owner.rb b/lib/workos/user_management/user_api_key_with_value_owner.rb new file mode 100644 index 00000000..5c506d62 --- /dev/null +++ b/lib/workos/user_management/user_api_key_with_value_owner.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UserApiKeyWithValueOwner = UserApiKeyCreatedDataOwner +end diff --git a/lib/workos/user_management/user_created.rb b/lib/workos/user_management/user_created.rb new file mode 100644 index 00000000..946d31ed --- /dev/null +++ b/lib/workos/user_management/user_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::User.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/user_deleted.rb b/lib/workos/user_management/user_deleted.rb new file mode 100644 index 00000000..1671fe12 --- /dev/null +++ b/lib/workos/user_management/user_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::User.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/user_identities_get_item.rb b/lib/workos/user_management/user_identities_get_item.rb new file mode 100644 index 00000000..09f8d76e --- /dev/null +++ b/lib/workos/user_management/user_identities_get_item.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserIdentitiesGetItem < WorkOS::Types::BaseModel + HASH_ATTRS = { + idp_id: :idp_id, + type: :type, + provider: :provider + }.freeze + + attr_accessor \ + :idp_id, + :type, + :provider + + def initialize(json) + hash = self.class.normalize(json) + @idp_id = hash[:idp_id] + @type = hash[:type] + @provider = hash[:provider] + end + end +end diff --git a/lib/workos/user_management/user_invite.rb b/lib/workos/user_management/user_invite.rb new file mode 100644 index 00000000..87ca1a14 --- /dev/null +++ b/lib/workos/user_management/user_invite.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserInvite < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + email: :email, + state: :state, + accepted_at: :accepted_at, + revoked_at: :revoked_at, + expires_at: :expires_at, + organization_id: :organization_id, + inviter_user_id: :inviter_user_id, + accepted_user_id: :accepted_user_id, + role_slug: :role_slug, + created_at: :created_at, + updated_at: :updated_at, + token: :token, + accept_invitation_url: :accept_invitation_url + }.freeze + + attr_accessor \ + :object, + :id, + :email, + :state, + :accepted_at, + :revoked_at, + :expires_at, + :organization_id, + :inviter_user_id, + :accepted_user_id, + :role_slug, + :created_at, + :updated_at, + :token, + :accept_invitation_url + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @email = hash[:email] + @state = hash[:state] + @accepted_at = hash[:accepted_at] + @revoked_at = hash[:revoked_at] + @expires_at = hash[:expires_at] + @organization_id = hash[:organization_id] + @inviter_user_id = hash[:inviter_user_id] + @accepted_user_id = hash[:accepted_user_id] + @role_slug = hash[:role_slug] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @token = hash[:token] + @accept_invitation_url = hash[:accept_invitation_url] + end + end +end diff --git a/lib/workos/user_management/user_organization_membership.rb b/lib/workos/user_management/user_organization_membership.rb new file mode 100644 index 00000000..22a8b2fb --- /dev/null +++ b/lib/workos/user_management/user_organization_membership.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserOrganizationMembership < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + user_id: :user_id, + organization_id: :organization_id, + status: :status, + directory_managed: :directory_managed, + organization_name: :organization_name, + custom_attributes: :custom_attributes, + created_at: :created_at, + updated_at: :updated_at, + role: :role, + user: :user + }.freeze + + attr_accessor \ + :object, + :id, + :user_id, + :organization_id, + :status, + :directory_managed, + :organization_name, + :custom_attributes, + :created_at, + :updated_at, + :role, + :user + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @user_id = hash[:user_id] + @organization_id = hash[:organization_id] + @status = hash[:status] + @directory_managed = hash[:directory_managed] + @organization_name = hash[:organization_name] + @custom_attributes = hash[:custom_attributes] || {} + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @user = hash[:user] ? WorkOS::User.new(hash[:user]) : nil + end + end +end diff --git a/lib/workos/user_management/user_sessions_impersonator.rb b/lib/workos/user_management/user_sessions_impersonator.rb new file mode 100644 index 00000000..85f414e0 --- /dev/null +++ b/lib/workos/user_management/user_sessions_impersonator.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + UserSessionsImpersonator = AuthenticateResponseImpersonator +end diff --git a/lib/workos/user_management/user_sessions_list_item.rb b/lib/workos/user_management/user_sessions_list_item.rb new file mode 100644 index 00000000..11da49a7 --- /dev/null +++ b/lib/workos/user_management/user_sessions_list_item.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserSessionsListItem < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + impersonator: :impersonator, + ip_address: :ip_address, + organization_id: :organization_id, + user_agent: :user_agent, + user_id: :user_id, + auth_method: :auth_method, + status: :status, + expires_at: :expires_at, + ended_at: :ended_at, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :impersonator, + :ip_address, + :organization_id, + :user_agent, + :user_id, + :auth_method, + :status, + :expires_at, + :ended_at, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @impersonator = hash[:impersonator] ? WorkOS::UserSessionsImpersonator.new(hash[:impersonator]) : nil + @ip_address = hash[:ip_address] + @organization_id = hash[:organization_id] + @user_agent = hash[:user_agent] + @user_id = hash[:user_id] + @auth_method = hash[:auth_method] + @status = hash[:status] + @expires_at = hash[:expires_at] + @ended_at = hash[:ended_at] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/user_management/user_updated.rb b/lib/workos/user_management/user_updated.rb new file mode 100644 index 00000000..50a1b426 --- /dev/null +++ b/lib/workos/user_management/user_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UserUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::User.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/user_management/verify_email_address.rb b/lib/workos/user_management/verify_email_address.rb new file mode 100644 index 00000000..e3864e40 --- /dev/null +++ b/lib/workos/user_management/verify_email_address.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + VerifyEmailAddress = AuthenticationChallengesVerifyRequest +end diff --git a/lib/workos/user_management/verify_email_response.rb b/lib/workos/user_management/verify_email_response.rb new file mode 100644 index 00000000..00004e69 --- /dev/null +++ b/lib/workos/user_management/verify_email_response.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + VerifyEmailResponse = ResetPasswordResponse +end diff --git a/lib/workos/user_management_organization_membership_groups.rb b/lib/workos/user_management_organization_membership_groups.rb new file mode 100644 index 00000000..f2cad83f --- /dev/null +++ b/lib/workos/user_management_organization_membership_groups.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class UserManagementOrganizationMembershipGroups + def initialize(client) + @client = client + end + + # List groups + # @param om_id [String] Unique identifier of the Organization Membership. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_organization_membership_groups( + om_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/user_management/organization_memberships/#{WorkOS::Util.encode_path(om_id)}/groups", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_organization_membership_groups( + om_id: om_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::Group, + filters: {om_id: om_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + end +end diff --git a/lib/workos/user_response.rb b/lib/workos/user_response.rb deleted file mode 100644 index 5776256d..00000000 --- a/lib/workos/user_response.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The UserResponse class represents a User as well as an corresponding - # response data that can later be appended on. - class UserResponse - include HashProvider - - attr_accessor :user - - def initialize(user_response_json) - json = JSON.parse(user_response_json, symbolize_names: true) - @user = WorkOS::User.new(json[:user].to_json) - end - - def to_json(*) - { - user: user.to_json, - } - end - end -end diff --git a/lib/workos/util.rb b/lib/workos/util.rb new file mode 100644 index 00000000..258e5b69 --- /dev/null +++ b/lib/workos/util.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +require "cgi" + +module WorkOS + module Util + # Percent-encode a value for use in a URL path segment (RFC 3986). + # Unlike CGI.escape, spaces become %20 instead of +. + def self.encode_path(value) + str = value.to_s + raise ArgumentError, "path segment cannot be nil or empty" if str.empty? + CGI.escape(str).gsub("+", "%20") + end + end +end diff --git a/lib/workos/util/signature.rb b/lib/workos/util/signature.rb new file mode 100644 index 00000000..a2b18a9a --- /dev/null +++ b/lib/workos/util/signature.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "openssl" + +module WorkOS + module Util + module Signature + module_function + + # Computes the expected signature hash for a webhook or action payload. + # + # @param payload [String] Raw request body. + # @param timestamp [String] Timestamp extracted from the signature header. + # @param secret [String] Webhook or action signing secret. + # @return [String] + def compute(payload:, timestamp:, secret:) + OpenSSL::HMAC.hexdigest("SHA256", secret, "#{timestamp}.#{payload}") + end + + # Parses the WorkOS signature header. + # + # @param sig_header [String] Header value in `t=..., v1=...` format. + # @return [Array(String, String)] + # @raise [ArgumentError] If the header is missing or malformed. + def parse_header(sig_header) + raise ArgumentError, "Signature header missing" if sig_header.nil? || sig_header.empty? + + parts = sig_header.split(",").map(&:strip) + timestamp = parts.find { |part| part.start_with?("t=") }&.sub(/\At=/, "") + signature = parts.find { |part| part.start_with?("v1=") }&.sub(/\Av1=/, "") + raise ArgumentError, "Unable to extract timestamp and signature hash from header" if timestamp.nil? || signature.nil? + + [timestamp, signature] + end + + # Compares two signature hashes in constant time. + # + # @param a [String] + # @param b [String] + # @return [Boolean] + def secure_compare(a, b) + return false if a.bytesize != b.bytesize + + OpenSSL.fixed_length_secure_compare(a, b) + rescue NoMethodError + left = a.unpack("C*") + result = 0 + index = -1 + b.each_byte { |byte| result |= byte ^ left[index += 1] } + result.zero? + end + end + end +end diff --git a/lib/workos/vault.rb b/lib/workos/vault.rb new file mode 100644 index 00000000..75624c6b --- /dev/null +++ b/lib/workos/vault.rb @@ -0,0 +1,241 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +# Hand-maintained Vault service: 8 KV endpoints + 2 key endpoints + client-side +# AES-GCM encrypt/decrypt (H18). The Vault HTTP API is not in the OpenAPI spec +# and the AES-GCM helpers are inherently client-side, so this stays +# hand-maintained regardless of spec coverage. +require "base64" +require "json" +require "openssl" +require "securerandom" + +module WorkOS + # WorkOS Vault: KV secret storage, server-managed key wrapping, and + # client-side AES-GCM encrypt/decrypt. + # + # @example Store and retrieve a secret + # client.vault.create_object(name: "api-key", value: "sk_...", key_context: { "tenant" => "t1" }) + # obj = client.vault.read_object_by_name(name: "api-key") + # obj.value # => "sk_..." + # + # @example Client-side encrypt/decrypt + # encrypted = client.vault.encrypt(data: "plaintext", key_context: { "tenant" => "t1" }) + # client.vault.decrypt(encrypted_data: encrypted) + class Vault + DEFAULT_RESPONSE_LIMIT = 10 + + DataKey = Data.define(:id, :key) do + def self.from_response(hash) + new(id: hash["id"], key: hash["data_key"]) + end + end + + DataKeyPair = Data.define(:context, :data_key, :encrypted_keys) do + def self.from_response(hash) + new( + context: hash["context"], + data_key: DataKey.new(id: hash["id"], key: hash["data_key"]), + encrypted_keys: hash["encrypted_keys"] + ) + end + end + + ObjectUpdateBy = Data.define(:id, :name) do + def self.from_hash(hash) + return nil if hash.nil? + new(id: hash["id"], name: hash["name"]) + end + end + + ObjectMetadata = Data.define(:context, :environment_id, :id, :key_id, :updated_at, :updated_by, :version_id) do + def self.from_hash(hash) + new( + context: hash["context"], + environment_id: hash["environment_id"], + id: hash["id"], + key_id: hash["key_id"], + updated_at: hash["updated_at"], + updated_by: ObjectUpdateBy.from_hash(hash["updated_by"]), + version_id: hash["version_id"] + ) + end + end + + VaultObject = Data.define(:id, :name, :value, :metadata) do + def self.from_hash(hash) + new( + id: hash["id"], + name: hash["name"], + value: hash["value"], + metadata: hash["metadata"] ? ObjectMetadata.from_hash(hash["metadata"]) : nil + ) + end + end + + ObjectDigest = Data.define(:id, :name, :updated_at) do + def self.from_hash(hash) + new(id: hash["id"], name: hash["name"], updated_at: hash["updated_at"]) + end + end + + ObjectVersion = Data.define(:id, :created_at, :current_version) do + def self.from_hash(hash) + new(id: hash["id"], created_at: hash["created_at"], current_version: hash["current_version"]) + end + end + + def initialize(client) + @client = client + end + + # -- KV operations -------------------------------------------------------- + + # Get a Vault object with the value decrypted. + def read_object(object_id:, request_options: {}) + response = @client.request(method: :get, path: "/vault/v1/kv/#{WorkOS::Util.encode_path(object_id)}", auth: true, request_options: request_options) + VaultObject.from_hash(JSON.parse(response.body)) + end + + # Get a Vault object by name with the value decrypted. + def read_object_by_name(name:, request_options: {}) + response = @client.request(method: :get, path: "/vault/v1/kv/name/#{WorkOS::Util.encode_path(name)}", auth: true, request_options: request_options) + VaultObject.from_hash(JSON.parse(response.body)) + end + + # Get a Vault object's metadata without decrypting the value. + def get_object_metadata(object_id:, request_options: {}) + response = @client.request(method: :get, path: "/vault/v1/kv/#{WorkOS::Util.encode_path(object_id)}/metadata", auth: true, request_options: request_options) + VaultObject.from_hash(JSON.parse(response.body)) + end + + # List encrypted Vault objects. + # @return [Array] + def list_objects(limit: DEFAULT_RESPONSE_LIMIT, before: nil, after: nil, request_options: {}) + params = {"limit" => limit, "before" => before, "after" => after}.compact + response = @client.request(method: :get, path: "/vault/v1/kv", auth: true, params: params, request_options: request_options) + parsed = JSON.parse(response.body) + (parsed["data"] || []).map { |item| ObjectDigest.from_hash(item) } + end + + # List versions for a specific Vault object. + # @return [Array] + def list_object_versions(object_id:, request_options: {}) + response = @client.request(method: :get, path: "/vault/v1/kv/#{WorkOS::Util.encode_path(object_id)}/versions", auth: true, request_options: request_options) + parsed = JSON.parse(response.body) + (parsed["data"] || []).map { |item| ObjectVersion.from_hash(item) } + end + + # Create a new Vault encrypted object. + def create_object(name:, value:, key_context:, request_options: {}) + body = {"name" => name, "value" => value, "key_context" => key_context} + response = @client.request(method: :post, path: "/vault/v1/kv", auth: true, body: body, request_options: request_options) + ObjectMetadata.from_hash(JSON.parse(response.body)) + end + + # Update an existing Vault object. + def update_object(object_id:, value:, version_check: nil, request_options: {}) + body = {"value" => value, "version_check" => version_check}.compact + response = @client.request(method: :put, path: "/vault/v1/kv/#{WorkOS::Util.encode_path(object_id)}", auth: true, body: body, request_options: request_options) + VaultObject.from_hash(JSON.parse(response.body)) + end + + # Permanently delete a Vault encrypted object. + def delete_object(object_id:, request_options: {}) + @client.request(method: :delete, path: "/vault/v1/kv/#{WorkOS::Util.encode_path(object_id)}", auth: true, request_options: request_options) + nil + end + + # -- Key operations ------------------------------------------------------- + + # Generate a data key for local encryption. + # @return [DataKeyPair] + def create_data_key(key_context:, request_options: {}) + body = {"context" => key_context} + response = @client.request(method: :post, path: "/vault/v1/keys/data-key", auth: true, body: body, request_options: request_options) + DataKeyPair.from_response(JSON.parse(response.body)) + end + + # Decrypt encrypted data keys previously generated by create_data_key. + # @return [DataKey] + def decrypt_data_key(keys:, request_options: {}) + body = {"keys" => keys} + response = @client.request(method: :post, path: "/vault/v1/keys/decrypt", auth: true, body: body, request_options: request_options) + DataKey.from_response(JSON.parse(response.body)) + end + + # -- Client-side AES-GCM encrypt/decrypt (H18) --------------------------- + + # Encrypt data locally using AES-GCM with a data key derived from the context. + # Returns base64(IV || TAG || LEB128(len(keyBlob)) || keyBlob || ciphertext). + def encrypt(data:, key_context:, associated_data: nil) + pair = create_data_key(key_context: key_context) + key = Base64.decode64(pair.data_key.key) + key_blob = Base64.decode64(pair.encrypted_keys) + prefix = encode_u32_leb128(key_blob.bytesize) + iv, ciphertext, tag = aes_gcm_encrypt(data.b, key, associated_data&.b) + Base64.strict_encode64(iv + tag + prefix + key_blob + ciphertext) + end + + # Decrypt data previously encrypted by `encrypt`. + def decrypt(encrypted_data:, associated_data: nil) + payload = Base64.decode64(encrypted_data) + iv = payload.byteslice(0, 12) + tag = payload.byteslice(12, 16) + key_len, leb_len = decode_u32_leb128(payload.byteslice(28, payload.bytesize - 28)) + keys_index = 28 + leb_len + key_blob = payload.byteslice(keys_index, key_len) + ciphertext = payload.byteslice(keys_index + key_len, payload.bytesize - (keys_index + key_len)) + data_key = decrypt_data_key(keys: Base64.strict_encode64(key_blob)) + key = Base64.decode64(data_key.key) + aes_gcm_decrypt(ciphertext, key, iv, tag, associated_data&.b) + end + + private + + def aes_gcm_encrypt(plaintext, key, aad) + cipher = OpenSSL::Cipher.new("aes-256-gcm").encrypt + cipher.key = key + iv = SecureRandom.random_bytes(12) + cipher.iv = iv + cipher.auth_data = aad if aad + ciphertext = cipher.update(plaintext) + cipher.final + [iv, ciphertext, cipher.auth_tag] + end + + def aes_gcm_decrypt(ciphertext, key, iv, tag, aad) + cipher = OpenSSL::Cipher.new("aes-256-gcm").decrypt + cipher.key = key + cipher.iv = iv + cipher.auth_tag = tag + cipher.auth_data = aad if aad + result = cipher.update(ciphertext) + cipher.final + result.force_encoding(Encoding::UTF_8) + end + + def encode_u32_leb128(value) + raise ArgumentError, "value must fit in u32" if value.negative? || value > 0xFFFFFFFF + bytes = +"" + loop do + byte = value & 0x7F + value >>= 7 + byte |= 0x80 if value != 0 + bytes << byte.chr + break if value.zero? + end + bytes + end + + def decode_u32_leb128(buf) + result = 0 + shift = 0 + buf.each_byte.with_index do |b, i| + raise ArgumentError, "LEB128 overflow" if i > 4 + result |= (b & 0x7F) << shift + return [result, i + 1] if (b & 0x80).zero? + shift += 7 + end + raise ArgumentError, "LEB128 not terminated" + end + end +end diff --git a/lib/workos/vault/vault_byok_key_deleted.rb b/lib/workos/vault/vault_byok_key_deleted.rb new file mode 100644 index 00000000..8ad39249 --- /dev/null +++ b/lib/workos/vault/vault_byok_key_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultByokKeyDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultByokKeyDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_byok_key_deleted_data.rb b/lib/workos/vault/vault_byok_key_deleted_data.rb new file mode 100644 index 00000000..9c3a51f9 --- /dev/null +++ b/lib/workos/vault/vault_byok_key_deleted_data.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultByokKeyDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + key_provider: :key_provider + }.freeze + + attr_accessor \ + :organization_id, + :key_provider + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @key_provider = hash[:key_provider] + end + end +end diff --git a/lib/workos/vault/vault_byok_key_verification_completed.rb b/lib/workos/vault/vault_byok_key_verification_completed.rb new file mode 100644 index 00000000..5638a96d --- /dev/null +++ b/lib/workos/vault/vault_byok_key_verification_completed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultByokKeyVerificationCompleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultByokKeyVerificationCompletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_byok_key_verification_completed_data.rb b/lib/workos/vault/vault_byok_key_verification_completed_data.rb new file mode 100644 index 00000000..45eeff8c --- /dev/null +++ b/lib/workos/vault/vault_byok_key_verification_completed_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultByokKeyVerificationCompletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + key_provider: :key_provider, + verified: :verified + }.freeze + + attr_accessor \ + :organization_id, + :key_provider, + :verified + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @key_provider = hash[:key_provider] + @verified = hash[:verified] + end + end +end diff --git a/lib/workos/vault/vault_data_created.rb b/lib/workos/vault/vault_data_created.rb new file mode 100644 index 00000000..6be3a932 --- /dev/null +++ b/lib/workos/vault/vault_data_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDataCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_data_created_data.rb b/lib/workos/vault/vault_data_created_data.rb new file mode 100644 index 00000000..ff632bc7 --- /dev/null +++ b/lib/workos/vault/vault_data_created_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + kv_name: :kv_name, + key_id: :key_id, + key_context: :key_context + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :kv_name, + :key_id, + :key_context + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @kv_name = hash[:kv_name] + @key_id = hash[:key_id] + @key_context = hash[:key_context] || {} + end + end +end diff --git a/lib/workos/vault/vault_data_deleted.rb b/lib/workos/vault/vault_data_deleted.rb new file mode 100644 index 00000000..2cdff212 --- /dev/null +++ b/lib/workos/vault/vault_data_deleted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataDeleted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDataDeletedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_data_deleted_data.rb b/lib/workos/vault/vault_data_deleted_data.rb new file mode 100644 index 00000000..cd620c5a --- /dev/null +++ b/lib/workos/vault/vault_data_deleted_data.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataDeletedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + kv_name: :kv_name + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :kv_name + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @kv_name = hash[:kv_name] + end + end +end diff --git a/lib/workos/vault/vault_data_read.rb b/lib/workos/vault/vault_data_read.rb new file mode 100644 index 00000000..9abdeaa8 --- /dev/null +++ b/lib/workos/vault/vault_data_read.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataRead < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDataReadData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_data_read_data.rb b/lib/workos/vault/vault_data_read_data.rb new file mode 100644 index 00000000..5ab87246 --- /dev/null +++ b/lib/workos/vault/vault_data_read_data.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataReadData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + kv_name: :kv_name, + key_id: :key_id + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :kv_name, + :key_id + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @kv_name = hash[:kv_name] + @key_id = hash[:key_id] + end + end +end diff --git a/lib/workos/vault/vault_data_updated.rb b/lib/workos/vault/vault_data_updated.rb new file mode 100644 index 00000000..dab9c3ed --- /dev/null +++ b/lib/workos/vault/vault_data_updated.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataUpdated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDataUpdatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_data_updated_data.rb b/lib/workos/vault/vault_data_updated_data.rb new file mode 100644 index 00000000..da2c0b37 --- /dev/null +++ b/lib/workos/vault/vault_data_updated_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDataUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + kv_name: :kv_name, + key_id: :key_id, + key_context: :key_context + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :kv_name, + :key_id, + :key_context + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @kv_name = hash[:kv_name] + @key_id = hash[:key_id] + @key_context = hash[:key_context] || {} + end + end +end diff --git a/lib/workos/vault/vault_dek_decrypted.rb b/lib/workos/vault/vault_dek_decrypted.rb new file mode 100644 index 00000000..02a0f0e4 --- /dev/null +++ b/lib/workos/vault/vault_dek_decrypted.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDekDecrypted < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDekDecryptedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_dek_decrypted_data.rb b/lib/workos/vault/vault_dek_decrypted_data.rb new file mode 100644 index 00000000..8ca57bbd --- /dev/null +++ b/lib/workos/vault/vault_dek_decrypted_data.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDekDecryptedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + key_id: :key_id + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :key_id + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @key_id = hash[:key_id] + end + end +end diff --git a/lib/workos/vault/vault_dek_read.rb b/lib/workos/vault/vault_dek_read.rb new file mode 100644 index 00000000..7e283583 --- /dev/null +++ b/lib/workos/vault/vault_dek_read.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDekRead < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultDekReadData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_dek_read_data.rb b/lib/workos/vault/vault_dek_read_data.rb new file mode 100644 index 00000000..c200c9f5 --- /dev/null +++ b/lib/workos/vault/vault_dek_read_data.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultDekReadData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + key_ids: :key_ids, + key_context: :key_context + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :key_ids, + :key_context + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @key_ids = hash[:key_ids] || [] + @key_context = hash[:key_context] || {} + end + end +end diff --git a/lib/workos/vault/vault_kek_created.rb b/lib/workos/vault/vault_kek_created.rb new file mode 100644 index 00000000..459455b1 --- /dev/null +++ b/lib/workos/vault/vault_kek_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultKekCreated < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultKekCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_kek_created_data.rb b/lib/workos/vault/vault_kek_created_data.rb new file mode 100644 index 00000000..e35a3ddc --- /dev/null +++ b/lib/workos/vault/vault_kek_created_data.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultKekCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + key_name: :key_name, + key_id: :key_id + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :key_name, + :key_id + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @key_name = hash[:key_name] + @key_id = hash[:key_id] + end + end +end diff --git a/lib/workos/vault/vault_metadata_read.rb b/lib/workos/vault/vault_metadata_read.rb new file mode 100644 index 00000000..10fb52ee --- /dev/null +++ b/lib/workos/vault/vault_metadata_read.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultMetadataRead < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultMetadataReadData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_metadata_read_data.rb b/lib/workos/vault/vault_metadata_read_data.rb new file mode 100644 index 00000000..f2e0d487 --- /dev/null +++ b/lib/workos/vault/vault_metadata_read_data.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultMetadataReadData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name, + kv_name: :kv_name + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name, + :kv_name + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + @kv_name = hash[:kv_name] + end + end +end diff --git a/lib/workos/vault/vault_names_listed.rb b/lib/workos/vault/vault_names_listed.rb new file mode 100644 index 00000000..55bf8fc8 --- /dev/null +++ b/lib/workos/vault/vault_names_listed.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultNamesListed < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + event: :event, + data: :data, + created_at: :created_at, + context: :context, + object: :object + }.freeze + + attr_accessor \ + :id, + :event, + :data, + :created_at, + :context, + :object + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @event = hash[:event] + @data = hash[:data] ? WorkOS::VaultNamesListedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + @object = hash[:object] + end + end +end diff --git a/lib/workos/vault/vault_names_listed_data.rb b/lib/workos/vault/vault_names_listed_data.rb new file mode 100644 index 00000000..c1d4252f --- /dev/null +++ b/lib/workos/vault/vault_names_listed_data.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class VaultNamesListedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + actor_id: :actor_id, + actor_source: :actor_source, + actor_name: :actor_name + }.freeze + + attr_accessor \ + :actor_id, + :actor_source, + :actor_name + + def initialize(json) + hash = self.class.normalize(json) + @actor_id = hash[:actor_id] + @actor_source = hash[:actor_source] + @actor_name = hash[:actor_name] + end + end +end diff --git a/lib/workos/verify_challenge.rb b/lib/workos/verify_challenge.rb deleted file mode 100644 index 10ca7221..00000000 --- a/lib/workos/verify_challenge.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The VerifyChallenge class provides a lightweight wrapper around - # a WorkOS Authentication Challenge resource. - class VerifyChallenge - include HashProvider - - attr_accessor :challenge, :valid - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @challenge = hash[:challenge] - @valid = hash[:valid] - end - - def to_json(*) - { - challenge: challenge, - valid: valid, - } - end - end -end diff --git a/lib/workos/version.rb b/lib/workos/version.rb index 88ce2c29..7fa958d7 100644 --- a/lib/workos/version.rb +++ b/lib/workos/version.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true +# @oagen-ignore-file module WorkOS - VERSION = '4.2.1' + VERSION = "8.0.1" end diff --git a/lib/workos/webhook.rb b/lib/workos/webhook.rb deleted file mode 100644 index 7a42d904..00000000 --- a/lib/workos/webhook.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -module WorkOS - # The Webhook class provides a lightweight wrapper around - # a WorkOS Webhook resource. This class is not meant to be instantiated - # in user space, and is instantiated internally but exposed. - class Webhook - include HashProvider - - attr_accessor :id, :event, :data, :created_at - - def initialize(json) - hash = JSON.parse(json, symbolize_names: true) - - @id = hash[:id] - @event = hash[:event] - @data = hash[:data] - @created_at = hash[:created_at] - end - - def to_json(*) - { - id: id, - event: event, - data: data, - created_at: created_at, - } - end - end -end diff --git a/lib/workos/webhook_event.rb b/lib/workos/webhook_event.rb new file mode 100644 index 00000000..165d749d --- /dev/null +++ b/lib/workos/webhook_event.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +require "json" + +module WorkOS + # Typed wrapper around a parsed webhook event payload. + # + # event = client.webhooks.construct_event( + # payload: body, sig_header: sig, secret: ENV["WORKOS_WEBHOOK_SECRET"] + # ) + # event.event # => "connection.activated" + # event.id # => "evt_01..." + # event.data # => WorkOS::ConnectionActivatedData (typed) or Hash (unknown event) + # event.created_at # => "2026-04-16T..." + # event.raw # => original Hash for escape hatch + class WebhookEvent + attr_reader :id, :event, :data, :created_at, :raw + + # Map of event type string -> data model class name. + # Entries with nil mean "no typed model yet" and will return the raw hash. + EVENT_DATA_MODELS = { + "authentication.email_verification_succeeded" => "WorkOS::AuthenticationEmailVerificationSucceededData", + "authentication.magic_auth_failed" => "WorkOS::AuthenticationMagicAuthFailedData", + "authentication.magic_auth_succeeded" => "WorkOS::AuthenticationMagicAuthSucceededData", + "authentication.mfa_succeeded" => "WorkOS::AuthenticationMFASucceededData", + "authentication.oauth_failed" => "WorkOS::AuthenticationOAuthFailedData", + "authentication.oauth_succeeded" => "WorkOS::AuthenticationOAuthSucceededData", + "authentication.password_failed" => "WorkOS::AuthenticationPasswordFailedData", + "authentication.password_succeeded" => "WorkOS::AuthenticationPasswordSucceededData", + "authentication.passkey_failed" => "WorkOS::AuthenticationPasskeyFailedData", + "authentication.passkey_succeeded" => "WorkOS::AuthenticationPasskeySucceededData", + "authentication.sso_failed" => "WorkOS::AuthenticationSSOFailedData", + "authentication.sso_started" => "WorkOS::AuthenticationSSOStartedData", + "authentication.sso_succeeded" => "WorkOS::AuthenticationSSOSucceededData", + "authentication.sso_timed_out" => "WorkOS::AuthenticationSSOTimedOutData", + "authentication.radar_risk_detected" => "WorkOS::AuthenticationRadarRiskDetectedData", + "api_key.created" => "WorkOS::ApiKeyCreatedData", + "api_key.revoked" => "WorkOS::ApiKeyRevokedData", + "connection.activated" => "WorkOS::ConnectionActivatedData", + "connection.deactivated" => "WorkOS::ConnectionDeactivatedData", + "connection.deleted" => "WorkOS::ConnectionDeletedData", + "connection.saml_certificate_renewal_required" => "WorkOS::ConnectionSAMLCertificateRenewalRequiredData", + "connection.saml_certificate_renewed" => "WorkOS::ConnectionSAMLCertificateRenewedData", + "dsync.activated" => "WorkOS::DsyncActivatedData", + "dsync.deleted" => "WorkOS::DsyncDeletedData", + "dsync.group.created" => nil, + "dsync.group.deleted" => nil, + "dsync.group.updated" => "WorkOS::DsyncGroupUpdatedData", + "dsync.group.user_added" => "WorkOS::DsyncGroupUserAddedData", + "dsync.group.user_removed" => "WorkOS::DsyncGroupUserRemovedData", + "dsync.user.created" => nil, + "dsync.user.deleted" => nil, + "dsync.user.updated" => "WorkOS::DsyncUserUpdatedData", + "email_verification.created" => "WorkOS::EmailVerificationCreatedData", + "group.created" => nil, + "group.deleted" => nil, + "group.updated" => nil, + "group.member_added" => "WorkOS::GroupMemberAddedData", + "group.member_removed" => "WorkOS::GroupMemberRemovedData", + "flag.created" => "WorkOS::FlagCreatedData", + "flag.deleted" => "WorkOS::FlagDeletedData", + "flag.updated" => "WorkOS::FlagUpdatedData", + "flag.rule_updated" => "WorkOS::FlagRuleUpdatedData", + "invitation.accepted" => "WorkOS::InvitationAcceptedData", + "invitation.created" => "WorkOS::InvitationCreatedData", + "invitation.resent" => "WorkOS::InvitationResentData", + "invitation.revoked" => "WorkOS::InvitationRevokedData", + "magic_auth.created" => "WorkOS::MagicAuthCreatedData", + "organization.created" => "WorkOS::OrganizationCreatedData", + "organization.deleted" => "WorkOS::OrganizationDeletedData", + "organization.updated" => "WorkOS::OrganizationUpdatedData", + "organization_domain.created" => "WorkOS::OrganizationDomainCreatedData", + "organization_domain.deleted" => "WorkOS::OrganizationDomainDeletedData", + "organization_domain.updated" => "WorkOS::OrganizationDomainUpdatedData", + "organization_domain.verified" => "WorkOS::OrganizationDomainVerifiedData", + "organization_domain.verification_failed" => "WorkOS::OrganizationDomainVerificationFailedData", + "password_reset.created" => "WorkOS::PasswordResetCreatedData", + "password_reset.succeeded" => "WorkOS::PasswordResetSucceededData", + "user.created" => nil, + "user.updated" => nil, + "user.deleted" => nil, + "organization_membership.created" => "WorkOS::OrganizationMembershipCreatedData", + "organization_membership.deleted" => "WorkOS::OrganizationMembershipDeletedData", + "organization_membership.updated" => "WorkOS::OrganizationMembershipUpdatedData", + "role.created" => "WorkOS::RoleCreatedData", + "role.deleted" => "WorkOS::RoleDeletedData", + "role.updated" => "WorkOS::RoleUpdatedData", + "organization_role.created" => "WorkOS::OrganizationRoleCreatedData", + "organization_role.deleted" => "WorkOS::OrganizationRoleDeletedData", + "organization_role.updated" => "WorkOS::OrganizationRoleUpdatedData", + "permission.created" => "WorkOS::PermissionCreatedData", + "permission.deleted" => "WorkOS::PermissionDeletedData", + "permission.updated" => "WorkOS::PermissionUpdatedData", + "session.created" => "WorkOS::SessionCreatedData", + "session.revoked" => "WorkOS::SessionRevokedData" + }.freeze + + def initialize(raw_hash) + @raw = raw_hash + @id = raw_hash["id"] + @event = raw_hash["event"] + @created_at = raw_hash["created_at"] + @data = coerce_data(raw_hash["data"]) + end + + private + + def coerce_data(data_hash) + return data_hash unless data_hash.is_a?(Hash) && @event + model_name = EVENT_DATA_MODELS[@event] + return data_hash unless model_name + + klass = Object.const_get(model_name) + klass.new(data_hash) + rescue NameError, JSON::ParserError + data_hash + end + end +end diff --git a/lib/workos/webhooks.rb b/lib/workos/webhooks.rb index 1f23044e..1b77bc19 100644 --- a/lib/workos/webhooks.rb +++ b/lib/workos/webhooks.rb @@ -1,180 +1,234 @@ # frozen_string_literal: true -require 'openssl' +# This file is auto-generated by oagen. Do not edit. + +require "json" module WorkOS - # The Webhooks module provides convenience methods for working with the WorkOS webhooks. - # You'll need to extract the signature header and payload from the webhook request - # sig_header = request.headers['WorkOS-Signature'] - # payload = request.body.read - # - # The secret is the Webhook Secret from your WorkOS Dashboard - # The tolerance is for the timestamp validation - # - module Webhooks - class << self - DEFAULT_TOLERANCE = 180 - - # Initializes an Event object from a JSON payload - # rubocop:disable Layout/LineLength - # - # @param [String] payload The payload from the webhook sent by WorkOS. This is the RAW_POST_DATA of the request. - # @param [String] sig_header The signature from the webhook sent by WorkOS. - # @param [String] secret The webhook secret from the WorkOS dashboard. - # @param [Integer] tolerance The time tolerance in seconds for the webhook. - # - # @example - # WorkOS::Webhooks.construct_event( - # payload: "{"id": "wh_123","data":{"id":"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG","state":"active","emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"idp_id":"00u1e8mutl6wlH3lL4x7","object":"directory_user","username":"blair@foo-corp.com","last_name":"Lunceford","first_name":"Blair","directory_id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","raw_attributes":{"name":{"givenName":"Blair","familyName":"Lunceford","middleName":"Elizabeth","honorificPrefix":"Ms."},"title":"Developer Success Engineer","active":true,"emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"groups":[],"locale":"en-US","schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"blair@foo-corp.com","addresses":[{"region":"CO","primary":true,"locality":"Steamboat Springs","postalCode":"80487"}],"externalId":"00u1e8mutl6wlH3lL4x7","displayName":"Blair Lunceford","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"manager":{"value":"2","displayName":"Kathleen Chung"},"division":"Engineering","department":"Customer Success"}}},"event":"dsync.user.created"}", - # sig_header: 't=1626125972272, v1=80f7ab7efadc306eb5797c588cee9410da9be4416782b497bf1e1bf4175fb928', - # secret: 'LJlTiC19GmCKWs8AE0IaOQcos', - # ) - # - # => #"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG", :state=>"active", :emails=>[{:type=>"work", :value=>"blair@foo-corp.com", :primary=>true}], :idp_id=>"00u1e8mutl6wlH3lL4x7", :object=>"directory_user", :username=>"blair@foo-corp.com", :last_name=>"Lunceford", :first_name=>"Blair", :directory_id=>"directory_01F9M7F68PZP8QXP8G7X5QRHS7", :raw_attributes=>{:name=>{:givenName=>"Blair", :familyName=>"Lunceford", :middleName=>"Elizabeth", :honorificPrefix=>"Ms."}, :title=>"Developer Success Engineer", :active=>true, :emails=>[{:type=>"work", :value=>"blair@foo-corp.com", :primary=>true}], :groups=>[], :locale=>"en-US", :schemas=>["urn:ietf:params:scim:schemas:core:2.0:User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"], :userName=>"blair@foo-corp.com", :addresses=>[{:region=>"CO", :primary=>true, :locality=>"Steamboat Springs", :postalCode=>"80487"}], :externalId=>"00u1e8mutl6wlH3lL4x7", :displayName=>"Blair Lunceford", :"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"=>{:manager=>{:value=>"2", :displayName=>"Kathleen Chung"}, :division=>"Engineering", :department=>"Customer Success"}}}> - # - # @return [WorkOS::Webhook] - # rubocop:enable Layout/LineLength - def construct_event( - payload:, - sig_header:, - secret:, - tolerance: DEFAULT_TOLERANCE + class Webhooks + def initialize(client) + @client = client + end + + # List Webhook Endpoints + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_webhook_endpoints( + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/webhook_endpoints", + auth: true, + params: params, + request_options: request_options ) - verify_header(payload: payload, sig_header: sig_header, secret: secret, tolerance: tolerance) - WorkOS::Webhook.new(payload) - end + fetch_next = ->(cursor) { + list_webhook_endpoints( + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::WebhookEndpointJson, + filters: {before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end - # Verifies WorkOS-Signature header from request - # rubocop:disable Layout/LineLength - # - # @param [String] payload The payload from the webhook sent by WorkOS. This is the RAW_POST_DATA of the request. - # @param [String] sig_header The signature from the webhook sent by WorkOS. - # @param [String] secret The webhook secret from the WorkOS dashboard. - # @param [Integer] tolerance The time tolerance in seconds for the webhook. - # - # @example - # WorkOS::Webhooks.verify_header( - # payload: "{"id": "wh_123","data":{"id":"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG","state":"active","emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"idp_id":"00u1e8mutl6wlH3lL4x7","object":"directory_user","username":"blair@foo-corp.com","last_name":"Lunchford","first_name":"Blair","directory_id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","raw_attributes":{"name":{"givenName":"Blair","familyName":"Lunchford","middleName":"Elizabeth","honorificPrefix":"Ms."},"title":"Developer Success Engineer","active":true,"emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"groups":[],"locale":"en-US","schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"blair@foo-corp.com","addresses":[{"region":"CA","primary":true,"locality":"San Francisco","postalCode":"94016"}],"externalId":"00u1e8mutl6wlH3lL4x7","displayName":"Blair Lunchford","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"manager":{"value":"2","displayName":"Kate Chapman"},"division":"Engineering","department":"Customer Success"}}},"event":"dsync.user.created"}", - # sig_header: 't=1626125972272, v1=80f7ab7efadc306eb5797c588cee9410da9be4416782b497bf1e1bf4175fb928', - # secret: 'LJlTiC19GmCKWs8AE0IaOQcos', - # ) - # - # => true - # - # @return Boolean - # rubocop:enable Layout/LineLength - # rubocop:disable Metrics/AbcSize - def verify_header( - payload:, - sig_header:, - secret:, - tolerance: DEFAULT_TOLERANCE + # Create a Webhook Endpoint + # @param endpoint_url [String] The HTTPS URL where webhooks will be sent. + # @param events [Array] The events that the Webhook Endpoint is subscribed to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::WebhookEndpointJson] + def create_webhook_endpoint( + endpoint_url:, + events:, + request_options: {} + ) + body = { + "endpoint_url" => endpoint_url, + "events" => events + } + response = @client.request( + method: :post, + path: "/webhook_endpoints", + auth: true, + body: body, + request_options: request_options ) - begin - timestamp, signature_hash = get_timestamp_and_signature_hash(sig_header: sig_header) - rescue StandardError - raise WorkOS::SignatureVerificationError.new( - message: 'Unable to extract timestamp and signature hash from header', - ) - end - - if signature_hash.empty? - raise WorkOS::SignatureVerificationError.new( - message: 'No signature hash found with expected scheme v1', - ) - end - - timestamp_to_time = Time.at(timestamp.to_i / 1000) - - if timestamp_to_time < Time.now - tolerance - raise WorkOS::SignatureVerificationError.new( - message: 'Timestamp outside the tolerance zone', - ) - end - - expected_sig = compute_signature(timestamp: timestamp, payload: payload, secret: secret) - unless secure_compare(str_a: expected_sig, str_b: signature_hash) - raise WorkOS::SignatureVerificationError.new( - message: 'Signature hash does not match the expected signature hash for payload', - ) - end - - true - end - # rubocop:enable Metrics/AbcSize - - # Extracts timestamp and signature hash from WorkOS-Signature header - # - # @param [String] sig_header The signature from the webhook sent by WorkOS. - # - # @example - # WorkOS::Webhooks.get_timestamp_and_signature_hash( - # sig_header: 't=1626125972272, v1=80f7ab7efadc306eb5797c588cee9410da9be4416782b497bf1e1bf4175fb928', - # ) - # - # => ['1626125972272', '80f7ab7efadc306eb5797c588cee9410da9be4416782b497bf1e1bf4175fb928'] - # - # @return Array - def get_timestamp_and_signature_hash( - sig_header: + result = WorkOS::WebhookEndpointJson.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 + + # Update a Webhook Endpoint + # @param id [String] Unique identifier of the Webhook Endpoint. + # @param endpoint_url [String, nil] The HTTPS URL where webhooks will be sent. + # @param status [WorkOS::Types::UpdateWebhookEndpointStatus, nil] Whether the Webhook Endpoint is enabled or disabled. + # @param events [Array, nil] The events that the Webhook Endpoint is subscribed to. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::WebhookEndpointJson] + def update_webhook_endpoint( + id:, + endpoint_url: nil, + status: nil, + events: nil, + request_options: {} + ) + body = { + "endpoint_url" => endpoint_url, + "status" => status, + "events" => events + }.compact + response = @client.request( + method: :patch, + path: "/webhook_endpoints/#{WorkOS::Util.encode_path(id)}", + auth: true, + body: body, + request_options: request_options ) - timestamp, signature_hash = sig_header.split(', ') + result = WorkOS::WebhookEndpointJson.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 - if timestamp.nil? || signature_hash.nil? - raise WorkOS::SignatureVerificationError.new( - message: 'Unable to extract timestamp and signature hash from header', - ) - end + # Delete a Webhook Endpoint + # @param id [String] Unique identifier of the Webhook Endpoint. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_webhook_endpoint( + id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/webhook_endpoints/#{WorkOS::Util.encode_path(id)}", + auth: true, + request_options: request_options + ) + nil + end - timestamp = timestamp.sub('t=', '') - signature_hash = signature_hash.sub('v1=', '') + # @oagen-ignore-start — non-spec helpers (hand-maintained) + require "openssl" + + DEFAULT_TOLERANCE_SECONDS = 180 + + # Verify a webhook signature and return a typed event struct. + # + # Parses the `WorkOS-Signature` header, validates the HMAC-SHA256 + # signature against the endpoint secret, checks that the event + # timestamp is within the tolerance window, and returns a typed + # {WorkOS::WebhookEvent}. + # + # @example Rack / Sinatra + # post "/webhooks" do + # event = client.webhooks.construct_event( + # payload: request.body.read, + # sig_header: request.env["HTTP_WORKOS_SIGNATURE"], + # secret: ENV["WORKOS_WEBHOOK_SECRET"] + # ) + # case event.event + # when "user.created" then handle_user_created(event.data) + # end + # end + # + # @param payload [String] Raw webhook request body (must be the + # exact bytes received; do not re-serialize). + # @param sig_header [String] Value of the `WorkOS-Signature` header + # (format: `"t=, v1="`). + # @param secret [String] Webhook endpoint secret from the WorkOS dashboard. + # @param tolerance [Integer] Maximum event age in seconds (default: 180). + # Events older than this are rejected to guard against replay attacks. + # @return [WorkOS::WebhookEvent] Typed event with `.event`, `.data`, `.id`, `.created_at`. + # @raise [WorkOS::SignatureVerificationError] if the signature does not + # match, the header is malformed, or the timestamp exceeds the tolerance. + def construct_event(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS) + raw = verify_event(payload: payload, sig_header: sig_header, secret: secret, tolerance: tolerance) + WebhookEvent.new(raw) + end - [timestamp, signature_hash] + # Verify a webhook signature and return the deserialized event payload. + # + # @param payload [String] Raw webhook request body. + # @param sig_header [String] Value of the WorkOS-Signature header + # (format: "t=, v1="). + # @param secret [String] Webhook endpoint secret from the dashboard. + # @param tolerance [Integer] Maximum age of the event in seconds. + # @return [Hash] Parsed JSON payload. + # @raise [WorkOS::SignatureVerificationError] if signature or timestamp invalid. + def verify_event(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS) + verify_header(payload: payload, sig_header: sig_header, secret: secret, tolerance: tolerance) + JSON.parse(payload) + end + + # Verify the webhook signature without deserializing the payload. + # + # @param payload [String] Raw webhook request body. + # @param sig_header [String] Value of the `WorkOS-Signature` header. + # @param secret [String] Webhook endpoint secret. + # @param tolerance [Integer] Maximum event age in seconds (default: 180). + # @return [true] Returns `true` on success. + # @raise [WorkOS::SignatureVerificationError] if verification fails. + def verify_header(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS) + timestamp_ms, signature_hash = parse_signature_header(sig_header) + max_age = tolerance.to_i + issued_at = timestamp_ms.to_i / 1000.0 + if (Time.now.to_f - issued_at).abs > max_age + raise WorkOS::SignatureVerificationError.new( + message: "Timestamp outside the tolerance zone", + http_status: nil + ) end - # Computes expected signature - # rubocop:disable Layout/LineLength - # - # @param [String] timestamp The timestamp from the webhook signature. - # @param [String] payload The payload from the webhook sent by WorkOS. This is the RAW_POST_DATA of the request. - # @param [String] secret The webhook secret from the WorkOS dashboard. - # - # @example - # WorkOS::Webhooks.compute_signature( - # timestamp: '1626125972272', - # payload: "{"id": "wh_123","data":{"id":"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG","state":"active","emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"idp_id":"00u1e8mutl6wlH3lL4x7","object":"directory_user","username":"blair@foo-corp.com","last_name":"Lunchford","first_name":"Blair","directory_id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","raw_attributes":{"name":{"givenName":"Blair","familyName":"Lunchford","middleName":"Elizabeth","honorificPrefix":"Ms."},"title":"Developer Success Engineer","active":true,"emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"groups":[],"locale":"en-US","schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"blair@foo-corp.com","addresses":[{"region":"CA","primary":true,"locality":"San Francisco","postalCode":"94016"}],"externalId":"00u1e8mutl6wlH3lL4x7","displayName":"Blair Lunchford","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"manager":{"value":"2","displayName":"Kate Chapman"},"division":"Engineering","department":"Customer Success"}}},"event":"dsync.user.created"}", - # secret: 'LJlTiC19GmCKWs8AE0IaOQcos', - # ) - # - # => '80f7ab7efadc306eb5797c588cee9410da9be4416782b497bf1e1bf4175fb928' - # - # @return String - # rubocop:enable Layout/LineLength - def compute_signature( - timestamp:, - payload:, - secret: - ) - unhashed_string = "#{timestamp}.#{payload}" - digest = OpenSSL::Digest.new('sha256') - OpenSSL::HMAC.hexdigest(digest, secret, unhashed_string) + expected = compute_signature(payload: payload, timestamp: timestamp_ms, secret: secret) + unless secure_compare(signature_hash, expected) + raise WorkOS::SignatureVerificationError.new( + message: "Signature hash does not match the expected signature hash for payload", + http_status: nil + ) end + true + end - # Constant time string comparison to prevent timing attacks - # Code borrowed from ActiveSupport - def secure_compare( - str_a:, - str_b: - ) - return false unless str_a.bytesize == str_b.bytesize + # Compute the HMAC-SHA256 hex signature for a (timestamp, payload) pair. + # Exposed publicly so users can build their own verification flow. + def compute_signature(payload:, timestamp:, secret:) + WorkOS::Util::Signature.compute(payload: payload, timestamp: timestamp, secret: secret) + end - l = str_a.unpack("C#{str_a.bytesize}") + # Parse a "t=, v1=" header into [timestamp, signature]. + # Exposed publicly for advanced use. + def parse_signature_header(sig_header) + WorkOS::Util::Signature.parse_header(sig_header) + rescue ArgumentError => e + raise WorkOS::SignatureVerificationError.new(message: e.message, http_status: nil) + end - res = 0 - str_b.each_byte { |byte| res |= byte ^ l.shift } + private - res.zero? - end + def secure_compare(a, b) + WorkOS::Util::Signature.secure_compare(a, b) end + # @oagen-ignore-end end end diff --git a/lib/workos/webhooks/create_webhook_endpoint.rb b/lib/workos/webhooks/create_webhook_endpoint.rb new file mode 100644 index 00000000..8ce04034 --- /dev/null +++ b/lib/workos/webhooks/create_webhook_endpoint.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class CreateWebhookEndpoint < WorkOS::Types::BaseModel + HASH_ATTRS = { + endpoint_url: :endpoint_url, + events: :events + }.freeze + + attr_accessor \ + :endpoint_url, + :events + + def initialize(json) + hash = self.class.normalize(json) + @endpoint_url = hash[:endpoint_url] + @events = hash[:events] || [] + end + end +end diff --git a/lib/workos/webhooks/update_webhook_endpoint.rb b/lib/workos/webhooks/update_webhook_endpoint.rb new file mode 100644 index 00000000..9d6f7c09 --- /dev/null +++ b/lib/workos/webhooks/update_webhook_endpoint.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class UpdateWebhookEndpoint < WorkOS::Types::BaseModel + HASH_ATTRS = { + endpoint_url: :endpoint_url, + status: :status, + events: :events + }.freeze + + attr_accessor \ + :endpoint_url, + :status, + :events + + def initialize(json) + hash = self.class.normalize(json) + @endpoint_url = hash[:endpoint_url] + @status = hash[:status] + @events = hash[:events] || [] + end + end +end diff --git a/lib/workos/webhooks/webhook_endpoint.rb b/lib/workos/webhooks/webhook_endpoint.rb new file mode 100644 index 00000000..e3b9abb0 --- /dev/null +++ b/lib/workos/webhooks/webhook_endpoint.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class WebhookEndpoint + include HashProvider + + HASH_ATTRS = { + object: :object, + id: :id, + endpoint_url: :endpoint_url, + secret: :secret, + status: :status, + events: :events, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :endpoint_url, + :secret, + :status, + :events, + :created_at, + :updated_at + + def initialize(json) + hash = json.is_a?(Hash) ? json : JSON.parse(json, symbolize_names: true) + hash = hash.transform_keys(&:to_sym) if hash.keys.first.is_a?(String) + @object = hash[:object] + @id = hash[:id] + @endpoint_url = hash[:endpoint_url] + @secret = hash[:secret] + @status = hash[:status] + @events = hash[:events] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/webhooks/webhook_endpoint_json.rb b/lib/workos/webhooks/webhook_endpoint_json.rb new file mode 100644 index 00000000..a033e364 --- /dev/null +++ b/lib/workos/webhooks/webhook_endpoint_json.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WebhookEndpointJson < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + endpoint_url: :endpoint_url, + secret: :secret, + status: :status, + events: :events, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :endpoint_url, + :secret, + :status, + :events, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @endpoint_url = hash[:endpoint_url] + @secret = hash[:secret] + @status = hash[:status] + @events = hash[:events] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/widgets.rb b/lib/workos/widgets.rb new file mode 100644 index 00000000..a0534089 --- /dev/null +++ b/lib/workos/widgets.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class Widgets + def initialize(client) + @client = client + end + + # Generate a widget token + # @param organization_id [String] The ID of the organization to scope the widget session to. + # @param user_id [String, nil] The ID of the user to issue the widget session token for. + # @param scopes [Array, nil] The scopes to grant the widget session. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::WidgetSessionTokenResponse] + def create_token( + organization_id:, + user_id: nil, + scopes: nil, + request_options: {} + ) + body = { + "organization_id" => organization_id, + "user_id" => user_id, + "scopes" => scopes + }.compact + response = @client.request( + method: :post, + path: "/widgets/token", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::WidgetSessionTokenResponse.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 + end +end diff --git a/lib/workos/widgets/widget_session_token.rb b/lib/workos/widgets/widget_session_token.rb new file mode 100644 index 00000000..f702967b --- /dev/null +++ b/lib/workos/widgets/widget_session_token.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WidgetSessionToken < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + user_id: :user_id, + scopes: :scopes + }.freeze + + attr_accessor \ + :organization_id, + :user_id, + :scopes + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @user_id = hash[:user_id] + @scopes = hash[:scopes] || [] + end + end +end diff --git a/lib/workos/widgets/widget_session_token_response.rb b/lib/workos/widgets/widget_session_token_response.rb new file mode 100644 index 00000000..05c3173a --- /dev/null +++ b/lib/workos/widgets/widget_session_token_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class WidgetSessionTokenResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + token: :token + }.freeze + + attr_accessor :token + + def initialize(json) + hash = self.class.normalize(json) + @token = hash[:token] + end + end +end diff --git a/rbi/workos/action_authentication_denied.rbi b/rbi/workos/action_authentication_denied.rbi new file mode 100644 index 00000000..b292df51 --- /dev/null +++ b/rbi/workos/action_authentication_denied.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ActionAuthenticationDenied + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ActionAuthenticationDeniedData) } + def data; end + + sig { params(value: WorkOS::ActionAuthenticationDeniedData).returns(WorkOS::ActionAuthenticationDeniedData) } + def data=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/action_authentication_denied_data.rbi b/rbi/workos/action_authentication_denied_data.rbi new file mode 100644 index 00000000..14cc5f25 --- /dev/null +++ b/rbi/workos/action_authentication_denied_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ActionAuthenticationDeniedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def action_endpoint_id; end + + sig { params(value: String).returns(String) } + def action_endpoint_id=(value); end + + sig { returns(String) } + def action_execution_id; end + + sig { params(value: String).returns(String) } + def action_execution_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def verdict; end + + sig { params(value: String).returns(String) } + def verdict=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/action_user_registration_denied.rbi b/rbi/workos/action_user_registration_denied.rbi new file mode 100644 index 00000000..b02e0b0a --- /dev/null +++ b/rbi/workos/action_user_registration_denied.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ActionUserRegistrationDenied + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ActionUserRegistrationDeniedData) } + def data; end + + sig { params(value: WorkOS::ActionUserRegistrationDeniedData).returns(WorkOS::ActionUserRegistrationDeniedData) } + def data=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/action_user_registration_denied_data.rbi b/rbi/workos/action_user_registration_denied_data.rbi new file mode 100644 index 00000000..d7b83312 --- /dev/null +++ b/rbi/workos/action_user_registration_denied_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ActionUserRegistrationDeniedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def action_endpoint_id; end + + sig { params(value: String).returns(String) } + def action_endpoint_id=(value); end + + sig { returns(String) } + def action_execution_id; end + + sig { params(value: String).returns(String) } + def action_execution_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def verdict; end + + sig { params(value: String).returns(String) } + def verdict=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/actions.rbi b/rbi/workos/actions.rbi new file mode 100644 index 00000000..76c17acf --- /dev/null +++ b/rbi/workos/actions.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Actions + DEFAULT_TOLERANCE_SECONDS = T.let(30, Integer) + ACTION_TYPE_TO_RESPONSE_OBJECT = T.let(T.unsafe(nil), T::Hash[String, String]) + + sig do + params( + payload: String, + sig_header: String, + secret: String, + tolerance: Integer + ).returns(T::Boolean) + end + def self.verify_header(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS); end + + sig do + params( + payload: String, + sig_header: String, + secret: String, + tolerance: Integer + ).returns(T::Hash[String, T.untyped]) + end + def self.construct_action(payload:, sig_header:, secret:, tolerance: DEFAULT_TOLERANCE_SECONDS); end + + sig do + params( + action_type: String, + verdict: String, + secret: String, + error_message: T.nilable(String) + ).returns(T::Hash[String, T.untyped]) + end + def self.sign_response(action_type:, verdict:, secret:, error_message: nil); end + + sig { params(payload: String, timestamp: T.any(String, Integer), secret: String).returns(String) } + def self.compute_signature(payload:, timestamp:, secret:); end + + sig { params(sig_header: String).returns([String, String]) } + def self.parse_signature_header(sig_header); end + end +end diff --git a/rbi/workos/add_role_permission.rbi b/rbi/workos/add_role_permission.rbi new file mode 100644 index 00000000..049baa84 --- /dev/null +++ b/rbi/workos/add_role_permission.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AddRolePermission + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/admin_portal.rbi b/rbi/workos/admin_portal.rbi new file mode 100644 index 00000000..d800a993 --- /dev/null +++ b/rbi/workos/admin_portal.rbi @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AdminPortal + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization: String, + return_url: T.nilable(String), + success_url: T.nilable(String), + intent: T.nilable(String), + intent_options: T.nilable(WorkOS::IntentOptions), + it_contact_emails: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::PortalLinkResponse) + end + def generate_link(organization:, return_url:, success_url:, intent:, intent_options:, it_contact_emails:, request_options:); end + + end +end diff --git a/rbi/workos/api_key.rbi b/rbi/workos/api_key.rbi new file mode 100644 index 00000000..016787a3 --- /dev/null +++ b/rbi/workos/api_key.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.any(WorkOS::ApiKeyOwner, WorkOS::UserApiKeyOwner)) } + def owner; end + + sig { params(value: T.any(WorkOS::ApiKeyOwner, WorkOS::UserApiKeyOwner)).returns(T.any(WorkOS::ApiKeyOwner, WorkOS::UserApiKeyOwner)) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_created.rbi b/rbi/workos/api_key_created.rbi new file mode 100644 index 00000000..a59f3d55 --- /dev/null +++ b/rbi/workos/api_key_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ApiKeyCreatedData) } + def data; end + + sig { params(value: WorkOS::ApiKeyCreatedData).returns(WorkOS::ApiKeyCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_created_data.rbi b/rbi/workos/api_key_created_data.rbi new file mode 100644 index 00000000..b676aada --- /dev/null +++ b/rbi/workos/api_key_created_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.any(WorkOS::ApiKeyCreatedDataOwner, WorkOS::UserApiKeyCreatedDataOwner)) } + def owner; end + + sig { params(value: T.any(WorkOS::ApiKeyCreatedDataOwner, WorkOS::UserApiKeyCreatedDataOwner)).returns(T.any(WorkOS::ApiKeyCreatedDataOwner, WorkOS::UserApiKeyCreatedDataOwner)) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_created_data_owner.rbi b/rbi/workos/api_key_created_data_owner.rbi new file mode 100644 index 00000000..ca58254d --- /dev/null +++ b/rbi/workos/api_key_created_data_owner.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyCreatedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_owner.rbi b/rbi/workos/api_key_owner.rbi new file mode 100644 index 00000000..32662250 --- /dev/null +++ b/rbi/workos/api_key_owner.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_revoked.rbi b/rbi/workos/api_key_revoked.rbi new file mode 100644 index 00000000..022de35c --- /dev/null +++ b/rbi/workos/api_key_revoked.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyRevoked + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ApiKeyRevokedData) } + def data; end + + sig { params(value: WorkOS::ApiKeyRevokedData).returns(WorkOS::ApiKeyRevokedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_revoked_data.rbi b/rbi/workos/api_key_revoked_data.rbi new file mode 100644 index 00000000..ffb02ca8 --- /dev/null +++ b/rbi/workos/api_key_revoked_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyRevokedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.any(WorkOS::ApiKeyRevokedDataOwner, WorkOS::UserApiKeyRevokedDataOwner)) } + def owner; end + + sig { params(value: T.any(WorkOS::ApiKeyRevokedDataOwner, WorkOS::UserApiKeyRevokedDataOwner)).returns(T.any(WorkOS::ApiKeyRevokedDataOwner, WorkOS::UserApiKeyRevokedDataOwner)) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_revoked_data_owner.rbi b/rbi/workos/api_key_revoked_data_owner.rbi new file mode 100644 index 00000000..03aa89ee --- /dev/null +++ b/rbi/workos/api_key_revoked_data_owner.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyRevokedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_key_validation_response.rbi b/rbi/workos/api_key_validation_response.rbi new file mode 100644 index 00000000..1b691a1f --- /dev/null +++ b/rbi/workos/api_key_validation_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeyValidationResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(WorkOS::ApiKey)) } + def api_key; end + + sig { params(value: T.nilable(WorkOS::ApiKey)).returns(T.nilable(WorkOS::ApiKey)) } + def api_key=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/api_keys.rbi b/rbi/workos/api_keys.rbi new file mode 100644 index 00000000..ae85f013 --- /dev/null +++ b/rbi/workos/api_keys.rbi @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApiKeys + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_organization_api_keys(organization_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_id: String, + name: String, + permissions: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationApiKeyWithValue) + end + def create_organization_api_key(organization_id:, name:, permissions:, request_options:); end + + sig do + params( + value: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ApiKeyValidationResponse) + end + def create_validation(value:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_api_key(id:, request_options:); end + + end +end diff --git a/rbi/workos/application_credentials_list_item.rbi b/rbi/workos/application_credentials_list_item.rbi new file mode 100644 index 00000000..2f9228e9 --- /dev/null +++ b/rbi/workos/application_credentials_list_item.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ApplicationCredentialsListItem + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def secret_hint; end + + sig { params(value: String).returns(String) } + def secret_hint=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/assign_role.rbi b/rbi/workos/assign_role.rbi new file mode 100644 index 00000000..d359992d --- /dev/null +++ b/rbi/workos/assign_role.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AssignRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def role_slug; end + + sig { params(value: String).returns(String) } + def role_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_action.rbi b/rbi/workos/audit_log_action.rbi new file mode 100644 index 00000000..4185bd10 --- /dev/null +++ b/rbi/workos/audit_log_action.rbi @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogAction + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(WorkOS::AuditLogSchema) } + def schema; end + + sig { params(value: WorkOS::AuditLogSchema).returns(WorkOS::AuditLogSchema) } + def schema=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_action_json.rbi b/rbi/workos/audit_log_action_json.rbi new file mode 100644 index 00000000..f88f196d --- /dev/null +++ b/rbi/workos/audit_log_action_json.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogActionJson + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(WorkOS::AuditLogSchemaJson) } + def schema; end + + sig { params(value: WorkOS::AuditLogSchemaJson).returns(WorkOS::AuditLogSchemaJson) } + def schema=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_configuration.rbi b/rbi/workos/audit_log_configuration.rbi new file mode 100644 index 00000000..b660bb20 --- /dev/null +++ b/rbi/workos/audit_log_configuration.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogConfiguration + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(Integer) } + def retention_period_in_days; end + + sig { params(value: Integer).returns(Integer) } + def retention_period_in_days=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(WorkOS::AuditLogConfigurationLogStream)) } + def log_stream; end + + sig { params(value: T.nilable(WorkOS::AuditLogConfigurationLogStream)).returns(T.nilable(WorkOS::AuditLogConfigurationLogStream)) } + def log_stream=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_configuration_log_stream.rbi b/rbi/workos/audit_log_configuration_log_stream.rbi new file mode 100644 index 00000000..e0129929 --- /dev/null +++ b/rbi/workos/audit_log_configuration_log_stream.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogConfigurationLogStream + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def last_synced_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_synced_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event.rbi b/rbi/workos/audit_log_event.rbi new file mode 100644 index 00000000..885bba72 --- /dev/null +++ b/rbi/workos/audit_log_event.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEvent + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def action; end + + sig { params(value: String).returns(String) } + def action=(value); end + + sig { returns(String) } + def occurred_at; end + + sig { params(value: String).returns(String) } + def occurred_at=(value); end + + sig { returns(WorkOS::AuditLogEventActor) } + def actor; end + + sig { params(value: WorkOS::AuditLogEventActor).returns(WorkOS::AuditLogEventActor) } + def actor=(value); end + + sig { returns(T::Array[WorkOS::AuditLogEventTarget]) } + def targets; end + + sig { params(value: T::Array[WorkOS::AuditLogEventTarget]).returns(T::Array[WorkOS::AuditLogEventTarget]) } + def targets=(value); end + + sig { returns(WorkOS::AuditLogEventContext) } + def context; end + + sig { params(value: WorkOS::AuditLogEventContext).returns(WorkOS::AuditLogEventContext) } + def context=(value); end + + sig { returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])).returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata=(value); end + + sig { returns(T.nilable(Integer)) } + def version; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def version=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event_actor.rbi b/rbi/workos/audit_log_event_actor.rbi new file mode 100644 index 00000000..b2338729 --- /dev/null +++ b/rbi/workos/audit_log_event_actor.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEventActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])).returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event_context.rbi b/rbi/workos/audit_log_event_context.rbi new file mode 100644 index 00000000..5585a178 --- /dev/null +++ b/rbi/workos/audit_log_event_context.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEventContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def location; end + + sig { params(value: String).returns(String) } + def location=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event_create_response.rbi b/rbi/workos/audit_log_event_create_response.rbi new file mode 100644 index 00000000..c7021b8f --- /dev/null +++ b/rbi/workos/audit_log_event_create_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEventCreateResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Boolean) } + def success; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def success=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event_ingestion.rbi b/rbi/workos/audit_log_event_ingestion.rbi new file mode 100644 index 00000000..52d94203 --- /dev/null +++ b/rbi/workos/audit_log_event_ingestion.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEventIngestion + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(WorkOS::AuditLogEvent) } + def event; end + + sig { params(value: WorkOS::AuditLogEvent).returns(WorkOS::AuditLogEvent) } + def event=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_event_target.rbi b/rbi/workos/audit_log_event_target.rbi new file mode 100644 index 00000000..b8e7237d --- /dev/null +++ b/rbi/workos/audit_log_event_target.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogEventTarget + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])).returns(T.nilable(T::Hash[String, T.any(String, Float, T::Boolean)])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_export.rbi b/rbi/workos/audit_log_export.rbi new file mode 100644 index 00000000..f2cbe49a --- /dev/null +++ b/rbi/workos/audit_log_export.rbi @@ -0,0 +1,53 @@ +# frozen_string_literal: true +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogExport + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def url=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_export_creation.rbi b/rbi/workos/audit_log_export_creation.rbi new file mode 100644 index 00000000..7b6f2cee --- /dev/null +++ b/rbi/workos/audit_log_export_creation.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogExportCreation + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def range_start; end + + sig { params(value: String).returns(String) } + def range_start=(value); end + + sig { returns(String) } + def range_end; end + + sig { params(value: String).returns(String) } + def range_end=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def actions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def actions=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def actors; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def actors=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def actor_names; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def actor_names=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def actor_ids; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def actor_ids=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def targets; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def targets=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_export_json.rbi b/rbi/workos/audit_log_export_json.rbi new file mode 100644 index 00000000..acdb6312 --- /dev/null +++ b/rbi/workos/audit_log_export_json.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogExportJson + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def url=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema.rbi b/rbi/workos/audit_log_schema.rbi new file mode 100644 index 00000000..580253b6 --- /dev/null +++ b/rbi/workos/audit_log_schema.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchema + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(WorkOS::AuditLogSchemaActor)) } + def actor; end + + sig { params(value: T.nilable(WorkOS::AuditLogSchemaActor)).returns(T.nilable(WorkOS::AuditLogSchemaActor)) } + def actor=(value); end + + sig { returns(T::Array[WorkOS::AuditLogSchemaTarget]) } + def targets; end + + sig { params(value: T::Array[WorkOS::AuditLogSchemaTarget]).returns(T::Array[WorkOS::AuditLogSchemaTarget]) } + def targets=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema_actor.rbi b/rbi/workos/audit_log_schema_actor.rbi new file mode 100644 index 00000000..2ee5202c --- /dev/null +++ b/rbi/workos/audit_log_schema_actor.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchemaActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Hash[String, T.untyped]) } + def metadata; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema_json.rbi b/rbi/workos/audit_log_schema_json.rbi new file mode 100644 index 00000000..22087b7e --- /dev/null +++ b/rbi/workos/audit_log_schema_json.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchemaJson + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(Integer) } + def version; end + + sig { params(value: Integer).returns(Integer) } + def version=(value); end + + sig { returns(T.nilable(WorkOS::AuditLogSchemaJsonActor)) } + def actor; end + + sig { params(value: T.nilable(WorkOS::AuditLogSchemaJsonActor)).returns(T.nilable(WorkOS::AuditLogSchemaJsonActor)) } + def actor=(value); end + + sig { returns(T::Array[WorkOS::AuditLogSchemaJsonTarget]) } + def targets; end + + sig { params(value: T::Array[WorkOS::AuditLogSchemaJsonTarget]).returns(T::Array[WorkOS::AuditLogSchemaJsonTarget]) } + def targets=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema_json_actor.rbi b/rbi/workos/audit_log_schema_json_actor.rbi new file mode 100644 index 00000000..ec091541 --- /dev/null +++ b/rbi/workos/audit_log_schema_json_actor.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchemaJsonActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Hash[String, T.untyped]) } + def metadata; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema_json_target.rbi b/rbi/workos/audit_log_schema_json_target.rbi new file mode 100644 index 00000000..04c80112 --- /dev/null +++ b/rbi/workos/audit_log_schema_json_target.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchemaJsonTarget + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_log_schema_target.rbi b/rbi/workos/audit_log_schema_target.rbi new file mode 100644 index 00000000..8cc049e8 --- /dev/null +++ b/rbi/workos/audit_log_schema_target.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogSchemaTarget + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_logs.rbi b/rbi/workos/audit_logs.rbi new file mode 100644 index 00000000..b022e197 --- /dev/null +++ b/rbi/workos/audit_logs.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogs + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogsRetentionJson) + end + def get_organization_audit_logs_retention(id:, request_options:); end + + sig do + params( + id: String, + retention_period_in_days: Integer, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogsRetentionJson) + end + def update_organization_audit_logs_retention(id:, retention_period_in_days:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::AuditLogActionJson]) + end + def list_actions(before:, after:, limit:, order:, request_options:); end + + sig do + params( + action_name: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::AuditLogSchemaJson]) + end + def list_action_schemas(action_name:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + action_name: String, + targets: T::Array[WorkOS::AuditLogSchemaTarget], + actor: T.nilable(WorkOS::AuditLogSchemaActor), + metadata: T.nilable(T::Hash[String, T.untyped]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogSchemaJson) + end + def create_schema(action_name:, targets:, actor:, metadata:, request_options:); end + + sig do + params( + organization_id: String, + event: WorkOS::AuditLogEvent, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogEventCreateResponse) + end + def create_event(organization_id:, event:, request_options:); end + + sig do + params( + organization_id: String, + range_start: String, + range_end: String, + actions: T.nilable(T::Array[String]), + actors: T.nilable(T::Array[String]), + actor_names: T.nilable(T::Array[String]), + actor_ids: T.nilable(T::Array[String]), + targets: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogExportJson) + end + def create_export(organization_id:, range_start:, range_end:, actions:, actors:, actor_names:, actor_ids:, targets:, request_options:); end + + sig do + params( + audit_log_export_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogExportJson) + end + def get_export(audit_log_export_id:, request_options:); end + + end +end diff --git a/rbi/workos/audit_logs_retention.rbi b/rbi/workos/audit_logs_retention.rbi new file mode 100644 index 00000000..4ca26347 --- /dev/null +++ b/rbi/workos/audit_logs_retention.rbi @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogsRetention + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(Integer)) } + def retention_period_in_days; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def retention_period_in_days=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/audit_logs_retention_json.rbi b/rbi/workos/audit_logs_retention_json.rbi new file mode 100644 index 00000000..151b6d7a --- /dev/null +++ b/rbi/workos/audit_logs_retention_json.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuditLogsRetentionJson + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(Integer)) } + def retention_period_in_days; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def retention_period_in_days=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authenticate_response.rbi b/rbi/workos/authenticate_response.rbi new file mode 100644 index 00000000..9c64547e --- /dev/null +++ b/rbi/workos/authenticate_response.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticateResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def authkit_authorization_code; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def authkit_authorization_code=(value); end + + sig { returns(String) } + def access_token; end + + sig { params(value: String).returns(String) } + def access_token=(value); end + + sig { returns(String) } + def refresh_token; end + + sig { params(value: String).returns(String) } + def refresh_token=(value); end + + sig { returns(T.nilable(String)) } + def authentication_method; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def authentication_method=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticateResponseImpersonator)) } + def impersonator; end + + sig { params(value: T.nilable(WorkOS::AuthenticateResponseImpersonator)).returns(T.nilable(WorkOS::AuthenticateResponseImpersonator)) } + def impersonator=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticateResponseOAuthToken)) } + def oauth_tokens; end + + sig { params(value: T.nilable(WorkOS::AuthenticateResponseOAuthToken)).returns(T.nilable(WorkOS::AuthenticateResponseOAuthToken)) } + def oauth_tokens=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authenticate_response_impersonator.rbi b/rbi/workos/authenticate_response_impersonator.rbi new file mode 100644 index 00000000..6ce8467b --- /dev/null +++ b/rbi/workos/authenticate_response_impersonator.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticateResponseImpersonator + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def reason=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authenticate_response_oauth_token.rbi b/rbi/workos/authenticate_response_oauth_token.rbi new file mode 100644 index 00000000..856dc88e --- /dev/null +++ b/rbi/workos/authenticate_response_oauth_token.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticateResponseOAuthToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def provider; end + + sig { params(value: String).returns(String) } + def provider=(value); end + + sig { returns(String) } + def refresh_token; end + + sig { params(value: String).returns(String) } + def refresh_token=(value); end + + sig { returns(String) } + def access_token; end + + sig { params(value: String).returns(String) } + def access_token=(value); end + + sig { returns(Integer) } + def expires_at; end + + sig { params(value: Integer).returns(Integer) } + def expires_at=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_challenge.rbi b/rbi/workos/authentication_challenge.rbi new file mode 100644 index 00000000..cebdd598 --- /dev/null +++ b/rbi/workos/authentication_challenge.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationChallenge + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def expires_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def code; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def code=(value); end + + sig { returns(String) } + def authentication_factor_id; end + + sig { params(value: String).returns(String) } + def authentication_factor_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_challenge_verify_response.rbi b/rbi/workos/authentication_challenge_verify_response.rbi new file mode 100644 index 00000000..6b9b39d6 --- /dev/null +++ b/rbi/workos/authentication_challenge_verify_response.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationChallengeVerifyResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::AuthenticationChallenge) } + def challenge; end + + sig { params(value: WorkOS::AuthenticationChallenge).returns(WorkOS::AuthenticationChallenge) } + def challenge=(value); end + + sig { returns(T::Boolean) } + def valid; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def valid=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_challenges_verify_request.rbi b/rbi/workos/authentication_challenges_verify_request.rbi new file mode 100644 index 00000000..03970967 --- /dev/null +++ b/rbi/workos/authentication_challenges_verify_request.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationChallengesVerifyRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_email_verification_failed.rbi b/rbi/workos/authentication_email_verification_failed.rbi new file mode 100644 index 00000000..5e0f6388 --- /dev/null +++ b/rbi/workos/authentication_email_verification_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationEmailVerificationFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationEmailVerificationFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationEmailVerificationFailedData).returns(WorkOS::AuthenticationEmailVerificationFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_email_verification_failed_data.rbi b/rbi/workos/authentication_email_verification_failed_data.rbi new file mode 100644 index 00000000..ccf21d39 --- /dev/null +++ b/rbi/workos/authentication_email_verification_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationEmailVerificationFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationEmailVerificationFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationEmailVerificationFailedDataError).returns(WorkOS::AuthenticationEmailVerificationFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_email_verification_failed_data_error.rbi b/rbi/workos/authentication_email_verification_failed_data_error.rbi new file mode 100644 index 00000000..9da0cfe1 --- /dev/null +++ b/rbi/workos/authentication_email_verification_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationEmailVerificationFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_email_verification_succeeded.rbi b/rbi/workos/authentication_email_verification_succeeded.rbi new file mode 100644 index 00000000..50831892 --- /dev/null +++ b/rbi/workos/authentication_email_verification_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationEmailVerificationSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationEmailVerificationSucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationEmailVerificationSucceededData).returns(WorkOS::AuthenticationEmailVerificationSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_email_verification_succeeded_data.rbi b/rbi/workos/authentication_email_verification_succeeded_data.rbi new file mode 100644 index 00000000..1ede1392 --- /dev/null +++ b/rbi/workos/authentication_email_verification_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationEmailVerificationSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor.rbi b/rbi/workos/authentication_factor.rbi new file mode 100644 index 00000000..5f5ddd71 --- /dev/null +++ b/rbi/workos/authentication_factor.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticationFactorSms)) } + def sms; end + + sig { params(value: T.nilable(WorkOS::AuthenticationFactorSms)).returns(T.nilable(WorkOS::AuthenticationFactorSms)) } + def sms=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticationFactorTotp)) } + def totp; end + + sig { params(value: T.nilable(WorkOS::AuthenticationFactorTotp)).returns(T.nilable(WorkOS::AuthenticationFactorTotp)) } + def totp=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor_enrolled.rbi b/rbi/workos/authentication_factor_enrolled.rbi new file mode 100644 index 00000000..ebbcf833 --- /dev/null +++ b/rbi/workos/authentication_factor_enrolled.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorEnrolled + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticationFactorEnrolledSms)) } + def sms; end + + sig { params(value: T.nilable(WorkOS::AuthenticationFactorEnrolledSms)).returns(T.nilable(WorkOS::AuthenticationFactorEnrolledSms)) } + def sms=(value); end + + sig { returns(T.nilable(WorkOS::AuthenticationFactorEnrolledTotp)) } + def totp; end + + sig { params(value: T.nilable(WorkOS::AuthenticationFactorEnrolledTotp)).returns(T.nilable(WorkOS::AuthenticationFactorEnrolledTotp)) } + def totp=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor_enrolled_sms.rbi b/rbi/workos/authentication_factor_enrolled_sms.rbi new file mode 100644 index 00000000..356a39c0 --- /dev/null +++ b/rbi/workos/authentication_factor_enrolled_sms.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorEnrolledSms + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def phone_number; end + + sig { params(value: String).returns(String) } + def phone_number=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor_enrolled_totp.rbi b/rbi/workos/authentication_factor_enrolled_totp.rbi new file mode 100644 index 00000000..b8c30ccf --- /dev/null +++ b/rbi/workos/authentication_factor_enrolled_totp.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorEnrolledTotp + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def issuer; end + + sig { params(value: String).returns(String) } + def issuer=(value); end + + sig { returns(String) } + def user; end + + sig { params(value: String).returns(String) } + def user=(value); end + + sig { returns(String) } + def secret; end + + sig { params(value: String).returns(String) } + def secret=(value); end + + sig { returns(String) } + def qr_code; end + + sig { params(value: String).returns(String) } + def qr_code=(value); end + + sig { returns(String) } + def uri; end + + sig { params(value: String).returns(String) } + def uri=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor_sms.rbi b/rbi/workos/authentication_factor_sms.rbi new file mode 100644 index 00000000..03e79bbd --- /dev/null +++ b/rbi/workos/authentication_factor_sms.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorSms + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def phone_number; end + + sig { params(value: String).returns(String) } + def phone_number=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factor_totp.rbi b/rbi/workos/authentication_factor_totp.rbi new file mode 100644 index 00000000..7553d31c --- /dev/null +++ b/rbi/workos/authentication_factor_totp.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorTotp + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def issuer; end + + sig { params(value: String).returns(String) } + def issuer=(value); end + + sig { returns(String) } + def user; end + + sig { params(value: String).returns(String) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_factors_create_request.rbi b/rbi/workos/authentication_factors_create_request.rbi new file mode 100644 index 00000000..66d39735 --- /dev/null +++ b/rbi/workos/authentication_factors_create_request.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationFactorsCreateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def phone_number; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def phone_number=(value); end + + sig { returns(T.nilable(String)) } + def totp_issuer; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def totp_issuer=(value); end + + sig { returns(T.nilable(String)) } + def totp_user; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def totp_user=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_magic_auth_failed.rbi b/rbi/workos/authentication_magic_auth_failed.rbi new file mode 100644 index 00000000..56dc51ef --- /dev/null +++ b/rbi/workos/authentication_magic_auth_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMagicAuthFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationMagicAuthFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationMagicAuthFailedData).returns(WorkOS::AuthenticationMagicAuthFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_magic_auth_failed_data.rbi b/rbi/workos/authentication_magic_auth_failed_data.rbi new file mode 100644 index 00000000..6dabd36c --- /dev/null +++ b/rbi/workos/authentication_magic_auth_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMagicAuthFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationMagicAuthFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationMagicAuthFailedDataError).returns(WorkOS::AuthenticationMagicAuthFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_magic_auth_failed_data_error.rbi b/rbi/workos/authentication_magic_auth_failed_data_error.rbi new file mode 100644 index 00000000..322bcb88 --- /dev/null +++ b/rbi/workos/authentication_magic_auth_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMagicAuthFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_magic_auth_succeeded.rbi b/rbi/workos/authentication_magic_auth_succeeded.rbi new file mode 100644 index 00000000..51d53e57 --- /dev/null +++ b/rbi/workos/authentication_magic_auth_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMagicAuthSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationMagicAuthSucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationMagicAuthSucceededData).returns(WorkOS::AuthenticationMagicAuthSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_magic_auth_succeeded_data.rbi b/rbi/workos/authentication_magic_auth_succeeded_data.rbi new file mode 100644 index 00000000..ed155614 --- /dev/null +++ b/rbi/workos/authentication_magic_auth_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMagicAuthSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_mfa_failed.rbi b/rbi/workos/authentication_mfa_failed.rbi new file mode 100644 index 00000000..4352dd45 --- /dev/null +++ b/rbi/workos/authentication_mfa_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMFAFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationMFAFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationMFAFailedData).returns(WorkOS::AuthenticationMFAFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_mfa_failed_data.rbi b/rbi/workos/authentication_mfa_failed_data.rbi new file mode 100644 index 00000000..5f2997cd --- /dev/null +++ b/rbi/workos/authentication_mfa_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMFAFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationMFAFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationMFAFailedDataError).returns(WorkOS::AuthenticationMFAFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_mfa_failed_data_error.rbi b/rbi/workos/authentication_mfa_failed_data_error.rbi new file mode 100644 index 00000000..624541ab --- /dev/null +++ b/rbi/workos/authentication_mfa_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMFAFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_mfa_succeeded.rbi b/rbi/workos/authentication_mfa_succeeded.rbi new file mode 100644 index 00000000..105895fe --- /dev/null +++ b/rbi/workos/authentication_mfa_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMFASucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationMFASucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationMFASucceededData).returns(WorkOS::AuthenticationMFASucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_mfa_succeeded_data.rbi b/rbi/workos/authentication_mfa_succeeded_data.rbi new file mode 100644 index 00000000..309ff5c5 --- /dev/null +++ b/rbi/workos/authentication_mfa_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationMFASucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_oauth_failed.rbi b/rbi/workos/authentication_oauth_failed.rbi new file mode 100644 index 00000000..f10b076c --- /dev/null +++ b/rbi/workos/authentication_oauth_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationOAuthFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationOAuthFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationOAuthFailedData).returns(WorkOS::AuthenticationOAuthFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_oauth_failed_data.rbi b/rbi/workos/authentication_oauth_failed_data.rbi new file mode 100644 index 00000000..6b90714b --- /dev/null +++ b/rbi/workos/authentication_oauth_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationOAuthFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationOAuthFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationOAuthFailedDataError).returns(WorkOS::AuthenticationOAuthFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_oauth_failed_data_error.rbi b/rbi/workos/authentication_oauth_failed_data_error.rbi new file mode 100644 index 00000000..c4d32d63 --- /dev/null +++ b/rbi/workos/authentication_oauth_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationOAuthFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_oauth_succeeded.rbi b/rbi/workos/authentication_oauth_succeeded.rbi new file mode 100644 index 00000000..bb768038 --- /dev/null +++ b/rbi/workos/authentication_oauth_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationOAuthSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationOAuthSucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationOAuthSucceededData).returns(WorkOS::AuthenticationOAuthSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_oauth_succeeded_data.rbi b/rbi/workos/authentication_oauth_succeeded_data.rbi new file mode 100644 index 00000000..94cb8314 --- /dev/null +++ b/rbi/workos/authentication_oauth_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationOAuthSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_passkey_failed.rbi b/rbi/workos/authentication_passkey_failed.rbi new file mode 100644 index 00000000..b8986307 --- /dev/null +++ b/rbi/workos/authentication_passkey_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasskeyFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationPasskeyFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationPasskeyFailedData).returns(WorkOS::AuthenticationPasskeyFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_passkey_failed_data.rbi b/rbi/workos/authentication_passkey_failed_data.rbi new file mode 100644 index 00000000..66db1035 --- /dev/null +++ b/rbi/workos/authentication_passkey_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasskeyFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationPasskeyFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationPasskeyFailedDataError).returns(WorkOS::AuthenticationPasskeyFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_passkey_failed_data_error.rbi b/rbi/workos/authentication_passkey_failed_data_error.rbi new file mode 100644 index 00000000..ba6848e5 --- /dev/null +++ b/rbi/workos/authentication_passkey_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasskeyFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_passkey_succeeded.rbi b/rbi/workos/authentication_passkey_succeeded.rbi new file mode 100644 index 00000000..ccebdc2d --- /dev/null +++ b/rbi/workos/authentication_passkey_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasskeySucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationPasskeySucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationPasskeySucceededData).returns(WorkOS::AuthenticationPasskeySucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_passkey_succeeded_data.rbi b/rbi/workos/authentication_passkey_succeeded_data.rbi new file mode 100644 index 00000000..fab857e8 --- /dev/null +++ b/rbi/workos/authentication_passkey_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasskeySucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_password_failed.rbi b/rbi/workos/authentication_password_failed.rbi new file mode 100644 index 00000000..bbc2c357 --- /dev/null +++ b/rbi/workos/authentication_password_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasswordFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationPasswordFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationPasswordFailedData).returns(WorkOS::AuthenticationPasswordFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_password_failed_data.rbi b/rbi/workos/authentication_password_failed_data.rbi new file mode 100644 index 00000000..58ee2873 --- /dev/null +++ b/rbi/workos/authentication_password_failed_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasswordFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationPasswordFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationPasswordFailedDataError).returns(WorkOS::AuthenticationPasswordFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_password_failed_data_error.rbi b/rbi/workos/authentication_password_failed_data_error.rbi new file mode 100644 index 00000000..7c66c25b --- /dev/null +++ b/rbi/workos/authentication_password_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasswordFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_password_succeeded.rbi b/rbi/workos/authentication_password_succeeded.rbi new file mode 100644 index 00000000..d12b4370 --- /dev/null +++ b/rbi/workos/authentication_password_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasswordSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationPasswordSucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationPasswordSucceededData).returns(WorkOS::AuthenticationPasswordSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_password_succeeded_data.rbi b/rbi/workos/authentication_password_succeeded_data.rbi new file mode 100644 index 00000000..a25c726b --- /dev/null +++ b/rbi/workos/authentication_password_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationPasswordSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_radar_risk_detected.rbi b/rbi/workos/authentication_radar_risk_detected.rbi new file mode 100644 index 00000000..3ec81b68 --- /dev/null +++ b/rbi/workos/authentication_radar_risk_detected.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationRadarRiskDetected + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationRadarRiskDetectedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationRadarRiskDetectedData).returns(WorkOS::AuthenticationRadarRiskDetectedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_radar_risk_detected_data.rbi b/rbi/workos/authentication_radar_risk_detected_data.rbi new file mode 100644 index 00000000..6bf908c2 --- /dev/null +++ b/rbi/workos/authentication_radar_risk_detected_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationRadarRiskDetectedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def auth_method; end + + sig { params(value: String).returns(String) } + def auth_method=(value); end + + sig { returns(String) } + def action; end + + sig { params(value: String).returns(String) } + def action=(value); end + + sig { returns(T.nilable(String)) } + def control; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def control=(value); end + + sig { returns(T.nilable(String)) } + def blocklist_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def blocklist_type=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_failed.rbi b/rbi/workos/authentication_sso_failed.rbi new file mode 100644 index 00000000..1177cc10 --- /dev/null +++ b/rbi/workos/authentication_sso_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationSSOFailedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationSSOFailedData).returns(WorkOS::AuthenticationSSOFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_failed_data.rbi b/rbi/workos/authentication_sso_failed_data.rbi new file mode 100644 index 00000000..8d72f477 --- /dev/null +++ b/rbi/workos/authentication_sso_failed_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationSSOFailedDataSSO) } + def sso; end + + sig { params(value: WorkOS::AuthenticationSSOFailedDataSSO).returns(WorkOS::AuthenticationSSOFailedDataSSO) } + def sso=(value); end + + sig { returns(WorkOS::AuthenticationSSOFailedDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationSSOFailedDataError).returns(WorkOS::AuthenticationSSOFailedDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_failed_data_error.rbi b/rbi/workos/authentication_sso_failed_data_error.rbi new file mode 100644 index 00000000..3b44cd20 --- /dev/null +++ b/rbi/workos/authentication_sso_failed_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOFailedDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_failed_data_sso.rbi b/rbi/workos/authentication_sso_failed_data_sso.rbi new file mode 100644 index 00000000..44c4f139 --- /dev/null +++ b/rbi/workos/authentication_sso_failed_data_sso.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOFailedDataSSO + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def connection_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_id=(value); end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_started.rbi b/rbi/workos/authentication_sso_started.rbi new file mode 100644 index 00000000..6707b6b6 --- /dev/null +++ b/rbi/workos/authentication_sso_started.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOStarted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationSSOStartedData) } + def data; end + + sig { params(value: WorkOS::AuthenticationSSOStartedData).returns(WorkOS::AuthenticationSSOStartedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_started_data.rbi b/rbi/workos/authentication_sso_started_data.rbi new file mode 100644 index 00000000..1eadea6a --- /dev/null +++ b/rbi/workos/authentication_sso_started_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOStartedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationSSOStartedDataSSO) } + def sso; end + + sig { params(value: WorkOS::AuthenticationSSOStartedDataSSO).returns(WorkOS::AuthenticationSSOStartedDataSSO) } + def sso=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_started_data_sso.rbi b/rbi/workos/authentication_sso_started_data_sso.rbi new file mode 100644 index 00000000..a60da2b2 --- /dev/null +++ b/rbi/workos/authentication_sso_started_data_sso.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOStartedDataSSO + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def connection_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_id=(value); end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_succeeded.rbi b/rbi/workos/authentication_sso_succeeded.rbi new file mode 100644 index 00000000..8e1a6d42 --- /dev/null +++ b/rbi/workos/authentication_sso_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationSSOSucceededData) } + def data; end + + sig { params(value: WorkOS::AuthenticationSSOSucceededData).returns(WorkOS::AuthenticationSSOSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_succeeded_data.rbi b/rbi/workos/authentication_sso_succeeded_data.rbi new file mode 100644 index 00000000..af057ca5 --- /dev/null +++ b/rbi/workos/authentication_sso_succeeded_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationSSOSucceededDataSSO) } + def sso; end + + sig { params(value: WorkOS::AuthenticationSSOSucceededDataSSO).returns(WorkOS::AuthenticationSSOSucceededDataSSO) } + def sso=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_succeeded_data_sso.rbi b/rbi/workos/authentication_sso_succeeded_data_sso.rbi new file mode 100644 index 00000000..0f3672d0 --- /dev/null +++ b/rbi/workos/authentication_sso_succeeded_data_sso.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOSucceededDataSSO + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def connection_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_id=(value); end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_timed_out.rbi b/rbi/workos/authentication_sso_timed_out.rbi new file mode 100644 index 00000000..d1fa6656 --- /dev/null +++ b/rbi/workos/authentication_sso_timed_out.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOTimedOut + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::AuthenticationSSOTimedOutData) } + def data; end + + sig { params(value: WorkOS::AuthenticationSSOTimedOutData).returns(WorkOS::AuthenticationSSOTimedOutData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_timed_out_data.rbi b/rbi/workos/authentication_sso_timed_out_data.rbi new file mode 100644 index 00000000..3b434681 --- /dev/null +++ b/rbi/workos/authentication_sso_timed_out_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOTimedOutData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(WorkOS::AuthenticationSSOTimedOutDataSSO) } + def sso; end + + sig { params(value: WorkOS::AuthenticationSSOTimedOutDataSSO).returns(WorkOS::AuthenticationSSOTimedOutDataSSO) } + def sso=(value); end + + sig { returns(WorkOS::AuthenticationSSOTimedOutDataError) } + def error; end + + sig { params(value: WorkOS::AuthenticationSSOTimedOutDataError).returns(WorkOS::AuthenticationSSOTimedOutDataError) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_timed_out_data_error.rbi b/rbi/workos/authentication_sso_timed_out_data_error.rbi new file mode 100644 index 00000000..65188269 --- /dev/null +++ b/rbi/workos/authentication_sso_timed_out_data_error.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOTimedOutDataError + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authentication_sso_timed_out_data_sso.rbi b/rbi/workos/authentication_sso_timed_out_data_sso.rbi new file mode 100644 index 00000000..0e6ce663 --- /dev/null +++ b/rbi/workos/authentication_sso_timed_out_data_sso.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthenticationSSOTimedOutDataSSO + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def connection_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def connection_id=(value); end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authorization.rbi b/rbi/workos/authorization.rbi new file mode 100644 index 00000000..6d2d35e0 --- /dev/null +++ b/rbi/workos/authorization.rbi @@ -0,0 +1,515 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Authorization + class ResourceTargetById + sig { returns(String) } + def resource_id; end + + sig do + params( + resource_id: String + ).returns(WorkOS::Authorization::ResourceTargetById) + end + def self.new(resource_id:); end + end + + class ResourceTargetByExternalId + sig { returns(String) } + def resource_external_id; end + + sig { returns(String) } + def resource_type_slug; end + + sig do + params( + resource_external_id: String, + resource_type_slug: String + ).returns(WorkOS::Authorization::ResourceTargetByExternalId) + end + def self.new(resource_external_id:, resource_type_slug:); end + end + + class ParentResourceById + sig { returns(String) } + def parent_resource_id; end + + sig do + params( + parent_resource_id: String + ).returns(WorkOS::Authorization::ParentResourceById) + end + def self.new(parent_resource_id:); end + end + + class ParentResourceByExternalId + sig { returns(String) } + def parent_resource_type_slug; end + + sig { returns(String) } + def parent_resource_external_id; end + + sig do + params( + parent_resource_type_slug: String, + parent_resource_external_id: String + ).returns(WorkOS::Authorization::ParentResourceByExternalId) + end + def self.new(parent_resource_type_slug:, parent_resource_external_id:); end + end + + class ParentById + sig { returns(String) } + def parent_resource_id; end + + sig do + params( + parent_resource_id: String + ).returns(WorkOS::Authorization::ParentById) + end + def self.new(parent_resource_id:); end + end + + class ParentByExternalId + sig { returns(String) } + def parent_resource_type_slug; end + + sig { returns(String) } + def parent_external_id; end + + sig do + params( + parent_resource_type_slug: String, + parent_external_id: String + ).returns(WorkOS::Authorization::ParentByExternalId) + end + def self.new(parent_resource_type_slug:, parent_external_id:); end + end + + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_membership_id: String, + permission_slug: String, + resource_target: T.any(WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationCheck) + end + def check(organization_membership_id:, permission_slug:, resource_target:, request_options:); end + + sig do + params( + organization_membership_id: String, + permission_slug: String, + parent_resource: T.any(WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId), + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_resources_for_membership(organization_membership_id:, permission_slug:, parent_resource:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_membership_id: String, + resource_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_effective_permissions(organization_membership_id:, resource_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_membership_id: String, + resource_type_slug: String, + external_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_effective_permissions_by_external_id(organization_membership_id:, resource_type_slug:, external_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_membership_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_role_assignments(organization_membership_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_membership_id: String, + role_slug: String, + resource_target: T.any(WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserRoleAssignment) + end + def assign_role(organization_membership_id:, role_slug:, resource_target:, request_options:); end + + sig do + params( + organization_membership_id: String, + role_slug: String, + resource_target: T.any(WorkOS::Authorization::ResourceTargetById, WorkOS::Authorization::ResourceTargetByExternalId), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def remove_role(organization_membership_id:, role_slug:, resource_target:, request_options:); end + + sig do + params( + organization_membership_id: String, + role_assignment_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def remove_role_assignment(organization_membership_id:, role_assignment_id:, request_options:); end + + sig do + params( + organization_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::RoleList) + end + def list_organization_roles(organization_id:, request_options:); end + + sig do + params( + organization_id: String, + name: String, + slug: T.nilable(String), + description: T.nilable(String), + resource_type_slug: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def create_organization_role(organization_id:, name:, slug:, description:, resource_type_slug:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def get_organization_role(organization_id:, slug:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + name: T.nilable(String), + description: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def update_organization_role(organization_id:, slug:, name:, description:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization_role(organization_id:, slug:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def add_organization_role_permission(organization_id:, slug:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + permissions: T::Array[String], + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def set_organization_role_permissions(organization_id:, slug:, permissions:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + permission_slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def remove_organization_role_permission(organization_id:, slug:, permission_slug:, request_options:); end + + sig do + params( + organization_id: String, + resource_type_slug: String, + external_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationResource) + end + def get_resource_by_external_id(organization_id:, resource_type_slug:, external_id:, request_options:); end + + sig do + params( + organization_id: String, + resource_type_slug: String, + external_id: String, + name: T.nilable(String), + description: T.nilable(String), + parent_resource: T.nilable(T.any(WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationResource) + end + def update_resource_by_external_id(organization_id:, resource_type_slug:, external_id:, name:, description:, parent_resource:, request_options:); end + + sig do + params( + organization_id: String, + resource_type_slug: String, + external_id: String, + cascade_delete: T.nilable(T::Boolean), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_resource_by_external_id(organization_id:, resource_type_slug:, external_id:, cascade_delete:, request_options:); end + + sig do + params( + organization_id: String, + resource_type_slug: String, + external_id: String, + permission_slug: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + assignment: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_memberships_for_resource_by_external_id(organization_id:, resource_type_slug:, external_id:, permission_slug:, before:, after:, limit:, order:, assignment:, request_options:); end + + sig do + params( + organization_id: String, + resource_type_slug: String, + external_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_role_assignments_for_resource_by_external_id(organization_id:, resource_type_slug:, external_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + resource_type_slug: T.nilable(String), + resource_external_id: T.nilable(String), + search: T.nilable(String), + parent: T.nilable(T.any(WorkOS::Authorization::ParentById, WorkOS::Authorization::ParentByExternalId)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_resources(before:, after:, limit:, order:, organization_id:, resource_type_slug:, resource_external_id:, search:, parent:, request_options:); end + + sig do + params( + external_id: String, + name: String, + resource_type_slug: String, + organization_id: String, + description: T.nilable(String), + parent_resource: T.nilable(T.any(WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationResource) + end + def create_resource(external_id:, name:, resource_type_slug:, organization_id:, description:, parent_resource:, request_options:); end + + sig do + params( + resource_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationResource) + end + def get_resource(resource_id:, request_options:); end + + sig do + params( + resource_id: String, + name: T.nilable(String), + description: T.nilable(String), + parent_resource: T.nilable(T.any(WorkOS::Authorization::ParentResourceById, WorkOS::Authorization::ParentResourceByExternalId)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationResource) + end + def update_resource(resource_id:, name:, description:, parent_resource:, request_options:); end + + sig do + params( + resource_id: String, + cascade_delete: T.nilable(T::Boolean), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_resource(resource_id:, cascade_delete:, request_options:); end + + sig do + params( + resource_id: String, + permission_slug: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + assignment: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_memberships_for_resource(resource_id:, permission_slug:, before:, after:, limit:, order:, assignment:, request_options:); end + + sig do + params( + resource_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_role_assignments_for_resource(resource_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::RoleList) + end + def list_environment_roles(request_options:); end + + sig do + params( + slug: String, + name: String, + description: T.nilable(String), + resource_type_slug: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def create_environment_role(slug:, name:, description:, resource_type_slug:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def get_environment_role(slug:, request_options:); end + + sig do + params( + slug: String, + name: T.nilable(String), + description: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def update_environment_role(slug:, name:, description:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def add_environment_role_permission(slug:, request_options:); end + + sig do + params( + slug: String, + permissions: T::Array[String], + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Role) + end + def set_environment_role_permissions(slug:, permissions:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_permissions(before:, after:, limit:, order:, request_options:); end + + sig do + params( + slug: String, + name: String, + description: T.nilable(String), + resource_type_slug: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Permission) + end + def create_permission(slug:, name:, description:, resource_type_slug:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationPermission) + end + def get_permission(slug:, request_options:); end + + sig do + params( + slug: String, + name: T.nilable(String), + description: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthorizationPermission) + end + def update_permission(slug:, name:, description:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_permission(slug:, request_options:); end + + end +end diff --git a/rbi/workos/authorization_check.rbi b/rbi/workos/authorization_check.rbi new file mode 100644 index 00000000..61461282 --- /dev/null +++ b/rbi/workos/authorization_check.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthorizationCheck + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Boolean) } + def authorized; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def authorized=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authorization_code_session_authenticate_request.rbi b/rbi/workos/authorization_code_session_authenticate_request.rbi new file mode 100644 index 00000000..bbd4696e --- /dev/null +++ b/rbi/workos/authorization_code_session_authenticate_request.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthorizationCodeSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T.nilable(String)) } + def code_verifier; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def code_verifier=(value); end + + sig { returns(T.nilable(String)) } + def invitation_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def invitation_token=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authorization_permission.rbi b/rbi/workos/authorization_permission.rbi new file mode 100644 index 00000000..8dee7e9b --- /dev/null +++ b/rbi/workos/authorization_permission.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthorizationPermission + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def system; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def system=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authorization_resource.rbi b/rbi/workos/authorization_resource.rbi new file mode 100644 index 00000000..608d99c6 --- /dev/null +++ b/rbi/workos/authorization_resource.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthorizationResource + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_id=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def external_id; end + + sig { params(value: String).returns(String) } + def external_id=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/authorized_connect_application_list_data.rbi b/rbi/workos/authorized_connect_application_list_data.rbi new file mode 100644 index 00000000..3c60be86 --- /dev/null +++ b/rbi/workos/authorized_connect_application_list_data.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class AuthorizedConnectApplicationListData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Array[String]) } + def granted_scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def granted_scopes=(value); end + + sig { returns(T.nilable(String)) } + def oauth_resource; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def oauth_resource=(value); end + + sig { returns(WorkOS::ConnectApplication) } + def application; end + + sig { params(value: WorkOS::ConnectApplication).returns(WorkOS::ConnectApplication) } + def application=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/base_client.rbi b/rbi/workos/base_client.rbi new file mode 100644 index 00000000..66c870a2 --- /dev/null +++ b/rbi/workos/base_client.rbi @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class BaseClient + DEFAULT_BASE_URL = T.let("https://api.workos.com", String) + DEFAULT_TIMEOUT = T.let(30, Integer) + DEFAULT_MAX_RETRIES = T.let(2, Integer) + RETRYABLE_STATUSES = T.let([408, 409, 429, 500, 502, 503, 504].freeze, T::Array[Integer]) + MAX_CACHED_CONNECTIONS = T.let(8, Integer) + RETRY_BACKOFF_BASE = T.let(0.5, Float) + LOG_SEVERITY = T.let({debug: 0, info: 1, warn: 2, error: 3, unknown: 4}.freeze, T::Hash[Symbol, Integer]) + USER_AGENT = T.let(T.unsafe(nil), String) + + sig { returns(T.nilable(String)) } + def api_key; end + + sig { returns(String) } + def base_url; end + + sig { returns(T.nilable(String)) } + def client_id; end + + sig { returns(Integer) } + def timeout; end + + sig { returns(Integer) } + def max_retries; end + + sig { returns(T.nilable(Logger)) } + def logger; end + + sig { returns(T.nilable(Symbol)) } + def log_level; end + + sig do + params( + api_key: T.nilable(String), + base_url: String, + client_id: T.nilable(String), + timeout: Integer, + max_retries: Integer, + logger: T.nilable(Logger), + log_level: T.nilable(Symbol), + random: Random + ).void + end + def initialize(api_key: nil, base_url: DEFAULT_BASE_URL, client_id: nil, + timeout: DEFAULT_TIMEOUT, max_retries: DEFAULT_MAX_RETRIES, + logger: nil, log_level: nil, random: Random.new); end + + sig do + params( + path: String, + auth: T::Boolean, + params: T::Hash[T.any(String, Symbol), T.untyped], + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPRequest) + end + def get_request(path:, auth: false, params: {}, request_options: nil); end + + sig do + params( + path: String, + auth: T::Boolean, + body: T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), + params: T::Hash[T.any(String, Symbol), T.untyped], + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPRequest) + end + def post_request(path:, auth: false, body: {}, params: {}, request_options: nil); end + + sig do + params( + path: String, + auth: T::Boolean, + body: T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), + params: T::Hash[T.any(String, Symbol), T.untyped], + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPRequest) + end + def put_request(path:, auth: false, body: {}, params: {}, request_options: nil); end + + sig do + params( + path: String, + auth: T::Boolean, + body: T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), + params: T::Hash[T.any(String, Symbol), T.untyped], + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPRequest) + end + def patch_request(path:, auth: false, body: {}, params: {}, request_options: nil); end + + sig do + params( + path: String, + auth: T::Boolean, + body: T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), + params: T::Hash[T.any(String, Symbol), T.untyped], + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPRequest) + end + def delete_request(path:, auth: false, body: nil, params: {}, request_options: nil); end + + sig do + params( + method: Symbol, + path: String, + auth: T::Boolean, + params: T::Hash[T.any(String, Symbol), T.untyped], + body: T.nilable(T::Hash[T.any(String, Symbol), T.untyped]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(Net::HTTPResponse) + end + def request(method:, path:, auth: true, params: {}, body: nil, request_options: {}); end + + sig do + params( + request: Net::HTTPRequest, + request_options: T.nilable(T::Hash[Symbol, T.untyped]) + ).returns(Net::HTTPResponse) + end + def execute_request(request:, request_options: nil); end + + sig { void } + def shutdown; end + end +end diff --git a/rbi/workos/challenge_authentication_factor.rbi b/rbi/workos/challenge_authentication_factor.rbi new file mode 100644 index 00000000..d0acd989 --- /dev/null +++ b/rbi/workos/challenge_authentication_factor.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ChallengeAuthenticationFactor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def sms_template; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def sms_template=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/check_authorization.rbi b/rbi/workos/check_authorization.rbi new file mode 100644 index 00000000..7efd4e8d --- /dev/null +++ b/rbi/workos/check_authorization.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CheckAuthorization + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def permission_slug; end + + sig { params(value: String).returns(String) } + def permission_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/client.rbi b/rbi/workos/client.rbi new file mode 100644 index 00000000..d2cf6514 --- /dev/null +++ b/rbi/workos/client.rbi @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Client < BaseClient + sig { returns(WorkOS::MultiFactorAuth) } + def multi_factor_auth; end + + sig { returns(WorkOS::Connect) } + def connect; end + + sig { returns(WorkOS::Authorization) } + def authorization; end + + sig { returns(WorkOS::SSO) } + def s_s_o; end + + sig { returns(WorkOS::Pipes) } + def pipes; end + + sig { returns(WorkOS::DirectorySync) } + def directory_sync; end + + sig { returns(WorkOS::Events) } + def events; end + + sig { returns(WorkOS::FeatureFlags) } + def feature_flags; end + + sig { returns(WorkOS::OrganizationDomains) } + def organization_domains; end + + sig { returns(WorkOS::Organizations) } + def organizations; end + + sig { returns(WorkOS::AuditLogs) } + def audit_logs; end + + sig { returns(WorkOS::ApiKeys) } + def api_keys; end + + sig { returns(WorkOS::Groups) } + def groups; end + + sig { returns(WorkOS::AdminPortal) } + def admin_portal; end + + sig { returns(WorkOS::Radar) } + def radar; end + + sig { returns(WorkOS::UserManagement) } + def user_management; end + + sig { returns(WorkOS::UserManagementOrganizationMembershipGroups) } + def user_management_organization_membership_groups; end + + sig { returns(WorkOS::Webhooks) } + def webhooks; end + + sig { returns(WorkOS::Widgets) } + def widgets; end + + end +end diff --git a/rbi/workos/configuration.rbi b/rbi/workos/configuration.rbi new file mode 100644 index 00000000..ada9a54a --- /dev/null +++ b/rbi/workos/configuration.rbi @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Configuration + sig { returns(T.nilable(String)) } + def api_key; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def api_key=(value); end + + sig { returns(T.nilable(String)) } + def base_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def base_url=(value); end + + sig { returns(T.nilable(String)) } + def client_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_id=(value); end + + sig { returns(T.nilable(Integer)) } + def timeout; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def timeout=(value); end + + sig { returns(T.nilable(Integer)) } + def max_retries; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def max_retries=(value); end + + sig { returns(T.nilable(Logger)) } + def logger; end + + sig { params(value: T.nilable(Logger)).returns(T.nilable(Logger)) } + def logger=(value); end + + sig { returns(T.nilable(Symbol)) } + def log_level; end + + sig { params(value: T.nilable(Symbol)).returns(T.nilable(Symbol)) } + def log_level=(value); end + + sig { void } + def initialize; end + end + + class << self + sig { params(block: T.proc.params(config: WorkOS::Configuration).void).void } + def configure(&block); end + + sig { returns(WorkOS::Configuration) } + def configuration; end + + sig { returns(WorkOS::Client) } + def client; end + + sig { void } + def reset_client; end + end +end diff --git a/rbi/workos/confirm_email_change.rbi b/rbi/workos/confirm_email_change.rbi new file mode 100644 index 00000000..249f59a2 --- /dev/null +++ b/rbi/workos/confirm_email_change.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConfirmEmailChange + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connect.rbi b/rbi/workos/connect.rbi new file mode 100644 index 00000000..d7179206 --- /dev/null +++ b/rbi/workos/connect.rbi @@ -0,0 +1,102 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Connect + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + external_auth_id: String, + user: WorkOS::UserObject, + user_consent_options: T.nilable(T::Array[WorkOS::UserConsentOption]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ExternalAuthCompleteResponse) + end + def complete_oauth2(external_auth_id:, user:, user_consent_options:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_applications(before:, after:, limit:, order:, organization_id:, request_options:); end + + sig do + params( + name: String, + application_type: String, + is_first_party: T::Boolean, + description: T.nilable(String), + scopes: T.nilable(T::Array[String]), + redirect_uris: T.nilable(T::Array[WorkOS::RedirectUriInput]), + uses_pkce: T.nilable(T::Boolean), + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectApplication) + end + def create_application(name:, application_type:, is_first_party:, description:, scopes:, redirect_uris:, uses_pkce:, organization_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectApplication) + end + def get_application(id:, request_options:); end + + sig do + params( + id: String, + name: T.nilable(String), + description: T.nilable(String), + scopes: T.nilable(T::Array[String]), + redirect_uris: T.nilable(T::Array[WorkOS::RedirectUriInput]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectApplication) + end + def update_application(id:, name:, description:, scopes:, redirect_uris:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_application(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::ApplicationCredentialsListItem]) + end + def list_application_client_secrets(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::NewConnectApplicationSecret) + end + def create_application_client_secret(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_client_secret(id:, request_options:); end + + end +end diff --git a/rbi/workos/connect_application.rbi b/rbi/workos/connect_application.rbi new file mode 100644 index 00000000..dd7f4488 --- /dev/null +++ b/rbi/workos/connect_application.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectApplication + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(String)) } + def application_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def application_type=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connected_account.rbi b/rbi/workos/connected_account.rbi new file mode 100644 index 00000000..ccc12a54 --- /dev/null +++ b/rbi/workos/connected_account.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectedAccount + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection.rbi b/rbi/workos/connection.rbi new file mode 100644 index 00000000..2affbc25 --- /dev/null +++ b/rbi/workos/connection.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Connection + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def connection_type; end + + sig { params(value: String).returns(String) } + def connection_type=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Array[WorkOS::ConnectionDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::ConnectionDomain]).returns(T::Array[WorkOS::ConnectionDomain]) } + def domains=(value); end + + sig { returns(T.nilable(WorkOS::ConnectionOption)) } + def options; end + + sig { params(value: T.nilable(WorkOS::ConnectionOption)).returns(T.nilable(WorkOS::ConnectionOption)) } + def options=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_activated.rbi b/rbi/workos/connection_activated.rbi new file mode 100644 index 00000000..7c0323ef --- /dev/null +++ b/rbi/workos/connection_activated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionActivated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ConnectionActivatedData) } + def data; end + + sig { params(value: WorkOS::ConnectionActivatedData).returns(WorkOS::ConnectionActivatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_activated_data.rbi b/rbi/workos/connection_activated_data.rbi new file mode 100644 index 00000000..e7340347 --- /dev/null +++ b/rbi/workos/connection_activated_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionActivatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def connection_type; end + + sig { params(value: String).returns(String) } + def connection_type=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def external_key; end + + sig { params(value: String).returns(String) } + def external_key=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Array[WorkOS::ConnectionActivatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::ConnectionActivatedDataDomain]).returns(T::Array[WorkOS::ConnectionActivatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_activated_data_domain.rbi b/rbi/workos/connection_activated_data_domain.rbi new file mode 100644 index 00000000..650f4b76 --- /dev/null +++ b/rbi/workos/connection_activated_data_domain.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionActivatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_deactivated.rbi b/rbi/workos/connection_deactivated.rbi new file mode 100644 index 00000000..c0fd502c --- /dev/null +++ b/rbi/workos/connection_deactivated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDeactivated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ConnectionDeactivatedData) } + def data; end + + sig { params(value: WorkOS::ConnectionDeactivatedData).returns(WorkOS::ConnectionDeactivatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_deactivated_data.rbi b/rbi/workos/connection_deactivated_data.rbi new file mode 100644 index 00000000..c3ceb14b --- /dev/null +++ b/rbi/workos/connection_deactivated_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDeactivatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def connection_type; end + + sig { params(value: String).returns(String) } + def connection_type=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def external_key; end + + sig { params(value: String).returns(String) } + def external_key=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Array[WorkOS::ConnectionDeactivatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::ConnectionDeactivatedDataDomain]).returns(T::Array[WorkOS::ConnectionDeactivatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_deactivated_data_domain.rbi b/rbi/workos/connection_deactivated_data_domain.rbi new file mode 100644 index 00000000..f2450a5d --- /dev/null +++ b/rbi/workos/connection_deactivated_data_domain.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDeactivatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_deleted.rbi b/rbi/workos/connection_deleted.rbi new file mode 100644 index 00000000..628720ce --- /dev/null +++ b/rbi/workos/connection_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ConnectionDeletedData) } + def data; end + + sig { params(value: WorkOS::ConnectionDeletedData).returns(WorkOS::ConnectionDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_deleted_data.rbi b/rbi/workos/connection_deleted_data.rbi new file mode 100644 index 00000000..5c860805 --- /dev/null +++ b/rbi/workos/connection_deleted_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def connection_type; end + + sig { params(value: String).returns(String) } + def connection_type=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_domain.rbi b/rbi/workos/connection_domain.rbi new file mode 100644 index 00000000..1ec9c344 --- /dev/null +++ b/rbi/workos/connection_domain.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_option.rbi b/rbi/workos/connection_option.rbi new file mode 100644 index 00000000..42fc29f3 --- /dev/null +++ b/rbi/workos/connection_option.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionOption + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def signing_cert; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def signing_cert=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewal_required.rbi b/rbi/workos/connection_saml_certificate_renewal_required.rbi new file mode 100644 index 00000000..66696e2f --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewal_required.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewalRequired + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredData) } + def data; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewalRequiredData).returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewal_required_data.rbi b/rbi/workos/connection_saml_certificate_renewal_required_data.rbi new file mode 100644 index 00000000..f33fcf8c --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewal_required_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection) } + def connection; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection).returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection) } + def connection=(value); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate) } + def certificate; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate).returns(WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate) } + def certificate=(value); end + + sig { returns(Integer) } + def days_until_expiry; end + + sig { params(value: Integer).returns(Integer) } + def days_until_expiry=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi b/rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi new file mode 100644 index 00000000..ec3bdf4a --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewal_required_data_certificate.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredDataCertificate + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def certificate_type; end + + sig { params(value: String).returns(String) } + def certificate_type=(value); end + + sig { returns(String) } + def expiry_date; end + + sig { params(value: String).returns(String) } + def expiry_date=(value); end + + sig { returns(T::Boolean) } + def is_expired; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def is_expired=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi b/rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi new file mode 100644 index 00000000..004e3b22 --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewal_required_data_connection.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewalRequiredDataConnection + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewed.rbi b/rbi/workos/connection_saml_certificate_renewed.rbi new file mode 100644 index 00000000..74a32493 --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewedData) } + def data; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewedData).returns(WorkOS::ConnectionSAMLCertificateRenewedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewed_data.rbi b/rbi/workos/connection_saml_certificate_renewed_data.rbi new file mode 100644 index 00000000..5a2806ed --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewed_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewedDataConnection) } + def connection; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewedDataConnection).returns(WorkOS::ConnectionSAMLCertificateRenewedDataConnection) } + def connection=(value); end + + sig { returns(WorkOS::ConnectionSAMLCertificateRenewedDataCertificate) } + def certificate; end + + sig { params(value: WorkOS::ConnectionSAMLCertificateRenewedDataCertificate).returns(WorkOS::ConnectionSAMLCertificateRenewedDataCertificate) } + def certificate=(value); end + + sig { returns(String) } + def renewed_at; end + + sig { params(value: String).returns(String) } + def renewed_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi b/rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi new file mode 100644 index 00000000..829436c6 --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewed_data_certificate.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewedDataCertificate + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def certificate_type; end + + sig { params(value: String).returns(String) } + def certificate_type=(value); end + + sig { returns(String) } + def expiry_date; end + + sig { params(value: String).returns(String) } + def expiry_date=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi b/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi new file mode 100644 index 00000000..4ed4df06 --- /dev/null +++ b/rbi/workos/connection_saml_certificate_renewed_data_connection.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConnectionSAMLCertificateRenewedDataConnection + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/cors_origin_response.rbi b/rbi/workos/cors_origin_response.rbi new file mode 100644 index 00000000..7699305c --- /dev/null +++ b/rbi/workos/cors_origin_response.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CORSOriginResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def origin; end + + sig { params(value: String).returns(String) } + def origin=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_application_secret.rbi b/rbi/workos/create_application_secret.rbi new file mode 100644 index 00000000..14067768 --- /dev/null +++ b/rbi/workos/create_application_secret.rbi @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateApplicationSecret + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_authorization_permission.rbi b/rbi/workos/create_authorization_permission.rbi new file mode 100644 index 00000000..872439a9 --- /dev/null +++ b/rbi/workos/create_authorization_permission.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateAuthorizationPermission + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_authorization_resource.rbi b/rbi/workos/create_authorization_resource.rbi new file mode 100644 index 00000000..96810bc2 --- /dev/null +++ b/rbi/workos/create_authorization_resource.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateAuthorizationResource + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def external_id; end + + sig { params(value: String).returns(String) } + def external_id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_cors_origin.rbi b/rbi/workos/create_cors_origin.rbi new file mode 100644 index 00000000..6679dee4 --- /dev/null +++ b/rbi/workos/create_cors_origin.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateCORSOrigin + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def origin; end + + sig { params(value: String).returns(String) } + def origin=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_group.rbi b/rbi/workos/create_group.rbi new file mode 100644 index 00000000..58ffa42a --- /dev/null +++ b/rbi/workos/create_group.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateGroup + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_group_membership.rbi b/rbi/workos/create_group_membership.rbi new file mode 100644 index 00000000..56aa7923 --- /dev/null +++ b/rbi/workos/create_group_membership.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateGroupMembership + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_membership_id; end + + sig { params(value: String).returns(String) } + def organization_membership_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_m2m_application.rbi b/rbi/workos/create_m2m_application.rbi new file mode 100644 index 00000000..53bf736a --- /dev/null +++ b/rbi/workos/create_m2m_application.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateM2MApplication + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def application_type; end + + sig { params(value: String).returns(String) } + def application_type=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_magic_code_and_return.rbi b/rbi/workos/create_magic_code_and_return.rbi new file mode 100644 index 00000000..55e625c4 --- /dev/null +++ b/rbi/workos/create_magic_code_and_return.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateMagicCodeAndReturn + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def invitation_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def invitation_token=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_oauth_application.rbi b/rbi/workos/create_oauth_application.rbi new file mode 100644 index 00000000..8fff4ca8 --- /dev/null +++ b/rbi/workos/create_oauth_application.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateOAuthApplication + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def application_type; end + + sig { params(value: String).returns(String) } + def application_type=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::RedirectUriInput])) } + def redirect_uris; end + + sig { params(value: T.nilable(T::Array[WorkOS::RedirectUriInput])).returns(T.nilable(T::Array[WorkOS::RedirectUriInput])) } + def redirect_uris=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def uses_pkce; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def uses_pkce=(value); end + + sig { returns(T::Boolean) } + def is_first_party; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def is_first_party=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_organization_api_key.rbi b/rbi/workos/create_organization_api_key.rbi new file mode 100644 index 00000000..26502f63 --- /dev/null +++ b/rbi/workos/create_organization_api_key.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateOrganizationApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def permissions=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_organization_domain.rbi b/rbi/workos/create_organization_domain.rbi new file mode 100644 index 00000000..c7db689a --- /dev/null +++ b/rbi/workos/create_organization_domain.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateOrganizationDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_organization_role.rbi b/rbi/workos/create_organization_role.rbi new file mode 100644 index 00000000..6328349d --- /dev/null +++ b/rbi/workos/create_organization_role.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateOrganizationRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_password_reset.rbi b/rbi/workos/create_password_reset.rbi new file mode 100644 index 00000000..0d9220c6 --- /dev/null +++ b/rbi/workos/create_password_reset.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreatePasswordReset + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def token; end + + sig { params(value: String).returns(String) } + def token=(value); end + + sig { returns(String) } + def new_password; end + + sig { params(value: String).returns(String) } + def new_password=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_password_reset_token.rbi b/rbi/workos/create_password_reset_token.rbi new file mode 100644 index 00000000..b6cedb02 --- /dev/null +++ b/rbi/workos/create_password_reset_token.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreatePasswordResetToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_redirect_uri.rbi b/rbi/workos/create_redirect_uri.rbi new file mode 100644 index 00000000..5373598a --- /dev/null +++ b/rbi/workos/create_redirect_uri.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateRedirectUri + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def uri; end + + sig { params(value: String).returns(String) } + def uri=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_role.rbi b/rbi/workos/create_role.rbi new file mode 100644 index 00000000..92e9af9a --- /dev/null +++ b/rbi/workos/create_role.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_user.rbi b/rbi/workos/create_user.rbi new file mode 100644 index 00000000..74d7b3b1 --- /dev/null +++ b/rbi/workos/create_user.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def email_verified=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def password; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password=(value); end + + sig { returns(T.nilable(String)) } + def password_hash; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password_hash=(value); end + + sig { returns(T.nilable(String)) } + def password_hash_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password_hash_type=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_user_api_key.rbi b/rbi/workos/create_user_api_key.rbi new file mode 100644 index 00000000..6186a001 --- /dev/null +++ b/rbi/workos/create_user_api_key.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateUserApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def permissions=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_user_invite_options.rbi b/rbi/workos/create_user_invite_options.rbi new file mode 100644 index 00000000..fa6a6af2 --- /dev/null +++ b/rbi/workos/create_user_invite_options.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateUserInviteOptions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(T.nilable(Integer)) } + def expires_in_days; end + + sig { params(value: T.nilable(Integer)).returns(T.nilable(Integer)) } + def expires_in_days=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def locale; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def locale=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_user_organization_membership.rbi b/rbi/workos/create_user_organization_membership.rbi new file mode 100644 index 00000000..8f70fa39 --- /dev/null +++ b/rbi/workos/create_user_organization_membership.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateUserOrganizationMembership + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def role_slugs; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def role_slugs=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/create_webhook_endpoint.rbi b/rbi/workos/create_webhook_endpoint.rbi new file mode 100644 index 00000000..3950b34b --- /dev/null +++ b/rbi/workos/create_webhook_endpoint.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateWebhookEndpoint + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def endpoint_url; end + + sig { params(value: String).returns(String) } + def endpoint_url=(value); end + + sig { returns(T::Array[String]) } + def events; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def events=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_access_token_response.rbi b/rbi/workos/data_integration_access_token_response.rbi new file mode 100644 index 00000000..2320dd34 --- /dev/null +++ b/rbi/workos/data_integration_access_token_response.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationAccessTokenResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def active; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def active=(value); end + + sig { returns(T.nilable(WorkOS::DataIntegrationAccessTokenResponseAccessToken)) } + def access_token; end + + sig { params(value: T.nilable(WorkOS::DataIntegrationAccessTokenResponseAccessToken)).returns(T.nilable(WorkOS::DataIntegrationAccessTokenResponseAccessToken)) } + def access_token=(value); end + + sig { returns(T.nilable(String)) } + def error; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def error=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_access_token_response_access_token.rbi b/rbi/workos/data_integration_access_token_response_access_token.rbi new file mode 100644 index 00000000..a7678930 --- /dev/null +++ b/rbi/workos/data_integration_access_token_response_access_token.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationAccessTokenResponseAccessToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def access_token; end + + sig { params(value: String).returns(String) } + def access_token=(value); end + + sig { returns(T.nilable(String)) } + def expires_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def expires_at=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(T::Array[String]) } + def missing_scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def missing_scopes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_authorize_url_response.rbi b/rbi/workos/data_integration_authorize_url_response.rbi new file mode 100644 index 00000000..5c3e7729 --- /dev/null +++ b/rbi/workos/data_integration_authorize_url_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationAuthorizeUrlResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def url; end + + sig { params(value: String).returns(String) } + def url=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi b/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi new file mode 100644 index 00000000..5b1ab5b9 --- /dev/null +++ b/rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationsGetDataIntegrationAuthorizeUrlRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def return_to; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def return_to=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_get_user_token_request.rbi b/rbi/workos/data_integrations_get_user_token_request.rbi new file mode 100644 index 00000000..bad71270 --- /dev/null +++ b/rbi/workos/data_integrations_get_user_token_request.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationsGetUserTokenRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_list_response.rbi b/rbi/workos/data_integrations_list_response.rbi new file mode 100644 index 00000000..72ae7976 --- /dev/null +++ b/rbi/workos/data_integrations_list_response.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationsListResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Array[WorkOS::DataIntegrationsListResponseData]) } + def data; end + + sig { params(value: T::Array[WorkOS::DataIntegrationsListResponseData]).returns(T::Array[WorkOS::DataIntegrationsListResponseData]) } + def data=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_list_response_data.rbi b/rbi/workos/data_integrations_list_response_data.rbi new file mode 100644 index 00000000..a796f906 --- /dev/null +++ b/rbi/workos/data_integrations_list_response_data.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationsListResponseData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def integration_type; end + + sig { params(value: String).returns(String) } + def integration_type=(value); end + + sig { returns(String) } + def credentials_type; end + + sig { params(value: String).returns(String) } + def credentials_type=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(String) } + def ownership; end + + sig { params(value: String).returns(String) } + def ownership=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(WorkOS::DataIntegrationsListResponseDataConnectedAccount)) } + def connected_account; end + + sig { params(value: T.nilable(WorkOS::DataIntegrationsListResponseDataConnectedAccount)).returns(T.nilable(WorkOS::DataIntegrationsListResponseDataConnectedAccount)) } + def connected_account=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_list_response_data_connected_account.rbi b/rbi/workos/data_integrations_list_response_data_connected_account.rbi new file mode 100644 index 00000000..9799b3b7 --- /dev/null +++ b/rbi/workos/data_integrations_list_response_data_connected_account.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationsListResponseDataConnectedAccount + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(String)) } + def userland_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def userland_user_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/device_authorization_response.rbi b/rbi/workos/device_authorization_response.rbi new file mode 100644 index 00000000..630bee1a --- /dev/null +++ b/rbi/workos/device_authorization_response.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DeviceAuthorizationResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def device_code; end + + sig { params(value: String).returns(String) } + def device_code=(value); end + + sig { returns(String) } + def user_code; end + + sig { params(value: String).returns(String) } + def user_code=(value); end + + sig { returns(String) } + def verification_uri; end + + sig { params(value: String).returns(String) } + def verification_uri=(value); end + + sig { returns(T.nilable(String)) } + def verification_uri_complete; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_uri_complete=(value); end + + sig { returns(Float) } + def expires_in; end + + sig { params(value: Float).returns(Float) } + def expires_in=(value); end + + sig { returns(T.nilable(Float)) } + def interval; end + + sig { params(value: T.nilable(Float)).returns(T.nilable(Float)) } + def interval=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/device_code_session_authenticate_request.rbi b/rbi/workos/device_code_session_authenticate_request.rbi new file mode 100644 index 00000000..d9532902 --- /dev/null +++ b/rbi/workos/device_code_session_authenticate_request.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DeviceCodeSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def device_code; end + + sig { params(value: String).returns(String) } + def device_code=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory.rbi b/rbi/workos/directory.rbi new file mode 100644 index 00000000..e1572880 --- /dev/null +++ b/rbi/workos/directory.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Directory + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def external_key; end + + sig { params(value: String).returns(String) } + def external_key=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def domain; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def domain=(value); end + + sig { returns(T.nilable(WorkOS::DirectoryMetadata)) } + def metadata; end + + sig { params(value: T.nilable(WorkOS::DirectoryMetadata)).returns(T.nilable(WorkOS::DirectoryMetadata)) } + def metadata=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_group.rbi b/rbi/workos/directory_group.rbi new file mode 100644 index 00000000..1391c5a1 --- /dev/null +++ b/rbi/workos/directory_group.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryGroup + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def raw_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def raw_attributes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_metadata.rbi b/rbi/workos/directory_metadata.rbi new file mode 100644 index 00000000..e88d8de6 --- /dev/null +++ b/rbi/workos/directory_metadata.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryMetadata + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::DirectoryMetadataUser) } + def users; end + + sig { params(value: WorkOS::DirectoryMetadataUser).returns(WorkOS::DirectoryMetadataUser) } + def users=(value); end + + sig { returns(Integer) } + def groups; end + + sig { params(value: Integer).returns(Integer) } + def groups=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_metadata_user.rbi b/rbi/workos/directory_metadata_user.rbi new file mode 100644 index 00000000..5d637da2 --- /dev/null +++ b/rbi/workos/directory_metadata_user.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryMetadataUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(Integer) } + def active; end + + sig { params(value: Integer).returns(Integer) } + def active=(value); end + + sig { returns(Integer) } + def inactive; end + + sig { params(value: Integer).returns(Integer) } + def inactive=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_sync.rbi b/rbi/workos/directory_sync.rbi new file mode 100644 index 00000000..c4985c8e --- /dev/null +++ b/rbi/workos/directory_sync.rbi @@ -0,0 +1,85 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectorySync + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + search: T.nilable(String), + domain: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_directories(before:, after:, limit:, order:, organization_id:, search:, domain:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Directory) + end + def get_directory(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_directory(id:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + directory: T.nilable(String), + user: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_groups(before:, after:, limit:, order:, directory:, user:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DirectoryGroup) + end + def get_group(id:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + directory: T.nilable(String), + group: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_users(before:, after:, limit:, order:, directory:, group:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DirectoryUserWithGroups) + end + def get_user(id:, request_options:); end + + end +end diff --git a/rbi/workos/directory_user.rbi b/rbi/workos/directory_user.rbi new file mode 100644 index 00000000..a0e65e9a --- /dev/null +++ b/rbi/workos/directory_user.rbi @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::DirectoryUserEmail])) } + def emails; end + + sig { params(value: T.nilable(T::Array[WorkOS::DirectoryUserEmail])).returns(T.nilable(T::Array[WorkOS::DirectoryUserEmail])) } + def emails=(value); end + + sig { returns(T.nilable(String)) } + def job_title; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def job_title=(value); end + + sig { returns(T.nilable(String)) } + def username; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def username=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def raw_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def raw_attributes=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T.nilable(WorkOS::SlimRole)) } + def role; end + + sig { params(value: T.nilable(WorkOS::SlimRole)).returns(T.nilable(WorkOS::SlimRole)) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_user_email.rbi b/rbi/workos/directory_user_email.rbi new file mode 100644 index 00000000..01ca0061 --- /dev/null +++ b/rbi/workos/directory_user_email.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryUserEmail + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def primary; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def primary=(value); end + + sig { returns(T.nilable(String)) } + def type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def value; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_user_with_groups.rbi b/rbi/workos/directory_user_with_groups.rbi new file mode 100644 index 00000000..61bddd7b --- /dev/null +++ b/rbi/workos/directory_user_with_groups.rbi @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryUserWithGroups + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::DirectoryUserWithGroupsEmail])) } + def emails; end + + sig { params(value: T.nilable(T::Array[WorkOS::DirectoryUserWithGroupsEmail])).returns(T.nilable(T::Array[WorkOS::DirectoryUserWithGroupsEmail])) } + def emails=(value); end + + sig { returns(T.nilable(String)) } + def job_title; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def job_title=(value); end + + sig { returns(T.nilable(String)) } + def username; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def username=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def raw_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def raw_attributes=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T.nilable(WorkOS::SlimRole)) } + def role; end + + sig { params(value: T.nilable(WorkOS::SlimRole)).returns(T.nilable(WorkOS::SlimRole)) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Array[WorkOS::DirectoryGroup]) } + def groups; end + + sig { params(value: T::Array[WorkOS::DirectoryGroup]).returns(T::Array[WorkOS::DirectoryGroup]) } + def groups=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/directory_user_with_groups_email.rbi b/rbi/workos/directory_user_with_groups_email.rbi new file mode 100644 index 00000000..2864e702 --- /dev/null +++ b/rbi/workos/directory_user_with_groups_email.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DirectoryUserWithGroupsEmail + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def primary; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def primary=(value); end + + sig { returns(T.nilable(String)) } + def type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def value; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/domain_verification_intent_options.rbi b/rbi/workos/domain_verification_intent_options.rbi new file mode 100644 index 00000000..8f53607a --- /dev/null +++ b/rbi/workos/domain_verification_intent_options.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DomainVerificationIntentOptions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def domain_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def domain_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_activated.rbi b/rbi/workos/dsync_activated.rbi new file mode 100644 index 00000000..8c74eaea --- /dev/null +++ b/rbi/workos/dsync_activated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncActivated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncActivatedData) } + def data; end + + sig { params(value: WorkOS::DsyncActivatedData).returns(WorkOS::DsyncActivatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_activated_data.rbi b/rbi/workos/dsync_activated_data.rbi new file mode 100644 index 00000000..2e382cf4 --- /dev/null +++ b/rbi/workos/dsync_activated_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncActivatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def external_key; end + + sig { params(value: String).returns(String) } + def external_key=(value); end + + sig { returns(T::Array[WorkOS::DsyncActivatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::DsyncActivatedDataDomain]).returns(T::Array[WorkOS::DsyncActivatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_activated_data_domain.rbi b/rbi/workos/dsync_activated_data_domain.rbi new file mode 100644 index 00000000..d19530fd --- /dev/null +++ b/rbi/workos/dsync_activated_data_domain.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncActivatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_deactivated.rbi b/rbi/workos/dsync_deactivated.rbi new file mode 100644 index 00000000..51bf08cb --- /dev/null +++ b/rbi/workos/dsync_deactivated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncDeactivated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncDeactivatedData) } + def data; end + + sig { params(value: WorkOS::DsyncDeactivatedData).returns(WorkOS::DsyncDeactivatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_deactivated_data.rbi b/rbi/workos/dsync_deactivated_data.rbi new file mode 100644 index 00000000..056bc3f5 --- /dev/null +++ b/rbi/workos/dsync_deactivated_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncDeactivatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def external_key; end + + sig { params(value: String).returns(String) } + def external_key=(value); end + + sig { returns(T::Array[WorkOS::DsyncDeactivatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::DsyncDeactivatedDataDomain]).returns(T::Array[WorkOS::DsyncDeactivatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_deactivated_data_domain.rbi b/rbi/workos/dsync_deactivated_data_domain.rbi new file mode 100644 index 00000000..c8f60862 --- /dev/null +++ b/rbi/workos/dsync_deactivated_data_domain.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncDeactivatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_deleted.rbi b/rbi/workos/dsync_deleted.rbi new file mode 100644 index 00000000..705080e9 --- /dev/null +++ b/rbi/workos/dsync_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncDeletedData) } + def data; end + + sig { params(value: WorkOS::DsyncDeletedData).returns(WorkOS::DsyncDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_deleted_data.rbi b/rbi/workos/dsync_deleted_data.rbi new file mode 100644 index 00000000..97cdf3b0 --- /dev/null +++ b/rbi/workos/dsync_deleted_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_created.rbi b/rbi/workos/dsync_group_created.rbi new file mode 100644 index 00000000..57ab9d28 --- /dev/null +++ b/rbi/workos/dsync_group_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DirectoryGroup) } + def data; end + + sig { params(value: WorkOS::DirectoryGroup).returns(WorkOS::DirectoryGroup) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_deleted.rbi b/rbi/workos/dsync_group_deleted.rbi new file mode 100644 index 00000000..6d62a1c0 --- /dev/null +++ b/rbi/workos/dsync_group_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DirectoryGroup) } + def data; end + + sig { params(value: WorkOS::DirectoryGroup).returns(WorkOS::DirectoryGroup) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_updated.rbi b/rbi/workos/dsync_group_updated.rbi new file mode 100644 index 00000000..e190600e --- /dev/null +++ b/rbi/workos/dsync_group_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncGroupUpdatedData) } + def data; end + + sig { params(value: WorkOS::DsyncGroupUpdatedData).returns(WorkOS::DsyncGroupUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_updated_data.rbi b/rbi/workos/dsync_group_updated_data.rbi new file mode 100644 index 00000000..0a1c6838 --- /dev/null +++ b/rbi/workos/dsync_group_updated_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def raw_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def raw_attributes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_user_added.rbi b/rbi/workos/dsync_group_user_added.rbi new file mode 100644 index 00000000..b1a55cf3 --- /dev/null +++ b/rbi/workos/dsync_group_user_added.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUserAdded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncGroupUserAddedData) } + def data; end + + sig { params(value: WorkOS::DsyncGroupUserAddedData).returns(WorkOS::DsyncGroupUserAddedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_user_added_data.rbi b/rbi/workos/dsync_group_user_added_data.rbi new file mode 100644 index 00000000..fcb1a232 --- /dev/null +++ b/rbi/workos/dsync_group_user_added_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUserAddedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(WorkOS::DirectoryUser) } + def user; end + + sig { params(value: WorkOS::DirectoryUser).returns(WorkOS::DirectoryUser) } + def user=(value); end + + sig { returns(WorkOS::DirectoryGroup) } + def group; end + + sig { params(value: WorkOS::DirectoryGroup).returns(WorkOS::DirectoryGroup) } + def group=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_user_removed.rbi b/rbi/workos/dsync_group_user_removed.rbi new file mode 100644 index 00000000..1756b81b --- /dev/null +++ b/rbi/workos/dsync_group_user_removed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUserRemoved + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncGroupUserRemovedData) } + def data; end + + sig { params(value: WorkOS::DsyncGroupUserRemovedData).returns(WorkOS::DsyncGroupUserRemovedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_group_user_removed_data.rbi b/rbi/workos/dsync_group_user_removed_data.rbi new file mode 100644 index 00000000..c21f46d0 --- /dev/null +++ b/rbi/workos/dsync_group_user_removed_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncGroupUserRemovedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(WorkOS::DirectoryUser) } + def user; end + + sig { params(value: WorkOS::DirectoryUser).returns(WorkOS::DirectoryUser) } + def user=(value); end + + sig { returns(WorkOS::DirectoryGroup) } + def group; end + + sig { params(value: WorkOS::DirectoryGroup).returns(WorkOS::DirectoryGroup) } + def group=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_user_created.rbi b/rbi/workos/dsync_user_created.rbi new file mode 100644 index 00000000..8a0d78a4 --- /dev/null +++ b/rbi/workos/dsync_user_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncUserCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DirectoryUser) } + def data; end + + sig { params(value: WorkOS::DirectoryUser).returns(WorkOS::DirectoryUser) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_user_deleted.rbi b/rbi/workos/dsync_user_deleted.rbi new file mode 100644 index 00000000..7d2151c9 --- /dev/null +++ b/rbi/workos/dsync_user_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncUserDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DirectoryUser) } + def data; end + + sig { params(value: WorkOS::DirectoryUser).returns(WorkOS::DirectoryUser) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_user_updated.rbi b/rbi/workos/dsync_user_updated.rbi new file mode 100644 index 00000000..888d2261 --- /dev/null +++ b/rbi/workos/dsync_user_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncUserUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::DsyncUserUpdatedData) } + def data; end + + sig { params(value: WorkOS::DsyncUserUpdatedData).returns(WorkOS::DsyncUserUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_user_updated_data.rbi b/rbi/workos/dsync_user_updated_data.rbi new file mode 100644 index 00000000..f1d26b09 --- /dev/null +++ b/rbi/workos/dsync_user_updated_data.rbi @@ -0,0 +1,138 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncUserUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def directory_id; end + + sig { params(value: String).returns(String) } + def directory_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::DsyncUserUpdatedDataEmail])) } + def emails; end + + sig { params(value: T.nilable(T::Array[WorkOS::DsyncUserUpdatedDataEmail])).returns(T.nilable(T::Array[WorkOS::DsyncUserUpdatedDataEmail])) } + def emails=(value); end + + sig { returns(T.nilable(String)) } + def job_title; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def job_title=(value); end + + sig { returns(T.nilable(String)) } + def username; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def username=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def raw_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def raw_attributes=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T.nilable(WorkOS::SlimRole)) } + def role; end + + sig { params(value: T.nilable(WorkOS::SlimRole)).returns(T.nilable(WorkOS::SlimRole)) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/dsync_user_updated_data_email.rbi b/rbi/workos/dsync_user_updated_data_email.rbi new file mode 100644 index 00000000..642f4ac5 --- /dev/null +++ b/rbi/workos/dsync_user_updated_data_email.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DsyncUserUpdatedDataEmail + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def primary; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def primary=(value); end + + sig { returns(T.nilable(String)) } + def type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def value; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_change.rbi b/rbi/workos/email_change.rbi new file mode 100644 index 00000000..b0aa8bbf --- /dev/null +++ b/rbi/workos/email_change.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailChange + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(String) } + def new_email; end + + sig { params(value: String).returns(String) } + def new_email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_change_confirmation.rbi b/rbi/workos/email_change_confirmation.rbi new file mode 100644 index 00000000..bbfe547d --- /dev/null +++ b/rbi/workos/email_change_confirmation.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailChangeConfirmation + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(WorkOS::EmailChangeConfirmationUser) } + def user; end + + sig { params(value: WorkOS::EmailChangeConfirmationUser).returns(WorkOS::EmailChangeConfirmationUser) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_change_confirmation_user.rbi b/rbi/workos/email_change_confirmation_user.rbi new file mode 100644 index 00000000..67fbca88 --- /dev/null +++ b/rbi/workos/email_change_confirmation_user.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailChangeConfirmationUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def profile_picture_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def profile_picture_url=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Boolean) } + def email_verified; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def email_verified=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def last_sign_in_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_sign_in_at=(value); end + + sig { returns(T.nilable(String)) } + def locale; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def locale=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_verification.rbi b/rbi/workos/email_verification.rbi new file mode 100644 index 00000000..93206900 --- /dev/null +++ b/rbi/workos/email_verification.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailVerification + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_verification_code_session_authenticate_request.rbi b/rbi/workos/email_verification_code_session_authenticate_request.rbi new file mode 100644 index 00000000..7078be32 --- /dev/null +++ b/rbi/workos/email_verification_code_session_authenticate_request.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailVerificationCodeSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def pending_authentication_token; end + + sig { params(value: String).returns(String) } + def pending_authentication_token=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_verification_created.rbi b/rbi/workos/email_verification_created.rbi new file mode 100644 index 00000000..43d1aadd --- /dev/null +++ b/rbi/workos/email_verification_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailVerificationCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::EmailVerificationCreatedData) } + def data; end + + sig { params(value: WorkOS::EmailVerificationCreatedData).returns(WorkOS::EmailVerificationCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/email_verification_created_data.rbi b/rbi/workos/email_verification_created_data.rbi new file mode 100644 index 00000000..663199e0 --- /dev/null +++ b/rbi/workos/email_verification_created_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EmailVerificationCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/encryptors/aes_gcm.rbi b/rbi/workos/encryptors/aes_gcm.rbi new file mode 100644 index 00000000..6d510fc5 --- /dev/null +++ b/rbi/workos/encryptors/aes_gcm.rbi @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Encryptors + class AesGcm + SEAL_VERSION = T.let(0x01, Integer) + + sig { params(data: T.any(String, T::Hash[T.untyped, T.untyped]), key: String).returns(String) } + def seal(data, key); end + + sig { params(sealed: String, key: String).returns(T.any(T::Hash[String, T.untyped], String)) } + def unseal(sealed, key); end + end + end +end diff --git a/rbi/workos/enroll_user_authentication_factor.rbi b/rbi/workos/enroll_user_authentication_factor.rbi new file mode 100644 index 00000000..76de94ae --- /dev/null +++ b/rbi/workos/enroll_user_authentication_factor.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EnrollUserAuthenticationFactor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(T.nilable(String)) } + def totp_issuer; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def totp_issuer=(value); end + + sig { returns(T.nilable(String)) } + def totp_user; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def totp_user=(value); end + + sig { returns(T.nilable(String)) } + def totp_secret; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def totp_secret=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/errors.rbi b/rbi/workos/errors.rbi new file mode 100644 index 00000000..b962556f --- /dev/null +++ b/rbi/workos/errors.rbi @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Error < StandardError + sig { returns(T.nilable(Integer)) } + def http_status; end + + sig { returns(T.nilable(String)) } + def request_id; end + + sig { returns(T.nilable(String)) } + def code; end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def body; end + + sig do + params( + message: String, + http_status: T.nilable(Integer), + request_id: T.nilable(String), + code: T.nilable(String), + body: T.nilable(T::Hash[String, T.untyped]) + ).void + end + def initialize(message:, http_status: nil, request_id: nil, code: nil, body: nil); end + end + + class APIError < Error; end + class APIConnectionError < Error; end + class AuthenticationError < APIError; end + class ForbiddenRequestError < APIError; end + class IdempotencyError < APIError; end + class InvalidRequestError < APIError; end + class NotFoundError < APIError; end + class RateLimitExceededError < APIError; end + class UnprocessableEntityError < APIError; end + class SignatureVerificationError < Error; end +end diff --git a/rbi/workos/event_context.rbi b/rbi/workos/event_context.rbi new file mode 100644 index 00000000..9948c962 --- /dev/null +++ b/rbi/workos/event_context.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EventContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def google_analytics_client_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def google_analytics_client_id=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::EventContextGoogleAnalyticsSession])) } + def google_analytics_sessions; end + + sig { params(value: T.nilable(T::Array[WorkOS::EventContextGoogleAnalyticsSession])).returns(T.nilable(T::Array[WorkOS::EventContextGoogleAnalyticsSession])) } + def google_analytics_sessions=(value); end + + sig { returns(T.nilable(String)) } + def ajs_anonymous_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ajs_anonymous_id=(value); end + + sig { returns(T.nilable(String)) } + def client_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_id=(value); end + + sig { returns(T.nilable(WorkOS::EventContextActor)) } + def actor; end + + sig { params(value: T.nilable(WorkOS::EventContextActor)).returns(T.nilable(WorkOS::EventContextActor)) } + def actor=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def previous_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/event_context_actor.rbi b/rbi/workos/event_context_actor.rbi new file mode 100644 index 00000000..8ec23b7e --- /dev/null +++ b/rbi/workos/event_context_actor.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EventContextActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def source; end + + sig { params(value: String).returns(String) } + def source=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/event_context_google_analytics_session.rbi b/rbi/workos/event_context_google_analytics_session.rbi new file mode 100644 index 00000000..1821df41 --- /dev/null +++ b/rbi/workos/event_context_google_analytics_session.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EventContextGoogleAnalyticsSession + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def container_id; end + + sig { params(value: String).returns(String) } + def container_id=(value); end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_id=(value); end + + sig { returns(T.nilable(String)) } + def session_number; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def session_number=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/event_list_list_metadata.rbi b/rbi/workos/event_list_list_metadata.rbi new file mode 100644 index 00000000..7e920ef6 --- /dev/null +++ b/rbi/workos/event_list_list_metadata.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EventListListMetadata + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def after; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def after=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/event_schema.rbi b/rbi/workos/event_schema.rbi new file mode 100644 index 00000000..455ee748 --- /dev/null +++ b/rbi/workos/event_schema.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class EventSchema + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def data; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def context; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/events.rbi b/rbi/workos/events.rbi new file mode 100644 index 00000000..d1b75791 --- /dev/null +++ b/rbi/workos/events.rbi @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Events + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + events: T.nilable(T::Array[String]), + range_start: T.nilable(String), + range_end: T.nilable(String), + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_events(before:, after:, limit:, order:, events:, range_start:, range_end:, organization_id:, request_options:); end + + end +end diff --git a/rbi/workos/external_auth_complete_response.rbi b/rbi/workos/external_auth_complete_response.rbi new file mode 100644 index 00000000..f0372b89 --- /dev/null +++ b/rbi/workos/external_auth_complete_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ExternalAuthCompleteResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def redirect_uri; end + + sig { params(value: String).returns(String) } + def redirect_uri=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/feature_flag.rbi b/rbi/workos/feature_flag.rbi new file mode 100644 index 00000000..4adb5bd9 --- /dev/null +++ b/rbi/workos/feature_flag.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FeatureFlag + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FeatureFlagOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FeatureFlagOwner)).returns(T.nilable(WorkOS::FeatureFlagOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/feature_flag_owner.rbi b/rbi/workos/feature_flag_owner.rbi new file mode 100644 index 00000000..e0656831 --- /dev/null +++ b/rbi/workos/feature_flag_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FeatureFlagOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/feature_flags.rbi b/rbi/workos/feature_flags.rbi new file mode 100644 index 00000000..7c31cbfc --- /dev/null +++ b/rbi/workos/feature_flags.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FeatureFlags + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_feature_flags(before:, after:, limit:, order:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Flag) + end + def get_feature_flag(slug:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::FeatureFlag) + end + def disable_feature_flag(slug:, request_options:); end + + sig do + params( + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::FeatureFlag) + end + def enable_feature_flag(slug:, request_options:); end + + sig do + params( + resource_id: String, + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def add_flag_target(resource_id:, slug:, request_options:); end + + sig do + params( + resource_id: String, + slug: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def remove_flag_target(resource_id:, slug:, request_options:); end + + sig do + params( + organization_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_organization_feature_flags(organization_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + user_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_user_feature_flags(user_id:, before:, after:, limit:, order:, request_options:); end + + end +end diff --git a/rbi/workos/flag.rbi b/rbi/workos/flag.rbi new file mode 100644 index 00000000..ee3b1660 --- /dev/null +++ b/rbi/workos/flag.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Flag + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FlagOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FlagOwner)).returns(T.nilable(WorkOS::FlagOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_created.rbi b/rbi/workos/flag_created.rbi new file mode 100644 index 00000000..23af0ef9 --- /dev/null +++ b/rbi/workos/flag_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::FlagCreatedData) } + def data; end + + sig { params(value: WorkOS::FlagCreatedData).returns(WorkOS::FlagCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(WorkOS::FlagCreatedContext) } + def context; end + + sig { params(value: WorkOS::FlagCreatedContext).returns(WorkOS::FlagCreatedContext) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_created_context.rbi b/rbi/workos/flag_created_context.rbi new file mode 100644 index 00000000..420606da --- /dev/null +++ b/rbi/workos/flag_created_context.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagCreatedContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(WorkOS::FlagCreatedContextActor) } + def actor; end + + sig { params(value: WorkOS::FlagCreatedContextActor).returns(WorkOS::FlagCreatedContextActor) } + def actor=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_created_context_actor.rbi b/rbi/workos/flag_created_context_actor.rbi new file mode 100644 index 00000000..80c98994 --- /dev/null +++ b/rbi/workos/flag_created_context_actor.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagCreatedContextActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def source; end + + sig { params(value: String).returns(String) } + def source=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_created_data.rbi b/rbi/workos/flag_created_data.rbi new file mode 100644 index 00000000..e93594e2 --- /dev/null +++ b/rbi/workos/flag_created_data.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def environment_id; end + + sig { params(value: String).returns(String) } + def environment_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FlagCreatedDataOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FlagCreatedDataOwner)).returns(T.nilable(WorkOS::FlagCreatedDataOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_created_data_owner.rbi b/rbi/workos/flag_created_data_owner.rbi new file mode 100644 index 00000000..22ac1afd --- /dev/null +++ b/rbi/workos/flag_created_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagCreatedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_deleted.rbi b/rbi/workos/flag_deleted.rbi new file mode 100644 index 00000000..59b473d4 --- /dev/null +++ b/rbi/workos/flag_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::FlagDeletedData) } + def data; end + + sig { params(value: WorkOS::FlagDeletedData).returns(WorkOS::FlagDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(WorkOS::FlagDeletedContext) } + def context; end + + sig { params(value: WorkOS::FlagDeletedContext).returns(WorkOS::FlagDeletedContext) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_deleted_context.rbi b/rbi/workos/flag_deleted_context.rbi new file mode 100644 index 00000000..e7ef6ee4 --- /dev/null +++ b/rbi/workos/flag_deleted_context.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagDeletedContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(WorkOS::FlagDeletedContextActor) } + def actor; end + + sig { params(value: WorkOS::FlagDeletedContextActor).returns(WorkOS::FlagDeletedContextActor) } + def actor=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_deleted_context_actor.rbi b/rbi/workos/flag_deleted_context_actor.rbi new file mode 100644 index 00000000..487b4572 --- /dev/null +++ b/rbi/workos/flag_deleted_context_actor.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagDeletedContextActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def source; end + + sig { params(value: String).returns(String) } + def source=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_deleted_data.rbi b/rbi/workos/flag_deleted_data.rbi new file mode 100644 index 00000000..dffb387b --- /dev/null +++ b/rbi/workos/flag_deleted_data.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def environment_id; end + + sig { params(value: String).returns(String) } + def environment_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FlagDeletedDataOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FlagDeletedDataOwner)).returns(T.nilable(WorkOS::FlagDeletedDataOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_deleted_data_owner.rbi b/rbi/workos/flag_deleted_data_owner.rbi new file mode 100644 index 00000000..3f596dd7 --- /dev/null +++ b/rbi/workos/flag_deleted_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagDeletedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_owner.rbi b/rbi/workos/flag_owner.rbi new file mode 100644 index 00000000..c03cc037 --- /dev/null +++ b/rbi/workos/flag_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated.rbi b/rbi/workos/flag_rule_updated.rbi new file mode 100644 index 00000000..8f8f68d2 --- /dev/null +++ b/rbi/workos/flag_rule_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::FlagRuleUpdatedData) } + def data; end + + sig { params(value: WorkOS::FlagRuleUpdatedData).returns(WorkOS::FlagRuleUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(WorkOS::FlagRuleUpdatedContext) } + def context; end + + sig { params(value: WorkOS::FlagRuleUpdatedContext).returns(WorkOS::FlagRuleUpdatedContext) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context.rbi b/rbi/workos/flag_rule_updated_context.rbi new file mode 100644 index 00000000..93d58644 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(WorkOS::FlagRuleUpdatedContextActor) } + def actor; end + + sig { params(value: WorkOS::FlagRuleUpdatedContextActor).returns(WorkOS::FlagRuleUpdatedContextActor) } + def actor=(value); end + + sig { returns(String) } + def access_type; end + + sig { params(value: String).returns(String) } + def access_type=(value); end + + sig { returns(WorkOS::FlagRuleUpdatedContextConfiguredTarget) } + def configured_targets; end + + sig { params(value: WorkOS::FlagRuleUpdatedContextConfiguredTarget).returns(WorkOS::FlagRuleUpdatedContextConfiguredTarget) } + def configured_targets=(value); end + + sig { returns(WorkOS::FlagRuleUpdatedContextPreviousAttribute) } + def previous_attributes; end + + sig { params(value: WorkOS::FlagRuleUpdatedContextPreviousAttribute).returns(WorkOS::FlagRuleUpdatedContextPreviousAttribute) } + def previous_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_actor.rbi b/rbi/workos/flag_rule_updated_context_actor.rbi new file mode 100644 index 00000000..274ad954 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_actor.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def source; end + + sig { params(value: String).returns(String) } + def source=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_configured_target.rbi b/rbi/workos/flag_rule_updated_context_configured_target.rbi new file mode 100644 index 00000000..e98cf9ab --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_configured_target.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextConfiguredTarget + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetOrganization]) } + def organizations; end + + sig { params(value: T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetOrganization]).returns(T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetOrganization]) } + def organizations=(value); end + + sig { returns(T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetUser]) } + def users; end + + sig { params(value: T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetUser]).returns(T::Array[WorkOS::FlagRuleUpdatedContextConfiguredTargetUser]) } + def users=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi b/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi new file mode 100644 index 00000000..b396d686 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_configured_target_organization.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextConfiguredTargetOrganization + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_configured_target_user.rbi b/rbi/workos/flag_rule_updated_context_configured_target_user.rbi new file mode 100644 index 00000000..8b472f74 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_configured_target_user.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextConfiguredTargetUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute.rbi new file mode 100644 index 00000000..8b781870 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttribute + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeData)) } + def data; end + + sig { params(value: T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeData)).returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeData)) } + def data=(value); end + + sig { returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContext)).returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContext)) } + def context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi new file mode 100644 index 00000000..3c3504cf --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute_context.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def access_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def access_type=(value); end + + sig { returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget)) } + def configured_targets; end + + sig { params(value: T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget)).returns(T.nilable(WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget)) } + def configured_targets=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi new file mode 100644 index 00000000..2ded502d --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization]) } + def organizations; end + + sig { params(value: T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization]).returns(T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization]) } + def organizations=(value); end + + sig { returns(T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser]) } + def users; end + + sig { params(value: T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser]).returns(T::Array[WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser]) } + def users=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi new file mode 100644 index 00000000..8512965d --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_organization.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi new file mode 100644 index 00000000..b39c98b3 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute_context_configured_target_user.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi b/rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi new file mode 100644 index 00000000..3923ada8 --- /dev/null +++ b/rbi/workos/flag_rule_updated_context_previous_attribute_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedContextPreviousAttributeData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def enabled; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def enabled=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def default_value; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def default_value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_data.rbi b/rbi/workos/flag_rule_updated_data.rbi new file mode 100644 index 00000000..fccc290e --- /dev/null +++ b/rbi/workos/flag_rule_updated_data.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def environment_id; end + + sig { params(value: String).returns(String) } + def environment_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FlagRuleUpdatedDataOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FlagRuleUpdatedDataOwner)).returns(T.nilable(WorkOS::FlagRuleUpdatedDataOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_rule_updated_data_owner.rbi b/rbi/workos/flag_rule_updated_data_owner.rbi new file mode 100644 index 00000000..188638c2 --- /dev/null +++ b/rbi/workos/flag_rule_updated_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagRuleUpdatedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated.rbi b/rbi/workos/flag_updated.rbi new file mode 100644 index 00000000..82be340b --- /dev/null +++ b/rbi/workos/flag_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::FlagUpdatedData) } + def data; end + + sig { params(value: WorkOS::FlagUpdatedData).returns(WorkOS::FlagUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(WorkOS::FlagUpdatedContext) } + def context; end + + sig { params(value: WorkOS::FlagUpdatedContext).returns(WorkOS::FlagUpdatedContext) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_context.rbi b/rbi/workos/flag_updated_context.rbi new file mode 100644 index 00000000..7a54833d --- /dev/null +++ b/rbi/workos/flag_updated_context.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedContext + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(WorkOS::FlagUpdatedContextActor) } + def actor; end + + sig { params(value: WorkOS::FlagUpdatedContextActor).returns(WorkOS::FlagUpdatedContextActor) } + def actor=(value); end + + sig { returns(T.nilable(WorkOS::FlagUpdatedContextPreviousAttribute)) } + def previous_attributes; end + + sig { params(value: T.nilable(WorkOS::FlagUpdatedContextPreviousAttribute)).returns(T.nilable(WorkOS::FlagUpdatedContextPreviousAttribute)) } + def previous_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_context_actor.rbi b/rbi/workos/flag_updated_context_actor.rbi new file mode 100644 index 00000000..fa3ecefa --- /dev/null +++ b/rbi/workos/flag_updated_context_actor.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedContextActor + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def source; end + + sig { params(value: String).returns(String) } + def source=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_context_previous_attribute.rbi b/rbi/workos/flag_updated_context_previous_attribute.rbi new file mode 100644 index 00000000..6a9e1deb --- /dev/null +++ b/rbi/workos/flag_updated_context_previous_attribute.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedContextPreviousAttribute + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(WorkOS::FlagUpdatedContextPreviousAttributeData)) } + def data; end + + sig { params(value: T.nilable(WorkOS::FlagUpdatedContextPreviousAttributeData)).returns(T.nilable(WorkOS::FlagUpdatedContextPreviousAttributeData)) } + def data=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_context_previous_attribute_data.rbi b/rbi/workos/flag_updated_context_previous_attribute_data.rbi new file mode 100644 index 00000000..edab5b5f --- /dev/null +++ b/rbi/workos/flag_updated_context_previous_attribute_data.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedContextPreviousAttributeData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def tags; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def tags=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def enabled; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def enabled=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def default_value; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def default_value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_data.rbi b/rbi/workos/flag_updated_data.rbi new file mode 100644 index 00000000..a7b477a3 --- /dev/null +++ b/rbi/workos/flag_updated_data.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def environment_id; end + + sig { params(value: String).returns(String) } + def environment_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(WorkOS::FlagUpdatedDataOwner)) } + def owner; end + + sig { params(value: T.nilable(WorkOS::FlagUpdatedDataOwner)).returns(T.nilable(WorkOS::FlagUpdatedDataOwner)) } + def owner=(value); end + + sig { returns(T::Array[String]) } + def tags; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def tags=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T::Boolean) } + def default_value; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default_value=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/flag_updated_data_owner.rbi b/rbi/workos/flag_updated_data_owner.rbi new file mode 100644 index 00000000..3489ad4d --- /dev/null +++ b/rbi/workos/flag_updated_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class FlagUpdatedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/generate_link.rbi b/rbi/workos/generate_link.rbi new file mode 100644 index 00000000..4dee0aaf --- /dev/null +++ b/rbi/workos/generate_link.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GenerateLink + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def return_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def return_url=(value); end + + sig { returns(T.nilable(String)) } + def success_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def success_url=(value); end + + sig { returns(String) } + def organization; end + + sig { params(value: String).returns(String) } + def organization=(value); end + + sig { returns(T.nilable(String)) } + def intent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def intent=(value); end + + sig { returns(T.nilable(WorkOS::IntentOptions)) } + def intent_options; end + + sig { params(value: T.nilable(WorkOS::IntentOptions)).returns(T.nilable(WorkOS::IntentOptions)) } + def intent_options=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def it_contact_emails; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def it_contact_emails=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group.rbi b/rbi/workos/group.rbi new file mode 100644 index 00000000..ff7fda30 --- /dev/null +++ b/rbi/workos/group.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Group + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_created.rbi b/rbi/workos/group_created.rbi new file mode 100644 index 00000000..5785c0fa --- /dev/null +++ b/rbi/workos/group_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::Group) } + def data; end + + sig { params(value: WorkOS::Group).returns(WorkOS::Group) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_deleted.rbi b/rbi/workos/group_deleted.rbi new file mode 100644 index 00000000..0f10e4f8 --- /dev/null +++ b/rbi/workos/group_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::Group) } + def data; end + + sig { params(value: WorkOS::Group).returns(WorkOS::Group) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_member_added.rbi b/rbi/workos/group_member_added.rbi new file mode 100644 index 00000000..30d370e5 --- /dev/null +++ b/rbi/workos/group_member_added.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupMemberAdded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::GroupMemberAddedData) } + def data; end + + sig { params(value: WorkOS::GroupMemberAddedData).returns(WorkOS::GroupMemberAddedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_member_added_data.rbi b/rbi/workos/group_member_added_data.rbi new file mode 100644 index 00000000..668dd0a1 --- /dev/null +++ b/rbi/workos/group_member_added_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupMemberAddedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def group_id; end + + sig { params(value: String).returns(String) } + def group_id=(value); end + + sig { returns(String) } + def organization_membership_id; end + + sig { params(value: String).returns(String) } + def organization_membership_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_member_removed.rbi b/rbi/workos/group_member_removed.rbi new file mode 100644 index 00000000..59a49f71 --- /dev/null +++ b/rbi/workos/group_member_removed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupMemberRemoved + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::GroupMemberRemovedData) } + def data; end + + sig { params(value: WorkOS::GroupMemberRemovedData).returns(WorkOS::GroupMemberRemovedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_member_removed_data.rbi b/rbi/workos/group_member_removed_data.rbi new file mode 100644 index 00000000..ea493d12 --- /dev/null +++ b/rbi/workos/group_member_removed_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupMemberRemovedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def group_id; end + + sig { params(value: String).returns(String) } + def group_id=(value); end + + sig { returns(String) } + def organization_membership_id; end + + sig { params(value: String).returns(String) } + def organization_membership_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_updated.rbi b/rbi/workos/group_updated.rbi new file mode 100644 index 00000000..454691bb --- /dev/null +++ b/rbi/workos/group_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::Group) } + def data; end + + sig { params(value: WorkOS::Group).returns(WorkOS::Group) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/groups.rbi b/rbi/workos/groups.rbi new file mode 100644 index 00000000..3f52d4b2 --- /dev/null +++ b/rbi/workos/groups.rbi @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Groups + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_organization_groups(organization_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_id: String, + name: String, + description: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Group) + end + def create_organization_group(organization_id:, name:, description:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Group) + end + def get_organization_group(organization_id:, group_id:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + name: T.nilable(String), + description: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Group) + end + def update_organization_group(organization_id:, group_id:, name:, description:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization_group(organization_id:, group_id:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_group_organization_memberships(organization_id:, group_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + organization_membership_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Group) + end + def create_group_organization_membership(organization_id:, group_id:, organization_membership_id:, request_options:); end + + sig do + params( + organization_id: String, + group_id: String, + om_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_group_organization_membership(organization_id:, group_id:, om_id:, request_options:); end + + end +end diff --git a/rbi/workos/hash_provider.rbi b/rbi/workos/hash_provider.rbi new file mode 100644 index 00000000..84ddb8ae --- /dev/null +++ b/rbi/workos/hash_provider.rbi @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module HashProvider + sig { returns(T::Hash[String, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + + sig { returns(String) } + def inspect; end + end +end diff --git a/rbi/workos/intent_options.rbi b/rbi/workos/intent_options.rbi new file mode 100644 index 00000000..38eea586 --- /dev/null +++ b/rbi/workos/intent_options.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class IntentOptions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(WorkOS::SSOIntentOptions)) } + def sso; end + + sig { params(value: T.nilable(WorkOS::SSOIntentOptions)).returns(T.nilable(WorkOS::SSOIntentOptions)) } + def sso=(value); end + + sig { returns(T.nilable(WorkOS::DomainVerificationIntentOptions)) } + def domain_verification; end + + sig { params(value: T.nilable(WorkOS::DomainVerificationIntentOptions)).returns(T.nilable(WorkOS::DomainVerificationIntentOptions)) } + def domain_verification=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation.rbi b/rbi/workos/invitation.rbi new file mode 100644 index 00000000..03ad00cb --- /dev/null +++ b/rbi/workos/invitation.rbi @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Invitation + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def token; end + + sig { params(value: String).returns(String) } + def token=(value); end + + sig { returns(String) } + def accept_invitation_url; end + + sig { params(value: String).returns(String) } + def accept_invitation_url=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_accepted.rbi b/rbi/workos/invitation_accepted.rbi new file mode 100644 index 00000000..8138556f --- /dev/null +++ b/rbi/workos/invitation_accepted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationAccepted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::InvitationAcceptedData) } + def data; end + + sig { params(value: WorkOS::InvitationAcceptedData).returns(WorkOS::InvitationAcceptedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_accepted_data.rbi b/rbi/workos/invitation_accepted_data.rbi new file mode 100644 index 00000000..e1485516 --- /dev/null +++ b/rbi/workos/invitation_accepted_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationAcceptedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_created.rbi b/rbi/workos/invitation_created.rbi new file mode 100644 index 00000000..c9c6eb69 --- /dev/null +++ b/rbi/workos/invitation_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::InvitationCreatedData) } + def data; end + + sig { params(value: WorkOS::InvitationCreatedData).returns(WorkOS::InvitationCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_created_data.rbi b/rbi/workos/invitation_created_data.rbi new file mode 100644 index 00000000..5acdac5c --- /dev/null +++ b/rbi/workos/invitation_created_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_resent.rbi b/rbi/workos/invitation_resent.rbi new file mode 100644 index 00000000..8edb243e --- /dev/null +++ b/rbi/workos/invitation_resent.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationResent + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::InvitationResentData) } + def data; end + + sig { params(value: WorkOS::InvitationResentData).returns(WorkOS::InvitationResentData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_resent_data.rbi b/rbi/workos/invitation_resent_data.rbi new file mode 100644 index 00000000..94cdb880 --- /dev/null +++ b/rbi/workos/invitation_resent_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationResentData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_revoked.rbi b/rbi/workos/invitation_revoked.rbi new file mode 100644 index 00000000..220b34c8 --- /dev/null +++ b/rbi/workos/invitation_revoked.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationRevoked + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::InvitationRevokedData) } + def data; end + + sig { params(value: WorkOS::InvitationRevokedData).returns(WorkOS::InvitationRevokedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/invitation_revoked_data.rbi b/rbi/workos/invitation_revoked_data.rbi new file mode 100644 index 00000000..fa37587b --- /dev/null +++ b/rbi/workos/invitation_revoked_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class InvitationRevokedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/jwks_response.rbi b/rbi/workos/jwks_response.rbi new file mode 100644 index 00000000..64351f36 --- /dev/null +++ b/rbi/workos/jwks_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class JwksResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Array[WorkOS::JwksResponseKeys]) } + def keys; end + + sig { params(value: T::Array[WorkOS::JwksResponseKeys]).returns(T::Array[WorkOS::JwksResponseKeys]) } + def keys=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/jwks_response_keys.rbi b/rbi/workos/jwks_response_keys.rbi new file mode 100644 index 00000000..af12afd0 --- /dev/null +++ b/rbi/workos/jwks_response_keys.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class JwksResponseKeys + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def alg; end + + sig { params(value: String).returns(String) } + def alg=(value); end + + sig { returns(String) } + def kty; end + + sig { params(value: String).returns(String) } + def kty=(value); end + + sig { returns(String) } + def use; end + + sig { params(value: String).returns(String) } + def use=(value); end + + sig { returns(T::Array[String]) } + def x_5_c; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def x_5_c=(value); end + + sig { returns(String) } + def n; end + + sig { params(value: String).returns(String) } + def n=(value); end + + sig { returns(String) } + def e; end + + sig { params(value: String).returns(String) } + def e=(value); end + + sig { returns(String) } + def kid; end + + sig { params(value: String).returns(String) } + def kid=(value); end + + sig { returns(String) } + def x_5_t_s_256; end + + sig { params(value: String).returns(String) } + def x_5_t_s_256=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/jwt_template_response.rbi b/rbi/workos/jwt_template_response.rbi new file mode 100644 index 00000000..11687fff --- /dev/null +++ b/rbi/workos/jwt_template_response.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class JWTTemplateResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def content; end + + sig { params(value: String).returns(String) } + def content=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/magic_auth.rbi b/rbi/workos/magic_auth.rbi new file mode 100644 index 00000000..a2e26f75 --- /dev/null +++ b/rbi/workos/magic_auth.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MagicAuth + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/magic_auth_code_session_authenticate_request.rbi b/rbi/workos/magic_auth_code_session_authenticate_request.rbi new file mode 100644 index 00000000..36442669 --- /dev/null +++ b/rbi/workos/magic_auth_code_session_authenticate_request.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MagicAuthCodeSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def invitation_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def invitation_token=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/magic_auth_created.rbi b/rbi/workos/magic_auth_created.rbi new file mode 100644 index 00000000..a89fecb1 --- /dev/null +++ b/rbi/workos/magic_auth_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MagicAuthCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::MagicAuthCreatedData) } + def data; end + + sig { params(value: WorkOS::MagicAuthCreatedData).returns(WorkOS::MagicAuthCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/magic_auth_created_data.rbi b/rbi/workos/magic_auth_created_data.rbi new file mode 100644 index 00000000..df9436fe --- /dev/null +++ b/rbi/workos/magic_auth_created_data.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MagicAuthCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/mfa_totp_session_authenticate_request.rbi b/rbi/workos/mfa_totp_session_authenticate_request.rbi new file mode 100644 index 00000000..0d410bb9 --- /dev/null +++ b/rbi/workos/mfa_totp_session_authenticate_request.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MFATotpSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def pending_authentication_token; end + + sig { params(value: String).returns(String) } + def pending_authentication_token=(value); end + + sig { returns(String) } + def authentication_challenge_id; end + + sig { params(value: String).returns(String) } + def authentication_challenge_id=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/multi_factor_auth.rbi b/rbi/workos/multi_factor_auth.rbi new file mode 100644 index 00000000..5ffb9677 --- /dev/null +++ b/rbi/workos/multi_factor_auth.rbi @@ -0,0 +1,83 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class MultiFactorAuth + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + id: String, + code: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthenticationChallengeVerifyResponse) + end + def verify_challenge(id:, code:, request_options:); end + + sig do + params( + type: String, + phone_number: T.nilable(String), + totp_issuer: T.nilable(String), + totp_user: T.nilable(String), + user_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthenticationFactorEnrolled) + end + def enroll_factor(type:, phone_number:, totp_issuer:, totp_user:, user_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthenticationFactor) + end + def get_factor(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_factor(id:, request_options:); end + + sig do + params( + id: String, + sms_template: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthenticationChallenge) + end + def challenge_factor(id:, sms_template:, request_options:); end + + sig do + params( + userland_user_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_user_auth_factors(userland_user_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + userland_user_id: String, + type: String, + totp_issuer: T.nilable(String), + totp_user: T.nilable(String), + totp_secret: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserAuthenticationFactorEnrollResponse) + end + def create_user_auth_factor(userland_user_id:, type:, totp_issuer:, totp_user:, totp_secret:, request_options:); end + + end +end diff --git a/rbi/workos/new_connect_application_secret.rbi b/rbi/workos/new_connect_application_secret.rbi new file mode 100644 index 00000000..1435ed6d --- /dev/null +++ b/rbi/workos/new_connect_application_secret.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class NewConnectApplicationSecret + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def secret_hint; end + + sig { params(value: String).returns(String) } + def secret_hint=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def secret; end + + sig { params(value: String).returns(String) } + def secret=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization.rbi b/rbi/workos/organization.rbi new file mode 100644 index 00000000..1443290b --- /dev/null +++ b/rbi/workos/organization.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Organization + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Array[WorkOS::OrganizationDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::OrganizationDomain]).returns(T::Array[WorkOS::OrganizationDomain]) } + def domains=(value); end + + sig { returns(T::Hash[String, String]) } + def metadata; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def stripe_customer_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def stripe_customer_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_api_key.rbi b/rbi/workos/organization_api_key.rbi new file mode 100644 index 00000000..c2413b53 --- /dev/null +++ b/rbi/workos/organization_api_key.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(WorkOS::OrganizationApiKeyOwner) } + def owner; end + + sig { params(value: WorkOS::OrganizationApiKeyOwner).returns(WorkOS::OrganizationApiKeyOwner) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_api_key_owner.rbi b/rbi/workos/organization_api_key_owner.rbi new file mode 100644 index 00000000..00ddb120 --- /dev/null +++ b/rbi/workos/organization_api_key_owner.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationApiKeyOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_api_key_with_value.rbi b/rbi/workos/organization_api_key_with_value.rbi new file mode 100644 index 00000000..ddf7c6a1 --- /dev/null +++ b/rbi/workos/organization_api_key_with_value.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationApiKeyWithValue + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(WorkOS::OrganizationApiKeyWithValueOwner) } + def owner; end + + sig { params(value: WorkOS::OrganizationApiKeyWithValueOwner).returns(WorkOS::OrganizationApiKeyWithValueOwner) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def value; end + + sig { params(value: String).returns(String) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_api_key_with_value_owner.rbi b/rbi/workos/organization_api_key_with_value_owner.rbi new file mode 100644 index 00000000..3a470243 --- /dev/null +++ b/rbi/workos/organization_api_key_with_value_owner.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationApiKeyWithValueOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_created.rbi b/rbi/workos/organization_created.rbi new file mode 100644 index 00000000..6bc18228 --- /dev/null +++ b/rbi/workos/organization_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationCreatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationCreatedData).returns(WorkOS::OrganizationCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_created_data.rbi b/rbi/workos/organization_created_data.rbi new file mode 100644 index 00000000..c24a180b --- /dev/null +++ b/rbi/workos/organization_created_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Array[WorkOS::OrganizationCreatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::OrganizationCreatedDataDomain]).returns(T::Array[WorkOS::OrganizationCreatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[String, String]) } + def metadata; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def stripe_customer_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def stripe_customer_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_created_data_domain.rbi b/rbi/workos/organization_created_data_domain.rbi new file mode 100644 index 00000000..c1e6f37a --- /dev/null +++ b/rbi/workos/organization_created_data_domain.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationCreatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_deleted.rbi b/rbi/workos/organization_deleted.rbi new file mode 100644 index 00000000..5ac4a868 --- /dev/null +++ b/rbi/workos/organization_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDeletedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDeletedData).returns(WorkOS::OrganizationDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_deleted_data.rbi b/rbi/workos/organization_deleted_data.rbi new file mode 100644 index 00000000..933b5656 --- /dev/null +++ b/rbi/workos/organization_deleted_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Array[WorkOS::OrganizationDeletedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::OrganizationDeletedDataDomain]).returns(T::Array[WorkOS::OrganizationDeletedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[String, String]) } + def metadata; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def stripe_customer_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def stripe_customer_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_deleted_data_domain.rbi b/rbi/workos/organization_deleted_data_domain.rbi new file mode 100644 index 00000000..40a235a1 --- /dev/null +++ b/rbi/workos/organization_deleted_data_domain.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDeletedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain.rbi b/rbi/workos/organization_domain.rbi new file mode 100644 index 00000000..4776a2ce --- /dev/null +++ b/rbi/workos/organization_domain.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_created.rbi b/rbi/workos/organization_domain_created.rbi new file mode 100644 index 00000000..6c718835 --- /dev/null +++ b/rbi/workos/organization_domain_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDomainCreatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDomainCreatedData).returns(WorkOS::OrganizationDomainCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_created_data.rbi b/rbi/workos/organization_domain_created_data.rbi new file mode 100644 index 00000000..e67f729a --- /dev/null +++ b/rbi/workos/organization_domain_created_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_data.rbi b/rbi/workos/organization_domain_data.rbi new file mode 100644 index 00000000..66c0a19b --- /dev/null +++ b/rbi/workos/organization_domain_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_deleted.rbi b/rbi/workos/organization_domain_deleted.rbi new file mode 100644 index 00000000..dc844e3a --- /dev/null +++ b/rbi/workos/organization_domain_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDomainDeletedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDomainDeletedData).returns(WorkOS::OrganizationDomainDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_deleted_data.rbi b/rbi/workos/organization_domain_deleted_data.rbi new file mode 100644 index 00000000..cb6a7fe1 --- /dev/null +++ b/rbi/workos/organization_domain_deleted_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_stand_alone.rbi b/rbi/workos/organization_domain_stand_alone.rbi new file mode 100644 index 00000000..950db190 --- /dev/null +++ b/rbi/workos/organization_domain_stand_alone.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainStandAlone + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_updated.rbi b/rbi/workos/organization_domain_updated.rbi new file mode 100644 index 00000000..e9fd3033 --- /dev/null +++ b/rbi/workos/organization_domain_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDomainUpdatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDomainUpdatedData).returns(WorkOS::OrganizationDomainUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_updated_data.rbi b/rbi/workos/organization_domain_updated_data.rbi new file mode 100644 index 00000000..03b90221 --- /dev/null +++ b/rbi/workos/organization_domain_updated_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_verification_failed.rbi b/rbi/workos/organization_domain_verification_failed.rbi new file mode 100644 index 00000000..2967eb9d --- /dev/null +++ b/rbi/workos/organization_domain_verification_failed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainVerificationFailed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDomainVerificationFailedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDomainVerificationFailedData).returns(WorkOS::OrganizationDomainVerificationFailedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_verification_failed_data.rbi b/rbi/workos/organization_domain_verification_failed_data.rbi new file mode 100644 index 00000000..ccade209 --- /dev/null +++ b/rbi/workos/organization_domain_verification_failed_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainVerificationFailedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def reason; end + + sig { params(value: String).returns(String) } + def reason=(value); end + + sig { returns(WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain) } + def organization_domain; end + + sig { params(value: WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain).returns(WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain) } + def organization_domain=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi b/rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi new file mode 100644 index 00000000..18c2fe7a --- /dev/null +++ b/rbi/workos/organization_domain_verification_failed_data_organization_domain.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainVerificationFailedDataOrganizationDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_verified.rbi b/rbi/workos/organization_domain_verified.rbi new file mode 100644 index 00000000..a5c65205 --- /dev/null +++ b/rbi/workos/organization_domain_verified.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainVerified + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationDomainVerifiedData) } + def data; end + + sig { params(value: WorkOS::OrganizationDomainVerifiedData).returns(WorkOS::OrganizationDomainVerifiedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domain_verified_data.rbi b/rbi/workos/organization_domain_verified_data.rbi new file mode 100644 index 00000000..ae28c143 --- /dev/null +++ b/rbi/workos/organization_domain_verified_data.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomainVerifiedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_domains.rbi b/rbi/workos/organization_domains.rbi new file mode 100644 index 00000000..36090166 --- /dev/null +++ b/rbi/workos/organization_domains.rbi @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationDomains + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + domain: String, + organization_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationDomain) + end + def create_organization_domain(domain:, organization_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationDomainStandAlone) + end + def get_organization_domain(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization_domain(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationDomainStandAlone) + end + def verify_organization_domain(id:, request_options:); end + + end +end diff --git a/rbi/workos/organization_input.rbi b/rbi/workos/organization_input.rbi new file mode 100644 index 00000000..a86eb591 --- /dev/null +++ b/rbi/workos/organization_input.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationInput + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def domains; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def domains=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::OrganizationDomainData])) } + def domain_data; end + + sig { params(value: T.nilable(T::Array[WorkOS::OrganizationDomainData])).returns(T.nilable(T::Array[WorkOS::OrganizationDomainData])) } + def domain_data=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership.rbi b/rbi/workos/organization_membership.rbi new file mode 100644 index 00000000..90776d84 --- /dev/null +++ b/rbi/workos/organization_membership.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembership + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(T.nilable(String)) } + def organization_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_created.rbi b/rbi/workos/organization_membership_created.rbi new file mode 100644 index 00000000..6bf7b86d --- /dev/null +++ b/rbi/workos/organization_membership_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationMembershipCreatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationMembershipCreatedData).returns(WorkOS::OrganizationMembershipCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_created_data.rbi b/rbi/workos/organization_membership_created_data.rbi new file mode 100644 index 00000000..f4151150 --- /dev/null +++ b/rbi/workos/organization_membership_created_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_deleted.rbi b/rbi/workos/organization_membership_deleted.rbi new file mode 100644 index 00000000..22741fc1 --- /dev/null +++ b/rbi/workos/organization_membership_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationMembershipDeletedData) } + def data; end + + sig { params(value: WorkOS::OrganizationMembershipDeletedData).returns(WorkOS::OrganizationMembershipDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_deleted_data.rbi b/rbi/workos/organization_membership_deleted_data.rbi new file mode 100644 index 00000000..2e44b35e --- /dev/null +++ b/rbi/workos/organization_membership_deleted_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_updated.rbi b/rbi/workos/organization_membership_updated.rbi new file mode 100644 index 00000000..8dffb228 --- /dev/null +++ b/rbi/workos/organization_membership_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationMembershipUpdatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationMembershipUpdatedData).returns(WorkOS::OrganizationMembershipUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_updated_data.rbi b/rbi/workos/organization_membership_updated_data.rbi new file mode 100644 index 00000000..4034ab1f --- /dev/null +++ b/rbi/workos/organization_membership_updated_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationMembershipUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def custom_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def custom_attributes=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_created.rbi b/rbi/workos/organization_role_created.rbi new file mode 100644 index 00000000..fd5227f2 --- /dev/null +++ b/rbi/workos/organization_role_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationRoleCreatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationRoleCreatedData).returns(WorkOS::OrganizationRoleCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_created_data.rbi b/rbi/workos/organization_role_created_data.rbi new file mode 100644 index 00000000..bd537837 --- /dev/null +++ b/rbi/workos/organization_role_created_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_deleted.rbi b/rbi/workos/organization_role_deleted.rbi new file mode 100644 index 00000000..b9e48d16 --- /dev/null +++ b/rbi/workos/organization_role_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationRoleDeletedData) } + def data; end + + sig { params(value: WorkOS::OrganizationRoleDeletedData).returns(WorkOS::OrganizationRoleDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_deleted_data.rbi b/rbi/workos/organization_role_deleted_data.rbi new file mode 100644 index 00000000..0b522ccb --- /dev/null +++ b/rbi/workos/organization_role_deleted_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_updated.rbi b/rbi/workos/organization_role_updated.rbi new file mode 100644 index 00000000..acbc1660 --- /dev/null +++ b/rbi/workos/organization_role_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationRoleUpdatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationRoleUpdatedData).returns(WorkOS::OrganizationRoleUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_role_updated_data.rbi b/rbi/workos/organization_role_updated_data.rbi new file mode 100644 index 00000000..1f815d66 --- /dev/null +++ b/rbi/workos/organization_role_updated_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationRoleUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_selection_session_authenticate_request.rbi b/rbi/workos/organization_selection_session_authenticate_request.rbi new file mode 100644 index 00000000..a848fa56 --- /dev/null +++ b/rbi/workos/organization_selection_session_authenticate_request.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationSelectionSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def pending_authentication_token; end + + sig { params(value: String).returns(String) } + def pending_authentication_token=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_updated.rbi b/rbi/workos/organization_updated.rbi new file mode 100644 index 00000000..0cf67fd6 --- /dev/null +++ b/rbi/workos/organization_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::OrganizationUpdatedData) } + def data; end + + sig { params(value: WorkOS::OrganizationUpdatedData).returns(WorkOS::OrganizationUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_updated_data.rbi b/rbi/workos/organization_updated_data.rbi new file mode 100644 index 00000000..92b25f60 --- /dev/null +++ b/rbi/workos/organization_updated_data.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Array[WorkOS::OrganizationUpdatedDataDomain]) } + def domains; end + + sig { params(value: T::Array[WorkOS::OrganizationUpdatedDataDomain]).returns(T::Array[WorkOS::OrganizationUpdatedDataDomain]) } + def domains=(value); end + + sig { returns(T::Hash[String, String]) } + def metadata; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def stripe_customer_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def stripe_customer_id=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_updated_data_domain.rbi b/rbi/workos/organization_updated_data_domain.rbi new file mode 100644 index 00000000..e237df78 --- /dev/null +++ b/rbi/workos/organization_updated_data_domain.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class OrganizationUpdatedDataDomain + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def domain; end + + sig { params(value: String).returns(String) } + def domain=(value); end + + sig { returns(T.nilable(String)) } + def state; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def verification_prefix; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_prefix=(value); end + + sig { returns(T.nilable(String)) } + def verification_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_token=(value); end + + sig { returns(T.nilable(String)) } + def verification_strategy; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def verification_strategy=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organizations.rbi b/rbi/workos/organizations.rbi new file mode 100644 index 00000000..7995e453 --- /dev/null +++ b/rbi/workos/organizations.rbi @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Organizations + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + domains: T.nilable(T::Array[String]), + search: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_organizations(before:, after:, limit:, order:, domains:, search:, request_options:); end + + sig do + params( + name: String, + allow_profiles_outside_organization: T.nilable(T::Boolean), + domains: T.nilable(T::Array[String]), + domain_data: T.nilable(T::Array[WorkOS::OrganizationDomainData]), + metadata: T.nilable(T::Hash[String, String]), + external_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Organization) + end + def create_organization(name:, allow_profiles_outside_organization:, domains:, domain_data:, metadata:, external_id:, request_options:); end + + sig do + params( + external_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Organization) + end + def get_organization_by_external_id(external_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Organization) + end + def get_organization(id:, request_options:); end + + sig do + params( + id: String, + name: T.nilable(String), + allow_profiles_outside_organization: T.nilable(T::Boolean), + domains: T.nilable(T::Array[String]), + domain_data: T.nilable(T::Array[WorkOS::OrganizationDomainData]), + stripe_customer_id: T.nilable(String), + metadata: T.nilable(T::Hash[String, String]), + external_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Organization) + end + def update_organization(id:, name:, allow_profiles_outside_organization:, domains:, domain_data:, stripe_customer_id:, metadata:, external_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuditLogConfiguration) + end + def get_audit_log_configuration(id:, request_options:); end + + end +end diff --git a/rbi/workos/password_reset.rbi b/rbi/workos/password_reset.rbi new file mode 100644 index 00000000..649b4c24 --- /dev/null +++ b/rbi/workos/password_reset.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordReset + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def password_reset_token; end + + sig { params(value: String).returns(String) } + def password_reset_token=(value); end + + sig { returns(String) } + def password_reset_url; end + + sig { params(value: String).returns(String) } + def password_reset_url=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/password_reset_created.rbi b/rbi/workos/password_reset_created.rbi new file mode 100644 index 00000000..3001796c --- /dev/null +++ b/rbi/workos/password_reset_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordResetCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PasswordResetCreatedData) } + def data; end + + sig { params(value: WorkOS::PasswordResetCreatedData).returns(WorkOS::PasswordResetCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/password_reset_created_data.rbi b/rbi/workos/password_reset_created_data.rbi new file mode 100644 index 00000000..9ebb64a7 --- /dev/null +++ b/rbi/workos/password_reset_created_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordResetCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/password_reset_succeeded.rbi b/rbi/workos/password_reset_succeeded.rbi new file mode 100644 index 00000000..167f283e --- /dev/null +++ b/rbi/workos/password_reset_succeeded.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordResetSucceeded + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PasswordResetSucceededData) } + def data; end + + sig { params(value: WorkOS::PasswordResetSucceededData).returns(WorkOS::PasswordResetSucceededData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/password_reset_succeeded_data.rbi b/rbi/workos/password_reset_succeeded_data.rbi new file mode 100644 index 00000000..f4f39942 --- /dev/null +++ b/rbi/workos/password_reset_succeeded_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordResetSucceededData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/password_session_authenticate_request.rbi b/rbi/workos/password_session_authenticate_request.rbi new file mode 100644 index 00000000..bcb0f23e --- /dev/null +++ b/rbi/workos/password_session_authenticate_request.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PasswordSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def password; end + + sig { params(value: String).returns(String) } + def password=(value); end + + sig { returns(T.nilable(String)) } + def invitation_token; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def invitation_token=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/passwordless.rbi b/rbi/workos/passwordless.rbi new file mode 100644 index 00000000..f058554e --- /dev/null +++ b/rbi/workos/passwordless.rbi @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Passwordless + class PasswordlessSession < T::Struct + const :id, T.nilable(String) + const :email, T.nilable(String) + const :expires_at, T.nilable(String) + const :link, T.nilable(String) + const :object, T.nilable(String) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Passwordless::PasswordlessSession) } + def self.from_hash(hash); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + end + + sig { params(client: WorkOS::Client).void } + def initialize(client); end + + sig do + params( + email: String, + type: String, + redirect_uri: T.nilable(String), + state: T.nilable(String), + connection: T.nilable(String), + expires_in: T.nilable(Integer), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Passwordless::PasswordlessSession) + end + def create_session(email:, type: "MagicLink", redirect_uri: nil, state: nil, connection: nil, expires_in: nil, request_options: {}); end + + sig do + params( + session_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Hash[String, T.untyped]) + end + def send_session(session_id, request_options: {}); end + end +end diff --git a/rbi/workos/permission.rbi b/rbi/workos/permission.rbi new file mode 100644 index 00000000..a1469b13 --- /dev/null +++ b/rbi/workos/permission.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Permission + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def system; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def system=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_created.rbi b/rbi/workos/permission_created.rbi new file mode 100644 index 00000000..94f3d015 --- /dev/null +++ b/rbi/workos/permission_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PermissionCreatedData) } + def data; end + + sig { params(value: WorkOS::PermissionCreatedData).returns(WorkOS::PermissionCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_created_data.rbi b/rbi/workos/permission_created_data.rbi new file mode 100644 index 00000000..878db3b0 --- /dev/null +++ b/rbi/workos/permission_created_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def system; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def system=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_deleted.rbi b/rbi/workos/permission_deleted.rbi new file mode 100644 index 00000000..fc04dc98 --- /dev/null +++ b/rbi/workos/permission_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PermissionDeletedData) } + def data; end + + sig { params(value: WorkOS::PermissionDeletedData).returns(WorkOS::PermissionDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_deleted_data.rbi b/rbi/workos/permission_deleted_data.rbi new file mode 100644 index 00000000..7949f42d --- /dev/null +++ b/rbi/workos/permission_deleted_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def system; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def system=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_updated.rbi b/rbi/workos/permission_updated.rbi new file mode 100644 index 00000000..26e6d11e --- /dev/null +++ b/rbi/workos/permission_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::PermissionUpdatedData) } + def data; end + + sig { params(value: WorkOS::PermissionUpdatedData).returns(WorkOS::PermissionUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/permission_updated_data.rbi b/rbi/workos/permission_updated_data.rbi new file mode 100644 index 00000000..87ecff9f --- /dev/null +++ b/rbi/workos/permission_updated_data.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PermissionUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Boolean) } + def system; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def system=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/pipes.rbi b/rbi/workos/pipes.rbi new file mode 100644 index 00000000..3680c7f1 --- /dev/null +++ b/rbi/workos/pipes.rbi @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Pipes + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + slug: String, + user_id: String, + organization_id: T.nilable(String), + return_to: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationAuthorizeUrlResponse) + end + def authorize_data_integration(slug:, user_id:, organization_id:, return_to:, request_options:); end + + sig do + params( + slug: String, + user_id: String, + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationAccessTokenResponse) + end + def create_data_integration_token(slug:, user_id:, organization_id:, request_options:); end + + sig do + params( + user_id: String, + slug: String, + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ConnectedAccount) + end + def get_user_connected_account(user_id:, slug:, organization_id:, request_options:); end + + sig do + params( + user_id: String, + slug: String, + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_user_connected_account(user_id:, slug:, organization_id:, request_options:); end + + sig do + params( + user_id: String, + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationsListResponse) + end + def list_user_data_providers(user_id:, organization_id:, request_options:); end + + end +end diff --git a/rbi/workos/portal_link_response.rbi b/rbi/workos/portal_link_response.rbi new file mode 100644 index 00000000..4c678fe6 --- /dev/null +++ b/rbi/workos/portal_link_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PortalLinkResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def link; end + + sig { params(value: String).returns(String) } + def link=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/profile.rbi b/rbi/workos/profile.rbi new file mode 100644 index 00000000..d2ff5e40 --- /dev/null +++ b/rbi/workos/profile.rbi @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Profile + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(String) } + def connection_id; end + + sig { params(value: String).returns(String) } + def connection_id=(value); end + + sig { returns(String) } + def connection_type; end + + sig { params(value: String).returns(String) } + def connection_type=(value); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(WorkOS::SlimRole)) } + def role; end + + sig { params(value: T.nilable(WorkOS::SlimRole)).returns(T.nilable(WorkOS::SlimRole)) } + def role=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles; end + + sig { params(value: T.nilable(T::Array[WorkOS::SlimRole])).returns(T.nilable(T::Array[WorkOS::SlimRole])) } + def roles=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def groups; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def groups=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def raw_attributes; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def raw_attributes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/public_client.rbi b/rbi/workos/public_client.rbi new file mode 100644 index 00000000..58f6f7ea --- /dev/null +++ b/rbi/workos/public_client.rbi @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module PublicClient + sig { params(client_id: String, opts: T.untyped).returns(WorkOS::Client) } + def self.create(client_id:, **opts); end + end +end diff --git a/rbi/workos/radar.rbi b/rbi/workos/radar.rbi new file mode 100644 index 00000000..0ae54330 --- /dev/null +++ b/rbi/workos/radar.rbi @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Radar + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + ip_address: String, + user_agent: String, + email: String, + auth_method: String, + action: String, + device_fingerprint: T.nilable(String), + bot_score: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::RadarStandaloneResponse) + end + def create_attempt(ip_address:, user_agent:, email:, auth_method:, action:, device_fingerprint:, bot_score:, request_options:); end + + sig do + params( + id: String, + challenge_status: T.nilable(String), + attempt_status: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def update_attempt(id:, challenge_status:, attempt_status:, request_options:); end + + sig do + params( + type: String, + action: String, + entry: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::RadarListEntryAlreadyPresentResponse) + end + def add_list_entry(type:, action:, entry:, request_options:); end + + sig do + params( + type: String, + action: String, + entry: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def remove_list_entry(type:, action:, entry:, request_options:); end + + end +end diff --git a/rbi/workos/radar_list_entry_already_present_response.rbi b/rbi/workos/radar_list_entry_already_present_response.rbi new file mode 100644 index 00000000..d4a61cdb --- /dev/null +++ b/rbi/workos/radar_list_entry_already_present_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarListEntryAlreadyPresentResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def message; end + + sig { params(value: String).returns(String) } + def message=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/radar_standalone_assess_request.rbi b/rbi/workos/radar_standalone_assess_request.rbi new file mode 100644 index 00000000..ab905468 --- /dev/null +++ b/rbi/workos/radar_standalone_assess_request.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarStandaloneAssessRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def ip_address; end + + sig { params(value: String).returns(String) } + def ip_address=(value); end + + sig { returns(String) } + def user_agent; end + + sig { params(value: String).returns(String) } + def user_agent=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def auth_method; end + + sig { params(value: String).returns(String) } + def auth_method=(value); end + + sig { returns(String) } + def action; end + + sig { params(value: String).returns(String) } + def action=(value); end + + sig { returns(T.nilable(String)) } + def device_fingerprint; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_fingerprint=(value); end + + sig { returns(T.nilable(String)) } + def bot_score; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def bot_score=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi b/rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi new file mode 100644 index 00000000..524f530d --- /dev/null +++ b/rbi/workos/radar_standalone_delete_radar_list_entry_request.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarStandaloneDeleteRadarListEntryRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def entry; end + + sig { params(value: String).returns(String) } + def entry=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/radar_standalone_response.rbi b/rbi/workos/radar_standalone_response.rbi new file mode 100644 index 00000000..0affa270 --- /dev/null +++ b/rbi/workos/radar_standalone_response.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarStandaloneResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def verdict; end + + sig { params(value: String).returns(String) } + def verdict=(value); end + + sig { returns(String) } + def reason; end + + sig { params(value: String).returns(String) } + def reason=(value); end + + sig { returns(String) } + def attempt_id; end + + sig { params(value: String).returns(String) } + def attempt_id=(value); end + + sig { returns(T.nilable(String)) } + def control; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def control=(value); end + + sig { returns(T.nilable(String)) } + def blocklist_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def blocklist_type=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/radar_standalone_update_radar_attempt_request.rbi b/rbi/workos/radar_standalone_update_radar_attempt_request.rbi new file mode 100644 index 00000000..2cc1ed8a --- /dev/null +++ b/rbi/workos/radar_standalone_update_radar_attempt_request.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarStandaloneUpdateRadarAttemptRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def challenge_status; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def challenge_status=(value); end + + sig { returns(T.nilable(String)) } + def attempt_status; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def attempt_status=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/radar_standalone_update_radar_list_request.rbi b/rbi/workos/radar_standalone_update_radar_list_request.rbi new file mode 100644 index 00000000..a1da0421 --- /dev/null +++ b/rbi/workos/radar_standalone_update_radar_list_request.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RadarStandaloneUpdateRadarListRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def entry; end + + sig { params(value: String).returns(String) } + def entry=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/redirect_uri.rbi b/rbi/workos/redirect_uri.rbi new file mode 100644 index 00000000..831933c8 --- /dev/null +++ b/rbi/workos/redirect_uri.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RedirectUri + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def uri; end + + sig { params(value: String).returns(String) } + def uri=(value); end + + sig { returns(T::Boolean) } + def default; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def default=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/redirect_uri_input.rbi b/rbi/workos/redirect_uri_input.rbi new file mode 100644 index 00000000..e836922b --- /dev/null +++ b/rbi/workos/redirect_uri_input.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RedirectUriInput + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def uri; end + + sig { params(value: String).returns(String) } + def uri=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def default; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def default=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/refresh_token_session_authenticate_request.rbi b/rbi/workos/refresh_token_session_authenticate_request.rbi new file mode 100644 index 00000000..596f2a3a --- /dev/null +++ b/rbi/workos/refresh_token_session_authenticate_request.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RefreshTokenSessionAuthenticateRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(String) } + def refresh_token; end + + sig { params(value: String).returns(String) } + def refresh_token=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def device_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def device_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/remove_role.rbi b/rbi/workos/remove_role.rbi new file mode 100644 index 00000000..1c2b3bd0 --- /dev/null +++ b/rbi/workos/remove_role.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RemoveRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def role_slug; end + + sig { params(value: String).returns(String) } + def role_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/resend_user_invite_options.rbi b/rbi/workos/resend_user_invite_options.rbi new file mode 100644 index 00000000..d2e24c4a --- /dev/null +++ b/rbi/workos/resend_user_invite_options.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ResendUserInviteOptions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def locale; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def locale=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/reset_password_response.rbi b/rbi/workos/reset_password_response.rbi new file mode 100644 index 00000000..d4c23b71 --- /dev/null +++ b/rbi/workos/reset_password_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ResetPasswordResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/revoke_session.rbi b/rbi/workos/revoke_session.rbi new file mode 100644 index 00000000..666aa43c --- /dev/null +++ b/rbi/workos/revoke_session.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RevokeSession + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def session_id; end + + sig { params(value: String).returns(String) } + def session_id=(value); end + + sig { returns(T.nilable(String)) } + def return_to; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def return_to=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role.rbi b/rbi/workos/role.rbi new file mode 100644 index 00000000..131dccd8 --- /dev/null +++ b/rbi/workos/role.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Role + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_created.rbi b/rbi/workos/role_created.rbi new file mode 100644 index 00000000..070899e7 --- /dev/null +++ b/rbi/workos/role_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::RoleCreatedData) } + def data; end + + sig { params(value: WorkOS::RoleCreatedData).returns(WorkOS::RoleCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_created_data.rbi b/rbi/workos/role_created_data.rbi new file mode 100644 index 00000000..54beb7df --- /dev/null +++ b/rbi/workos/role_created_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_deleted.rbi b/rbi/workos/role_deleted.rbi new file mode 100644 index 00000000..d75ccd0e --- /dev/null +++ b/rbi/workos/role_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::RoleDeletedData) } + def data; end + + sig { params(value: WorkOS::RoleDeletedData).returns(WorkOS::RoleDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_deleted_data.rbi b/rbi/workos/role_deleted_data.rbi new file mode 100644 index 00000000..5f14ab2d --- /dev/null +++ b/rbi/workos/role_deleted_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_list.rbi b/rbi/workos/role_list.rbi new file mode 100644 index 00000000..b2b8cce5 --- /dev/null +++ b/rbi/workos/role_list.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleList + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Array[WorkOS::Role]) } + def data; end + + sig { params(value: T::Array[WorkOS::Role]).returns(T::Array[WorkOS::Role]) } + def data=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_updated.rbi b/rbi/workos/role_updated.rbi new file mode 100644 index 00000000..4465c3ec --- /dev/null +++ b/rbi/workos/role_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::RoleUpdatedData) } + def data; end + + sig { params(value: WorkOS::RoleUpdatedData).returns(WorkOS::RoleUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/role_updated_data.rbi b/rbi/workos/role_updated_data.rbi new file mode 100644 index 00000000..e7aa1468 --- /dev/null +++ b/rbi/workos/role_updated_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class RoleUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/send_email_change.rbi b/rbi/workos/send_email_change.rbi new file mode 100644 index 00000000..706163f2 --- /dev/null +++ b/rbi/workos/send_email_change.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SendEmailChange + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def new_email; end + + sig { params(value: String).returns(String) } + def new_email=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/send_verification_email_response.rbi b/rbi/workos/send_verification_email_response.rbi new file mode 100644 index 00000000..5cf4909f --- /dev/null +++ b/rbi/workos/send_verification_email_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SendVerificationEmailResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session.rbi b/rbi/workos/session.rbi new file mode 100644 index 00000000..74d7355d --- /dev/null +++ b/rbi/workos/session.rbi @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Session + sig { returns(T.nilable(String)) } + def seal_data; end + + sig { returns(String) } + def cookie_password; end + + sig do + params( + manager: WorkOS::SessionManager, + seal_data: T.nilable(String), + cookie_password: String + ).void + end + def initialize(manager, seal_data:, cookie_password:); end + + sig do + params( + include_expired: T::Boolean, + claim_extractor: T.nilable(T.proc.params(decoded: T::Hash[String, T.untyped]).returns(T.nilable(T::Hash[Symbol, T.untyped]))) + ).returns(T.any(WorkOS::SessionManager::AuthSuccess, WorkOS::SessionManager::AuthError)) + end + def authenticate(include_expired: false, &claim_extractor); end + + sig do + params( + organization_id: T.nilable(String), + cookie_password: T.nilable(String) + ).returns(T.any(WorkOS::SessionManager::RefreshSuccess, WorkOS::SessionManager::RefreshError)) + end + def refresh(organization_id: nil, cookie_password: nil); end + + sig { params(return_to: T.nilable(String)).returns(String) } + def get_logout_url(return_to: nil); end + end +end diff --git a/rbi/workos/session_created.rbi b/rbi/workos/session_created.rbi new file mode 100644 index 00000000..930e0478 --- /dev/null +++ b/rbi/workos/session_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::SessionCreatedData) } + def data; end + + sig { params(value: WorkOS::SessionCreatedData).returns(WorkOS::SessionCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session_created_data.rbi b/rbi/workos/session_created_data.rbi new file mode 100644 index 00000000..72b03de0 --- /dev/null +++ b/rbi/workos/session_created_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(WorkOS::SessionCreatedDataImpersonator)) } + def impersonator; end + + sig { params(value: T.nilable(WorkOS::SessionCreatedDataImpersonator)).returns(T.nilable(WorkOS::SessionCreatedDataImpersonator)) } + def impersonator=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def auth_method; end + + sig { params(value: String).returns(String) } + def auth_method=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def ended_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ended_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session_created_data_impersonator.rbi b/rbi/workos/session_created_data_impersonator.rbi new file mode 100644 index 00000000..cfb44837 --- /dev/null +++ b/rbi/workos/session_created_data_impersonator.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionCreatedDataImpersonator + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def reason=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session_manager.rbi b/rbi/workos/session_manager.rbi new file mode 100644 index 00000000..00bba0f5 --- /dev/null +++ b/rbi/workos/session_manager.rbi @@ -0,0 +1,154 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionManager + JWK_ALGORITHMS = T.let(["RS256"].freeze, T::Array[String]) + + NO_SESSION_COOKIE_PROVIDED = T.let("no_session_cookie_provided", String) + INVALID_SESSION_COOKIE = T.let("invalid_session_cookie", String) + INVALID_JWT = T.let("invalid_jwt", String) + INVALID_JWT_ALGORITHM = T.let("invalid_jwt_algorithm", String) + INVALID_JWT_SIGNATURE = T.let("invalid_jwt_signature", String) + EXPIRED_JWT = T.let("expired_jwt", String) + + class AuthSuccess + RESERVED_KEYS = T.let(T.unsafe(nil), T::Array[Symbol]) + + sig { returns(T::Boolean) } + def authenticated; end + + sig { returns(T.nilable(String)) } + def reason; end + + sig { returns(T.nilable(String)) } + def session_id; end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { returns(T.nilable(String)) } + def role; end + + sig { returns(T.nilable(T::Array[String])) } + def roles; end + + sig { returns(T.nilable(T::Array[String])) } + def permissions; end + + sig { returns(T.nilable(T::Array[String])) } + def entitlements; end + + sig { returns(T.untyped) } + def user; end + + sig { returns(T.untyped) } + def impersonator; end + + sig { returns(T.untyped) } + def feature_flags; end + + sig do + params( + authenticated: T::Boolean, + session_id: T.nilable(String), + organization_id: T.nilable(String), + role: T.nilable(String), + roles: T.nilable(T::Array[String]), + permissions: T.nilable(T::Array[String]), + entitlements: T.nilable(T::Array[String]), + user: T.untyped, + impersonator: T.untyped, + feature_flags: T.untyped, + reason: T.nilable(String), + custom_claims: T.nilable(T::Hash[Symbol, T.untyped]) + ).void + end + def initialize(authenticated:, session_id:, organization_id:, role:, roles:, permissions:, entitlements:, user:, impersonator:, feature_flags:, reason: nil, custom_claims: nil); end + + sig { params(key: T.any(String, Symbol)).returns(T.untyped) } + def [](key); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + end + + class AuthError < T::Struct + const :authenticated, T::Boolean + const :reason, T.nilable(String) + end + + class RefreshSuccess < T::Struct + const :authenticated, T::Boolean + const :sealed_session, T.nilable(String) + const :session_id, T.nilable(String) + const :organization_id, T.nilable(String) + const :role, T.nilable(String) + const :roles, T.nilable(T::Array[String]) + const :permissions, T.nilable(T::Array[String]) + const :entitlements, T.nilable(T::Array[String]) + const :user, T.untyped + const :impersonator, T.untyped + const :feature_flags, T.untyped + end + + class RefreshError < T::Struct + const :authenticated, T::Boolean + const :reason, T.nilable(String) + end + + sig { returns(WorkOS::Client) } + def client; end + + sig { params(client: WorkOS::Client, encryptor: T.nilable(T.untyped)).void } + def initialize(client, encryptor: nil); end + + sig { params(seal_data: String, cookie_password: String).returns(WorkOS::Session) } + def load(seal_data:, cookie_password:); end + + sig do + params( + seal_data: String, + cookie_password: String, + include_expired: T::Boolean, + claim_extractor: T.nilable(T.proc.params(decoded: T::Hash[String, T.untyped]).returns(T.nilable(T::Hash[Symbol, T.untyped]))) + ).returns(T.any(WorkOS::SessionManager::AuthSuccess, WorkOS::SessionManager::AuthError)) + end + def authenticate(seal_data:, cookie_password:, include_expired: false, &claim_extractor); end + + sig do + params( + seal_data: String, + cookie_password: String, + organization_id: T.nilable(String) + ).returns(T.any(WorkOS::SessionManager::RefreshSuccess, WorkOS::SessionManager::RefreshError)) + end + def refresh(seal_data:, cookie_password:, organization_id: nil); end + + sig { params(data: T.any(String, T::Hash[T.untyped, T.untyped]), key: String).returns(String) } + def seal_data(data, key); end + + sig { params(sealed: String, key: String).returns(T.any(T::Hash[String, T.untyped], String)) } + def unseal_data(sealed, key); end + + sig do + params( + access_token: String, + refresh_token: String, + cookie_password: String, + user: T.untyped, + impersonator: T.untyped + ).returns(String) + end + def seal_session_from_auth_response(access_token:, refresh_token:, cookie_password:, user: nil, impersonator: nil); end + + sig { params(access_token: String, verify_expiration: T::Boolean).returns(T::Hash[String, T.untyped]) } + def decode_jwt(access_token, verify_expiration: true); end + + sig { params(now: Time).returns(T::Hash[String, T.untyped]) } + def fetch_jwks(now: Time.now); end + end +end diff --git a/rbi/workos/session_revoked.rbi b/rbi/workos/session_revoked.rbi new file mode 100644 index 00000000..605e90b1 --- /dev/null +++ b/rbi/workos/session_revoked.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionRevoked + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::SessionRevokedData) } + def data; end + + sig { params(value: WorkOS::SessionRevokedData).returns(WorkOS::SessionRevokedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session_revoked_data.rbi b/rbi/workos/session_revoked_data.rbi new file mode 100644 index 00000000..b0880cd9 --- /dev/null +++ b/rbi/workos/session_revoked_data.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionRevokedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(WorkOS::SessionRevokedDataImpersonator)) } + def impersonator; end + + sig { params(value: T.nilable(WorkOS::SessionRevokedDataImpersonator)).returns(T.nilable(WorkOS::SessionRevokedDataImpersonator)) } + def impersonator=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def auth_method; end + + sig { params(value: String).returns(String) } + def auth_method=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def ended_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ended_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/session_revoked_data_impersonator.rbi b/rbi/workos/session_revoked_data_impersonator.rbi new file mode 100644 index 00000000..d7048563 --- /dev/null +++ b/rbi/workos/session_revoked_data_impersonator.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SessionRevokedDataImpersonator + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def reason=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/set_role_permissions.rbi b/rbi/workos/set_role_permissions.rbi new file mode 100644 index 00000000..b0ce0b18 --- /dev/null +++ b/rbi/workos/set_role_permissions.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SetRolePermissions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/slim_role.rbi b/rbi/workos/slim_role.rbi new file mode 100644 index 00000000..ae66ab9c --- /dev/null +++ b/rbi/workos/slim_role.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SlimRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso.rbi b/rbi/workos/sso.rbi new file mode 100644 index 00000000..9c134fac --- /dev/null +++ b/rbi/workos/sso.rbi @@ -0,0 +1,67 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSO + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + connection_type: T.nilable(String), + domain: T.nilable(String), + organization_id: T.nilable(String), + search: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_connections(before:, after:, limit:, order:, connection_type:, domain:, organization_id:, search:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Connection) + end + def get_connection(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_connection(id:, request_options:); end + + sig do + params( + profile_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::SSOLogoutAuthorizeResponse) + end + def authorize_logout(profile_id:, request_options:); end + + sig do + params( + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Profile) + end + def get_profile(request_options:); end + + sig do + params( + code: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::SSOTokenResponse) + end + def get_profile_and_token(code:, request_options:); end + + end +end diff --git a/rbi/workos/sso_authorize_url_response.rbi b/rbi/workos/sso_authorize_url_response.rbi new file mode 100644 index 00000000..5fa59c7e --- /dev/null +++ b/rbi/workos/sso_authorize_url_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOAuthorizeUrlResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def url; end + + sig { params(value: String).returns(String) } + def url=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_device_authorization_request.rbi b/rbi/workos/sso_device_authorization_request.rbi new file mode 100644 index 00000000..82163afd --- /dev/null +++ b/rbi/workos/sso_device_authorization_request.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSODeviceAuthorizationRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_intent_options.rbi b/rbi/workos/sso_intent_options.rbi new file mode 100644 index 00000000..6f9ac5ee --- /dev/null +++ b/rbi/workos/sso_intent_options.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOIntentOptions + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def bookmark_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def bookmark_slug=(value); end + + sig { returns(T.nilable(String)) } + def provider_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def provider_type=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_logout_authorize_request.rbi b/rbi/workos/sso_logout_authorize_request.rbi new file mode 100644 index 00000000..8ad9c49d --- /dev/null +++ b/rbi/workos/sso_logout_authorize_request.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOLogoutAuthorizeRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def profile_id; end + + sig { params(value: String).returns(String) } + def profile_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_logout_authorize_response.rbi b/rbi/workos/sso_logout_authorize_response.rbi new file mode 100644 index 00000000..4cc3b97e --- /dev/null +++ b/rbi/workos/sso_logout_authorize_response.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOLogoutAuthorizeResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def logout_url; end + + sig { params(value: String).returns(String) } + def logout_url=(value); end + + sig { returns(String) } + def logout_token; end + + sig { params(value: String).returns(String) } + def logout_token=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_token_response.rbi b/rbi/workos/sso_token_response.rbi new file mode 100644 index 00000000..576bad40 --- /dev/null +++ b/rbi/workos/sso_token_response.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOTokenResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def token_type; end + + sig { params(value: String).returns(String) } + def token_type=(value); end + + sig { returns(String) } + def access_token; end + + sig { params(value: String).returns(String) } + def access_token=(value); end + + sig { returns(Integer) } + def expires_in; end + + sig { params(value: Integer).returns(Integer) } + def expires_in=(value); end + + sig { returns(WorkOS::Profile) } + def profile; end + + sig { params(value: WorkOS::Profile).returns(WorkOS::Profile) } + def profile=(value); end + + sig { returns(T.nilable(WorkOS::SSOTokenResponseOAuthToken)) } + def oauth_tokens; end + + sig { params(value: T.nilable(WorkOS::SSOTokenResponseOAuthToken)).returns(T.nilable(WorkOS::SSOTokenResponseOAuthToken)) } + def oauth_tokens=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/sso_token_response_oauth_token.rbi b/rbi/workos/sso_token_response_oauth_token.rbi new file mode 100644 index 00000000..618ccfa6 --- /dev/null +++ b/rbi/workos/sso_token_response_oauth_token.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class SSOTokenResponseOAuthToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def provider; end + + sig { params(value: String).returns(String) } + def provider=(value); end + + sig { returns(String) } + def refresh_token; end + + sig { params(value: String).returns(String) } + def refresh_token=(value); end + + sig { returns(String) } + def access_token; end + + sig { params(value: String).returns(String) } + def access_token=(value); end + + sig { returns(Integer) } + def expires_at; end + + sig { params(value: Integer).returns(Integer) } + def expires_at=(value); end + + sig { returns(T::Array[String]) } + def scopes; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def scopes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/token_query.rbi b/rbi/workos/token_query.rbi new file mode 100644 index 00000000..5ba0982d --- /dev/null +++ b/rbi/workos/token_query.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class TokenQuery + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def client_id; end + + sig { params(value: String).returns(String) } + def client_id=(value); end + + sig { returns(String) } + def client_secret; end + + sig { params(value: String).returns(String) } + def client_secret=(value); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(String) } + def grant_type; end + + sig { params(value: String).returns(String) } + def grant_type=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/types/api_response.rbi b/rbi/workos/types/api_response.rbi new file mode 100644 index 00000000..375f9049 --- /dev/null +++ b/rbi/workos/types/api_response.rbi @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Types + class ApiResponse + sig { returns(Integer) } + def http_status; end + + sig { returns(T::Hash[String, String]) } + def http_headers; end + + sig { returns(T.nilable(String)) } + def request_id; end + + sig do + params( + http_status: Integer, + http_headers: T::Hash[String, String], + request_id: T.nilable(String) + ).returns(WorkOS::Types::ApiResponse) + end + def self.new(http_status:, http_headers:, request_id:); end + end + end +end diff --git a/rbi/workos/types/base_model.rbi b/rbi/workos/types/base_model.rbi new file mode 100644 index 00000000..726391dd --- /dev/null +++ b/rbi/workos/types/base_model.rbi @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Types + class BaseModel + include WorkOS::HashProvider + + sig { returns(T.nilable(WorkOS::Types::ApiResponse)) } + def last_response; end + + sig { params(value: T.nilable(WorkOS::Types::ApiResponse)).returns(T.nilable(WorkOS::Types::ApiResponse)) } + def last_response=(value); end + + sig { params(json: T.any(String, T::Hash[T.untyped, T.untyped])).returns(T::Hash[Symbol, T.untyped]) } + def self.normalize(json); end + end + end +end diff --git a/rbi/workos/types/list_struct.rbi b/rbi/workos/types/list_struct.rbi new file mode 100644 index 00000000..1b8fe05d --- /dev/null +++ b/rbi/workos/types/list_struct.rbi @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Types + class ListStruct + include Enumerable + + sig { returns(T::Array[T.untyped]) } + def data; end + + sig { params(value: T::Array[T.untyped]).returns(T::Array[T.untyped]) } + def data=(value); end + + sig { returns(T::Hash[String, T.untyped]) } + def list_metadata; end + + sig { params(value: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped]) } + def list_metadata=(value); end + + sig { returns(T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))) } + def fetch_next; end + + sig { params(value: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))).returns(T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))) } + def fetch_next=(value); end + + sig { returns(T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))) } + def fetch_previous; end + + sig { params(value: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))).returns(T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct))) } + def fetch_previous=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def filters; end + + sig { params(value: T::Hash[Symbol, T.untyped]).returns(T::Hash[Symbol, T.untyped]) } + def filters=(value); end + + sig { returns(T.nilable(WorkOS::Types::ApiResponse)) } + def last_response; end + + sig { params(value: T.nilable(WorkOS::Types::ApiResponse)).returns(T.nilable(WorkOS::Types::ApiResponse)) } + def last_response=(value); end + + sig do + params( + data: T::Array[T.untyped], + list_metadata: T::Hash[String, T.untyped], + fetch_next: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct)), + fetch_previous: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct)), + filters: T::Hash[Symbol, T.untyped] + ).void + end + def initialize(data:, list_metadata:, fetch_next: nil, fetch_previous: nil, filters: {}); end + + sig do + params( + response: Net::HTTPResponse, + model: T.nilable(T.class_of(WorkOS::Types::BaseModel)), + filters: T::Hash[Symbol, T.untyped], + fetch_next: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct)), + fetch_previous: T.nilable(T.proc.params(cursor: String).returns(WorkOS::Types::ListStruct)) + ).returns(WorkOS::Types::ListStruct) + end + def self.from_response(response, model: nil, filters: {}, fetch_next: nil, fetch_previous: nil); end + + sig { params(block: T.proc.params(item: T.untyped).void).returns(T.untyped) } + def each(&block); end + + sig { returns(T::Boolean) } + def has_more?; end + + sig { returns(T.nilable(WorkOS::Types::ListStruct)) } + def next_page; end + + sig { returns(T.nilable(WorkOS::Types::ListStruct)) } + def previous_page; end + + sig { params(block: T.proc.params(item: T.untyped).void).returns(T.untyped) } + def auto_paging_each(&block); end + + sig { params(block: T.proc.params(page: WorkOS::Types::ListStruct).void).returns(T.untyped) } + def each_page(&block); end + end + end +end diff --git a/rbi/workos/types/request_options.rbi b/rbi/workos/types/request_options.rbi new file mode 100644 index 00000000..dc92c319 --- /dev/null +++ b/rbi/workos/types/request_options.rbi @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Types + class RequestOptions + end + end +end diff --git a/rbi/workos/update_audit_logs_retention.rbi b/rbi/workos/update_audit_logs_retention.rbi new file mode 100644 index 00000000..9784964c --- /dev/null +++ b/rbi/workos/update_audit_logs_retention.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateAuditLogsRetention + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(Integer) } + def retention_period_in_days; end + + sig { params(value: Integer).returns(Integer) } + def retention_period_in_days=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_authorization_permission.rbi b/rbi/workos/update_authorization_permission.rbi new file mode 100644 index 00000000..da1c25d0 --- /dev/null +++ b/rbi/workos/update_authorization_permission.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateAuthorizationPermission + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_authorization_resource.rbi b/rbi/workos/update_authorization_resource.rbi new file mode 100644 index 00000000..fa5f9eb8 --- /dev/null +++ b/rbi/workos/update_authorization_resource.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateAuthorizationResource + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def parent_resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def parent_resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_group.rbi b/rbi/workos/update_group.rbi new file mode 100644 index 00000000..44a36ebc --- /dev/null +++ b/rbi/workos/update_group.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateGroup + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_jwt_template.rbi b/rbi/workos/update_jwt_template.rbi new file mode 100644 index 00000000..ed9b8b49 --- /dev/null +++ b/rbi/workos/update_jwt_template.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateJWTTemplate + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def content; end + + sig { params(value: String).returns(String) } + def content=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_oauth_application.rbi b/rbi/workos/update_oauth_application.rbi new file mode 100644 index 00000000..8a83b8bb --- /dev/null +++ b/rbi/workos/update_oauth_application.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateOAuthApplication + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::RedirectUriInput])) } + def redirect_uris; end + + sig { params(value: T.nilable(T::Array[WorkOS::RedirectUriInput])).returns(T.nilable(T::Array[WorkOS::RedirectUriInput])) } + def redirect_uris=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_organization.rbi b/rbi/workos/update_organization.rbi new file mode 100644 index 00000000..cdc55825 --- /dev/null +++ b/rbi/workos/update_organization.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateOrganization + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def allow_profiles_outside_organization=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def domains; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def domains=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::OrganizationDomainData])) } + def domain_data; end + + sig { params(value: T.nilable(T::Array[WorkOS::OrganizationDomainData])).returns(T.nilable(T::Array[WorkOS::OrganizationDomainData])) } + def domain_data=(value); end + + sig { returns(T.nilable(String)) } + def stripe_customer_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def stripe_customer_id=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_organization_role.rbi b/rbi/workos/update_organization_role.rbi new file mode 100644 index 00000000..a7c333c7 --- /dev/null +++ b/rbi/workos/update_organization_role.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateOrganizationRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_role.rbi b/rbi/workos/update_role.rbi new file mode 100644 index 00000000..71a331e0 --- /dev/null +++ b/rbi/workos/update_role.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateRole + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def name=(value); end + + sig { returns(T.nilable(String)) } + def description; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def description=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_user.rbi b/rbi/workos/update_user.rbi new file mode 100644 index 00000000..e4311c0a --- /dev/null +++ b/rbi/workos/update_user.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def email; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(T::Boolean)) } + def email_verified; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def email_verified=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(String)) } + def locale; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def locale=(value); end + + sig { returns(T.nilable(String)) } + def password; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password=(value); end + + sig { returns(T.nilable(String)) } + def password_hash; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password_hash=(value); end + + sig { returns(T.nilable(String)) } + def password_hash_type; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def password_hash_type=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_user_organization_membership.rbi b/rbi/workos/update_user_organization_membership.rbi new file mode 100644 index 00000000..7f6377f3 --- /dev/null +++ b/rbi/workos/update_user_organization_membership.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateUserOrganizationMembership + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def role_slugs; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def role_slugs=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/update_webhook_endpoint.rbi b/rbi/workos/update_webhook_endpoint.rbi new file mode 100644 index 00000000..8ec96bb7 --- /dev/null +++ b/rbi/workos/update_webhook_endpoint.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UpdateWebhookEndpoint + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def endpoint_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def endpoint_url=(value); end + + sig { returns(T.nilable(String)) } + def status; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def status=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def events; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def events=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user.rbi b/rbi/workos/user.rbi new file mode 100644 index 00000000..91856669 --- /dev/null +++ b/rbi/workos/user.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class User + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(String)) } + def profile_picture_url; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def profile_picture_url=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T::Boolean) } + def email_verified; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def email_verified=(value); end + + sig { returns(T.nilable(String)) } + def external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def external_id=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T.nilable(String)) } + def last_sign_in_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_sign_in_at=(value); end + + sig { returns(T.nilable(String)) } + def locale; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def locale=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key.rbi b/rbi/workos/user_api_key.rbi new file mode 100644 index 00000000..3da15af1 --- /dev/null +++ b/rbi/workos/user_api_key.rbi @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(WorkOS::UserApiKeyOwner) } + def owner; end + + sig { params(value: WorkOS::UserApiKeyOwner).returns(WorkOS::UserApiKeyOwner) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key_created_data_owner.rbi b/rbi/workos/user_api_key_created_data_owner.rbi new file mode 100644 index 00000000..fce87524 --- /dev/null +++ b/rbi/workos/user_api_key_created_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKeyCreatedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key_owner.rbi b/rbi/workos/user_api_key_owner.rbi new file mode 100644 index 00000000..272e6d62 --- /dev/null +++ b/rbi/workos/user_api_key_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKeyOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key_revoked_data_owner.rbi b/rbi/workos/user_api_key_revoked_data_owner.rbi new file mode 100644 index 00000000..944e5f15 --- /dev/null +++ b/rbi/workos/user_api_key_revoked_data_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKeyRevokedDataOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key_with_value.rbi b/rbi/workos/user_api_key_with_value.rbi new file mode 100644 index 00000000..66c5296e --- /dev/null +++ b/rbi/workos/user_api_key_with_value.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKeyWithValue + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(WorkOS::UserApiKeyWithValueOwner) } + def owner; end + + sig { params(value: WorkOS::UserApiKeyWithValueOwner).returns(WorkOS::UserApiKeyWithValueOwner) } + def owner=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(String) } + def obfuscated_value; end + + sig { params(value: String).returns(String) } + def obfuscated_value=(value); end + + sig { returns(T.nilable(String)) } + def last_used_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_used_at=(value); end + + sig { returns(T::Array[String]) } + def permissions; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def permissions=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def value; end + + sig { params(value: String).returns(String) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_api_key_with_value_owner.rbi b/rbi/workos/user_api_key_with_value_owner.rbi new file mode 100644 index 00000000..1f1b7566 --- /dev/null +++ b/rbi/workos/user_api_key_with_value_owner.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserApiKeyWithValueOwner + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_authentication_factor_enroll_response.rbi b/rbi/workos/user_authentication_factor_enroll_response.rbi new file mode 100644 index 00000000..3bd39137 --- /dev/null +++ b/rbi/workos/user_authentication_factor_enroll_response.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserAuthenticationFactorEnrollResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::AuthenticationFactorEnrolled) } + def authentication_factor; end + + sig { params(value: WorkOS::AuthenticationFactorEnrolled).returns(WorkOS::AuthenticationFactorEnrolled) } + def authentication_factor=(value); end + + sig { returns(WorkOS::AuthenticationChallenge) } + def authentication_challenge; end + + sig { params(value: WorkOS::AuthenticationChallenge).returns(WorkOS::AuthenticationChallenge) } + def authentication_challenge=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_consent_option.rbi b/rbi/workos/user_consent_option.rbi new file mode 100644 index 00000000..e4f01db4 --- /dev/null +++ b/rbi/workos/user_consent_option.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserConsentOption + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def claim; end + + sig { params(value: String).returns(String) } + def claim=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def label; end + + sig { params(value: String).returns(String) } + def label=(value); end + + sig { returns(T::Array[WorkOS::UserConsentOptionChoice]) } + def choices; end + + sig { params(value: T::Array[WorkOS::UserConsentOptionChoice]).returns(T::Array[WorkOS::UserConsentOptionChoice]) } + def choices=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_consent_option_choice.rbi b/rbi/workos/user_consent_option_choice.rbi new file mode 100644 index 00000000..7437ea64 --- /dev/null +++ b/rbi/workos/user_consent_option_choice.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserConsentOptionChoice + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(String)) } + def value; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def value=(value); end + + sig { returns(T.nilable(String)) } + def label; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def label=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_created.rbi b/rbi/workos/user_created.rbi new file mode 100644 index 00000000..1e36a910 --- /dev/null +++ b/rbi/workos/user_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::User) } + def data; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_deleted.rbi b/rbi/workos/user_deleted.rbi new file mode 100644 index 00000000..c2ba2e92 --- /dev/null +++ b/rbi/workos/user_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::User) } + def data; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_identities_get_item.rbi b/rbi/workos/user_identities_get_item.rbi new file mode 100644 index 00000000..8c494401 --- /dev/null +++ b/rbi/workos/user_identities_get_item.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserIdentitiesGetItem + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def idp_id; end + + sig { params(value: String).returns(String) } + def idp_id=(value); end + + sig { returns(String) } + def type; end + + sig { params(value: String).returns(String) } + def type=(value); end + + sig { returns(String) } + def provider; end + + sig { params(value: String).returns(String) } + def provider=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_invite.rbi b/rbi/workos/user_invite.rbi new file mode 100644 index 00000000..b96f062a --- /dev/null +++ b/rbi/workos/user_invite.rbi @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserInvite + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def accepted_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_at=(value); end + + sig { returns(T.nilable(String)) } + def revoked_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def revoked_at=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def inviter_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def inviter_user_id=(value); end + + sig { returns(T.nilable(String)) } + def accepted_user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def accepted_user_id=(value); end + + sig { returns(T.nilable(String)) } + def role_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def role_slug=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(String) } + def token; end + + sig { params(value: String).returns(String) } + def token=(value); end + + sig { returns(String) } + def accept_invitation_url; end + + sig { params(value: String).returns(String) } + def accept_invitation_url=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_management.rbi b/rbi/workos/user_management.rbi new file mode 100644 index 00000000..c0e19532 --- /dev/null +++ b/rbi/workos/user_management.rbi @@ -0,0 +1,487 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserManagement + class PasswordPlaintext + sig { returns(String) } + def password; end + + sig do + params( + password: String + ).returns(WorkOS::UserManagement::PasswordPlaintext) + end + def self.new(password:); end + end + + class PasswordHashed + sig { returns(String) } + def password_hash; end + + sig { returns(String) } + def password_hash_type; end + + sig do + params( + password_hash: String, + password_hash_type: String + ).returns(WorkOS::UserManagement::PasswordHashed) + end + def self.new(password_hash:, password_hash_type:); end + end + + class RoleSingle + sig { returns(String) } + def role_slug; end + + sig do + params( + role_slug: String + ).returns(WorkOS::UserManagement::RoleSingle) + end + def self.new(role_slug:); end + end + + class RoleMultiple + sig { returns(T::Array[String]) } + def role_slugs; end + + sig do + params( + role_slugs: T::Array[String] + ).returns(WorkOS::UserManagement::RoleMultiple) + end + def self.new(role_slugs:); end + end + + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + client_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::JwksResponse) + end + def get_jwks(client_id:, request_options:); end + + sig do + params( + client_id: String, + client_secret: String, + grant_type: String, + code: String, + code_verifier: T.nilable(String), + invitation_token: T.nilable(String), + ip_address: T.nilable(String), + device_id: T.nilable(String), + user_agent: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::AuthenticateResponse) + end + def create_authenticate(client_id:, client_secret:, grant_type:, code:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, request_options:); end + + sig do + params( + client_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DeviceAuthorizationResponse) + end + def create_device(client_id:, request_options:); end + + sig do + params( + session_id: String, + return_to: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def revoke_session(session_id:, return_to:, request_options:); end + + sig do + params( + origin: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::CORSOriginResponse) + end + def create_cors_origin(origin:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::EmailVerification) + end + def get_email_verification(id:, request_options:); end + + sig do + params( + email: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::PasswordReset) + end + def reset_password(email:, request_options:); end + + sig do + params( + token: String, + new_password: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ResetPasswordResponse) + end + def confirm_password_reset(token:, new_password:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::PasswordReset) + end + def get_password_reset(id:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization: T.nilable(String), + organization_id: T.nilable(String), + email: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_users(before:, after:, limit:, order:, organization:, organization_id:, email:, request_options:); end + + sig do + params( + email: String, + first_name: T.nilable(String), + last_name: T.nilable(String), + email_verified: T.nilable(T::Boolean), + metadata: T.nilable(T::Hash[String, String]), + external_id: T.nilable(String), + password: T.nilable(T.any(WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::User) + end + def create_user(email:, first_name:, last_name:, email_verified:, metadata:, external_id:, password:, request_options:); end + + sig do + params( + external_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::User) + end + def get_user_by_external_id(external_id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::User) + end + def get_user(id:, request_options:); end + + sig do + params( + id: String, + email: T.nilable(String), + first_name: T.nilable(String), + last_name: T.nilable(String), + email_verified: T.nilable(T::Boolean), + metadata: T.nilable(T::Hash[String, String]), + external_id: T.nilable(String), + locale: T.nilable(String), + password: T.nilable(T.any(WorkOS::UserManagement::PasswordPlaintext, WorkOS::UserManagement::PasswordHashed)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::User) + end + def update_user(id:, email:, first_name:, last_name:, email_verified:, metadata:, external_id:, locale:, password:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_user(id:, request_options:); end + + sig do + params( + id: String, + code: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::EmailChangeConfirmation) + end + def confirm_email_change(id:, code:, request_options:); end + + sig do + params( + id: String, + new_email: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::EmailChange) + end + def send_email_change(id:, new_email:, request_options:); end + + sig do + params( + id: String, + code: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::VerifyEmailResponse) + end + def verify_email(id:, code:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::SendVerificationEmailResponse) + end + def send_verification_email(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::UserIdentitiesGetItem]) + end + def get_user_identities(id:, request_options:); end + + sig do + params( + id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::UserSessionsListItem]) + end + def list_sessions(id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + email: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::UserInvite]) + end + def list_invitations(before:, after:, limit:, order:, organization_id:, email:, request_options:); end + + sig do + params( + email: String, + organization_id: T.nilable(String), + role_slug: T.nilable(String), + expires_in_days: T.nilable(Integer), + inviter_user_id: T.nilable(String), + locale: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserInvite) + end + def send_invitation(email:, organization_id:, role_slug:, expires_in_days:, inviter_user_id:, locale:, request_options:); end + + sig do + params( + token: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserInvite) + end + def find_invitation_by_token(token:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserInvite) + end + def get_invitation(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Invitation) + end + def accept_invitation(id:, request_options:); end + + sig do + params( + id: String, + locale: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserInvite) + end + def resend_invitation(id:, locale:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Invitation) + end + def revoke_invitation(id:, request_options:); end + + sig do + params( + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::JWTTemplateResponse) + end + def list_jwt_template(request_options:); end + + sig do + params( + content: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::JWTTemplateResponse) + end + def update_jwt_template(content:, request_options:); end + + sig do + params( + email: String, + invitation_token: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::MagicAuth) + end + def create_magic_auth(email:, invitation_token:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::MagicAuth) + end + def get_magic_auth(id:, request_options:); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + statuses: T.nilable(T::Array[String]), + user_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::UserOrganizationMembership]) + end + def list_organization_memberships(before:, after:, limit:, order:, organization_id:, statuses:, user_id:, request_options:); end + + sig do + params( + user_id: String, + organization_id: String, + role: T.nilable(T.any(WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationMembership) + end + def create_organization_membership(user_id:, organization_id:, role:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserOrganizationMembership) + end + def get_organization_membership(id:, request_options:); end + + sig do + params( + id: String, + role: T.nilable(T.any(WorkOS::UserManagement::RoleSingle, WorkOS::UserManagement::RoleMultiple)), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserOrganizationMembership) + end + def update_organization_membership(id:, role:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_organization_membership(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::OrganizationMembership) + end + def deactivate_organization_membership(id:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserOrganizationMembership) + end + def reactivate_organization_membership(id:, request_options:); end + + sig do + params( + uri: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::RedirectUri) + end + def create_redirect_uri(uri:, request_options:); end + + sig do + params( + user_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_user_authorized_applications(user_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + application_id: String, + user_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_user_authorized_application(application_id:, user_id:, request_options:); end + + sig do + params( + user_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + organization_id: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_user_api_keys(user_id:, before:, after:, limit:, order:, organization_id:, request_options:); end + + sig do + params( + user_id: String, + name: String, + organization_id: String, + permissions: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::UserApiKeyWithValue) + end + def create_user_api_key(user_id:, name:, organization_id:, permissions:, request_options:); end + + end +end diff --git a/rbi/workos/user_management_login_request.rbi b/rbi/workos/user_management_login_request.rbi new file mode 100644 index 00000000..35ff184a --- /dev/null +++ b/rbi/workos/user_management_login_request.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserManagementLoginRequest + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def external_auth_id; end + + sig { params(value: String).returns(String) } + def external_auth_id=(value); end + + sig { returns(WorkOS::UserObject) } + def user; end + + sig { params(value: WorkOS::UserObject).returns(WorkOS::UserObject) } + def user=(value); end + + sig { returns(T.nilable(T::Array[WorkOS::UserConsentOption])) } + def user_consent_options; end + + sig { params(value: T.nilable(T::Array[WorkOS::UserConsentOption])).returns(T.nilable(T::Array[WorkOS::UserConsentOption])) } + def user_consent_options=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_management_organization_membership_groups.rbi b/rbi/workos/user_management_organization_membership_groups.rbi new file mode 100644 index 00000000..a4b8f5d5 --- /dev/null +++ b/rbi/workos/user_management_organization_membership_groups.rbi @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserManagementOrganizationMembershipGroups + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + om_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_organization_membership_groups(om_id:, before:, after:, limit:, order:, request_options:); end + + end +end diff --git a/rbi/workos/user_object.rbi b/rbi/workos/user_object.rbi new file mode 100644 index 00000000..4e44fc89 --- /dev/null +++ b/rbi/workos/user_object.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserObject + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def first_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def first_name=(value); end + + sig { returns(T.nilable(String)) } + def last_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def last_name=(value); end + + sig { returns(T.nilable(T::Hash[String, String])) } + def metadata; end + + sig { params(value: T.nilable(T::Hash[String, String])).returns(T.nilable(T::Hash[String, String])) } + def metadata=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_organization_membership.rbi b/rbi/workos/user_organization_membership.rbi new file mode 100644 index 00000000..06990a12 --- /dev/null +++ b/rbi/workos/user_organization_membership.rbi @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserOrganizationMembership + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(T.nilable(String)) } + def organization_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_organization_membership_base_list_data.rbi b/rbi/workos/user_organization_membership_base_list_data.rbi new file mode 100644 index 00000000..d720fe76 --- /dev/null +++ b/rbi/workos/user_organization_membership_base_list_data.rbi @@ -0,0 +1,84 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserOrganizationMembershipBaseListData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Boolean) } + def directory_managed; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def directory_managed=(value); end + + sig { returns(T.nilable(String)) } + def organization_name; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_name=(value); end + + sig { returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes; end + + sig { params(value: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(T::Hash[String, T.untyped])) } + def custom_attributes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_role_assignment.rbi b/rbi/workos/user_role_assignment.rbi new file mode 100644 index 00000000..2e6c4882 --- /dev/null +++ b/rbi/workos/user_role_assignment.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserRoleAssignment + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_membership_id; end + + sig { params(value: String).returns(String) } + def organization_membership_id=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(WorkOS::UserRoleAssignmentResource) } + def resource; end + + sig { params(value: WorkOS::UserRoleAssignmentResource).returns(WorkOS::UserRoleAssignmentResource) } + def resource=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_role_assignment_resource.rbi b/rbi/workos/user_role_assignment_resource.rbi new file mode 100644 index 00000000..0cff34c4 --- /dev/null +++ b/rbi/workos/user_role_assignment_resource.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserRoleAssignmentResource + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def external_id; end + + sig { params(value: String).returns(String) } + def external_id=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_sessions_impersonator.rbi b/rbi/workos/user_sessions_impersonator.rbi new file mode 100644 index 00000000..9aff166a --- /dev/null +++ b/rbi/workos/user_sessions_impersonator.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserSessionsImpersonator + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(T.nilable(String)) } + def reason; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def reason=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_sessions_list_item.rbi b/rbi/workos/user_sessions_list_item.rbi new file mode 100644 index 00000000..646d576a --- /dev/null +++ b/rbi/workos/user_sessions_list_item.rbi @@ -0,0 +1,96 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserSessionsListItem + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(T.nilable(WorkOS::UserSessionsImpersonator)) } + def impersonator; end + + sig { params(value: T.nilable(WorkOS::UserSessionsImpersonator)).returns(T.nilable(WorkOS::UserSessionsImpersonator)) } + def impersonator=(value); end + + sig { returns(T.nilable(String)) } + def ip_address; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ip_address=(value); end + + sig { returns(T.nilable(String)) } + def organization_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def user_agent; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_agent=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(String) } + def auth_method; end + + sig { params(value: String).returns(String) } + def auth_method=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(String) } + def expires_at; end + + sig { params(value: String).returns(String) } + def expires_at=(value); end + + sig { returns(T.nilable(String)) } + def ended_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def ended_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_updated.rbi b/rbi/workos/user_updated.rbi new file mode 100644 index 00000000..1e21a640 --- /dev/null +++ b/rbi/workos/user_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class UserUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::User) } + def data; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/util.rbi b/rbi/workos/util.rbi new file mode 100644 index 00000000..8fce5436 --- /dev/null +++ b/rbi/workos/util.rbi @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + module Util + sig { params(value: T.any(String, Symbol, Integer)).returns(String) } + def self.encode_path(value); end + end +end diff --git a/rbi/workos/validate_api_key.rbi b/rbi/workos/validate_api_key.rbi new file mode 100644 index 00000000..b8e03051 --- /dev/null +++ b/rbi/workos/validate_api_key.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ValidateApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def value; end + + sig { params(value: String).returns(String) } + def value=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault.rbi b/rbi/workos/vault.rbi new file mode 100644 index 00000000..24cb2709 --- /dev/null +++ b/rbi/workos/vault.rbi @@ -0,0 +1,137 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Vault + DEFAULT_RESPONSE_LIMIT = T.let(10, Integer) + + class DataKey < T::Struct + const :id, T.nilable(String) + const :key, T.nilable(String) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::DataKey) } + def self.from_response(hash); end + end + + class DataKeyPair < T::Struct + const :context, T.untyped + const :data_key, WorkOS::Vault::DataKey + const :encrypted_keys, T.nilable(String) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::DataKeyPair) } + def self.from_response(hash); end + end + + class ObjectUpdateBy < T::Struct + const :id, T.nilable(String) + const :name, T.nilable(String) + + sig { params(hash: T.nilable(T::Hash[String, T.untyped])).returns(T.nilable(WorkOS::Vault::ObjectUpdateBy)) } + def self.from_hash(hash); end + end + + class ObjectMetadata < T::Struct + const :context, T.untyped + const :environment_id, T.nilable(String) + const :id, T.nilable(String) + const :key_id, T.nilable(String) + const :updated_at, T.nilable(String) + const :updated_by, T.nilable(WorkOS::Vault::ObjectUpdateBy) + const :version_id, T.nilable(String) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::ObjectMetadata) } + def self.from_hash(hash); end + end + + class VaultObject < T::Struct + const :id, T.nilable(String) + const :name, T.nilable(String) + const :value, T.nilable(String) + const :metadata, T.nilable(WorkOS::Vault::ObjectMetadata) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::VaultObject) } + def self.from_hash(hash); end + end + + class ObjectDigest < T::Struct + const :id, T.nilable(String) + const :name, T.nilable(String) + const :updated_at, T.nilable(String) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::ObjectDigest) } + def self.from_hash(hash); end + end + + class ObjectVersion < T::Struct + const :id, T.nilable(String) + const :created_at, T.nilable(String) + const :current_version, T.nilable(T::Boolean) + + sig { params(hash: T::Hash[String, T.untyped]).returns(WorkOS::Vault::ObjectVersion) } + def self.from_hash(hash); end + end + + sig { params(client: WorkOS::Client).void } + def initialize(client); end + + sig { params(object_id: String, request_options: T::Hash[Symbol, T.untyped]).returns(WorkOS::Vault::VaultObject) } + def read_object(object_id:, request_options: {}); end + + sig { params(name: String, request_options: T::Hash[Symbol, T.untyped]).returns(WorkOS::Vault::VaultObject) } + def read_object_by_name(name:, request_options: {}); end + + sig { params(object_id: String, request_options: T::Hash[Symbol, T.untyped]).returns(WorkOS::Vault::VaultObject) } + def get_object_metadata(object_id:, request_options: {}); end + + sig do + params( + limit: Integer, + before: T.nilable(String), + after: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(T::Array[WorkOS::Vault::ObjectDigest]) + end + def list_objects(limit: DEFAULT_RESPONSE_LIMIT, before: nil, after: nil, request_options: {}); end + + sig { params(object_id: String, request_options: T::Hash[Symbol, T.untyped]).returns(T::Array[WorkOS::Vault::ObjectVersion]) } + def list_object_versions(object_id:, request_options: {}); end + + sig do + params( + name: String, + value: String, + key_context: T::Hash[String, T.untyped], + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Vault::ObjectMetadata) + end + def create_object(name:, value:, key_context:, request_options: {}); end + + sig do + params( + object_id: String, + value: String, + version_check: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Vault::VaultObject) + end + def update_object(object_id:, value:, version_check: nil, request_options: {}); end + + sig { params(object_id: String, request_options: T::Hash[Symbol, T.untyped]).void } + def delete_object(object_id:, request_options: {}); end + + sig { params(key_context: T::Hash[String, T.untyped], request_options: T::Hash[Symbol, T.untyped]).returns(WorkOS::Vault::DataKeyPair) } + def create_data_key(key_context:, request_options: {}); end + + sig { params(keys: String, request_options: T::Hash[Symbol, T.untyped]).returns(WorkOS::Vault::DataKey) } + def decrypt_data_key(keys:, request_options: {}); end + + sig { params(data: String, key_context: T::Hash[String, T.untyped], associated_data: T.nilable(String)).returns(String) } + def encrypt(data:, key_context:, associated_data: nil); end + + sig { params(encrypted_data: String, associated_data: T.nilable(String)).returns(String) } + def decrypt(encrypted_data:, associated_data: nil); end + end +end diff --git a/rbi/workos/vault_byok_key_deleted.rbi b/rbi/workos/vault_byok_key_deleted.rbi new file mode 100644 index 00000000..c82e4f2d --- /dev/null +++ b/rbi/workos/vault_byok_key_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultByokKeyDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultByokKeyDeletedData) } + def data; end + + sig { params(value: WorkOS::VaultByokKeyDeletedData).returns(WorkOS::VaultByokKeyDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_byok_key_deleted_data.rbi b/rbi/workos/vault_byok_key_deleted_data.rbi new file mode 100644 index 00000000..37dff254 --- /dev/null +++ b/rbi/workos/vault_byok_key_deleted_data.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultByokKeyDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def key_provider; end + + sig { params(value: String).returns(String) } + def key_provider=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_byok_key_verification_completed.rbi b/rbi/workos/vault_byok_key_verification_completed.rbi new file mode 100644 index 00000000..d06710b9 --- /dev/null +++ b/rbi/workos/vault_byok_key_verification_completed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultByokKeyVerificationCompleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultByokKeyVerificationCompletedData) } + def data; end + + sig { params(value: WorkOS::VaultByokKeyVerificationCompletedData).returns(WorkOS::VaultByokKeyVerificationCompletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_byok_key_verification_completed_data.rbi b/rbi/workos/vault_byok_key_verification_completed_data.rbi new file mode 100644 index 00000000..76d801ae --- /dev/null +++ b/rbi/workos/vault_byok_key_verification_completed_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultByokKeyVerificationCompletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def key_provider; end + + sig { params(value: String).returns(String) } + def key_provider=(value); end + + sig { returns(T::Boolean) } + def verified; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def verified=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_created.rbi b/rbi/workos/vault_data_created.rbi new file mode 100644 index 00000000..f2762093 --- /dev/null +++ b/rbi/workos/vault_data_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDataCreatedData) } + def data; end + + sig { params(value: WorkOS::VaultDataCreatedData).returns(WorkOS::VaultDataCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_created_data.rbi b/rbi/workos/vault_data_created_data.rbi new file mode 100644 index 00000000..2a5d3db2 --- /dev/null +++ b/rbi/workos/vault_data_created_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def kv_name; end + + sig { params(value: String).returns(String) } + def kv_name=(value); end + + sig { returns(String) } + def key_id; end + + sig { params(value: String).returns(String) } + def key_id=(value); end + + sig { returns(T::Hash[String, String]) } + def key_context; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def key_context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_deleted.rbi b/rbi/workos/vault_data_deleted.rbi new file mode 100644 index 00000000..9d424862 --- /dev/null +++ b/rbi/workos/vault_data_deleted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataDeleted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDataDeletedData) } + def data; end + + sig { params(value: WorkOS::VaultDataDeletedData).returns(WorkOS::VaultDataDeletedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_deleted_data.rbi b/rbi/workos/vault_data_deleted_data.rbi new file mode 100644 index 00000000..ee52ad04 --- /dev/null +++ b/rbi/workos/vault_data_deleted_data.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataDeletedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def kv_name; end + + sig { params(value: String).returns(String) } + def kv_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_read.rbi b/rbi/workos/vault_data_read.rbi new file mode 100644 index 00000000..e6aff1b8 --- /dev/null +++ b/rbi/workos/vault_data_read.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataRead + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDataReadData) } + def data; end + + sig { params(value: WorkOS::VaultDataReadData).returns(WorkOS::VaultDataReadData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_read_data.rbi b/rbi/workos/vault_data_read_data.rbi new file mode 100644 index 00000000..8316ba0c --- /dev/null +++ b/rbi/workos/vault_data_read_data.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataReadData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def kv_name; end + + sig { params(value: String).returns(String) } + def kv_name=(value); end + + sig { returns(String) } + def key_id; end + + sig { params(value: String).returns(String) } + def key_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_updated.rbi b/rbi/workos/vault_data_updated.rbi new file mode 100644 index 00000000..05fdf3b6 --- /dev/null +++ b/rbi/workos/vault_data_updated.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataUpdated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDataUpdatedData) } + def data; end + + sig { params(value: WorkOS::VaultDataUpdatedData).returns(WorkOS::VaultDataUpdatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_data_updated_data.rbi b/rbi/workos/vault_data_updated_data.rbi new file mode 100644 index 00000000..add8e355 --- /dev/null +++ b/rbi/workos/vault_data_updated_data.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDataUpdatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def kv_name; end + + sig { params(value: String).returns(String) } + def kv_name=(value); end + + sig { returns(String) } + def key_id; end + + sig { params(value: String).returns(String) } + def key_id=(value); end + + sig { returns(T::Hash[String, String]) } + def key_context; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def key_context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_dek_decrypted.rbi b/rbi/workos/vault_dek_decrypted.rbi new file mode 100644 index 00000000..9a77263e --- /dev/null +++ b/rbi/workos/vault_dek_decrypted.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDekDecrypted + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDekDecryptedData) } + def data; end + + sig { params(value: WorkOS::VaultDekDecryptedData).returns(WorkOS::VaultDekDecryptedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_dek_decrypted_data.rbi b/rbi/workos/vault_dek_decrypted_data.rbi new file mode 100644 index 00000000..1930cbcc --- /dev/null +++ b/rbi/workos/vault_dek_decrypted_data.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDekDecryptedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def key_id; end + + sig { params(value: String).returns(String) } + def key_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_dek_read.rbi b/rbi/workos/vault_dek_read.rbi new file mode 100644 index 00000000..04995705 --- /dev/null +++ b/rbi/workos/vault_dek_read.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDekRead + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultDekReadData) } + def data; end + + sig { params(value: WorkOS::VaultDekReadData).returns(WorkOS::VaultDekReadData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_dek_read_data.rbi b/rbi/workos/vault_dek_read_data.rbi new file mode 100644 index 00000000..5c428736 --- /dev/null +++ b/rbi/workos/vault_dek_read_data.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultDekReadData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(T::Array[String]) } + def key_ids; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def key_ids=(value); end + + sig { returns(T::Hash[String, String]) } + def key_context; end + + sig { params(value: T::Hash[String, String]).returns(T::Hash[String, String]) } + def key_context=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_kek_created.rbi b/rbi/workos/vault_kek_created.rbi new file mode 100644 index 00000000..af66ec9b --- /dev/null +++ b/rbi/workos/vault_kek_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultKekCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultKekCreatedData) } + def data; end + + sig { params(value: WorkOS::VaultKekCreatedData).returns(WorkOS::VaultKekCreatedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_kek_created_data.rbi b/rbi/workos/vault_kek_created_data.rbi new file mode 100644 index 00000000..baa25d1d --- /dev/null +++ b/rbi/workos/vault_kek_created_data.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultKekCreatedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def key_name; end + + sig { params(value: String).returns(String) } + def key_name=(value); end + + sig { returns(String) } + def key_id; end + + sig { params(value: String).returns(String) } + def key_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_metadata_read.rbi b/rbi/workos/vault_metadata_read.rbi new file mode 100644 index 00000000..6073f667 --- /dev/null +++ b/rbi/workos/vault_metadata_read.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultMetadataRead + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultMetadataReadData) } + def data; end + + sig { params(value: WorkOS::VaultMetadataReadData).returns(WorkOS::VaultMetadataReadData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_metadata_read_data.rbi b/rbi/workos/vault_metadata_read_data.rbi new file mode 100644 index 00000000..9d2a6fd6 --- /dev/null +++ b/rbi/workos/vault_metadata_read_data.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultMetadataReadData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(String) } + def kv_name; end + + sig { params(value: String).returns(String) } + def kv_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_names_listed.rbi b/rbi/workos/vault_names_listed.rbi new file mode 100644 index 00000000..8a64f47f --- /dev/null +++ b/rbi/workos/vault_names_listed.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultNamesListed + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::VaultNamesListedData) } + def data; end + + sig { params(value: WorkOS::VaultNamesListedData).returns(WorkOS::VaultNamesListedData) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/vault_names_listed_data.rbi b/rbi/workos/vault_names_listed_data.rbi new file mode 100644 index 00000000..6ad289d3 --- /dev/null +++ b/rbi/workos/vault_names_listed_data.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VaultNamesListedData + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def actor_id; end + + sig { params(value: String).returns(String) } + def actor_id=(value); end + + sig { returns(String) } + def actor_source; end + + sig { params(value: String).returns(String) } + def actor_source=(value); end + + sig { returns(String) } + def actor_name; end + + sig { params(value: String).returns(String) } + def actor_name=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/verify_email_address.rbi b/rbi/workos/verify_email_address.rbi new file mode 100644 index 00000000..bf28d4c8 --- /dev/null +++ b/rbi/workos/verify_email_address.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VerifyEmailAddress + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def code; end + + sig { params(value: String).returns(String) } + def code=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/verify_email_response.rbi b/rbi/workos/verify_email_response.rbi new file mode 100644 index 00000000..dd52765c --- /dev/null +++ b/rbi/workos/verify_email_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class VerifyEmailResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(WorkOS::User) } + def user; end + + sig { params(value: WorkOS::User).returns(WorkOS::User) } + def user=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/waitlist_user.rbi b/rbi/workos/waitlist_user.rbi new file mode 100644 index 00000000..e694809f --- /dev/null +++ b/rbi/workos/waitlist_user.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WaitlistUser + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def email; end + + sig { params(value: String).returns(String) } + def email=(value); end + + sig { returns(String) } + def state; end + + sig { params(value: String).returns(String) } + def state=(value); end + + sig { returns(T.nilable(String)) } + def approved_at; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def approved_at=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/waitlist_user_approved.rbi b/rbi/workos/waitlist_user_approved.rbi new file mode 100644 index 00000000..947c2aa5 --- /dev/null +++ b/rbi/workos/waitlist_user_approved.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WaitlistUserApproved + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::WaitlistUser) } + def data; end + + sig { params(value: WorkOS::WaitlistUser).returns(WorkOS::WaitlistUser) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/waitlist_user_created.rbi b/rbi/workos/waitlist_user_created.rbi new file mode 100644 index 00000000..b1be8351 --- /dev/null +++ b/rbi/workos/waitlist_user_created.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WaitlistUserCreated + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::WaitlistUser) } + def data; end + + sig { params(value: WorkOS::WaitlistUser).returns(WorkOS::WaitlistUser) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/waitlist_user_denied.rbi b/rbi/workos/waitlist_user_denied.rbi new file mode 100644 index 00000000..ab811f93 --- /dev/null +++ b/rbi/workos/waitlist_user_denied.rbi @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WaitlistUserDenied + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def event; end + + sig { params(value: String).returns(String) } + def event=(value); end + + sig { returns(WorkOS::WaitlistUser) } + def data; end + + sig { params(value: WorkOS::WaitlistUser).returns(WorkOS::WaitlistUser) } + def data=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(T.nilable(WorkOS::EventContext)) } + def context; end + + sig { params(value: T.nilable(WorkOS::EventContext)).returns(T.nilable(WorkOS::EventContext)) } + def context=(value); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/webhook_endpoint.rbi b/rbi/workos/webhook_endpoint.rbi new file mode 100644 index 00000000..b752841c --- /dev/null +++ b/rbi/workos/webhook_endpoint.rbi @@ -0,0 +1,65 @@ +# frozen_string_literal: true +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WebhookEndpoint + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def endpoint_url; end + + sig { params(value: String).returns(String) } + def endpoint_url=(value); end + + sig { returns(String) } + def secret; end + + sig { params(value: String).returns(String) } + def secret=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Array[String]) } + def events; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def events=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/webhook_endpoint_json.rbi b/rbi/workos/webhook_endpoint_json.rbi new file mode 100644 index 00000000..23b74d0e --- /dev/null +++ b/rbi/workos/webhook_endpoint_json.rbi @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WebhookEndpointJson + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def endpoint_url; end + + sig { params(value: String).returns(String) } + def endpoint_url=(value); end + + sig { returns(String) } + def secret; end + + sig { params(value: String).returns(String) } + def secret=(value); end + + sig { returns(String) } + def status; end + + sig { params(value: String).returns(String) } + def status=(value); end + + sig { returns(T::Array[String]) } + def events; end + + sig { params(value: T::Array[String]).returns(T::Array[String]) } + def events=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/webhooks.rbi b/rbi/workos/webhooks.rbi new file mode 100644 index 00000000..7a45a24f --- /dev/null +++ b/rbi/workos/webhooks.rbi @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Webhooks + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_webhook_endpoints(before:, after:, limit:, order:, request_options:); end + + sig do + params( + endpoint_url: String, + events: T::Array[String], + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::WebhookEndpointJson) + end + def create_webhook_endpoint(endpoint_url:, events:, request_options:); end + + sig do + params( + id: String, + endpoint_url: T.nilable(String), + status: T.nilable(String), + events: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::WebhookEndpointJson) + end + def update_webhook_endpoint(id:, endpoint_url:, status:, events:, request_options:); end + + sig do + params( + id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_webhook_endpoint(id:, request_options:); end + + end +end diff --git a/rbi/workos/widget_session_token.rbi b/rbi/workos/widget_session_token.rbi new file mode 100644 index 00000000..e0643d99 --- /dev/null +++ b/rbi/workos/widget_session_token.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WidgetSessionToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(T.nilable(String)) } + def user_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def user_id=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/widget_session_token_response.rbi b/rbi/workos/widget_session_token_response.rbi new file mode 100644 index 00000000..64a5a6b9 --- /dev/null +++ b/rbi/workos/widget_session_token_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class WidgetSessionTokenResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def token; end + + sig { params(value: String).returns(String) } + def token=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/widgets.rbi b/rbi/workos/widgets.rbi new file mode 100644 index 00000000..c2feab5a --- /dev/null +++ b/rbi/workos/widgets.rbi @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class Widgets + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + user_id: T.nilable(String), + scopes: T.nilable(T::Array[String]), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::WidgetSessionTokenResponse) + end + def create_token(organization_id:, user_id:, scopes:, request_options:); end + + end +end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..29926c7e --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "packages": { + ".": { + "release-type": "ruby", + "package-name": "workos", + "version-file": "lib/workos/version.rb", + "changelog-path": "CHANGELOG.md", + "include-component-in-tag": false + } + } +} diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..e0562d89 --- /dev/null +++ b/renovate.json @@ -0,0 +1,66 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>workos/renovate-config" + ], + "dependencyDashboard": false, + "schedule": [ + "on the 15th day of the month before 12pm" + ], + "timezone": "UTC", + "rebaseWhen": "conflicted", + "packageRules": [ + { + "matchManagers": [ + "github-actions" + ], + "pinDigests": true, + "extractVersion": "^v(?\\d+\\.\\d+\\.\\d+)$" + }, + { + "matchUpdateTypes": [ + "minor", + "patch" + ], + "automerge": true, + "groupName": "minor and patch updates" + }, + { + "matchUpdateTypes": [ + "major" + ], + "automerge": false + }, + { + "matchUpdateTypes": [ + "digest" + ], + "automerge": false + }, + { + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "minor", + "patch", + "digest", + "pinDigest" + ], + "groupName": "github actions non-major", + "groupSlug": "github-actions-non-major", + "automerge": true + }, + { + "matchManagers": [ + "github-actions" + ], + "matchUpdateTypes": [ + "major" + ], + "groupName": "github actions major", + "groupSlug": "github-actions-major", + "automerge": false + } + ] +} diff --git a/script/ci b/script/ci new file mode 100755 index 00000000..a1affc4b --- /dev/null +++ b/script/ci @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/.." + +echo "==> standardrb (lint)" +bundle exec standardrb + +# Ruby has no separate type-check step here: this gem doesn't ship Sorbet +# (.rbi) or RBS signatures. If we add either later, run `srb tc` or +# `rbs validate` here. + +echo "==> rake test" +bundle exec rake test + +echo "==> All checks passed." diff --git a/script/docs b/script/docs new file mode 100755 index 00000000..64f4e986 --- /dev/null +++ b/script/docs @@ -0,0 +1,16 @@ +#!/bin/sh +set -eu +cd "$(dirname "$0")/.." +bundle config set --local with 'docs' +bundle install +rm -rf docs/_site +# 1. Generate HTML docs (default YARD format). +bundle exec yard doc +# 2. Generate Markdown docs alongside the HTML, using the yard-markdown plugin. +# We point output at the same docs/_site directory so .md files land next to .html. +# --no-cache forces a re-parse so the markdown formatter sees fresh registry data. +# --plugin yard-markdown ensures the plugin is loaded without relying on ~/.yard/config. +bundle exec yard doc --plugin yard-markdown --format markdown --no-cache --output-dir docs/_site +# 3. Generate llms.txt (index) from the markdown output, so the published site +# is consumable by LLM tooling. +bundle exec ./script/llms-txt diff --git a/script/docs-serve b/script/docs-serve new file mode 100755 index 00000000..bba4cc2d --- /dev/null +++ b/script/docs-serve @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu +cd "$(dirname "$0")/.." +bundle config set --local with 'docs' +bundle install --quiet +if [ "${1:-}" = "--static" ]; then + if [ ! -d docs/_site ]; then + ./script/docs + fi + exec bundle exec ruby -run -e httpd -- docs/_site -p 4000 +fi +exec bundle exec yard server --reload --port 4000 diff --git a/script/llms-txt b/script/llms-txt new file mode 100755 index 00000000..ca82b7e8 --- /dev/null +++ b/script/llms-txt @@ -0,0 +1,37 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# Generates llms.txt (curated index) from the Markdown docs produced by +# `yard --format markdown` in docs/_site. See https://llmstxt.org for the format. + +require "pathname" + +ROOT = Pathname.new(__dir__).join("..").expand_path +SITE = ROOT.join("docs/_site") +require ROOT.join("lib/workos/version").to_s + +abort "docs/_site is missing — run script/docs first" unless SITE.directory? + +md_files = Pathname.glob(SITE.join("**/*.md")).sort_by { |p| p.relative_path_from(SITE).to_s } + +title_for = lambda do |path| + first_heading = path.each_line.lazy.map(&:strip).find { |l| l.start_with?("# ") } + first_heading ? first_heading.sub(/^#\s+/, "").sub(/\s*\s*$/, "").strip : path.basename(".md").to_s +end + +index_lines = [] +index_lines << "# WorkOS Ruby SDK v#{WorkOS::VERSION}" +index_lines << "" +index_lines << "> API client for WorkOS. This file indexes the auto-generated YARD documentation for the `workos` gem so language models can locate per-class references." +index_lines << "" +index_lines << "## API Reference" +index_lines << "" +md_files.each do |path| + rel = path.relative_path_from(SITE).to_s + index_lines << "- [#{title_for.call(path)}](#{rel})" +end +index_lines << "" + +SITE.join("llms.txt").write(index_lines.join("\n")) + +puts "Wrote #{SITE.join("llms.txt")} (#{md_files.size} entries)" diff --git a/spec/lib/workos/audit_logs_spec.rb b/spec/lib/workos/audit_logs_spec.rb deleted file mode 100644 index df93b6b2..00000000 --- a/spec/lib/workos/audit_logs_spec.rb +++ /dev/null @@ -1,150 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::AuditLogs do - it_behaves_like 'client' - - before do - WorkOS.configure do |config| - config.key = 'example_api_key' - end - end - - describe '.create_event' do - context 'with valid event payload' do - let(:valid_event) do - { - action: 'user.signed_in', - occurred_at: '2022-08-22T15:04:19.704Z', - actor: { - id: 'user_123', - type: 'user', - name: 'User', - metadata: { - foo: 'bar', - }, - }, - targets: [{ - id: 'team_123', - type: 'team', - name: 'Team', - metadata: { - foo: 'bar', - }, - }], - context: { - location: '1.1.1.1', - user_agent: 'Mozilla', - }, - } - end - - context 'with idempotency key' do - it 'creates an event' do - VCR.use_cassette 'audit_logs/create_event_custom_idempotency_key', match_requests_on: %i[path body] do - response = described_class.create_event( - organization: 'org_123', - event: valid_event, - idempotency_key: 'idempotency_key', - ) - - expect(response.code).to eq '201' - end - end - end - - context 'without idempotency key' do - it 'creates an event' do - VCR.use_cassette 'audit_logs/create_event', match_requests_on: %i[path body] do - response = described_class.create_event( - organization: 'org_123', - event: valid_event, - ) - - expect(response.code).to eq '201' - end - end - end - - context 'with invalid event' do - it 'returns error' do - VCR.use_cassette 'audit_logs/create_event_invalid', match_requests_on: %i[path body] do - described_class.create_event( - organization: 'org_123', - event: valid_event, - ) - rescue WorkOS::InvalidRequestError => e - expect( - e.message, - ).to eq 'Status 400, Invalid Audit Log event - request ID: 1cf9b8e7-5910-4a6d-a333-46bcf841422e' - expect(e.code).to eq 'invalid_audit_log' - expect(e.errors.count).to eq 1 - end - end - end - end - end - - describe '.create_export' do - context 'without filters applied' do - it 'creates an event' do - VCR.use_cassette 'audit_logs/create_export', match_requests_on: %i[path body] do - audit_log_export = described_class.create_export( - organization: 'org_123', - range_start: '2022-06-22T15:04:19.704Z', - range_end: '2022-08-22T15:04:19.704Z', - ) - - expect(audit_log_export).to have_attributes( - object: 'audit_log_export', - id: 'audit_log_export_123', - state: 'pending', - url: nil, - created_at: '2022-08-22T15:04:19.704Z', - updated_at: '2022-08-22T15:04:19.704Z', - ) - end - end - end - - context 'with filters applied' do - it 'creates an export' do - VCR.use_cassette 'audit_logs/create_export_with_filters', match_requests_on: %i[path body] do - audit_log_export = described_class.create_export( - organization: 'org_123', - range_start: '2022-06-22T15:04:19.704Z', - range_end: '2022-08-22T15:04:19.704Z', - actions: ['user.signed_in'], - actors: ['Jon Smith'], - actor_names: ['Jon Smith'], - actor_ids: ['user_123'], - targets: %w[user team], - ) - - expect(audit_log_export.object).to eq 'audit_log_export' - expect(audit_log_export.id).to eq 'audit_log_export_123' - expect(audit_log_export.state).to eq 'pending' - expect(audit_log_export.url).to eq nil - expect(audit_log_export.created_at).to eq '2022-08-22T15:04:19.704Z' - expect(audit_log_export.updated_at).to eq '2022-08-22T15:04:19.704Z' - end - end - end - end - - describe '.get_export' do - it 'returns an export' do - VCR.use_cassette 'audit_logs/get_export', match_requests_on: %i[path] do - audit_log_export = described_class.get_export( - id: 'audit_log_export_123', - ) - - expect(audit_log_export.object).to eq 'audit_log_export' - expect(audit_log_export.id).to eq 'audit_log_export_123' - expect(audit_log_export.state).to eq 'ready' - expect(audit_log_export.url).to eq 'https://audit-logs.com/download.csv' - expect(audit_log_export.created_at).to eq '2022-08-22T15:04:19.704Z' - expect(audit_log_export.updated_at).to eq '2022-08-22T15:04:19.704Z' - end - end - end -end diff --git a/spec/lib/workos/configuration_spec.rb b/spec/lib/workos/configuration_spec.rb deleted file mode 100644 index c5e8abbd..00000000 --- a/spec/lib/workos/configuration_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS do - describe '.configure' do - context 'with key and no timeout' do - before do - WorkOS.configure do |config| - config.key = 'example_api_key' - end - end - - it 'sets the key and default timeout configuration' do - expect(WorkOS.config.key).to eq('example_api_key') - expect(WorkOS.config.timeout).to eq(60) - end - end - - context 'with key and timeout' do - before do - WorkOS.configure do |config| - config.key = 'example_api_key' - config.timeout = 120 - end - end - - it 'sets the key and timeout configuration' do - expect(WorkOS.config.key).to eq('example_api_key') - expect(WorkOS.config.timeout).to eq(120) - end - end - end -end - -describe WorkOS::Configuration do - describe '.key!' do - context 'with key set' do - before do - WorkOS.config.key = 'example_api_key' - end - - it 'returns the key' do - expect(WorkOS.config.key!).to eq('example_api_key') - end - end - - context 'with key not set' do - before do - WorkOS.config.key = nil - end - - it 'throws an error' do - expect do - WorkOS.config.key! - end.to raise_error( - '`WorkOS.config.key` not set', - ) - end - end - end -end diff --git a/spec/lib/workos/directory_sync_spec.rb b/spec/lib/workos/directory_sync_spec.rb deleted file mode 100644 index 786ac0b2..00000000 --- a/spec/lib/workos/directory_sync_spec.rb +++ /dev/null @@ -1,506 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::DirectorySync do - it_behaves_like 'client' - - describe '.list_directories' do - context 'with no options' do - it 'returns directories and metadata' do - expected_metadata = { - 'after' => nil, - 'before' => 'before-id', - } - - VCR.use_cassette 'directory_sync/list_directories/with_no_options' do - directories = described_class.list_directories - - expect(directories.data.size).to eq(10) - expect(directories.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with domain option' do - it 'forms the proper request to the API' do - request_args = [ - '/directories?domain=foo-corp.com&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_directories/with_domain' do - directories = described_class.list_directories( - domain: 'foo-corp.com', - ) - - expect(directories.data.size).to eq(1) - end - end - end - - context 'with search option' do - it 'forms the proper request to the API' do - request_args = [ - '/directories?search=Testing&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_directories/with_search' do - directories = described_class.list_directories( - search: 'Testing', - ) - - expect(directories.data.size).to eq(2) - expect(directories.data[0].name).to include('Testing') - end - end - end - - context 'with the before option' do - it 'forms the proper request to the API' do - request_args = [ - '/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_directories/with_before' do - directories = described_class.list_directories( - before: 'directory_01FGCPNV312FHFRCX0BYWHVSE1', - ) - - expect(directories.data.size).to eq(6) - end - end - end - - context 'with the after option' do - it 'forms the proper request to the API' do - request_args = [ - '/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_directories/with_after' do - directories = described_class.list_directories(after: 'directory_01FGCPNV312FHFRCX0BYWHVSE1') - - expect(directories.data.size).to eq(4) - end - end - end - - context 'with the limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/directories?limit=2&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_directories/with_limit' do - directories = described_class.list_directories(limit: 2) - - expect(directories.data.size).to eq(2) - end - end - end - end - - describe '.delete_directory' do - context 'with valid id' do - it 'deletes a directory' do - VCR.use_cassette('directory_sync/delete_directory') do - response = WorkOS::DirectorySync.delete_directory( - 'directory_01F2T098SKN5PCTVSJ7CWP70N5', - ) - - expect(response).to be(true) - end - end - end - end - - describe '.get_directory' do - context 'with a valid id' do - it 'gets the directory details' do - VCR.use_cassette('directory_sync/get_directory_with_valid_id') do - directory = WorkOS::DirectorySync.get_directory( - id: 'directory_01FK17DWRHH7APAFXT5B52PV0W', - ) - - expect(directory.id).to eq('directory_01FK17DWRHH7APAFXT5B52PV0W') - expect(directory.name).to eq('Testing Active Attribute') - expect(directory.domain).to eq('example.me') - expect(directory.type).to eq('azure scim v2.0') - expect(directory.state).to eq('linked') - expect(directory.organization_id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV') - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('directory_sync/get_directory_with_invalid_id') do - expect do - WorkOS::DirectorySync.get_directory(id: 'invalid') - end.to raise_error( - WorkOS::APIError, - "Status 404, Directory not found: 'invalid'. - request ID: ", - ) - end - end - end - end - - describe '.list_groups' do - context 'with no options' do - it 'raises an error' do - VCR.use_cassette('directory_sync/list_groups/with_no_options') do - expect do - WorkOS::DirectorySync.list_groups - end.to raise_error(WorkOS::InvalidRequestError) - end - end - end - - context 'with directory option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_groups/with_directory' do - groups = described_class.list_groups( - directory: 'directory_01G2Z8ADK5NPMVTWF48MVVE4HT', - ) - - expect(groups.data.size).to eq(10) - expect(groups.data[0].name).to eq(groups.data[0]['name']) - end - end - end - - context 'with user option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_groups?user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_groups/with_user' do - groups = described_class.list_groups( - user: 'directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P', - ) - - expect(groups.data.size).to eq(3) - end - end - end - - context 'with the before option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_groups?before=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&' \ - 'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_groups/with_before' do - groups = described_class.list_groups( - before: 'directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG', - directory: 'directory_01G2Z8ADK5NPMVTWF48MVVE4HT', - ) - - expect(groups.data.size).to eq(10) - end - end - end - - context 'with the after option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_groups?after=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&' \ - 'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_groups/with_after' do - groups = described_class.list_groups( - after: 'directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG', - directory: 'directory_01G2Z8ADK5NPMVTWF48MVVE4HT', - ) - - expect(groups.data.size).to eq(9) - end - end - end - - context 'with the limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_groups?limit=2&' \ - 'directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_groups/with_limit' do - groups = described_class.list_groups( - limit: 2, - directory: 'directory_01G2Z8ADK5NPMVTWF48MVVE4HT', - ) - - expect(groups.data.size).to eq(2) - end - end - end - end - - describe '.list_users' do - context 'with no options' do - it 'raises an error' do - VCR.use_cassette('directory_sync/list_users/with_no_options') do - expect do - WorkOS::DirectorySync.list_users - end.to raise_error(WorkOS::InvalidRequestError) - end - end - end - - context 'with directory option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_users/with_directory' do - users = described_class.list_users( - directory: 'directory_01FAZYMST676QMTFN1DDJZZX87', - ) - - expect(users.data.size).to eq(4) - expect(users.data[0].first_name).to eq(users.data[0]['first_name']) - end - end - end - - context 'with group option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_users/with_group' do - users = described_class.list_users( - group: 'directory_group_01FBXGP79EJAYKW0WS9JCK1V6E', - ) - - expect(users.data.size).to eq(1) - end - end - end - - context 'with the before option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&'\ - 'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_users/with_before' do - users = described_class.list_users( - before: 'directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF', - directory: 'directory_01FAZYMST676QMTFN1DDJZZX87', - ) - - expect(users.data.size).to eq(2) - end - end - end - - context 'with the after option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&' \ - 'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_users/with_after' do - users = described_class.list_users( - after: 'directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF', - directory: 'directory_01FAZYMST676QMTFN1DDJZZX87', - ) - - expect(users.data.size).to eq(1) - end - end - end - - context 'with the limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/directory_users?limit=2&' \ - 'directory=directory_01FAZYMST676QMTFN1DDJZZX87&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'directory_sync/list_users/with_limit' do - users = described_class.list_users( - limit: 2, - directory: 'directory_01FAZYMST676QMTFN1DDJZZX87', - ) - - expect(users.data.size).to eq(2) - end - end - end - end - - describe '.get_group' do - context 'with valid id' do - it 'returns a group' do - VCR.use_cassette('directory_sync/get_group') do - group = WorkOS::DirectorySync.get_group( - 'directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG', - ) - - expect(group['directory_id']).to eq('directory_01G2Z8ADK5NPMVTWF48MVVE4HT') - expect(group['organization_id']).to eq('org_01EGS4P7QR31EZ4YWD1Z1XA176') - expect(group['idp_id']).to eq('01jlao4614two3d') - expect(group['name']).to eq('Sales') - expect(group.name).to eq('Sales') - expect(group['created_at']).to eq('2022-05-13T17:45:31.732Z') - expect(group['updated_at']).to eq('2022-07-13T17:45:42.618Z') - end - end - end - - context 'with invalid id' do - it 'raises an error' do - VCR.use_cassette('directory_sync/get_group_with_invalid_id') do - expect do - WorkOS::DirectorySync.get_group('invalid') - end.to raise_error(WorkOS::APIError) - end - end - end - end - - describe '.get_user' do - context 'with valid id' do - it 'returns a user' do - VCR.use_cassette('directory_sync/get_user') do - user = WorkOS::DirectorySync.get_user( - 'directory_user_01FAZYNPC8M0HRYTKFP2GNX852', - ) - - expect(user['first_name']).to eq('Logan') - expect(user.directory_id).to eq('directory_01FAZYMST676QMTFN1DDJZZX87') - expect(user.organization_id).to eq('org_01FAZWCWR03DVWA83NCJYKKD54') - expect(user.first_name).to eq('Logan') - end - end - end - - context 'with invalid id' do - it 'raises an error' do - VCR.use_cassette('directory_sync/get_user_with_invalid_id') do - expect do - WorkOS::DirectorySync.get_user('invalid') - end.to raise_error(WorkOS::APIError) - end - end - end - end -end diff --git a/spec/lib/workos/directory_user_spec.rb b/spec/lib/workos/directory_user_spec.rb deleted file mode 100644 index a4497905..00000000 --- a/spec/lib/workos/directory_user_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::DirectoryUser do - # rubocop:disable Layout/LineLength - describe '.get_primary_email' do - context 'with one primary email' do - it 'returns the primary email' do - user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}, {"primary":false,"value":"logan@gmail.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}') - expect(user.primary_email).to eq('logan@workos.com') - end - end - - context 'with multiple primary emails' do - it 'returns the first email marked as primary' do - user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}, {"primary":true,"value":"logan@gmail.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z", "updated_at":"2022-07-13T17:45:42.618Z"}') - expect(user.primary_email).to eq('logan@workos.com') - end - end - - context 'with no primary emails' do - it 'returns nil' do - user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":false,"value":"logan@gmail.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z"}') - expect(user.primary_email).to eq(nil) - end - end - - context 'with an empty email array' do - it 'returns nil' do - user = WorkOS::DirectoryUser.new('{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{},"custom_attributes":{},"groups":[],"created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z"}') - expect(user.primary_email).to eq(nil) - end - end - end - # rubocop:enable Layout/LineLength -end diff --git a/spec/lib/workos/event_spec.rb b/spec/lib/workos/event_spec.rb deleted file mode 100644 index 8fc96503..00000000 --- a/spec/lib/workos/event_spec.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::Events do - it_behaves_like 'client' - - describe '.list_events' do - context 'with no options' do - it 'returns events and metadata' do - expected_metadata = { - 'after' => nil, - } - - VCR.use_cassette 'events/list_events_with_no_options' do - events = described_class.list_events - - expect(events.data.size).to eq(1) - expect(events.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with event option' do - it 'forms the proper request to the API' do - request_args = [ - '/events?events=connection.activated', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'events/list_events_with_event' do - events = described_class.list_events( - events: ['connection.activated'], - ) - - expect(events.data.size).to eq(1) - end - end - end - - context 'with the after option' do - it 'forms the proper request to the API' do - request_args = [ - '/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'events/list_events_with_after' do - events = described_class.list_events(after: 'event_01FGCPNV312FHFRCX0BYWHVSE1') - - expect(events.data.size).to eq(1) - end - end - end - - context 'with the range_start and range_end options' do - it 'forms the proper request to the API' do - request_args = [ - '/events?range_start=2023-01-01T00%3A00%3A00Z&range_end=2023-01-03T00%3A00%3A00Z', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'events/list_events_with_range' do - events = described_class.list_events( - range_start: '2023-01-01T00:00:00Z', - range_end: '2023-01-03T00:00:00Z', - ) - - expect(events.data.size).to eq(1) - end - end - end - end -end diff --git a/spec/lib/workos/mfa_spec.rb b/spec/lib/workos/mfa_spec.rb deleted file mode 100644 index 6262a72b..00000000 --- a/spec/lib/workos/mfa_spec.rb +++ /dev/null @@ -1,280 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::MFA do - it_behaves_like 'client' - - describe '.enroll_factor' do - context 'with valid generic argument' do - it 'returns a valid factor object' do - VCR.use_cassette 'mfa/enroll_factor_generic_valid' do - factor = described_class.enroll_factor( - type: 'generic_otp', - ) - expect(factor.type == 'generic_otp') - end - end - end - - context 'with valid totp arguments' do - it 'returns a valid factor object' do - VCR.use_cassette 'mfa/enroll_factor_totp_valid' do - factor = described_class.enroll_factor( - type: 'totp', - totp_issuer: 'WorkOS', - totp_user: 'some_user', - ) - expect(factor.totp.instance_of?(Hash)) - end - end - end - - context 'with valid sms arguments' do - it 'returns a valid factor object' do - VCR.use_cassette 'mfa/enroll_factor_sms_valid' do - factor = described_class.enroll_factor( - type: 'sms', - phone_number: '55555555555', - ) - expect(factor.sms.instance_of?(Hash)) - end - end - end - - context 'when type is not sms or totp' do - it 'returns an error' do - expect do - described_class.enroll_factor( - type: 'invalid', - phone_number: '+15005550006', - ) - end.to raise_error( - ArgumentError, - "Type argument must be either 'sms' or 'totp'", - ) - end - end - - context 'when type is totp but missing arguments' do - it 'returns an error' do - expect do - described_class.enroll_factor( - type: 'totp', - totp_issuer: 'WorkOS', - ) - end.to raise_error( - ArgumentError, - 'Incomplete arguments. Need to specify both totp_issuer and totp_user when type is totp', - ) - end - end - context 'when type is sms and phone number is nil' do - it 'returns an error' do - expect do - described_class.enroll_factor( - type: 'sms', - ) - end.to raise_error( - ArgumentError, - 'Incomplete arguments. Need to specify phone_number when type is sms', - ) - end - end - end - - describe '.challenge_factor' do - context 'challenge with totp' do - it 'returns challenge factor object for totp' do - VCR.use_cassette 'mfa/challenge_factor_totp_valid' do - challenge_factor = described_class.challenge_factor( - authentication_factor_id: 'auth_factor_01FZ4TS0MWPZR7GATS7KCXANQZ', - ) - expect(challenge_factor.authentication_factor_id.class.instance_of?(String)) - end - end - end - - context 'challenge with sms' do - it 'returns a challenge factor object for sms' do - VCR.use_cassette 'mfa/challenge_factor_sms_valid' do - challenge_factor = described_class.challenge_factor( - authentication_factor_id: 'auth_factor_01FZ4TS14D1PHFNZ9GF6YD8M1F', - sms_template: 'Your code is {{code}}', - ) - expect(challenge_factor.authentication_factor_id.instance_of?(String)) - end - end - end - - context 'challenge with generic' do - it 'returns a valid challenge factor object for generic otp' do - VCR.use_cassette 'mfa/challenge_factor_generic_valid' do - challenge_factor = described_class.challenge_factor( - authentication_factor_id: 'auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M', - ) - expect(challenge_factor.code.instance_of?(String)) - end - end - end - - context 'challenge with totp mssing authentication_factor_id' do - it 'returns argument error' do - expect do - described_class.challenge_factor - end.to raise_error( - ArgumentError, - "Incomplete arguments: 'authentication_factor_id' is a required argument", - ) - end - end - end - - describe '.verify_factor' do - it 'throws a warning' do - expect do - VCR.use_cassette 'mfa/verify_challenge_generic_valid' do - described_class.verify_factor( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - end - end.to output("[DEPRECATION] `verify_factor` is deprecated. Please use `verify_challenge` instead.\n").to_stderr - end - - it 'calls verify_challenge' do - VCR.use_cassette 'mfa/verify_challenge_generic_valid' do - verify_factor = described_class.verify_factor( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - expect(verify_factor.valid == 'true') - end - end - end - - describe '.verify_challenge' do - context 'with generic otp' do - context 'and the challenge has not been verified' do - it 'returns true if the code is correct' do - VCR.use_cassette 'mfa/verify_challenge_generic_valid' do - verify_challenge = described_class.verify_challenge( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - expect(verify_challenge.valid == 'true') - end - end - - it 'returns false if the code is incorrect' do - VCR.use_cassette 'mfa/verify_challenge_generic_valid_is_false' do - verify_challenge = described_class.verify_challenge( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - expect(verify_challenge.valid == 'false') - end - end - end - - context 'and the challenge has already been verified' do - it 'returns an error' do - VCR.use_cassette 'mfa/verify_challenge_generic_invalid' do - expect do - described_class.verify_challenge( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - end.to raise_error(WorkOS::InvalidRequestError) - end - end - end - - context 'and the challenge has expired' do - it 'returns an error' do - VCR.use_cassette 'mfa/verify_challenge_generic_expired' do - expect do - described_class.verify_challenge( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - code: '897792', - ) - end.to raise_error(WorkOS::InvalidRequestError) - end - end - end - - context 'with missing code argument' do - it 'returns an argument error' do - expect do - described_class.verify_challenge( - authentication_challenge_id: 'auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J', - ) - end.to raise_error( - ArgumentError, - "Incomplete arguments: 'authentication_challenge_id' and 'code' are required arguments", - ) - end - end - - context 'with missing authentication_challenge_id argument' do - it 'returns an error' do - expect do - described_class.verify_challenge( - code: '897792', - ) - end.to raise_error( - ArgumentError, - "Incomplete arguments: 'authentication_challenge_id' and 'code' are required arguments", - ) - end - end - - context 'with missing code and authentication_challenge_id arguments' do - it 'returns an argument error' do - expect do - described_class.verify_challenge - end.to raise_error( - ArgumentError, - "Incomplete arguments: 'authentication_challenge_id' and 'code' are required arguments", - ) - end - end - end - end - - describe '.get_factor' do - context 'with a valid id' do - it 'returns a factor' do - VCR.use_cassette 'mfa/get_factor_valid' do - factor = described_class.get_factor( - id: 'auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M', - ) - expect(factor.id.instance_of?(String)) - end - end - end - - context 'with an invalid id' do - it 'returns an error' do - VCR.use_cassette 'mfa/get_factor_invalid' do - expect do - described_class.get_factor( - id: 'auth_factor_invalid', - ) - end.to raise_error(WorkOS::APIError) - end - end - end - end - - describe '.delete_factor' do - context 'deletes facotr' do - it 'uses delete_factor to delete factor' do - VCR.use_cassette 'mfa/delete_factor' do - response = described_class.delete_factor( - id: 'auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M', - ) - expect(response).to be(true) - end - end - end - end -end diff --git a/spec/lib/workos/organizations_spec.rb b/spec/lib/workos/organizations_spec.rb deleted file mode 100644 index c10c63fc..00000000 --- a/spec/lib/workos/organizations_spec.rb +++ /dev/null @@ -1,259 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::Organizations do - it_behaves_like 'client' - - describe '.create_organization' do - context 'with valid payload' do - context 'with no idempotency key' do - it 'creates an organization' do - VCR.use_cassette 'organization/create' do - organization = described_class.create_organization( - domains: ['example.io'], - name: 'Test Organization', - ) - - expect(organization.id).to eq('org_01FCPEJXEZR4DSBA625YMGQT9N') - expect(organization.name).to eq('Test Organization') - expect(organization.domains.first[:domain]).to eq('example.io') - end - end - end - - context 'with idempotency key' do - context 'when idempotency key is used once' do - it 'creates an organization' do - VCR.use_cassette 'organization/create_with_idempotency_key' do - organization = described_class.create_organization( - domains: ['example.io'], - name: 'Test Organization', - idempotency_key: 'key', - ) - - expect(organization.name).to eq('Test Organization') - expect(organization.domains.first[:domain]).to eq('example.io') - end - end - end - - context 'when idempotency key is used more than once' do - context 'with duplicate event payloads' do - it 'returns the already created organization' do - VCR.use_cassette 'organization/create_with_duplicate_idempotency_key_and_payload' do - organization1 = described_class.create_organization( - domains: ['example.com'], - name: 'Test Organization', - idempotency_key: 'foo', - ) - - organization2 = described_class.create_organization( - domains: ['example.com'], - name: 'Test Organization', - idempotency_key: 'foo', - ) - - expect(organization1.id).to eq(organization2.id) - end - end - end - - context 'with different event payloads' do - it 'raises an error' do - VCR.use_cassette 'organization/create_with_duplicate_idempotency_key_and_different_payload' do - described_class.create_organization( - domains: ['example.me'], - name: 'Test Organization', - idempotency_key: 'bar', - ) - - expect do - described_class.create_organization( - domains: ['example.me'], - name: 'Organization Test', - idempotency_key: 'bar', - ) - end.to raise_error( - WorkOS::InvalidRequestError, - /Status 400, Another idempotency key \(bar\) with different request parameters was found. Please use a different idempotency key./, - ) - end - end - end - end - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'organization/create_invalid' do - expect do - described_class.create_organization( - domains: ['example.com'], - name: 'Test Organization 2', - ) - end.to raise_error( - WorkOS::APIError, - /An Organization with the domain example.com already exists/, - ) - end - end - end - end - - describe '.list_organizations' do - context 'with no options' do - it 'returns organizations and metadata' do - expected_metadata = { - 'after' => nil, - 'before' => 'before-id', - } - - VCR.use_cassette 'organization/list' do - organizations = described_class.list_organizations - - expect(organizations.data.size).to eq(6) - expect(organizations.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with the before option' do - it 'forms the proper request to the API' do - request_args = [ - '/organizations?before=before-id&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'organization/list', match_requests_on: [:path] do - organizations = described_class.list_organizations( - before: 'before-id', - ) - - expect(organizations.data.size).to eq(6) - end - end - end - - context 'with the after option' do - it 'forms the proper request to the API' do - request_args = [ - '/organizations?after=after-id&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'organization/list', match_requests_on: [:path] do - organizations = described_class.list_organizations(after: 'after-id') - - expect(organizations.data.size).to eq(6) - end - end - end - - context 'with the limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/organizations?limit=10&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'organization/list', match_requests_on: [:path] do - organizations = described_class.list_organizations(limit: 10) - - expect(organizations.data.size).to eq(6) - end - end - end - end - - describe '.get_organization' do - context 'with a valid id' do - it 'gets the organization details' do - VCR.use_cassette('organization/get') do - organization = described_class.get_organization( - id: 'org_01F9293WD2PDEEV4Y625XPZVG7', - ) - - expect(organization.id).to eq('org_01F9293WD2PDEEV4Y625XPZVG7') - expect(organization.name).to eq('Foo Corp') - expect(organization.domains.first[:domain]).to eq('foo-corp.com') - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('organization/get_invalid') do - expect do - described_class.get_organization(id: 'invalid') - end.to raise_error( - WorkOS::APIError, - 'Status 404, Not Found - request ID: ', - ) - end - end - end - end - - describe '.update_organization' do - context 'with valid payload' do - it 'creates an organization' do - VCR.use_cassette 'organization/update' do - organization = described_class.update_organization( - organization: 'org_01F6Q6TFP7RD2PF6J03ANNWDKV', - domains: ['example.me'], - name: 'Test Organization', - ) - - expect(organization.id).to eq('org_01F6Q6TFP7RD2PF6J03ANNWDKV') - expect(organization.name).to eq('Test Organization') - expect(organization.domains.first[:domain]).to eq('example.me') - end - end - end - end - - describe '.delete_organization' do - context 'with a valid id' do - it 'returns true' do - VCR.use_cassette('organization/delete') do - response = described_class.delete_organization( - id: 'org_01F4A8TD0B4N1Y9SJ8SH635HDB', - ) - - expect(response).to be(true) - end - end - end - - context 'with an invalid id' do - it 'returns false' do - VCR.use_cassette('organization/delete_invalid') do - expect do - described_class.delete_organization(id: 'invalid') - end.to raise_error( - WorkOS::APIError, - 'Status 404, Not Found - request ID: ', - ) - end - end - end - end -end diff --git a/spec/lib/workos/passwordless_spec.rb b/spec/lib/workos/passwordless_spec.rb deleted file mode 100644 index 38c6c628..00000000 --- a/spec/lib/workos/passwordless_spec.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::Passwordless do - it_behaves_like 'client' - - describe '.create_session' do - context 'with valid options payload' do - let(:valid_options) do - { - email: 'demo@workos-okta.com', - type: 'MagicLink', - redirect_uri: 'foo.com/auth/callback', - } - end - - it 'creates a session' do - VCR.use_cassette('passwordless/create_session') do - response = described_class.create_session(valid_options) - - expect(response.email).to eq 'demo@workos-okta.com' - end - end - end - - context 'with invalid event payload' do - let(:invalid_options) do - {} - end - - it 'raises an error' do - VCR.use_cassette('passwordless/create_session_invalid') do - expect do - described_class.create_session(invalid_options) - end.to raise_error( - WorkOS::InvalidRequestError, - /Status 422, Validation failed \(email: email must be a string; type: type must be a valid enum value\)/, - ) - end - end - end - end - - describe '.send_session' do - context 'with valid session id' do - let(:valid_options) do - { - email: 'demo@workos-okta.com', - type: 'MagicLink', - } - end - - it 'send a session' do - VCR.use_cassette('passwordless/send_session') do - response = described_class.send_session( - 'passwordless_session_01EJC0F4KH42T11Y2DHPEB09BM', - ) - - expect(response['success']).to eq true - end - end - end - - context 'with invalid session id' do - it 'raises an error' do - VCR.use_cassette('passwordless/send_session_invalid') do - expect do - described_class.send_session('session_123') - end.to raise_error( - WorkOS::InvalidRequestError, - /Status 422, The passwordless session 'session_123' has expired or is invalid./, - ) - end - end - end - end -end diff --git a/spec/lib/workos/portal_spec.rb b/spec/lib/workos/portal_spec.rb deleted file mode 100644 index 0f093c1d..00000000 --- a/spec/lib/workos/portal_spec.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::Portal do - it_behaves_like 'client' - - describe '.generate_link' do - let(:organization) { 'org_01EHQMYV6MBK39QC5PZXHY59C3' } - - describe 'with a valid organization' do - context 'with the sso intent' do - it 'returns an Admin Portal link' do - VCR.use_cassette 'portal/generate_link_sso' do - portal_link = described_class.generate_link( - intent: 'sso', - organization: organization, - ) - - expect(portal_link).to eq( - 'https://id.workos.com/portal/launch?secret=secret', - ) - end - end - end - - describe 'with the dsync intent' do - it 'returns an Admin Portal link' do - VCR.use_cassette 'portal/generate_link_dsync' do - portal_link = described_class.generate_link( - intent: 'dsync', - organization: organization, - ) - - expect(portal_link).to eq( - 'https://id.workos.com/portal/launch?secret=secret', - ) - end - end - end - - describe 'with the audit_logs intent' do - it 'returns an Admin Portal link' do - VCR.use_cassette 'portal/generate_link_audit_logs', match_requests_on: %i[path body] do - portal_link = described_class.generate_link( - intent: 'audit_logs', - organization: organization, - ) - - expect(portal_link).to eq( - 'https://id.workos.com/portal/launch?secret=secret', - ) - end - end - end - end - - describe 'with an invalid organization' do - it 'raises an error' do - VCR.use_cassette 'portal/generate_link_invalid' do - expect do - described_class.generate_link( - intent: 'sso', - organization: 'bogus-id', - ) - end.to raise_error( - WorkOS::InvalidRequestError, - /Could not find an organization with the id, bogus-id/, - ) - end - end - end - - describe 'with an invalid intent' do - it 'raises an error' do - expect do - described_class.generate_link( - intent: 'bogus-intent', - organization: organization, - ) - end.to raise_error( - ArgumentError, - /bogus-intent is not a valid value/, - ) - end - end - end -end diff --git a/spec/lib/workos/sso_spec.rb b/spec/lib/workos/sso_spec.rb deleted file mode 100644 index 9a1098bf..00000000 --- a/spec/lib/workos/sso_spec.rb +++ /dev/null @@ -1,655 +0,0 @@ -# frozen_string_literal: true - -require 'securerandom' - -describe WorkOS::SSO do - it_behaves_like 'client' - - describe '.authorization_url' do - context 'with a domain' do - let(:args) do - { - domain: 'foo.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&domain=foo.com', - ) - end - end - - context 'with a provider' do - let(:args) do - { - provider: 'GoogleOAuth', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&provider=GoogleOAuth', - ) - end - end - - context 'with a connection' do - let(:args) do - { - connection: 'connection_123', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&connection=connection_123', - ) - end - end - - context 'with a domain' do - let(:args) do - { - domain: 'foo.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&domain=foo.com', - ) - end - end - - context 'with a domain_hint' do - let(:args) do - { - connection: 'connection_123', - domain_hint: 'foo.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2' \ - 'Fedit%22%7D&domain_hint=foo.com&connection=connection_123', - ) - end - end - - context 'with a login_hint' do - let(:args) do - { - connection: 'connection_123', - login_hint: 'foo@workos.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2' \ - 'Fedit%22%7D&login_hint=foo%40workos.com&connection=connection_123', - ) - end - end - - context 'with an organization' do - let(:args) do - { - organization: 'org_123', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&organization=org_123', - ) - end - end - - context 'with neither connection, domain, provider, or organization' do - let(:args) do - { - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'raises an error' do - expect do - described_class.authorization_url(**args) - end.to raise_error( - ArgumentError, - 'Either connection, domain, provider, or organization is required.', - ) - end - end - - context 'with an invalid provider' do - let(:args) do - { - provider: 'Okta', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'raises an error' do - expect do - described_class.authorization_url(**args) - end.to raise_error( - ArgumentError, - 'Okta is not a valid value. `provider` must be in ["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth"]', - ) - end - end - end - - describe '.get_profile' do - # rubocop:disable Metrics/BlockLength - it 'returns a profile' do - VCR.use_cassette 'sso/profile' do - profile = described_class.get_profile(access_token: 'access_token') - - expectation = { - connection_id: 'conn_01E83FVYZHY7DM4S9503JHV0R5', - connection_type: 'GoogleOAuth', - email: 'bob.loblaw@workos.com', - first_name: 'Bob', - id: 'prof_01EEJTY9SZ1R350RB7B73SNBKF', - idp_id: '116485463307139932699', - last_name: 'Loblaw', - groups: nil, - organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB', - raw_attributes: { - email: 'bob.loblaw@workos.com', - family_name: 'Loblaw', - given_name: 'Bob', - hd: 'workos.com', - id: '116485463307139932699', - locale: 'en', - name: 'Bob Loblaw', - picture: 'https://lh3.googleusercontent.com/a-/AOh14GyO2hLlgZvteDQ3Ldi3_-RteZLya0hWH7247Cam=s96-c', - verified_email: true, - }, - } - expect(profile.to_json).to eq(expectation) - end - end - # rubocop:enable Metrics/BlockLength - end - - describe '.profile_and_token' do - let(:args) do - { - code: SecureRandom.hex(10), - client_id: 'workos-proj-123', - } - end - - let(:request_body) do - { - client_id: args[:client_id], - client_secret: WorkOS.config.key, - code: args[:code], - grant_type: 'authorization_code', - } - end - let(:user_agent) { 'user-agent-string' } - let(:headers) { { 'User-Agent' => user_agent } } - - before do - allow(described_class).to receive(:user_agent).and_return(user_agent) - end - - context 'with a successful response' do - let(:response_body) { File.read("#{SPEC_ROOT}/support/profile.txt") } - - before do - stub_request(:post, 'https://api.workos.com/sso/token'). - with(headers: headers, body: request_body). - to_return(status: 200, body: response_body) - end - - it 'includes the SDK Version header' do - described_class.profile_and_token(**args) - - expect(a_request(:post, 'https://api.workos.com/sso/token'). - with(headers: headers, body: request_body)).to have_been_made - end - - it 'returns a WorkOS::ProfileAndToken' do - profile_and_token = described_class.profile_and_token(**args) - expect(profile_and_token).to be_a(WorkOS::ProfileAndToken) - - expectation = { - connection_id: 'conn_01EMH8WAK20T42N2NBMNBCYHAG', - connection_type: 'OktaSAML', - email: 'demo@workos-okta.com', - first_name: 'WorkOS', - id: 'prof_01DRA1XNSJDZ19A31F183ECQW5', - idp_id: '00u1klkowm8EGah2H357', - last_name: 'Demo', - groups: %w[Admins Developers], - organization_id: 'org_01FG53X8636WSNW2WEKB2C31ZB', - raw_attributes: { - email: 'demo@workos-okta.com', - first_name: 'WorkOS', - id: 'prof_01DRA1XNSJDZ19A31F183ECQW5', - idp_id: '00u1klkowm8EGah2H357', - last_name: 'Demo', - groups: %w[Admins Developers], - }, - } - - expect(profile_and_token.access_token).to eq('01DVX6QBS3EG6FHY2ESAA5Q65X') - expect(profile_and_token.profile.to_json).to eq(expectation) - end - end - - context 'with an unprocessable request' do - before do - stub_request(:post, 'https://api.workos.com/sso/token'). - with(headers: headers, body: request_body). - to_return( - headers: { 'X-Request-ID' => 'request-id' }, - status: 422, - body: { "error": 'some error', "error_description": 'some error description' }.to_json, - ) - end - - it 'raises an exception with request ID' do - expect do - described_class.profile_and_token(**args) - end.to raise_error( - WorkOS::APIError, - 'error: some error, error_description: some error description - request ID: request-id', - ) - end - end - - context 'with an expired code' do - before do - stub_request(:post, 'https://api.workos.com/sso/token'). - with(body: request_body). - to_return( - status: 400, - headers: { 'X-Request-ID' => 'request-id' }, - body: { - "error": 'invalid_grant', - "error_description": "The code '01DVX3C5Z367SFHR8QNDMK7V24' has expired or is invalid.", - }.to_json, - ) - end - - it 'raises an exception' do - expect do - described_class.profile_and_token(**args) - end.to raise_error( - WorkOS::APIError, - "error: invalid_grant, error_description: The code '01DVX3C5Z367SFHR8QNDMK7V24'" \ - ' has expired or is invalid. - request ID: request-id', - ) - end - end - end - - describe '.list_connections' do - context 'with no options' do - it 'returns connections and metadata' do - expected_metadata = { - 'after' => nil, - 'before' => 'before_id', - } - - VCR.use_cassette 'sso/list_connections/with_no_options' do - connections = described_class.list_connections - - expect(connections.data.size).to eq(6) - expect(connections.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with connection_type option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?connection_type=OktaSAML&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_connection_type' do - connections = described_class.list_connections( - connection_type: 'OktaSAML', - ) - - expect(connections.data.size).to eq(10) - expect(connections.data.first.connection_type).to eq('OktaSAML') - end - end - end - - context 'with domain option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?domain=foo-corp.com&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_domain' do - connections = described_class.list_connections( - domain: 'foo-corp.com', - ) - - expect(connections.data.size).to eq(1) - end - end - end - - context 'with organization_id option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?organization_id=org_01F9293WD2PDEEV4Y625XPZVG7&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_organization_id' do - connections = described_class.list_connections( - organization_id: 'org_01F9293WD2PDEEV4Y625XPZVG7', - ) - - expect(connections.data.size).to eq(1) - expect(connections.data.first.organization_id).to eq( - 'org_01F9293WD2PDEEV4Y625XPZVG7', - ) - end - end - end - - context 'with limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?limit=2&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_limit' do - connections = described_class.list_connections( - limit: 2, - ) - - expect(connections.data.size).to eq(2) - end - end - end - - context 'with before option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?before=conn_01FA3WGCWPCCY1V2FGES2FDNP7&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_before' do - connections = described_class.list_connections( - before: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7', - ) - - expect(connections.data.size).to eq(3) - end - end - end - - context 'with after option' do - it 'forms the proper request to the API' do - request_args = [ - '/connections?after=conn_01FA3WGCWPCCY1V2FGES2FDNP7&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'sso/list_connections/with_after' do - connections = described_class.list_connections( - after: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7', - ) - - expect(connections.data.size).to eq(2) - end - end - end - end - - describe '.get_connection' do - context 'with a valid id' do - it 'gets the connection details' do - VCR.use_cassette('sso/get_connection_with_valid_id') do - connection = WorkOS::SSO.get_connection( - id: 'conn_01FA3WGCWPCCY1V2FGES2FDNP7', - ) - - expect(connection.id).to eq('conn_01FA3WGCWPCCY1V2FGES2FDNP7') - expect(connection.connection_type).to eq('OktaSAML') - expect(connection.name).to eq('Foo Corp') - expect(connection.domains.first[:domain]).to eq('foo-corp.com') - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('sso/get_connection_with_invalid_id') do - expect do - WorkOS::SSO.get_connection(id: 'invalid') - end.to raise_error( - WorkOS::APIError, - 'Status 404, Not Found - request ID: ', - ) - end - end - end - end - - describe '.delete_connection' do - context 'with a valid id' do - it 'returns true' do - VCR.use_cassette('sso/delete_connection_with_valid_id') do - response = WorkOS::SSO.delete_connection( - id: 'conn_01EX55FRVN1V2PCA9YWTMZQMMQ', - ) - - expect(response).to be(true) - end - end - end - - context 'with an invalid id' do - it 'returns false' do - VCR.use_cassette('sso/delete_connection_with_invalid_id') do - expect do - WorkOS::SSO.delete_connection(id: 'invalid') - end.to raise_error( - WorkOS::APIError, - 'Status 404, Not Found - request ID: ', - ) - end - end - end - end -end diff --git a/spec/lib/workos/user_management_spec.rb b/spec/lib/workos/user_management_spec.rb deleted file mode 100644 index 09ed937f..00000000 --- a/spec/lib/workos/user_management_spec.rb +++ /dev/null @@ -1,1177 +0,0 @@ -# frozen_string_literal: true - -describe WorkOS::UserManagement do - it_behaves_like 'client' - - describe '.authorization_url' do - context 'with a provider' do - let(:args) do - { - provider: 'authkit', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&provider=authkit', - ) - end - end - - context 'with a connection selector' do - let(:args) do - { - connection_id: 'connection_123', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&connection_id=connection_123', - ) - end - end - - context 'with an organization selector' do - let(:args) do - { - organization_id: 'org_123', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2F' \ - 'edit%22%7D&organization_id=org_123', - ) - end - end - - context 'with a domain hint' do - let(:args) do - { - connection_id: 'connection_123', - domain_hint: 'foo.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2' \ - 'Fedit%22%7D&domain_hint=foo.com&connection_id=connection_123', - ) - end - end - - context 'with a login hint' do - let(:args) do - { - connection_id: 'connection_123', - login_hint: 'foo@workos.com', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'returns a valid URL' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url)).to be_a URI - end - - it 'returns the expected hostname' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).host).to eq(WorkOS.config.api_hostname) - end - - it 'returns the expected query string' do - authorization_url = described_class.authorization_url(**args) - - expect(URI.parse(authorization_url).query).to eq( - 'client_id=workos-proj-123&redirect_uri=foo.com%2Fauth%2Fcallback' \ - '&response_type=code&state=%7B%3Anext_page%3D%3E%22%2Fdashboard%2' \ - 'Fedit%22%7D&login_hint=foo%40workos.com&connection_id=connection_123', - ) - end - end - - context 'with neither connection_id, organization_id or provider' do - let(:args) do - { - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'raises an error' do - expect do - described_class.authorization_url(**args) - end.to raise_error( - ArgumentError, - 'Either connection ID, organization ID, or provider is required.', - ) - end - end - - context 'with an invalid provider' do - let(:args) do - { - provider: 'Okta', - client_id: 'workos-proj-123', - redirect_uri: 'foo.com/auth/callback', - state: { - next_page: '/dashboard/edit', - }.to_s, - } - end - it 'raises an error' do - expect do - described_class.authorization_url(**args) - end.to raise_error( - ArgumentError, - 'Okta is not a valid value. `provider` must be in ' \ - '["GitHubOAuth", "GoogleOAuth", "MicrosoftOAuth", "authkit"]', - ) - end - end - end - - describe '.get_user' do - context 'with a valid id' do - it 'returns a user' do - VCR.use_cassette 'user_management/get_user' do - user = described_class.get_user( - id: 'user_01HP0B4ZV2FWWVY0BF16GFDAER', - ) - - expect(user.id.instance_of?(String)) - expect(user.instance_of?(WorkOS::User)) - end - end - end - - context 'with an invalid id' do - it 'returns an error' do - expect do - described_class.get_user( - id: 'invalid_user_id', - ).to raise_error(WorkOS::APIError) - end - end - end - end - - describe '.list_users' do - context 'with no options' do - it 'returns a list of users' do - expected_metadata = { - 'after' => nil, - 'before' => 'before-id', - } - - VCR.use_cassette 'user_management/list_users/no_options' do - users = described_class.list_users - - expect(users.data.size).to eq(2) - expect(users.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with options' do - it 'returns a list of matching users' do - request_args = [ - '/user_management/users?email=lucy.lawless%40example.com&'\ - 'order=desc&'\ - 'limit=5', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_users/with_options' do - users = described_class.list_users( - email: 'lucy.lawless@example.com', - order: 'desc', - limit: '5', - ) - - expect(users.data.size).to eq(1) - expect(users.data[0].email).to eq('lucy.lawless@example.com') - end - end - end - end - - describe '.create_user' do - context 'with a valid payload' do - it 'creates a user' do - VCR.use_cassette 'user_management/create_user_valid' do - user = described_class.create_user( - email: 'foo@example.com', - first_name: 'Foo', - last_name: 'Bar', - email_verified: true, - ) - - expect(user.first_name).to eq('Foo') - expect(user.last_name).to eq('Bar') - expect(user.email).to eq('foo@example.com') - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/create_user_invalid' do - expect do - described_class.create_user(email: '') - end.to raise_error( - WorkOS::InvalidRequestError, - /email_string_required/, - ) - end - end - end - end - end - - describe '.update_user' do - context 'with a valid payload' do - it 'update_user a user' do - VCR.use_cassette 'user_management/update_user/valid' do - user = described_class.update_user( - id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - first_name: 'Jane', - last_name: 'Doe', - email_verified: false, - ) - expect(user.first_name).to eq('Jane') - expect(user.last_name).to eq('Doe') - expect(user.email_verified).to eq(false) - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/update_user/invalid' do - expect do - described_class.update_user(id: 'invalid') - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - end - end - - describe '.delete_user' do - context 'with a valid id' do - it 'returns true' do - VCR.use_cassette('user_management/delete_user/valid') do - response = WorkOS::UserManagement.delete_user( - id: 'user_01H7WRJBPAAHX1BYRQHEK7QC4A', - ) - - expect(response).to be(true) - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('user_management/delete_user/invalid') do - expect do - WorkOS::UserManagement.delete_user(id: 'invalid') - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - end - - describe '.authenticate_with_password' do - context 'with a valid password' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_password/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_password( - email: 'test@workos.app', - password: '7YtYic00VWcXatPb', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H7TVSKS45SDHN5V9XPSM6H44') - end - end - end - - context 'with an invalid user' do - it 'raises an error' do - VCR.use_cassette('user_management/authenticate_with_password/invalid') do - expect do - WorkOS::UserManagement.authenticate_with_password( - email: 'invalid@workos.app', - password: 'invalid', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - end - - describe '.authenticate_with_code' do - context 'with a valid code' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_code/valid') do - authentication_response = WorkOS::UserManagement.authenticate_with_code( - code: '01H93ZZHA0JBHFJH9RR11S83YN', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H93ZY4F80YZRRS6N59Z2HFVS') - expect(authentication_response.access_token).to eq('') - expect(authentication_response.refresh_token).to eq('') - end - end - - context 'when the user is being impersonated' do - it 'contains the impersonator metadata' do - VCR.use_cassette('user_management/authenticate_with_code/valid_with_impersonator') do - authentication_response = WorkOS::UserManagement.authenticate_with_code( - code: '01HRX85ATQB2MN40K4FZ9C2HFR', - client_id: 'client_01GS91XFB2YPR1C0NR5SH758Q0', - ) - - expect(authentication_response.impersonator).to have_attributes( - email: 'admin@foocorp.com', - reason: 'For testing.', - ) - end - end - end - end - - context 'with an invalid code' do - it 'raises an error' do - VCR.use_cassette('user_management/authenticate_with_code/invalid') do - expect do - WorkOS::UserManagement.authenticate_with_code( - code: 'invalid', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.authenticate_with_refresh_token' do - context 'with a valid refresh_token' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_refresh_token/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_refresh_token( - refresh_token: 'some_refresh_token', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.access_token).to eq('') - expect(authentication_response.refresh_token).to eq('') - end - end - end - - context 'with an invalid refresh_token' do - it 'raises an error' do - VCR.use_cassette('user_management/authenticate_with_refresh_code/invalid', tag: :token) do - expect do - WorkOS::UserManagement.authenticate_with_refresh_token( - refresh_token: 'invalid', - client_id: 'client_123', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.authenticate_with_magic_auth' do - context 'with a valid code' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_magic_auth/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_magic_auth( - code: '452079', - client_id: 'project_01EGKAEB7G5N88E83MF99J785F', - email: 'test@workos.com', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H93WD0R0KWF8Q7BK02C0RPYJ') - end - end - end - - context 'with an invalid code' do - it 'returns an error' do - VCR.use_cassette('user_management/authenticate_with_magic_auth/invalid', tag: :token) do - expect do - WorkOS::UserManagement.authenticate_with_magic_auth( - code: 'invalid', - client_id: 'client_123', - email: 'test@workos.com', - ) - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - end - - describe '.authenticate_with_organization_selection' do - context 'with a valid code' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_organization_selection/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_organization_selection( - client_id: 'project_01EGKAEB7G5N88E83MF99J785F', - organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', - pending_authentication_token: 'pending_authentication_token_1234', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H93WD0R0KWF8Q7BK02C0RPYJ') - expect(authentication_response.organization_id).to eq('org_01H5JQDV7R7ATEYZDEG0W5PRYS') - end - end - end - - context 'with an invalid token' do - it 'returns an error' do - VCR.use_cassette('user_management/authenticate_with_organization_selection/invalid', tag: :token) do - expect do - WorkOS::UserManagement.authenticate_with_organization_selection( - organization_id: 'invalid_org_id', - client_id: 'project_01EGKAEB7G5N88E83MF99J785F', - pending_authentication_token: 'pending_authentication_token_1234', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.authenticate_with_totp' do - context 'with a valid code' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_totp/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_totp( - code: '01H93ZZHA0JBHFJH9RR11S83YN', - client_id: 'client_123', - pending_authentication_token: 'pending_authentication_token_1234', - authentication_challenge_id: 'authentication_challenge_id', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H93ZY4F80YZRRS6N59Z2HFVS') - end - end - end - - context 'with an invalid code' do - it 'raises an error' do - VCR.use_cassette('user_management/authenticate_with_totp/invalid', tag: :token) do - expect do - WorkOS::UserManagement.authenticate_with_totp( - code: 'invalid', - client_id: 'client_123', - pending_authentication_token: 'pending_authentication_token_1234', - authentication_challenge_id: 'authentication_challenge_id', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.authenticate_with_email_verification' do - context 'with a valid code' do - it 'returns user' do - VCR.use_cassette('user_management/authenticate_with_email_verification/valid', tag: :token) do - authentication_response = WorkOS::UserManagement.authenticate_with_email_verification( - code: '01H93ZZHA0JBHFJH9RR11S83YN', - client_id: 'client_123', - pending_authentication_token: 'pending_authentication_token_1234', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - expect(authentication_response.user.id).to eq('user_01H93ZY4F80YZRRS6N59Z2HFVS') - end - end - end - - context 'with an invalid code' do - it 'raises an error' do - VCR.use_cassette('user_management/authenticate_with_email_verification/invalid', tag: :token) do - expect do - WorkOS::UserManagement.authenticate_with_email_verification( - code: 'invalid', - client_id: 'client_123', - pending_authentication_token: 'pending_authentication_token_1234', - ip_address: '200.240.210.16', - user_agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.send_magic_auth_code' do - context 'with valid parameters' do - it 'sends a magic link to the email address' do - VCR.use_cassette 'user_management/send_magic_auth_code/valid' do - described_class.send_magic_auth_code( - email: 'test@gmail.com', - ) - end - end - end - end - - describe '.enroll_auth_factor' do - context 'with a valid user_id and auth factor type' do - it 'returns an auth factor and challenge' do - VCR.use_cassette('user_management/enroll_auth_factor/valid') do - authentication_response = WorkOS::UserManagement.enroll_auth_factor( - user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - type: 'totp', - ) - - expect(authentication_response.authentication_factor.id).to eq('auth_factor_01H96FETXENNY99ARX0GRC804C') - expect(authentication_response.authentication_challenge.id).to eq('auth_challenge_01H96FETXGTW1QMBSBT2T36PW0') - end - end - end - - context 'with an incorrect user id' do - it 'raises an error' do - VCR.use_cassette('user_management/enroll_auth_factor/invalid') do - expect do - WorkOS::UserManagement.enroll_auth_factor( - user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - type: 'totp', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - - context 'with an invalid auth factor type' do - it 'raises an error' do - expect do - described_class.enroll_auth_factor(user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - type: 'invalid-factor',) - end.to raise_error( - ArgumentError, - 'invalid-factor is not a valid value. `type` must be in ["totp"]', - ) - end - end - end - - describe '.list_auth_factors' do - context 'with a valid user_id' do - it 'returns a list of auth factors' do - VCR.use_cassette('user_management/list_auth_factors/valid') do - authentication_response = WorkOS::UserManagement.list_auth_factors( - user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - ) - - expect(authentication_response.data.first.id).to eq('auth_factor_01H96FETXENNY99ARX0GRC804C') - end - end - end - context 'with an incorrect user id' do - it 'raises an error' do - VCR.use_cassette('user_management/list_auth_factors/invalid') do - expect do - WorkOS::UserManagement.list_auth_factors( - user_id: 'user_01H7TVSKS45SDHN5V9XPSM6H44', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Status 400/) - end - end - end - end - - describe '.send_verification_email' do - context 'with valid parameters' do - it 'sends an email to that user and the magic auth challenge' do - VCR.use_cassette 'user_management/send_verification_email/valid' do - verification_response = described_class.send_verification_email( - user_id: 'user_01H93WD0R0KWF8Q7BK02C0RPYJ', - ) - expect(verification_response.user.id).to eq('user_01H93WD0R0KWF8Q7BK02C0RPYJ') - end - end - end - - context 'when the user does not exist' do - it 'returns an error' do - VCR.use_cassette 'user_management/send_verification_email/invalid' do - expect do - described_class.send_verification_email( - user_id: 'bad_id', - ) - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - end - - describe '.verify_email' do - context 'with valid parameters' do - it 'verifies the email and returns the user' do - VCR.use_cassette 'user_management/verify_email/valid' do - verify_response = described_class.verify_email( - code: '333495', - user_id: 'user_01H968BR1R84DSPYS9QR5PM6RZ', - ) - - expect(verify_response.user.id).to eq('user_01H968BR1R84DSPYS9QR5PM6RZ') - end - end - end - - context 'with invalid parameters' do - context 'when the id does not exist' do - it 'raises an error' do - VCR.use_cassette 'user_management/verify_email/invalid_magic_auth_challenge' do - expect do - described_class.verify_email( - code: '659770', - user_id: 'bad_id', - ) - end.to raise_error(WorkOS::APIError, /User not found/) - end - end - end - - context 'when the code is incorrect' do - it 'raises an error' do - VCR.use_cassette 'user_management/verify_email/invalid_code' do - expect do - described_class.verify_email( - code: '000000', - user_id: 'user_01H93WD0R0KWF8Q7BK02C0RPYJ', - ) - end.to raise_error(WorkOS::InvalidRequestError, /Email verification code is incorrect/) - end - end - end - end - end - - describe '.send_password_reset_email' do - context 'with a valid payload' do - it 'sends a password reset email' do - VCR.use_cassette 'user_management/send_password_reset_email/valid' do - response = described_class.send_password_reset_email( - email: 'lucy.lawless@example.com', - password_reset_url: 'https://example.com/reset', - ) - - expect(response).to be(true) - end - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/send_password_reset_email/invalid' do - expect do - described_class.send_password_reset_email( - email: 'foo@bar.com', - password_reset_url: '', - ) - end.to raise_error( - WorkOS::InvalidRequestError, - /password_reset_url_string_required/, - ) - end - end - end - end - - describe '.reset_password' do - context 'with a valid payload' do - it 'resets the password and returns the user' do - VCR.use_cassette 'user_management/reset_password/valid' do - user = described_class.reset_password( - token: 'eEgAgvAE0blvU1zWV3yWVAD22', - new_password: 'very_cool_new_pa$$word', - ) - - expect(user.email).to eq('lucy.lawless@example.com') - end - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/reset_password/invalid' do - expect do - described_class.reset_password( - token: 'bogus_token', - new_password: 'new_password', - ) - end.to raise_error( - WorkOS::APIError, - /Could not locate user with provided token/, - ) - end - end - end - end - - describe '.get_organization_membership' do - context 'with a valid id' do - it 'returns a organization membership' do - VCR.use_cassette 'user_management/get_organization_membership' do - organization_membership = described_class.get_organization_membership( - id: 'om_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(organization_membership.id.instance_of?(String)) - expect(organization_membership.instance_of?(WorkOS::OrganizationMembership)) - end - end - end - - context 'with an invalid id' do - it 'returns an error' do - expect do - described_class.get_organization_membership( - id: 'invalid_organization_membership_id', - ).to raise_error(WorkOS::APIError) - end - end - end - end - - describe '.list_organization_memberships' do - context 'with no options' do - it 'returns a list of users' do - expected_metadata = { - 'after' => nil, - 'before' => 'before-id', - } - - VCR.use_cassette 'user_management/list_organization_memberships/no_options' do - organization_memberships = described_class.list_organization_memberships - - expect(organization_memberships.data.size).to eq(2) - expect(organization_memberships.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with options' do - it 'returns a list of matching users' do - request_args = [ - '/user_management/organization_memberships?user_id=user_01H5JQDV7R7ATEYZDEG0W5PRYS&'\ - 'order=desc&limit=5', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_organization_memberships/with_options' do - organization_memberships = described_class.list_organization_memberships( - user_id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS', - order: 'desc', - limit: '5', - ) - - expect(organization_memberships.data.size).to eq(1) - expect(organization_memberships.data[0].user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS') - end - end - end - end - - describe '.create_organization_membership' do - context 'with a valid payload' do - it 'creates an organization membership' do - VCR.use_cassette 'user_management/create_organization_membership/valid' do - organization_membership = described_class.create_organization_membership( - user_id: 'user_01H5JQDV7R7ATEYZDEG0W5PRYS', - organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(organization_membership.organization_id).to eq('organization_01H5JQDV7R7ATEYZDEG0W5PRYS') - expect(organization_membership.user_id).to eq('user_01H5JQDV7R7ATEYZDEG0W5PRYS') - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/create_organization_membership/invalid' do - expect do - described_class.create_organization_membership(user_id: '', organization_id: '') - end.to raise_error( - WorkOS::InvalidRequestError, - /user_id_string_required/, - ) - end - end - end - end - end - - describe '.delete_organization_membership' do - context 'with a valid id' do - it 'returns true' do - VCR.use_cassette('user_management/delete_organization_membership/valid') do - response = WorkOS::UserManagement.delete_organization_membership( - id: 'om_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(response).to be(true) - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('user_management/delete_organization_membership/invalid') do - expect do - WorkOS::UserManagement.delete_organization_membership(id: 'invalid') - end.to raise_error(WorkOS::APIError, /Organization Membership not found/) - end - end - end - end - - describe '.get_invitation' do - context 'with a valid id' do - it 'returns an invitation' do - VCR.use_cassette 'user_management/get_invitation/valid' do - invitation = described_class.get_invitation( - id: 'invitation_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(invitation.id.instance_of?(String)) - expect(invitation.instance_of?(WorkOS::Invitation)) - end - end - end - - context 'with an invalid id' do - it 'raises an error' do - VCR.use_cassette('user_management/get_invitation/invalid') do - expect do - WorkOS::UserManagement.get_invitation(id: 'invalid') - end.to raise_error(WorkOS::APIError, /Invitation not found/) - end - end - end - end - - describe '.list_invitations' do - context 'with no options' do - it 'returns invitations and metadata' do - expected_metadata = { - 'after' => nil, - 'before' => 'before_id', - } - - VCR.use_cassette 'user_management/list_invitations/with_no_options' do - invitations = described_class.list_invitations - - expect(invitations.data.size).to eq(5) - expect(invitations.list_metadata).to eq(expected_metadata) - end - end - end - - context 'with organization_id option' do - it 'forms the proper request to the API' do - request_args = [ - '/user_management/invitations?organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_invitations/with_organization_id' do - invitations = described_class.list_invitations( - organization_id: 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(invitations.data.size).to eq(1) - expect(invitations.data.first.organization_id).to eq( - 'org_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - end - end - end - - context 'with limit option' do - it 'forms the proper request to the API' do - request_args = [ - '/user_management/invitations?limit=2&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_invitations/with_limit' do - invitations = described_class.list_invitations( - limit: 2, - ) - - expect(invitations.data.size).to eq(3) - end - end - end - - context 'with before option' do - it 'forms the proper request to the API' do - request_args = [ - '/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_invitations/with_before' do - invitations = described_class.list_invitations( - before: 'invitation_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(invitations.data.size).to eq(2) - end - end - end - - context 'with after option' do - it 'forms the proper request to the API' do - request_args = [ - '/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&'\ - 'order=desc', - 'Content-Type' => 'application/json' - ] - - expected_request = Net::HTTP::Get.new(*request_args) - - expect(Net::HTTP::Get).to receive(:new).with(*request_args). - and_return(expected_request) - - VCR.use_cassette 'user_management/list_invitations/with_after' do - invitations = described_class.list_invitations( - after: 'invitation_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(invitations.data.size).to eq(2) - end - end - end - end - - describe '.send_invitation' do - context 'with valid payload' do - it 'sends an invitation' do - VCR.use_cassette 'user_management/send_invitation/valid' do - invitation = described_class.send_invitation( - email: 'test@workos.com', - ) - - expect(invitation.id).to eq('invitation_01H5JQDV7R7ATEYZDEG0W5PRYS') - expect(invitation.email).to eq('test@workos.com') - end - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/send_invitation/invalid' do - expect do - described_class.send_invitation( - email: 'invalid@workos.com', - ) - end.to raise_error( - WorkOS::APIError, - /An Invitation with the email invalid@workos.com already exists/, - ) - end - end - end - end - - describe '.revoke_invitation' do - context 'with valid payload' do - it 'revokes invitation' do - VCR.use_cassette 'user_management/revoke_invitation/valid' do - invitation = described_class.revoke_invitation( - id: 'invitation_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - - expect(invitation.id).to eq('invitation_01H5JQDV7R7ATEYZDEG0W5PRYS') - expect(invitation.email).to eq('test@workos.com') - end - end - end - - context 'with an invalid payload' do - it 'returns an error' do - VCR.use_cassette 'user_management/revoke_invitation/invalid' do - expect do - described_class.revoke_invitation( - id: 'invalid_id', - ) - end.to raise_error( - WorkOS::APIError, - /Invitation not found/, - ) - end - end - end - end - - describe '.revoke_session' do - context 'with valid payload' do - it 'revokes session' do - VCR.use_cassette 'user_management/revoke_session/valid' do - result = described_class.revoke_session( - session_id: 'session_01HRX85ATNADY1GQ053AHRFFN6', - ) - - expect(result).to be true - end - end - end - - context 'with a non-existant session' do - it 'returns an error' do - VCR.use_cassette 'user_management/revoke_session/not_found' do - expect do - described_class.revoke_session( - session_id: 'session_01H5JQDV7R7ATEYZDEG0W5PRYS', - ) - end.to raise_error( - WorkOS::APIError, - /Session not found/, - ) - end - end - end - end -end diff --git a/spec/lib/workos/webhooks_spec.rb b/spec/lib/workos/webhooks_spec.rb deleted file mode 100644 index 6154bd57..00000000 --- a/spec/lib/workos/webhooks_spec.rb +++ /dev/null @@ -1,235 +0,0 @@ -# frozen_string_literal: true - -require 'json' -require 'openssl' - -describe WorkOS::Webhooks do - before(:each) do - @payload = File.read("#{SPEC_ROOT}/support/webhook_payload.txt") - @secret = 'secret' - @timestamp = Time.at(Time.now.to_i * 1000) - unhashed_string = "#{@timestamp.to_i}.#{@payload}" - digest = OpenSSL::Digest.new('sha256') - @signature_hash = OpenSSL::HMAC.hexdigest(digest, @secret, unhashed_string) - @expectation = { - id: 'directory_user_01FAEAJCR3ZBZ30D8BD1924TVG', - state: 'active', - emails: [{ - type: 'work', - value: 'blair@foo-corp.com', - primary: true, - }], - idp_id: '00u1e8mutl6wlH3lL4x7', - object: 'directory_user', - username: 'blair@foo-corp.com', - last_name: 'Lunchford', - first_name: 'Blair', - directory_id: 'directory_01F9M7F68PZP8QXP8G7X5QRHS7', - raw_attributes: { - name: { - givenName: 'Blair', - familyName: 'Lunchford', - middleName: 'Elizabeth', - honorificPrefix: 'Ms.', - }, - title: 'Developer Success Engineer', - active: true, - emails: [{ - type: 'work', - value: 'blair@foo-corp.com', - primary: true, - }], - groups: [], - locale: 'en-US', - schemas: [ - 'urn:ietf:params:scim:schemas:core:2.0:User', - 'urn:ietf:params:scim:schemas:extension:enterprise:2.0:User' - ], - userName: 'blair@foo-corp.com', - addresses: [{ - region: 'CA', - primary: true, - locality: 'San Francisco', - postalCode: '94016', - }], - externalId: '00u1e8mutl6wlH3lL4x7', - displayName: 'Blair Lunchford', - "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { - manager: { - value: '2', - displayName: 'Kate Chapman', - }, - division: 'Engineering', - department: 'Customer Success', - }, - }, - } - end - - # rubocop:disable Metrics/BlockLength - shared_examples 'WorkOS-Signature header failures' do - context 'with an empty header' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: @payload, - sig_header: '', - secret: @secret, - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'Unable to extract timestamp and signature hash from header', - ) - end - end - - context 'with an empty signature hash' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=", - secret: @secret, - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'No signature hash found with expected scheme v1', - ) - end - end - - context 'with an incorrect signature hash' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=99999", - secret: @secret, - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'Signature hash does not match the expected signature hash for payload', - ) - end - end - - context 'with an incorrect payload' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: 'invalid', - sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}", - secret: @secret, - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'Signature hash does not match the expected signature hash for payload', - ) - end - end - - context 'with an incorrect webhook secret' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}", - secret: 'invalid', - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'Signature hash does not match the expected signature hash for payload', - ) - end - end - - context 'with a timestamp outside tolerance' do - it 'raises an error' do - expect do - described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i - (200 * 1000)}, v1=#{@signature_hash}", - secret: @secret, - ) - end.to raise_error( - WorkOS::SignatureVerificationError, - 'Timestamp outside the tolerance zone', - ) - end - end - end - # rubocop:enable Metrics/BlockLength - - describe '.construct_event' do - it_behaves_like 'WorkOS-Signature header failures' - - context 'with the correct payload, sig_header, and secret' do - it 'returns a webhook event' do - webhook = described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}", - secret: @secret, - ) - - expect(webhook.data).to eq(@expectation) - expect(webhook.event).to eq('dsync.user.created') - expect(webhook.id).to eq('wh_123') - end - end - - context 'with the correct payload, sig_header, secret, and tolerance' do - it 'returns a webhook event' do - webhook = described_class.construct_event( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}", - secret: @secret, - tolerance: 300, - ) - - expect(webhook.data).to eq(@expectation) - expect(webhook.event).to eq('dsync.user.created') - expect(webhook.id).to eq('wh_123') - end - end - end - - describe '.verify_header' do - it_behaves_like 'WorkOS-Signature header failures' - - it 'returns true when the signature is valid' do - described_class.verify_header( - payload: @payload, - sig_header: "t=#{@timestamp.to_i}, v1=#{@signature_hash}", - secret: @secret, - ) - end - end - - describe '.get_timestamp_and_signature_hash' do - it_behaves_like 'WorkOS-Signature header failures' - - it 'returns the timestamp and signature when the signature is valid' do - timestamp_int = @timestamp.to_i - timestamp_and_signature = described_class.get_timestamp_and_signature_hash( - sig_header: "t=#{timestamp_int}, v1=#{@signature_hash}", - ) - - expect(timestamp_and_signature).to eq([timestamp_int.to_s, @signature_hash]) - end - end - - describe '.compute_signature' do - it_behaves_like 'WorkOS-Signature header failures' - - it 'returns the computed signature' do - timestamp_int = @timestamp.to_i - signature = described_class.compute_signature( - timestamp: timestamp_int.to_s, - payload: @payload, - secret: @secret, - ) - - expect(signature).to eq(@signature_hash) - end - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index ae48b876..00000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') -$LOAD_PATH << File.join(File.dirname(__FILE__)) - -require 'rubygems' -require 'rspec' -require 'webmock/rspec' -require 'workos' -require 'vcr' - -# Support -Dir['./spec/support/**/*.rb'].sort.each { |f| require f } - -SPEC_ROOT = File.dirname __FILE__ - -VCR.configure do |config| - config.cassette_library_dir = 'spec/support/fixtures/vcr_cassettes' - config.filter_sensitive_data('') { WorkOS.config.key } - config.filter_sensitive_data('', :token) do |interaction| - JSON.parse(interaction.response.body)['access_token'] - end - config.filter_sensitive_data('', :token) do |interaction| - JSON.parse(interaction.response.body)['refresh_token'] - end - config.hook_into :webmock -end - -RSpec.configure do |config| - config.expect_with :rspec do |expectations| - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - config.mock_with :rspec do |mocks| - mocks.verify_partial_doubles = true - end - - config.shared_context_metadata_behavior = :apply_to_host_groups - - WebMock::API.prepend(Module.new do - extend self - - # Disable VCR when a WebMock stub is created - # for clearer spec failure messaging - def stub_request(*args) - VCR.turn_off! - super - end - end) - - config.before(:all) { WorkOS.config.key ||= '' } - config.before(:each) { VCR.turn_on! } -end diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml deleted file mode 100644 index 4f64036a..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/audit_logs/events - body: - encoding: UTF-8 - string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}' - headers: - Content-Type: "application/json" - Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" - Accept: "*/*" - User-Agent: "WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1" - Authorization: "Bearer example_api_key" - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - X-Dns-Prefetch-Control: - - "off" - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 1cf9b8e7-5910-4a6d-a333-46bcf841422e - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "16" - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:22:48 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:22:48 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml deleted file mode 100644 index c590f60d..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_custom_idempotency_key.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/audit_logs/events - body: - encoding: UTF-8 - string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}' - headers: - Content-Type: "application/json" - Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" - Accept: "*/*" - User-Agent: "WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1" - Authorization: "Bearer example_api_key" - Idempotency-Key: "idempotency_key" - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - X-Dns-Prefetch-Control: - - "off" - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 1cf9b8e7-5910-4a6d-a333-46bcf841422e - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "16" - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:22:48 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:22:48 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml deleted file mode 100644 index fb5e3a63..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/create_event_invalid.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/audit_logs/events - body: - encoding: UTF-8 - string: '{"organization_id":"org_123","event":{"action":"user.signed_in","occurred_at":"2022-08-22T15:04:19.704Z","actor":{"id":"user_123","type":"user","name":"User","metadata":{"foo":"bar"}},"targets":[{"id":"team_123","type":"team","name":"Team","metadata":{"foo":"bar"}}],"context":{"location":"1.1.1.1","user_agent":"Mozilla"}}}' - headers: - Content-Type: "application/json" - Accept-Encoding: "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" - Accept: "*/*" - User-Agent: "WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1" - Authorization: "Bearer example_api_key" - response: - status: - code: 400 - message: Bad Request - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - X-Dns-Prefetch-Control: - - "off" - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 1cf9b8e7-5910-4a6d-a333-46bcf841422e - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "16" - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:22:48 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"code":"invalid_audit_log","message":"Invalid Audit Log event","errors":[{"instancePath":"/targets/0/type","schemaPath":"#/properties/targets/allOf/0/contains/properties/type/const","keyword":"const","params":{"allowValues":["team"]},"message":"must be equal to constant","schema":"team","parentSchema":{"enum":["team"],"type":"string"},"data":"user"}]}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:22:48 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml deleted file mode 100644 index 8bd71cbc..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/create_export.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/audit_logs/exports - body: - encoding: UTF-8 - string: '{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1 - Authorization: - - "Bearer example_api_key" - response: - status: - code: 201 - message: Created - headers: - Date: - - Mon, 22 Aug 2022 17:47:49 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "26" - Connection: - - keep-alive - Cf-Ray: - - 73ed6f92c9161847-ATL - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - Cf-Cache-Status: - - DYNAMIC - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - eb09b349-08f4-b79b-ccb2-87fa4609c1ee - X-Xss-Protection: - - "0" - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"audit_log_export","id":"audit_log_export_123","state":"pending","created_at":"2022-08-22T15:04:19.704Z","updated_at":"2022-08-22T15:04:19.704Z"}' - http_version: - recorded_at: Mon, 22 Aug 2022 17:47:49 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml deleted file mode 100644 index 11e27b87..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/create_export_with_filters.yml +++ /dev/null @@ -1,77 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/audit_logs/exports - body: - encoding: UTF-8 - string: - '{"organization_id":"org_123","range_start":"2022-06-22T15:04:19.704Z","range_end":"2022-08-22T15:04:19.704Z","actions":["user.signed_in"],"actors":["Jon Smith"],"actor_names":["Jon Smith"],"actor_ids":["user_123"],"targets":["user","team"]}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1 - Authorization: - - "Bearer example_api_key" - response: - status: - code: 201 - message: Created - headers: - Date: - - Mon, 22 Aug 2022 17:47:49 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "26" - Connection: - - keep-alive - Cf-Ray: - - 73ed6f92c9161847-ATL - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - Cf-Cache-Status: - - DYNAMIC - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - eb09b349-08f4-b79b-ccb2-87fa4609c1ee - X-Xss-Protection: - - "0" - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"audit_log_export","id":"audit_log_export_123","state":"pending","created_at":"2022-08-22T15:04:19.704Z","updated_at":"2022-08-22T15:04:19.704Z"}' - http_version: - recorded_at: Mon, 22 Aug 2022 17:47:49 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml b/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml deleted file mode 100644 index 589f7377..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_logs/get_export.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/audit_logs/exports/audit_log_export_123 - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin21; v2.5.1 - Authorization: - - "Bearer example_api_key" - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 22 Aug 2022 17:47:49 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "26" - Connection: - - keep-alive - Cf-Ray: - - 73ed6f92c9161847-ATL - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - Cf-Cache-Status: - - DYNAMIC - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - eb09b349-08f4-b79b-ccb2-87fa4609c1ee - X-Xss-Protection: - - "0" - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"audit_log_export","id":"audit_log_export_123","state":"ready","url":"https://audit-logs.com/download.csv","created_at":"2022-08-22T15:04:19.704Z","updated_at":"2022-08-22T15:04:19.704Z"}' - http_version: - recorded_at: Mon, 22 Aug 2022 17:47:49 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml deleted file mode 100644 index 79c77eea..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event.yml +++ /dev/null @@ -1,65 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - b0aea387-fce0-446b-95e9-600dd869a8b0 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:24:02 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:24:02 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml deleted file mode 100644 index db658401..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_custom_idempotency_key.yml +++ /dev/null @@ -1,67 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - Idempotency-Key: - - key - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 1cf9b8e7-5910-4a6d-a333-46bcf841422e - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:22:48 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:22:48 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml deleted file mode 100644 index 1fb1b91b..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/create_event_invalid.yml +++ /dev/null @@ -1,68 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - b5e5033d-4d6c-4459-9018-4746be643113 - Request-Id: - - b5e5033d-4d6c-4459-9018-4746be643113 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '104' - Etag: - - W/"68-JY6dzr9lnqlivbnfVxCBKwKt3Zc" - Date: - - Sat, 11 Jan 2020 02:32:14 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Validation failed","errors":[{"field":"action_type","code":"action_type - must be a string"}]}' - http_version: - recorded_at: Sat, 11 Jan 2020 02:32:14 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml deleted file mode 100644 index 85957340..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_and_payload.yml +++ /dev/null @@ -1,131 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - Idempotency-Key: - - foo - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 495fd4e3-a66c-4154-8922-22fb3fb1f809 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:25:32 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:25:32 GMT -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - Idempotency-Key: - - foo - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 66cf2a20-65a5-47ae-94f9-fd215f1705a3 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:25:32 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:25:32 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml deleted file mode 100644 index 63a86e27..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/create_events_duplicate_idempotency_key_different_payload.yml +++ /dev/null @@ -1,134 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Daiki - Miyagi","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - Idempotency-Key: - - bar - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - fb5891e8-eb0c-4257-b476-c5aea60623c3 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Sat, 11 Jan 2020 04:48:06 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:48:06 GMT -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: '{"group":"Terrace House","location":"1.1.1.1","action":"house.created","action_type":"C","actor_name":"Tetsuya - Sugaya","actor_id":"user_12345","target_name":"Ryota Yamasato","target_id":"user_67890","occurred_at":"2020-01-10T15:30:00-05:00","metadata":{"a":"b"}}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - Bearer - Idempotency-Key: - - bar - response: - status: - code: 400 - message: Bad Request - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 3f060f0b-2c26-46c2-a2f8-76c4332e84aa - Request-Id: - - 3f060f0b-2c26-46c2-a2f8-76c4332e84aa - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '128' - Etag: - - W/"80-jILfJK6SRXhN8oqz8Na6yutVwHM" - Date: - - Sat, 11 Jan 2020 04:48:06 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Another idempotency key (bar) with different request parameters - was found. Please use a different idempotency key."}' - http_version: - recorded_at: Sat, 11 Jan 2020 04:48:06 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml b/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml deleted file mode 100644 index f888e16d..00000000 --- a/spec/support/fixtures/vcr_cassettes/audit_trail/get_events.yml +++ /dev/null @@ -1,61 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/events - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - X-Dns-Prefetch-Control: - - "off" - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - "" - Content-Type: - - application/json; charset=utf-8 - Etag: - - W/"1784-HtVN7X+AT30Dlt9nZrirP0nnyV8" - Date: - - Fri, 31 Jul 2020 14:41:12 GMT - Connection: - - keep-alive - Transfer-Encoding: - - chunked - body: - encoding: ASCII-8BIT - string: - '{"data":[{"object":"event","id":"evt_01EEJM9Q9SMC3W2SZDKA5VJ8XQ","group":"workos.com","location":"::1","latitude":null,"longitude":null,"type":"r","actor_name":"foo@example.com","actor_id":"user_01EEG9P7A1DA9VY9CX7GT47RPF","target_name":"api_key_query","target_id":"key_01EEG9MPHAYX46BBZKGK3BGQXJ","metadata":{"description":"User - viewed API key.","x_request_id":""},"occurred_at":"2020-07-31T14:27:00.384Z","action":{"object":"event_action","id":"evt_action_01EEGQXWAHB065P5JD0QDAAGDC","name":"user.viewed_api_key","client_id":"project_01DZB0E7HQMA6G85PQNHQJMZD0"}},{"object":"event","id":"evt_01EEJM9Q7GMR1VGT6VXN2N2JJQ","group":"workos.com","location":"::1","latitude":null,"longitude":null,"type":"r","actor_name":"foo@example.com","actor_id":"user_01EEG9P7A1DA9VY9CX7GT47RPF","target_name":"api_key_query","target_id":"key_01EEG9MPGM8KFT9VBQHJMV8YZB","metadata":{"description":"User - viewed API key.","x_request_id":""},"occurred_at":"2020-07-31T14:27:00.360Z","action":{"object":"event_action","id":"evt_action_01EEGQXWAHB065P5JD0QDAAGDC","name":"user.viewed_api_key","client_id":"project_01DZB0E7HQMA6G85PQNHQJMZD0"}}],"listMetadata":{"before":"evt_01EEJKZDAR6G4JHFQT4R3KSZDQ","after":null}}' - http_version: - recorded_at: Fri, 31 Jul 2020 14:41:12 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml b/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml deleted file mode 100644 index ca4bbfa2..00000000 --- a/spec/support/fixtures/vcr_cassettes/base/execute_request_unauthenticated.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/events - body: - encoding: UTF-8 - string: "{}" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.6.5; x86_64-darwin19; v0.1.0 - Authorization: - - 'Bearer ' - response: - status: - code: 401 - message: Unauthorized - headers: - Server: - - Cowboy - Connection: - - keep-alive - Access-Control-Allow-Origin: - - https://dashboard.workos-test.com - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 32a67a24-bfaf-4463-bf47-c407d54955d3 - Request-Id: - - 32a67a24-bfaf-4463-bf47-c407d54955d3 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '26' - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Date: - - Sat, 11 Jan 2020 03:50:27 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Unauthorized"}' - http_version: - recorded_at: Sat, 11 Jan 2020 03:50:27 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml deleted file mode 100644 index 3749a318..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/delete_directory.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/directories/directory_01F2T098SKN5PCTVSJ7CWP70N5 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin20; v0.10.3 - Authorization: - - Bearer - response: - status: - code: 202 - message: Accepted - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 834c3434-80dd-4e5e-bda7-95cd1412ad29 - Content-Type: - - text/plain; charset=utf-8 - Content-Length: - - '8' - Etag: - - W/"8-YaBXLEiT7zQxEyDYTILfiL6oPhE" - Date: - - Wed, 21 Apr 2021 22:26:51 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: Accepted - http_version: - recorded_at: Wed, 21 Apr 2021 22:26:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml deleted file mode 100644 index e75364f4..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_invalid_id.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.1 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Sun, 07 Nov 2021 19:18:31 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - - Etag: - - W/"5d-Sx4XoCfDLxkGIc0yAjSbi2ILYww" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=9UGS4Swz%2BHWvLOf0MGTCQbJyS0uBKnB72E77LfjybUN%2FXbJaDPBYfHnAUcgVM7JZbTefNquu4bG0Fw0edgQVoGnTK9OWPuO6fVKmo8XkF1G%2FNgibe8B715ZZje%2FZM7m3%2B9bEbNout5ArQfFyyQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6aa8e86f7b5a66bf-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"message":"Directory not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Sun, 07 Nov 2021 19:18:31 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml deleted file mode 100644 index ed47256e..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_directory_with_valid_id.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories/directory_01FK17DWRHH7APAFXT5B52PV0W - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 07 Nov 2021 19:18:31 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - c63229f4-faa3-4693-a769-f132af1d156e - Etag: - - W/"149-gnrinkKr5pyIOSLENIObBLph9N0" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8pe6lAa%2BE5FfpwjmgW1wU%2Fn%2BqfVS0xUHV0FKT%2Fvt%2FpQCa1A4nNwqR1hMyE9ytoi%2F3InXs3rP9ELYw%2FpJZ1Ow0uaNd3xoll7al5maCCPI1JWivjr%2Bxx6G1Otiw5iTIaAh3MXoP0pjUAnZVsf4bw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6aa8e86daa570b76-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing - Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"}' - http_version: - recorded_at: Sun, 07 Nov 2021 19:18:31 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml deleted file mode 100644 index 31a7bd35..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_group.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups/directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:49:09 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"277-8j8DgAIILf/mCF7LCmvrqcqdwK4" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 0f21c2f3-e24a-e3a2-85d3-41ee9e45b3e2 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Hnm%2BEiBTG2ROFxqX2mdwcp0HvQ173SgQlQDCmTmBQEbLv9w2dkcl2qMqYh44OSHRABBCkRfuJ2MtnHuqb6sQ5RjHRMKSCfRqklsOrgd%2FHo0PEE6mW0u%2BlZqBMIlN1BEp"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abc002fbd9f039-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"directory_group","id":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","idp_id":"01jlao4614two3d","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","organization_id":"org_01EGS4P7QR31EZ4YWD1Z1XA176","name":"Sales","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-07-13T17:45:42.618Z","raw_attributes":{"id":"01jlao4614two3d","etag":"\"SEQQBYC70u6XQ2UUjmjNYw6b0a5EzY0mTMShjiZga8A/uLYJ0Hrx1gXXVg9z-zGLBZET2Wo\"","kind":"admin#directory#group","name":"Sales","email":"sales@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sales@foo-corp.com.test-google-a.com"]}}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:49:09 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml deleted file mode 100644 index 06d79deb..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_group_with_invalid_id.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.2.3 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - bbf92391-32bd-4d77-bbdc-0e77983d04d4 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Thu, 30 Apr 2020 04:48:28 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Thu, 30 Apr 2020 04:48:28 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml deleted file mode 100644 index e00625b4..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_user.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users/directory_user_01FAZYNPC8M0HRYTKFP2GNX852 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:46:23 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '616' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 51a82273-b413-cead-b968-c07ba4d6fd08 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abbbf2b93e8ca5-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Logan - Paul Gingerich","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Gingerich","created_at":"2021-05-05T16:06:24+0000","firstName":"Logan","updated_at":"2021-11-11T05:08:14+0000","workEmail":"logan@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{},"created_at":"2021-07-19T17:57:57.268Z","updated_at":"2022-01-24T11:23:01.614Z","groups":[{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","idp_id":"5f696c8e9a63a60e965aaca8","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","name":"Team - - Platform","created_at":"2021-07-19T17:57:56.580Z","updated_at":"2022-01-24T11:23:01.333Z","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","idp_id":"5f27ada9a5e9bc0001a0ae4a","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","organization_id":"org_01FAZWCWR03DVWA83NCJYKKD54","name":"Department - - Infra","created_at":"2021-07-19T17:57:55.893Z","updated_at":"2022-01-24T11:23:01.333Z","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}}]}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:46:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml deleted file mode 100644 index f973e481..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/get_user_with_invalid_id.yml +++ /dev/null @@ -1,62 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.2.3 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Dns-Prefetch-Control: - - 'off' - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Xss-Protection: - - 1; mode=block - X-Request-Id: - - 19dfa905-2015-44fb-8d5f-46f2d6c49826 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Thu, 30 Apr 2020 04:45:35 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Thu, 30 Apr 2020 04:45:35 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml deleted file mode 100644 index 88f043f4..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_after.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?after=directory_01FGCPNV312FHFRCX0BYWHVSE1&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:16:20 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 9b8b2fde-c533-499f-8255-ae5a38dec1c9 - Etag: - - W/"57d-b8X7nQ95z8XcpGDAg30zxtq4cyU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bjisueAcX0y8T%2Bw7bzZ80xRsaJ5DYZJgfN2zGa5B24dZ%2BZPVtKMFVRMw4L9VpcpSuElvsrz9f503dDZJ46JT6sbHmUEE188lRzuHV1UC45wkzjRb%2B%2BMdPysI9473RJMX2ilURb2knzhC29H0YA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a7097287c0866e3-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure - Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing - Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FHZKS052FGZQQCZHAX0E4AC0","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Okta - SCIM Test","external_key":"z76YkVQ9vEK0AUyy","type":"okta scim v2.0","state":"linked","created_at":"2021-10-14T14:37:24.004Z","updated_at":"2021-10-27T15:50:21.248Z"},{"object":"directory","id":"directory_01FGCQE0KD0V01GB46NJ7871F7","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Azure - Test","external_key":"S16nSw4AaAyW06ia","type":"azure scim v2.0","state":"linked","created_at":"2021-09-24T20:20:02.285Z","updated_at":"2021-10-27T15:50:21.579Z"}],"list_metadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null},"listMetadata":{"before":"directory_01FGCQE0KD0V01GB46NJ7871F7","after":null}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:16:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml deleted file mode 100644 index 5af2a63b..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_before.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?before=directory_01FGCPNV312FHFRCX0BYWHVSE1&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:16:19 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - f6691c56-0bec-4224-b82c-ca59bab86bfc - Etag: - - W/"7fd-djK1P4BOpjA1geoLytAYBJmPVUE" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=QqBEPSIOhswfJhIT0bQZkAmYAUYn4aciBJ0IqnBShioQo9rrCjEqe7v0ZLpVdPgxr7acbaWOaHuUZZM3gdx1ad7S5TDNP5sMWZJCRhwBG9qxX2A678OHDThvHQQqHSFjUq7CKfKt%2F3h%2FAOKRZA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a709726ea2966dd-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FG7FERZ204FKVG0YJA2CKFNG","organization_id":"org_01FG52B571GYMYNX3JNY5X3QAK","name":"Azure - Test","external_key":"UtCjmfF8gmEiOU0O","type":"azure scim v2.0","state":"linked","created_at":"2021-09-22T19:24:26.462Z","updated_at":"2021-10-27T15:50:20.636Z","domain":"example.com"},{"object":"directory","id":"directory_01FG226GXGR369PTWYGFNDWR9D","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"JumpCloud - Test","external_key":"NRgx1V0pe8m4ai6u","type":"generic scim v2.0","state":"linked","created_at":"2021-09-20T16:56:32.434Z","updated_at":"2021-10-27T15:50:20.888Z","domain":"example.io"},{"object":"directory","id":"directory_01FFR1120F90Z4YJC29JT37VK0","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Azure","external_key":"rAaT6GNCDuyyYkKq","type":"azure - scim v2.0","state":"linked","created_at":"2021-09-16T19:23:40.419Z","updated_at":"2021-10-27T15:50:19.998Z"},{"object":"directory","id":"directory_01FE1VTQYEQF7S3T2G0R2MFHN9","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Okta - SCIM test","external_key":"JCik62hLK6CA804q","type":"okta scim v2.0","state":"linked","created_at":"2021-08-26T18:33:51.309Z","updated_at":"2021-10-27T15:50:19.921Z","domain":"example.io"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure - scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"},{"object":"directory","id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Example - Directory","external_key":"houUTobogoaaI0A0","type":"okta scim v2.0","state":"linked","created_at":"2021-07-02T18:25:06.343Z","updated_at":"2021-10-27T15:50:14.624Z"}],"list_metadata":{"before":null,"after":"directory_01FG7FERZ204FKVG0YJA2CKFNG"},"listMetadata":{"before":null,"after":"directory_01FG7FERZ204FKVG0YJA2CKFNG"}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:16:19 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml deleted file mode 100644 index 5d1893fd..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_domain.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?domain=foo-corp.com&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:03:01 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 6d450b69-226e-43b9-85e2-a9af8acc3587 - Etag: - - W/"1ae-fFF8nGLOuVotMa13kni7myHqhLI" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8ezv4P5avuKkdxcUh1hzoLa%2B%2BqrY3KNgK6vvzH8%2F57%2B3ByY9kRBf%2By1wrM7Q84StvoG4mBzl9qAmmpOPIVCiMiZjpY2rB3WJwY5ZcJ7Mc0qAHhwH5oE88orepnesd5BIZUO0hViBpvfcyJ8lfA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a7083ab7fa8ecaf-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure - scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":null,"after":null},"listMetadata":{"before":null,"after":null}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:03:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml deleted file mode 100644 index 91e88b7d..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_limit.yml +++ /dev/null @@ -1,85 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?limit=2&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:03:02 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 5ce37d38-1376-429a-9052-f8b3a20b7a1f - Etag: - - W/"32e-Omiowe6KK7MTqS3mgnIBMR53RMc" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FokV%2F1WK8Sg4dLf6m6Id%2F8wfHWKcdGsLenHbJdpxkh6Pc8TLsRsSD68RDAeDY%2FwavJ%2Bf1TjFwDsuIF%2FV2bPMJFMAqZ6uinTANK2iNXp8FGA9pM98aa9v8bekYflxceYXqDzkW8VhWtv6Wiv%2BsQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a7083b1f8086799-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure - Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing - Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"}],"list_metadata":{"before":"directory_01FK17DWRHH7APAFXT5B52PV0W","after":null},"listMetadata":{"before":"directory_01FK17DWRHH7APAFXT5B52PV0W","after":null}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:03:02 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml deleted file mode 100644 index 9cc8fb33..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_no_options.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:03:01 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 6009e44d-df2c-40f3-86ad-929ea9362079 - Etag: - - W/"cc4-a76uP4WPcu7cTLA79G0DPZmGW9Q" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=O7wQC%2B7g1ppMHWz9lao8DR2my83z8XtBX68EnYTeP8X1d4tSho2n8jpWq%2FT4xaKExSPn%2BnvlIotIUwtrZ5pkoULZQQvn1vHxHBE3eRKYZi7W0TO86ct3jtxDne%2B3FLOzLjCmkwYVgEEjkeb5Jg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a7083a96c520bef-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK3HFFGMC2WF32RR8SKWC8KA","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Azure - Set Up Test","external_key":"Ii2mw43BMAIqiKuA","type":"azure scim v2.0","state":"linked","created_at":"2021-10-28T13:29:54.451Z","updated_at":"2021-10-28T13:32:03.737Z"},{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing - Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FHZKS052FGZQQCZHAX0E4AC0","organization_id":"org_01FHRF60X0CDBB8F6A0YGSJJ2B","name":"Okta - SCIM Test","external_key":"z76YkVQ9vEK0AUyy","type":"okta scim v2.0","state":"linked","created_at":"2021-10-14T14:37:24.004Z","updated_at":"2021-10-27T15:50:21.248Z"},{"object":"directory","id":"directory_01FGCQE0KD0V01GB46NJ7871F7","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Azure - Test","external_key":"S16nSw4AaAyW06ia","type":"azure scim v2.0","state":"linked","created_at":"2021-09-24T20:20:02.285Z","updated_at":"2021-10-27T15:50:21.579Z"},{"object":"directory","id":"directory_01FGCPNV312FHFRCX0BYWHVSE1","organization_id":"org_01FGCPJPQ35DR0WGGGBEC2V1GN","name":"Jump - Cloud Test","external_key":"amuPHnduKW0WQWmc","type":"generic scim v2.0","state":"linked","created_at":"2021-09-24T20:06:50.208Z","updated_at":"2021-10-27T15:50:21.493Z"},{"object":"directory","id":"directory_01FG7FERZ204FKVG0YJA2CKFNG","organization_id":"org_01FG52B571GYMYNX3JNY5X3QAK","name":"Azure - Test","external_key":"UtCjmfF8gmEiOU0O","type":"azure scim v2.0","state":"linked","created_at":"2021-09-22T19:24:26.462Z","updated_at":"2021-10-27T15:50:20.636Z","domain":"example.com"},{"object":"directory","id":"directory_01FG226GXGR369PTWYGFNDWR9D","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"JumpCloud - Test","external_key":"NRgx1V0pe8m4ai6u","type":"generic scim v2.0","state":"linked","created_at":"2021-09-20T16:56:32.434Z","updated_at":"2021-10-27T15:50:20.888Z","domain":"example.io"},{"object":"directory","id":"directory_01FFR1120F90Z4YJC29JT37VK0","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Azure","external_key":"rAaT6GNCDuyyYkKq","type":"azure - scim v2.0","state":"linked","created_at":"2021-09-16T19:23:40.419Z","updated_at":"2021-10-27T15:50:19.998Z"},{"object":"directory","id":"directory_01FE1VTQYEQF7S3T2G0R2MFHN9","organization_id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Okta - SCIM test","external_key":"JCik62hLK6CA804q","type":"okta scim v2.0","state":"linked","created_at":"2021-08-26T18:33:51.309Z","updated_at":"2021-10-27T15:50:19.921Z","domain":"example.io"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure - scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":"before-id","after":null},"listMetadata":{"before":"before-id","after":null}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:03:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml deleted file mode 100644 index 99868832..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_directories/with_search.yml +++ /dev/null @@ -1,85 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directories?order=desc&search=Testing - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v1.6.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 31 Oct 2021 23:16:19 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 11c4f81a-6849-4809-8c57-a3d1b56612eb - Etag: - - W/"2f8-aWsjddKqVKL34/+wL752xfuiH2Q" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=t8d6LCrGu92dvmMmTECbvhqH82TcvvWNxTw%2Bz6jGMz8S0Y7mg91uXsTylK4KEs9uMr5gnnYAi%2FHAq1FwNpt5MoYMFTqfR1wDpE3UIsNusj%2F1TxwAUwx2J3BclqJl0riP44WITzFLdv66r3kd1g%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6a7097250eb40baf-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400, h3-28=":443"; ma=86400, h3-27=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory","id":"directory_01FK17DWRHH7APAFXT5B52PV0W","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Testing - Active Attribute","external_key":"QArgyQQkq4G0MquM","type":"azure scim v2.0","state":"linked","created_at":"2021-10-27T15:55:47.856Z","updated_at":"2021-10-27T16:03:43.990Z","domain":"example.me"},{"object":"directory","id":"directory_01FCV1FRW3D93X8VBZBCAQWEVS","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Testing","external_key":"p2TZ3heuEoyU2kWk","type":"azure - scim v2.0","state":"linked","created_at":"2021-08-11T16:42:20.416Z","updated_at":"2021-10-27T15:50:19.430Z","domain":"foo-corp.com"}],"list_metadata":{"before":null,"after":null},"listMetadata":{"before":null,"after":null}}' - http_version: - recorded_at: Sun, 31 Oct 2021 23:16:19 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml deleted file mode 100644 index 4c12cd3e..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_after.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?after=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 07 Jun 2022 22:28:36 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '1163' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"15fc-zBhUbLZyJQxiq8umMaogT0kzj/8" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f3944a4c-8532-4b6a-196a-84ee38216e1b - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=1YP42SeOofST3UnTgCIrEFd696HKzEJZ8n%2BBstJNNpMA98mb0YLj3fWYfmEA7eO5zxgderbhiUaenVJ9XVHdxOrOqKVitgdDejHBmbTFCceoPJf%2BQoH4wH6aOuSDALnFIe9cPUIsWo3nhxVpvg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cd2605c599ecb-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory_group","id":"directory_group_01G2Z8D5VBM14YQKFY02DHGFHD","idp_id":"01fob9te1lgjaw4","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Security","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"01fob9te1lgjaw4","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/i0mPa7pjMhSlP3jSyX-lRL7ScU8\"","kind":"admin#directory#group","name":"Security","email":"security@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["security@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5SAKF3GXE9BTR6KZCJR","idp_id":"028h4qwu0uyrb9k","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Risk - Management","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"028h4qwu0uyrb9k","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/F0K5jmtHPYux11G_e7no2r29804\"","kind":"admin#directory#group","name":"Risk - Management","email":"risk@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["risk@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5P1AFTJ8XK16RQ1FKWD","idp_id":"02szc72q2sp1i88","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Michael - Youngs Group","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02szc72q2sp1i88","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/nF7tojOSI2G7C_nIp74DiIKrzbs\"","kind":"admin#directory#group","name":"Michael - Youngs Group","email":"michaelyoungsgroup@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["Michaelyoungsgroup@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5MBRDS85VWEHFHF74SZ","idp_id":"01y810tw1ti9q8c","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Marketing","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"01y810tw1ti9q8c","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/41snDYeG-HeWJ3n0Q3SGWwlvUpo\"","kind":"admin#directory#group","name":"Marketing","email":"marketing@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["marketing@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5JD50HDRNPDYB8VWXSE","idp_id":"02xcytpi45aqkmr","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Finance","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02xcytpi45aqkmr","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/fjF75r0GGL7S9fWA5ngkflNIduQ\"","kind":"admin#directory#group","name":"Finance","email":"finance@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["finance@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5F80M4DEMGGMFPHV4XV","idp_id":"03as4poj49cz6j9","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Documentation","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"03as4poj49cz6j9","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/-sI8PUONUvqYWMpmaVCxKjp8YBY\"","kind":"admin#directory#group","name":"Documentation","email":"docs@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["docs@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D59X1K7Q38CJCN0T9KPR","idp_id":"02iq8gzs1b2i1ae","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Contractors","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02iq8gzs1b2i1ae","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/JHD88ylaaIXdP90ob6UHKZ_PYHo\"","kind":"admin#directory#group","name":"Contractors","email":"contractors@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["contractors@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D586TSJBGTFJ5SGS3BAC","idp_id":"03fwokq01u3hhmd","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sync - Delay Test All Users","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"03fwokq01u3hhmd","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/reGSvbZ45OETFOEVxJtCcqUYi3A\"","kind":"admin#directory#group","name":"Sync - Delay Test All Users","email":"allusers@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["allusers@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D50AEFFZHKBFNRE0Y16C","idp_id":"041mghml1ld1sg5","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sync - Delay 2","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"041mghml1ld1sg5","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/5tCYHwRu-uImFIfoexVJvinM9rM\"","kind":"admin#directory#group","name":"Sync - Delay 2","email":"sd2@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sd2@foo-corp.com.test-google-a.com"]}}],"list_metadata":{"before":"directory_group_01G2Z8D50AEFFZHKBFNRE0Y16C","after":null},"listMetadata":{"before":"directory_group_01G2Z8D50AEFFZHKBFNRE0Y16C","after":null}}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:28:36 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml deleted file mode 100644 index 4300c26a..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_before.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?before=directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG&directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 07 Jun 2022 22:28:36 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '1244' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"190a-JonqCohX6cL7n0wcQQA8Kg+TPEE" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 82d22803-f18d-3631-8423-6656d7140a01 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FhQofzBw3L0rL%2BFOl1ANeGyokRua2ZrLG6GhpGAfljx6D7qHsvDTHxGiC%2BfeyodCbzXyK5u0rsbEH5WBkLPsbVH%2BnCUHm%2FcQRJ1cCam7OloBoWYNCS5oqkk4n0dVg2KvRF2Pk6lsnnYViryjhw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cd25e4bdc9f12-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory_group","id":"directory_group_01G2Z8D4Z78331QJ6NS4SS23R2","idp_id":"03ep43zb4k5jctj","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Top - Level Testing Group","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"03ep43zb4k5jctj","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/Rv3rXSfY7UNiJs3Pr3ZQF_awbJs\"","kind":"admin#directory#group","name":"Top - Level Testing Group","email":"top-level-testing-group@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["top-level-testing-group@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4YNGM52FAMCN957G2MN","idp_id":"02u6wntf1dyjihd","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Solutions - Engineering","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"02u6wntf1dyjihd","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/5l7SbdbosPbGq61b1rf0xJ7uVv4\"","kind":"admin#directory#group","name":"Solutions - Engineering","email":"solutions@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["solutions@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4Y3CBBJ0A3NFGRKYGHJ","idp_id":"01baon6m2km2f35","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"All - users add test","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"01baon6m2km2f35","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/mRuvBpx11GHfb70eGtUSI9PTi7Y\"","kind":"admin#directory#group","name":"All - users add test","email":"auad1@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["auad1@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4WVTPFCAAY49PWKXJ8G","idp_id":"04du1wux3xtq7g3","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"nested-testing-group","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"04du1wux3xtq7g3","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/wVI7nPHi3T9SxQSeubz8XktrUrA\"","kind":"admin#directory#group","name":"nested-testing-group","email":"nested-testing-group@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"3","nonEditableAliases":["nested-testing-group@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4WBJAZ5KNPHN9RNC3NN","idp_id":"03hv69ve1ssgpby","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Product","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"03hv69ve1ssgpby","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/akv0W7AtILwAbK00X1pIhnOcYz0\"","kind":"admin#directory#group","name":"Product","email":"product@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["product@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4VSSEM22MQ9GXMJFRWQ","idp_id":"045jfvxd1049v32","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Partnerships","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"045jfvxd1049v32","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/A3klhKGDCgS_gA9TeU3-CmtPuOA\"","kind":"admin#directory#group","name":"Partnerships","email":"partnerships@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["partnerships@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4TXW3JPSK425M710KRM","idp_id":"03dy6vkm1y2alqi","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Design","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"03dy6vkm1y2alqi","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/fFPsJbCjOImSDOp5Krvi2NKdjIY\"","kind":"admin#directory#group","name":"Design","email":"design@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["design@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4SF1Q3JSKQ3ATXXRM6S","idp_id":"030j0zll1b5a1gf","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Engineering","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"030j0zll1b5a1gf","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/FMy2bHceMX55_T9U8C44ZRK7l3U\"","kind":"admin#directory#group","name":"Engineering","email":"engineering@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"4","nonEditableAliases":["engineering@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4RA97JQ3ECAK7T9DN8J","idp_id":"04iylrwe0qvafhv","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"David - Testing Group","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"04iylrwe0qvafhv","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/YJOEah4Cy1mft4AbEfWfvAXsHDs\"","kind":"admin#directory#group","name":"David - Testing Group","email":"davidtesting@foo-corp.com","description":"Group description","adminCreated":true,"directMembersCount":"5","nonEditableAliases":["davidtesting@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4PCZPAAB9CGS8EB34G5","idp_id":"00gjdgxs2s95kg4","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Admins","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"00gjdgxs2s95kg4","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/Un_xfweaPs74WQWtUQJesHlOKAk\"","kind":"admin#directory#group","name":"Admins","email":"admins@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"3","nonEditableAliases":["admins@foo-corp.com.test-google-a.com"]}}],"list_metadata":{"before":"directory_group_01G2Z8D4PCZPAAB9CGS8EB34G5","after":"directory_group_01G2Z8D4Z78331QJ6NS4SS23R2"},"listMetadata":{"before":"directory_group_01G2Z8D4PCZPAAB9CGS8EB34G5","after":"directory_group_01G2Z8D4Z78331QJ6NS4SS23R2"}}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:28:36 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml deleted file mode 100644 index c122604e..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_directory.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 07 Jun 2022 22:28:36 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '1243' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"1841-2gkLQD4hUD6PBarO4U2C81W0gKg" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - e3f3c46f-ede7-b953-5759-8ea11b26f399 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=JPK0RC%2FHk5EEQXYqzHAsvuafRQM1lOQtie9k7un6jLH6mDrH3GNtRLL99bjIp0fpa4J5mPxskq0IhgW2y7eBFmCxdz1LiC1zVmvf%2ForQan9eMf5Z2Gx5Tup6zbAUlAAWV6j7ABycBL%2B%2B9VfUmQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cd25c2b619f1f-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory_group","id":"directory_group_01G2Z8D5VBM14YQKFY02DHGFHD","idp_id":"01fob9te1lgjaw4","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Security","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"01fob9te1lgjaw4","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/i0mPa7pjMhSlP3jSyX-lRL7ScU8\"","kind":"admin#directory#group","name":"Security","email":"security@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["security@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5SAKF3GXE9BTR6KZCJR","idp_id":"028h4qwu0uyrb9k","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Risk - Management","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"028h4qwu0uyrb9k","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/F0K5jmtHPYux11G_e7no2r29804\"","kind":"admin#directory#group","name":"Risk - Management","email":"risk@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["risk@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5P1AFTJ8XK16RQ1FKWD","idp_id":"02szc72q2sp1i88","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Michael - Youngs Group","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02szc72q2sp1i88","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/nF7tojOSI2G7C_nIp74DiIKrzbs\"","kind":"admin#directory#group","name":"Michael - Youngs Group","email":"michaelyoungsgroup@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["Michaelyoungsgroup@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5MBRDS85VWEHFHF74SZ","idp_id":"01y810tw1ti9q8c","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Marketing","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"01y810tw1ti9q8c","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/41snDYeG-HeWJ3n0Q3SGWwlvUpo\"","kind":"admin#directory#group","name":"Marketing","email":"marketing@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["marketing@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5JD50HDRNPDYB8VWXSE","idp_id":"02xcytpi45aqkmr","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Finance","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02xcytpi45aqkmr","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/fjF75r0GGL7S9fWA5ngkflNIduQ\"","kind":"admin#directory#group","name":"Finance","email":"finance@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["finance@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5F80M4DEMGGMFPHV4XV","idp_id":"03as4poj49cz6j9","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Documentation","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"03as4poj49cz6j9","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/-sI8PUONUvqYWMpmaVCxKjp8YBY\"","kind":"admin#directory#group","name":"Documentation","email":"docs@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["docs@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D59X1K7Q38CJCN0T9KPR","idp_id":"02iq8gzs1b2i1ae","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Contractors","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"02iq8gzs1b2i1ae","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/JHD88ylaaIXdP90ob6UHKZ_PYHo\"","kind":"admin#directory#group","name":"Contractors","email":"contractors@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["contractors@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D586TSJBGTFJ5SGS3BAC","idp_id":"03fwokq01u3hhmd","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sync - Delay Test All Users","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"03fwokq01u3hhmd","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/reGSvbZ45OETFOEVxJtCcqUYi3A\"","kind":"admin#directory#group","name":"Sync - Delay Test All Users","email":"allusers@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["allusers@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D50AEFFZHKBFNRE0Y16C","idp_id":"041mghml1ld1sg5","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sync - Delay 2","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"041mghml1ld1sg5","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/5tCYHwRu-uImFIfoexVJvinM9rM\"","kind":"admin#directory#group","name":"Sync - Delay 2","email":"sd2@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sd2@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","idp_id":"01jlao4614two3d","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sales","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"01jlao4614two3d","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/uLYJ0Hrx1gXXVg9z-zGLBZET2Wo\"","kind":"admin#directory#group","name":"Sales","email":"sales@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sales@foo-corp.com.test-google-a.com"]}}],"list_metadata":{"before":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","after":null},"listMetadata":{"before":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","after":null}}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:28:36 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml deleted file mode 100644 index 33f79b66..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_limit.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?directory=directory_01G2Z8ADK5NPMVTWF48MVVE4HT&limit=2&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 07 Jun 2022 22:52:29 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '535' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"56b-KvIBGDPohNpRGKEuGxgDZ///hJs" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - b47d9803-9cf2-54c0-e486-7ccfd9c0e907 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=vSG1OnIauGCT8ZAsX5cDWB039V9IkDGSonMdZpLOKLLen1RYfIjaFTYr%2FecbDYVEqbjnY%2BMVcT3R4G5DIopjOZ8Ebtjl3FMcHXmFzr0Hvbnp7BkiTqo4xgAP2rWkLYThrztmMUWMEPWYc%2FURsg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cf558df300c3d-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory_group","id":"directory_group_01G2Z8D5VBM14YQKFY02DHGFHD","idp_id":"01fob9te1lgjaw4","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Security","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"01fob9te1lgjaw4","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/i0mPa7pjMhSlP3jSyX-lRL7ScU8\"","kind":"admin#directory#group","name":"Security","email":"security@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["security@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D5SAKF3GXE9BTR6KZCJR","idp_id":"028h4qwu0uyrb9k","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Risk - Management","created_at":"2022-05-13T17:45:32.577Z","updated_at":"2022-06-07T17:45:36.258Z","raw_attributes":{"id":"028h4qwu0uyrb9k","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/F0K5jmtHPYux11G_e7no2r29804\"","kind":"admin#directory#group","name":"Risk - Management","email":"risk@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"0","nonEditableAliases":["risk@foo-corp.com.test-google-a.com"]}}],"list_metadata":{"before":"directory_group_01G2Z8D5SAKF3GXE9BTR6KZCJR","after":null},"listMetadata":{"before":"directory_group_01G2Z8D5SAKF3GXE9BTR6KZCJR","after":null}}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:52:29 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml deleted file mode 100644 index 3f8bc762..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_no_options.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Tue, 07 Jun 2022 22:28:35 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '219' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"db-gphk1TAe8P3eXtQnl1v8qxKQjZs" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 0e9b2e8d-129e-8cd7-c4a3-078f18455441 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rolm9dOV9PPapql1sEHtD4Pxu5K%2BTSSv9bNRONOED4qxiBE5Vc6TfLylhv1o%2F9bJz90IQmRlzm%2BtQRgd8gBOPag8j8rxue7PfVNAyiBLaY5nqLUUwtb64q9UTRBUGbncG7SUNxtqPSHjjRznrw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cd25a3c3a9eca-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"message":"Validation failed","errors":[{"field":"directory","code":"Please - provide either \"directory\" or \"user\" parameters."},{"field":"user","code":"Please - provide either \"directory\" or \"user\" parameters."}]}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:28:35 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml deleted file mode 100644 index 845866d5..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_groups/with_user.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_groups?order=desc&user=directory_user_01G2Z8D4FDB28ZNSRRBVCF2E0P - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 07 Jun 2022 22:48:29 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '612' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"74a-JABiWu66XPEPqE+CDJ+LFYrX/Hk" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (664a92218d61) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 7d909909-c03b-ab72-02b3-ec7385d008de - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=m9ozUh%2F7%2FiIWkqLPDWhF9aDd1CTE9Gv%2BMhuCdh%2Binj7dHVBAUTML3swCnyIXiCnOhTdSSx8IIrUM%2B5q2WRd3HFw%2FnZ7c7aKhd2lEqTh4NZohxhuKiLz9CIcnbcbUuo0HkOeRNenlqBdnxhRwWA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 717cef8159a993e9-DFW - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"directory_group","id":"directory_group_01G2Z8D4ZR8RJ03Y1W7P9K8NMG","idp_id":"01jlao4614two3d","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Sales","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"01jlao4614two3d","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/uLYJ0Hrx1gXXVg9z-zGLBZET2Wo\"","kind":"admin#directory#group","name":"Sales","email":"sales@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"1","nonEditableAliases":["sales@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4TXW3JPSK425M710KRM","idp_id":"03dy6vkm1y2alqi","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Design","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"03dy6vkm1y2alqi","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/fFPsJbCjOImSDOp5Krvi2NKdjIY\"","kind":"admin#directory#group","name":"Design","email":"design@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"2","nonEditableAliases":["design@foo-corp.com.test-google-a.com"]}},{"object":"directory_group","id":"directory_group_01G2Z8D4PCZPAAB9CGS8EB34G5","idp_id":"00gjdgxs2s95kg4","directory_id":"directory_01G2Z8ADK5NPMVTWF48MVVE4HT","name":"Admins","created_at":"2022-05-13T17:45:31.732Z","updated_at":"2022-06-07T17:45:35.739Z","raw_attributes":{"id":"00gjdgxs2s95kg4","etag":"\"DaDAXuEwpvygu_Ul-89tlT4iVJBEvO3LZpQ0lrbYRrc/Un_xfweaPs74WQWtUQJesHlOKAk\"","kind":"admin#directory#group","name":"Admins","email":"admins@foo-corp.com","description":"","adminCreated":true,"directMembersCount":"3","nonEditableAliases":["admins@foo-corp.com.test-google-a.com"]}}],"list_metadata":{"before":null,"after":null},"listMetadata":{"before":null,"after":null}}' - http_version: - recorded_at: Tue, 07 Jun 2022 22:48:29 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml deleted file mode 100644 index b9b4f84b..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_after.yml +++ /dev/null @@ -1,186 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users?after=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 17:40:53 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 7077a5fa-612c-4e79-9c8f-f023e91c0478 - Etag: - - W/"25b2-5RmyJGVmMYCXhCM7c6dJtsTkYO8" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=VaJiLsTSS%2B6C9T8F1J5qbkIMTFIAud3HLWKwrvtGDqvy1OPthVZ4YtYNnZCaNkSA6WG4fQ0quxXg9pg5lNSR0Lhcn0jgb7AOUcVeSO%2B1Tk3Z3%2FJKq6sV8ciJXj1CTqHtNjcOuURLbOfZrqVl%2BQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c2c5a75f520bc4-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","listMetadata":{"before":"directory_user_01FC73296N43TB1NW9J9CQ8AHT","after":null},"data":[{"object":"directory_user","id":"directory_user_01FC73296N43TB1NW9J9CQ8AHT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6104db3b6246f63d0df47ac5","username":"dave.liu@workos.com","emails":[{"primary":true,"value":"dave.liu@workos.com"}],"first_name":"Dave","last_name":"Liu","job_title":"Software Engineer","state":"active","created_at":"2021-07-31T05:10:19+0000","updated_at":"2021-07-31T08:02:36+0000","raw_attributes":{"id":"6104db3b6246f63d0df47ac5","name":"Dave - Liu","teams":["5f696c8e9a63a60e965aaca8","6101bf5fa9e1adf3c668a1ad","6104da936b1079a2e20debb5","6104daab1a8ff9a9f023a689","6104dae33d1730d92ca27c51"],"spokeId":null,"lastName":"Liu","firstName":"Dave","workEmail":"dave.liu@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FBXGP7AM2ZTG9C2NT96E0T8B","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Neque viverra justo nec - ultrices dui sapien. Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt - vitae semper quis lectus. Aliquet enim tortor at auctor urna nunc id cursus - metus. Sapien et ligula ullamcorper malesuada proin. Tellus pellentesque eu - tincidunt tortor aliquam nulla facilisi cras. Id aliquet risus feugiat in - ante. Consectetur adipiscing elit duis tristique sollicitudin nibh sit amet. - Eleifend mi in nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo - sed egestas egestas fringilla. Quis eleifend quam adipiscing vitae proin sagittis. - Amet facilisis magna etiam tempor orci. Quam nulla porttitor massa id neque. - Laoreet sit amet cursus sit amet dictum sit amet. Scelerisque eleifend donec - pretium vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet - purus gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat - est velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","raw_attributes":{"id":"6104dae33d1730d92ca27c51","name":"Lorem - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Neque viverra justo nec ultrices dui sapien. - Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt vitae semper - quis lectus. Aliquet enim tortor at auctor urna nunc id cursus metus. Sapien - et ligula ullamcorper malesuada proin. Tellus pellentesque eu tincidunt tortor - aliquam nulla facilisi cras. Id aliquet risus feugiat in ante. Consectetur - adipiscing elit duis tristique sollicitudin nibh sit amet. Eleifend mi in - nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo sed egestas egestas - fringilla. Quis eleifend quam adipiscing vitae proin sagittis. Amet facilisis - magna etiam tempor orci. Quam nulla porttitor massa id neque. Laoreet sit - amet cursus sit amet dictum sit amet. Scelerisque eleifend donec pretium - vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet purus - gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat est - velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP79EJAYKW0WS9JCK1V6E","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Fight Club","raw_attributes":{"id":"6104daab1a8ff9a9f023a689","name":"Fight - Club","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP743J13S0CNRM84M8RZT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Party Planners","raw_attributes":{"id":"6104da936b1079a2e20debb5","name":"Party - Planners","parent":null}},{"object":"directory_group","id":"directory_group_01FBQDKP34JY5AWYYMZT3ME8VX","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - The Best Team","raw_attributes":{"id":"6101bf5fa9e1adf3c668a1ad","name":"The - Best Team","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 17:40:53 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml deleted file mode 100644 index 78504603..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_before.yml +++ /dev/null @@ -1,88 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users?before=directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF&directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 17:40:52 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 429298f1-659a-45d4-be75-7fc7af8def7d - Etag: - - W/"8dc-bUq/ea3T9pcZBOpZ/yYPHrEhh3k" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=7NNLKAJOPN0IObmEqZaikaYDnp8fIe4SYh4GMEW1urJYFu3DIEK5L38iIDVUlcSXokBwnFOk%2BzvwByh%2BU5tmFY27BTo84CxqYVt4aYmCunLwgc4G84acdsNZwuydcDuF6pbBDuQ7gBdTuj2ehw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c2c5a4c8970b71-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","listMetadata":{"before":null,"after":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852"},"data":[{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","created_at":"2021-05-05T16:06:24+0000","updated_at":"2021-07-19T19:17:52+0000","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Logan - Paul Gingerich","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Gingerich","firstName":"Logan","workEmail":"logan@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{"department":"Infra"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Infra","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8DYPEWZ0BSHBA21RM","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f27ada8a5e9bc0001a0adcf","username":"workos@test.com","emails":[{"primary":true,"value":"workos@test.com"}],"first_name":"Michael","last_name":"Grinich","job_title":"CEO","state":"active","created_at":"2020-08-03T06:24:40+0000","updated_at":"2021-07-07T08:50:53+0000","raw_attributes":{"id":"5f27ada8a5e9bc0001a0adcf","name":"Michael - Grinich","teams":[],"spokeId":null,"lastName":"Grinich","firstName":"Michael","workEmail":"workos@test.com","department":"Marketing","departmentId":"5f27ada9a5e9bc0001a0ae4e"},"custom_attributes":{"department":"Marketing"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNMWS67E66CD01E7A1PC4","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Marketing","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4e","name":"Marketing","parent":null}}]}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 17:40:52 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml deleted file mode 100644 index fa943f99..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_directory.yml +++ /dev/null @@ -1,194 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 17:36:11 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 7bec1c90-22f4-482d-81c2-484bdd0c7d33 - Etag: - - W/"32ac-tppjb9CvAhoQDyAQeujCJrrMZLQ" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=6PJUMNnvc7Ear%2FtCtz8uML%2F6roM0a5DvAYUo9VOlOZebpMPWW3rffAM2scIUyh%2Bnvo7PUXUK3eVx34Z6HMi%2Bwd8Y5BuMj7LF23oJaAtTjFY4V9xIza3avCksCayUGk%2BG2TXIR4sqYqSOP0pb3w%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c2bec519580e6a-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory_user","id":"directory_user_01FC73296N43TB1NW9J9CQ8AHT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6104db3b6246f63d0df47ac5","username":"dave.liu@workos.com","emails":[{"primary":true,"value":"dave.liu@workos.com"}],"first_name":"Dave","last_name":"Liu","job_title":"Software Engineer","state":"active","created_at":"2021-07-31T05:10:19+0000","updated_at":"2021-07-31T08:02:36+0000","raw_attributes":{"id":"6104db3b6246f63d0df47ac5","name":"Dave - Liu","teams":["5f696c8e9a63a60e965aaca8","6101bf5fa9e1adf3c668a1ad","6104da936b1079a2e20debb5","6104daab1a8ff9a9f023a689","6104dae33d1730d92ca27c51"],"spokeId":null,"lastName":"Liu","firstName":"Dave","workEmail":"dave.liu@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FBXGP7AM2ZTG9C2NT96E0T8B","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Neque viverra justo nec - ultrices dui sapien. Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt - vitae semper quis lectus. Aliquet enim tortor at auctor urna nunc id cursus - metus. Sapien et ligula ullamcorper malesuada proin. Tellus pellentesque eu - tincidunt tortor aliquam nulla facilisi cras. Id aliquet risus feugiat in - ante. Consectetur adipiscing elit duis tristique sollicitudin nibh sit amet. - Eleifend mi in nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo - sed egestas egestas fringilla. Quis eleifend quam adipiscing vitae proin sagittis. - Amet facilisis magna etiam tempor orci. Quam nulla porttitor massa id neque. - Laoreet sit amet cursus sit amet dictum sit amet. Scelerisque eleifend donec - pretium vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet - purus gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat - est velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","raw_attributes":{"id":"6104dae33d1730d92ca27c51","name":"Lorem - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Neque viverra justo nec ultrices dui sapien. - Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt vitae semper - quis lectus. Aliquet enim tortor at auctor urna nunc id cursus metus. Sapien - et ligula ullamcorper malesuada proin. Tellus pellentesque eu tincidunt tortor - aliquam nulla facilisi cras. Id aliquet risus feugiat in ante. Consectetur - adipiscing elit duis tristique sollicitudin nibh sit amet. Eleifend mi in - nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo sed egestas egestas - fringilla. Quis eleifend quam adipiscing vitae proin sagittis. Amet facilisis - magna etiam tempor orci. Quam nulla porttitor massa id neque. Laoreet sit - amet cursus sit amet dictum sit amet. Scelerisque eleifend donec pretium - vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet purus - gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat est - velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP79EJAYKW0WS9JCK1V6E","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Fight Club","raw_attributes":{"id":"6104daab1a8ff9a9f023a689","name":"Fight - Club","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP743J13S0CNRM84M8RZT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Party Planners","raw_attributes":{"id":"6104da936b1079a2e20debb5","name":"Party - Planners","parent":null}},{"object":"directory_group","id":"directory_group_01FBQDKP34JY5AWYYMZT3ME8VX","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - The Best Team","raw_attributes":{"id":"6101bf5fa9e1adf3c668a1ad","name":"The - Best Team","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f6e1d0d67a73900a6c29e15","username":"henry@workos.com","emails":[{"primary":true,"value":"henry@workos.com"}],"first_name":"Henry","last_name":"Chan","job_title":"Software Engineer","state":"active","created_at":"2020-09-25T16:38:37+0000","updated_at":"2021-07-07T08:46:02+0000","raw_attributes":{"id":"5f6e1d0d67a73900a6c29e15","name":"Henry - Chan","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Chan","firstName":"Henry","workEmail":"henry@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8M0HRYTKFP2GNX852","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6092c280a3f1e19ef6d8cef8","username":"logan@workos.com","emails":[{"primary":true,"value":"logan@workos.com"}],"first_name":"Logan","last_name":"Gingerich","job_title":"Developer Success Engineer","state":"active","created_at":"2021-05-05T16:06:24+0000","updated_at":"2021-07-19T19:17:52+0000","raw_attributes":{"id":"6092c280a3f1e19ef6d8cef8","name":"Logan - Paul Gingerich","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Gingerich","firstName":"Logan","workEmail":"logan@workos.com","department":"Infra","departmentId":"5f27ada9a5e9bc0001a0ae4a"},"custom_attributes":{"department":"Infra"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNN1NZWMBRAXXDSTB5NFH","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Infra","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4a","name":"Infra","parent":"5f27ada9a5e9bc0001a0ae48"}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8DYPEWZ0BSHBA21RM","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f27ada8a5e9bc0001a0adcf","username":"workos@test.com","emails":[{"primary":true,"value":"workos@test.com"}],"first_name":"Michael","last_name":"Grinich","job_title":"CEO","state":"active","created_at":"2020-08-03T06:24:40+0000","updated_at":"2021-07-07T08:50:53+0000","raw_attributes":{"id":"5f27ada8a5e9bc0001a0adcf","name":"Michael - Grinich","teams":[],"spokeId":null,"lastName":"Grinich","firstName":"Michael","workEmail":"workos@test.com","department":"Marketing","departmentId":"5f27ada9a5e9bc0001a0ae4e"},"custom_attributes":{"department":"Marketing"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNMWS67E66CD01E7A1PC4","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Marketing","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae4e","name":"Marketing","parent":null}}]}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 17:36:11 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml deleted file mode 100644 index e445d34d..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_group.yml +++ /dev/null @@ -1,186 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users?group=directory_group_01FBXGP79EJAYKW0WS9JCK1V6E&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 17:43:06 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - b28d9d07-dc0d-4177-90b8-1ca2e6ad16e3 - Etag: - - W/"258b-TDvtW7zDvbYuZdWKeuyMG81fF4M" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=NyMWn6qw%2F8J517ZNHJhdMcl0UcJUbuX7WkWKCMjp6ftJ8fpIkqWSwVPWVog50K6RGzaS07i9JmdyOqlXTYgjWo%2Bix4ZS0WxYhLjMMiWPsvvcBQkaOAKpB9r0vL8pNA5F%2BH%2BeKzhdgx%2F3u47t1Q%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c2c8e75b50ec7a-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","listMetadata":{"before":null,"after":null},"data":[{"object":"directory_user","id":"directory_user_01FC73296N43TB1NW9J9CQ8AHT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6104db3b6246f63d0df47ac5","username":"dave.liu@workos.com","emails":[{"primary":true,"value":"dave.liu@workos.com"}],"first_name":"Dave","last_name":"Liu","job_title":"Software Engineer","state":"active","created_at":"2021-07-31T05:10:19+0000","updated_at":"2021-07-31T08:02:36+0000","raw_attributes":{"id":"6104db3b6246f63d0df47ac5","name":"Dave - Liu","teams":["5f696c8e9a63a60e965aaca8","6101bf5fa9e1adf3c668a1ad","6104da936b1079a2e20debb5","6104daab1a8ff9a9f023a689","6104dae33d1730d92ca27c51"],"spokeId":null,"lastName":"Liu","firstName":"Dave","workEmail":"dave.liu@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FBXGP7AM2ZTG9C2NT96E0T8B","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Neque viverra justo nec - ultrices dui sapien. Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt - vitae semper quis lectus. Aliquet enim tortor at auctor urna nunc id cursus - metus. Sapien et ligula ullamcorper malesuada proin. Tellus pellentesque eu - tincidunt tortor aliquam nulla facilisi cras. Id aliquet risus feugiat in - ante. Consectetur adipiscing elit duis tristique sollicitudin nibh sit amet. - Eleifend mi in nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo - sed egestas egestas fringilla. Quis eleifend quam adipiscing vitae proin sagittis. - Amet facilisis magna etiam tempor orci. Quam nulla porttitor massa id neque. - Laoreet sit amet cursus sit amet dictum sit amet. Scelerisque eleifend donec - pretium vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet - purus gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat - est velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","raw_attributes":{"id":"6104dae33d1730d92ca27c51","name":"Lorem - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Neque viverra justo nec ultrices dui sapien. - Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt vitae semper - quis lectus. Aliquet enim tortor at auctor urna nunc id cursus metus. Sapien - et ligula ullamcorper malesuada proin. Tellus pellentesque eu tincidunt tortor - aliquam nulla facilisi cras. Id aliquet risus feugiat in ante. Consectetur - adipiscing elit duis tristique sollicitudin nibh sit amet. Eleifend mi in - nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo sed egestas egestas - fringilla. Quis eleifend quam adipiscing vitae proin sagittis. Amet facilisis - magna etiam tempor orci. Quam nulla porttitor massa id neque. Laoreet sit - amet cursus sit amet dictum sit amet. Scelerisque eleifend donec pretium - vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet purus - gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat est - velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP79EJAYKW0WS9JCK1V6E","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Fight Club","raw_attributes":{"id":"6104daab1a8ff9a9f023a689","name":"Fight - Club","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP743J13S0CNRM84M8RZT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Party Planners","raw_attributes":{"id":"6104da936b1079a2e20debb5","name":"Party - Planners","parent":null}},{"object":"directory_group","id":"directory_group_01FBQDKP34JY5AWYYMZT3ME8VX","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - The Best Team","raw_attributes":{"id":"6101bf5fa9e1adf3c668a1ad","name":"The - Best Team","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 17:43:06 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml deleted file mode 100644 index ea1edd89..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_limit.yml +++ /dev/null @@ -1,189 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/directory_users?directory=directory_01FAZYMST676QMTFN1DDJZZX87&limit=2&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 17:36:12 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 3f0bbea9-a104-41d9-8874-1cfaa40500b5 - Etag: - - W/"2a64-2f0QLR9cfINRAJthEtaNWgEMUzM" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=cfIgbm%2BpcD4MTnwWaVE2uYye00h3eAh0OwvQwGsmIYIdurSQ6Rw8YQC%2BVLJ4U8iSgVcnlH1%2FLFYTqH6EitVKKLYlw1UZnARCPz1TlnP%2FRQoOntlLA%2B5LjnbChqh6lBwDt%2FRrt4o8u2SCutj4jA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c2bece58300c46-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","listMetadata":{"before":"directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF","after":null},"data":[{"object":"directory_user","id":"directory_user_01FC73296N43TB1NW9J9CQ8AHT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"6104db3b6246f63d0df47ac5","username":"dave.liu@workos.com","emails":[{"primary":true,"value":"dave.liu@workos.com"}],"first_name":"Dave","last_name":"Liu","job_title":"Software Engineer","state":"active","created_at":"2021-07-31T05:10:19+0000","updated_at":"2021-07-31T08:02:36+0000","raw_attributes":{"id":"6104db3b6246f63d0df47ac5","name":"Dave - Liu","teams":["5f696c8e9a63a60e965aaca8","6101bf5fa9e1adf3c668a1ad","6104da936b1079a2e20debb5","6104daab1a8ff9a9f023a689","6104dae33d1730d92ca27c51"],"spokeId":null,"lastName":"Liu","firstName":"Dave","workEmail":"dave.liu@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FBXGP7AM2ZTG9C2NT96E0T8B","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod - tempor incididunt ut labore et dolore magna aliqua. Neque viverra justo nec - ultrices dui sapien. Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt - vitae semper quis lectus. Aliquet enim tortor at auctor urna nunc id cursus - metus. Sapien et ligula ullamcorper malesuada proin. Tellus pellentesque eu - tincidunt tortor aliquam nulla facilisi cras. Id aliquet risus feugiat in - ante. Consectetur adipiscing elit duis tristique sollicitudin nibh sit amet. - Eleifend mi in nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo - sed egestas egestas fringilla. Quis eleifend quam adipiscing vitae proin sagittis. - Amet facilisis magna etiam tempor orci. Quam nulla porttitor massa id neque. - Laoreet sit amet cursus sit amet dictum sit amet. Scelerisque eleifend donec - pretium vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet - purus gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat - est velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","raw_attributes":{"id":"6104dae33d1730d92ca27c51","name":"Lorem - ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt - ut labore et dolore magna aliqua. Neque viverra justo nec ultrices dui sapien. - Eu scelerisque felis imperdiet proin fermentum leo. Tincidunt vitae semper - quis lectus. Aliquet enim tortor at auctor urna nunc id cursus metus. Sapien - et ligula ullamcorper malesuada proin. Tellus pellentesque eu tincidunt tortor - aliquam nulla facilisi cras. Id aliquet risus feugiat in ante. Consectetur - adipiscing elit duis tristique sollicitudin nibh sit amet. Eleifend mi in - nulla posuere. Nec dui nunc mattis enim ut. Volutpat commodo sed egestas egestas - fringilla. Quis eleifend quam adipiscing vitae proin sagittis. Amet facilisis - magna etiam tempor orci. Quam nulla porttitor massa id neque. Laoreet sit - amet cursus sit amet dictum sit amet. Scelerisque eleifend donec pretium - vulputate sapien. Faucibus turpis in eu mi bibendum. Magna sit amet purus - gravida quis. Placerat vestibulum lectus mauris ultrices eros. Volutpat est - velit egestas dui id ornare. Aliquet eget sit amet tellus cras adipiscing - enim eu. Velit scelerisque in dictum non consectetur. Egestas fringilla phasellus - faucibus scelerisque eleifend donec pretium vulputate sapien. Malesuada nunc - vel risus commodo viverra maecenas accumsan lacus vel. Senectus et netus et - malesuada fames ac turpis. In mollis nunc sed id semper risus in hendrerit. - Phasellus faucibus scelerisque eleifend donec pretium vulputate sapien nec. - Purus semper eget duis at tellus. Et ligula ullamcorper malesuada proin libero - nunc consequat interdum varius. Odio aenean sed adipiscing diam donec adipiscing. - Pretium quam vulputate dignissim suspendisse in est ante. Orci nulla pellentesque - dignissim enim sit amet venenatis urna. Viverra aliquet eget sit amet tellus - cras adipiscing enim. Lacus viverra vitae congue eu consequat ac felis donec. - Quis ipsum suspendisse ultrices gravida dictum fusce ut. Faucibus turpis - in eu mi bibendum. Lorem sed risus ultricies tristique nulla. Habitant morbi - tristique senectus et. Vitae suscipit tellus mauris a. Id leo in vitae turpis - massa sed. In hac habitasse platea dictumst vestibulum rhoncus est pellentesque. - Ornare arcu dui vivamus arcu felis bibendum ut tristique et. Ut aliquam purus - sit amet luctus venenatis lectus magna. Mollis aliquam ut porttitor leo a - diam. Pulvinar pellentesque habitant morbi tristique senectus et netus et. - Eget felis eget nunc lobortis. Viverra adipiscing at in tellus. Morbi tempus - iaculis urna id volutpat lacus laoreet non curabitur. Nam aliquam sem et tortor. - Maecenas sed enim ut sem viverra aliquet eget sit. Nec dui nunc mattis enim. - Donec ac odio tempor orci dapibus ultrices in iaculis. Tristique risus nec - feugiat in fermentum posuere urna nec. Suscipit adipiscing bibendum est ultricies. - Magna fringilla urna porttitor rhoncus. Cum sociis natoque penatibus et magnis - dis parturient montes nascetur. Amet nulla facilisi morbi tempus iaculis. - Mattis vulputate enim nulla aliquet porttitor lacus. Adipiscing elit duis - tristique sollicitudin nibh sit. Placerat duis ultricies lacus sed turpis - tincidunt id aliquet. Ut sem viverra aliquet eget sit amet tellus. Sagittis - id consectetur purus ut faucibus pulvinar. Id faucibus nisl tincidunt eget - nullam. Sed augue lacus viverra vitae congue eu consequat ac felis. Interdum - varius sit amet mattis vulputate enim. Ut venenatis tellus in metus vulputate - eu scelerisque. Lacus sed viverra tellus in hac habitasse. Nulla facilisi - etiam dignissim diam quis. Id porta nibh venenatis cras sed felis eget velit. - Orci porta non pulvinar neque laoreet suspendisse interdum consectetur.","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP79EJAYKW0WS9JCK1V6E","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Fight Club","raw_attributes":{"id":"6104daab1a8ff9a9f023a689","name":"Fight - Club","parent":null}},{"object":"directory_group","id":"directory_group_01FBXGP743J13S0CNRM84M8RZT","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Party Planners","raw_attributes":{"id":"6104da936b1079a2e20debb5","name":"Party - Planners","parent":null}},{"object":"directory_group","id":"directory_group_01FBQDKP34JY5AWYYMZT3ME8VX","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - The Best Team","raw_attributes":{"id":"6101bf5fa9e1adf3c668a1ad","name":"The - Best Team","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]},{"object":"directory_user","id":"directory_user_01FAZYNPC8TJBP7Y2ERT51MGDF","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","idp_id":"5f6e1d0d67a73900a6c29e15","username":"henry@workos.com","emails":[{"primary":true,"value":"henry@workos.com"}],"first_name":"Henry","last_name":"Chan","job_title":"Software Engineer","state":"active","created_at":"2020-09-25T16:38:37+0000","updated_at":"2021-07-07T08:46:02+0000","raw_attributes":{"id":"5f6e1d0d67a73900a6c29e15","name":"Henry - Chan","teams":["5f696c8e9a63a60e965aaca8"],"spokeId":null,"lastName":"Chan","firstName":"Henry","workEmail":"henry@workos.com","department":"Engineering","departmentId":"5f27ada9a5e9bc0001a0ae48"},"custom_attributes":{"department":"Engineering"},"groups":[{"object":"directory_group","id":"directory_group_01FAZYNNQ4HQ6EBF29MPTH7VKB","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Team - - Platform","raw_attributes":{"id":"5f696c8e9a63a60e965aaca8","name":"Platform","parent":null}},{"object":"directory_group","id":"directory_group_01FAZYNMV2TDE78FEAH724YGMP","directory_id":"directory_01FAZYMST676QMTFN1DDJZZX87","name":"Department - - Engineering","raw_attributes":{"id":"5f27ada9a5e9bc0001a0ae48","name":"Engineering","parent":null}}]}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 17:36:12 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml deleted file mode 100644 index acef6cbf..00000000 --- a/spec/support/fixtures/vcr_cassettes/directory_sync/list_users/with_no_options.yml +++ /dev/null @@ -1,75 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/directory_users?order=desc - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.3 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - X-Dns-Prefetch-Control: - - "off" - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - "0" - X-Request-Id: - - 7ec78e21-576f-44a4-895f-bd911a3f4b04 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "222" - Etag: - - W/"de-33B+CY27z2HlOGKZPu4nzUVQpuI" - Date: - - Thu, 22 Apr 2021 21:58:34 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: - '{"message":"Validation failed","errors":[{"field":"directory","code":"Please - provide either \"directory\" or \"group\" parameters."},{"field":"group","code":"Please - provide either \"directory\" or \"group\" parameters."}]}' - http_version: - recorded_at: Thu, 22 Apr 2021 21:58:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml b/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml deleted file mode 100644 index 66ff30c5..00000000 --- a/spec/support/fixtures/vcr_cassettes/events/list_events_with_after.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/events?after=event_01FGCPNV312FHFRCX0BYWHVSE1 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:46:23 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '616' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 51a82273-b413-cead-b968-c07ba4d6fd08 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abbbf2b93e8ca5-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "list_metadata":{"after":null}}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:46:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml b/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml deleted file mode 100644 index 3d84e8a1..00000000 --- a/spec/support/fixtures/vcr_cassettes/events/list_events_with_event.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/events?events=connection.activated - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:46:23 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '616' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 51a82273-b413-cead-b968-c07ba4d6fd08 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abbbf2b93e8ca5-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "list_metadata":{"after":null}}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:46:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml b/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml deleted file mode 100644 index 2df7324a..00000000 --- a/spec/support/fixtures/vcr_cassettes/events/list_events_with_no_options.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/events - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:46:23 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '616' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 51a82273-b413-cead-b968-c07ba4d6fd08 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abbbf2b93e8ca5-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "list_metadata":{"after":null}}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:46:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml b/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml deleted file mode 100644 index 574c3949..00000000 --- a/spec/support/fixtures/vcr_cassettes/events/list_events_with_range.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/events?range_end=2023-01-03T00:00:00Z&range_start=2023-01-01T00:00:00Z - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.2; arm64-darwin21; v2.3.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Jul 2022 16:46:23 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '616' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"680-NPvBik348v8xg6EE7iZMYwD5UXw" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (b642bf20b975) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 51a82273-b413-cead-b968-c07ba4d6fd08 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=OS7ELJ3A8tkzMafvaIThD%2B5JlYmul1puZlAXTxEKYBLlq%2B6DCtqDqAi4dtr4yRP3khNmg6MwPiuLqtdOXRmPOtag9Ti%2FGK8ra%2BJOlpwkFjD965CNBfzao4EJtExDkbS3"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 72abbbf2b93e8ca5-EWR - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"event","id":"event_01FK3HFFGMC2WF32RR8SKWC8KA","event":"dsync.user.created","created_at":"2021-10-28T13:29:54.451Z","data":{"email":"foo@foocorp.com"}}], "list_metadata":{"after":null}}' - http_version: - recorded_at: Thu, 14 Jul 2022 16:46:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml deleted file mode 100644 index ba4e04e5..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_generic_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M/challenge - body: - encoding: UTF-8 - string: '{"sms_template":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:15:26 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '290' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 6f320a1f-92d8-496c-9c30-69355787d21e - Etag: - - W/"122-QtSiaXex7UKEyydEC3oPpuHzGNw" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2kePZ4Q7kGQ1by5iXZxRevmSkQq4vTbW1vXTqFev99eLBrrfEHOLK2%2FE0ItWB2GAKoQvhPBk3rhS%2FKg0rtK3ZH4DGTf%2FEQKGFPT6BxtCqQE2L%2ByfEv1AgU152ZwIBPVYjQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25a5f0dddf088d-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"object":"authentication_challenge","id":"auth_challenge_01FZ4WSWV2SCEDX3GKY1NA9YTN","created_at":"2022-03-27T05:15:26.432Z","updated_at":"2022-03-27T05:15:26.432Z","expires_at":"2022-03-27T05:25:26.434Z","code":"541295","authentication_factor_id":"auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M"}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:15:26 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml deleted file mode 100644 index 51ead07f..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_sms_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/auth_factor_01FZ4TS14D1PHFNZ9GF6YD8M1F/challenge - body: - encoding: UTF-8 - string: '{"sms_template":"Your code is {{code}}"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:03:26 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '274' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - b9c66c87-adf4-4a9a-854f-d838f966ea5c - Etag: - - W/"112-VpD9nscbxE6VOcsJlK2RHEzlq3s" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=yNaSbl1oXtixmxb7lJOn7tDKzD0mN8jSFHJmTsZfD6YTlSGeMrdBgfi3LUFeDv1ldKcdNe5eZ%2BkRrVM986RUizGOhL2xzdl2AkJEdudIRaaJCMdWbjQDmGLbC4OPFajMIA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25945b9ee639b4-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"object":"authentication_challenge","id":"auth_challenge_01FZ4W3XG1VD8ZD5TXSYQMFMSR","created_at":"2022-03-27T05:03:26.203Z","updated_at":"2022-03-27T05:03:26.203Z","expires_at":"2022-03-27T05:13:26.204Z","authentication_factor_id":"auth_factor_01FZ4TS14D1PHFNZ9GF6YD8M1F"}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:03:26 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml deleted file mode 100644 index 3686f6d8..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/challenge_factor_totp_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/auth_factor_01FZ4TS0MWPZR7GATS7KCXANQZ/challenge - body: - encoding: UTF-8 - string: '{"sms_template":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:03:25 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '234' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - f04282d0-e78a-42f8-9403-23cebbb4bb66 - Etag: - - W/"ea-SVZUKXJpb27hGw8Q2jIf8W5kZA8" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=yZfS4xxk1lbY3jrk5QxKFnwdRyRdSajEVp0nlEAoJsESmp40wQP7kosvTWU4dHccBOuEaTIEvPHXVd5buOQbKDmOhuHmVNM89nsd3ukSicS%2BhcutdMpwnTNO5xgqErdEzA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f2594595b62e46e-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"object":"authentication_challenge","id":"auth_challenge_01FZ4W3X566NPKJRNB85KHF74F","created_at":"2022-03-27T05:03:25.859Z","updated_at":"2022-03-27T05:03:25.859Z","expires_at":"2022-03-27T05:13:26.204Z","authentication_factor_id":"auth_factor_01FZ4TS0MWPZR7GATS7KCXANQZ"}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:03:25 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml b/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml deleted file mode 100644 index dd32c420..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/delete_factor.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/auth/factors/auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 204 - message: No Content - headers: - Date: - - Sun, 27 Mar 2022 19:18:03 GMT - Content-Length: - - '0' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 80c43068-a8f1-4132-9cb8-43375017ed5d - Etag: - - W/"a-bAsFyilMr4Ra1hIU5PyoyFRunpI" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=XQ3mj7g%2Bn7W16dxobD%2FNQjo7xvTl1Huh7T%2BF0Jgnk6p%2FFLlz%2BB3monRxzeVDU8oG2%2Ff81D40WjwV2e1YNqLivRnaSIB9u19O2gLXlatMVa9tjYA6XsvSIipvvmbUDPvYjQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f2a78410ca0609b-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Sun, 27 Mar 2022 19:18:03 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml deleted file mode 100644 index 9268869c..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_generic_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/enroll - body: - encoding: UTF-8 - string: '{"type":"generic_otp","totp_issuer":null,"totp_user":null,"phone_number":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:12:43 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '239' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - bd24abb9-3aa1-4106-8d6a-df425ff1d209 - Etag: - - W/"ef-wqcMjWChK4ut5ZQqtU8qO89bfTU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=iQMKZkYKfEuWDKP6gbTQAS9tfzZ9%2F%2Bre2CD6Fy1rRsuFC8Jz0dioXUQ8G95%2Bmrhlz4R6Tji1nCsXfNLiDCwFFmowX%2B%2BOf1HfeVgk10CkJcOUbBcTZ5%2BxoR6RnWaYwQrCBA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25a1f8b80430d4-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"object":"authentication_factor","id":"auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M","created_at":"2022-03-27T05:12:43.689Z","updated_at":"2022-03-27T05:12:43.689Z","type":"generic_otp"}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:12:43 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml deleted file mode 100644 index f76594a1..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_sms_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/enroll - body: - encoding: UTF-8 - string: '{"type":"sms","totp_issuer":null,"totp_user":null,"phone_number":"16073517112"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Mon, 28 Mar 2022 15:21:01 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '269' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - e71fdbab-074a-4bf3-a31d-734e6210fdb9 - Etag: - - W/"10d-s7YFa2CZnDwEUgFqpAYbiwzv0+U" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=J%2BBvROB9mj71IVd8IMQvLNpgfbJcnEsWO7yH6hwf%2Fn6S8kZeDiyTReKQlGZwK76iF%2FZeSTNAINWXatf7zB4lxEDy%2FWOesjX2kRVNDLc7rSWAC%2F0Z4wyfxW%2FZnWS6o3k9ig%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f315a63e8b76083-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"object":"authentication_factor","id":"auth_factor_01FZ8HVEV5XV0YQ0ENHWM14CCB","created_at":"2022-03-28T15:21:00.975Z","updated_at":"2022-03-28T15:21:00.975Z","type":"sms","sms":{"phone_number":"+55555555555"}}' - http_version: - recorded_at: Mon, 28 Mar 2022 15:21:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml deleted file mode 100644 index 4be279b7..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/enroll_factor_totp_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/factors/enroll - body: - encoding: UTF-8 - string: '{"type":"totp","totp_issuer":"WorkOS","totp_user":"some_user","phone_number":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 04:40:00 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - b5f94f4b-f7d0-4251-88cf-5843e9dc0689 - Etag: - - W/"1852-PXRL614j7Vn/X3IdFKgKqOVSMe8" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=LJ%2F1lJPNJg66mkvbR04zhJEIQlBW1LVeRaV4OtIwaCgRXJghmP6z%2BaoiXMEdD03wqMIZZFN13KrjaKv7Q%2FmIiahSd3o2bzXl6zHzlu%2FXDdx%2FyWo%2FMNFyeVPKsLpwJYmICw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f257208da875fe0-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"authentication_factor","id":"auth_factor_01FZ4TS0MWPZR7GATS7KCXANQZ","created_at":"2022-03-27T04:40:00.410Z","updated_at":"2022-03-27T04:40:00.410Z","type":"totp","totp":{"qr_code":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlAAAAJQCAYAAABB4lpFAAAAAklEQVR4AewaftIAABDASURBVO3B0Y0s2w0EsJJw80+57BT0zkdjsCQnScPPaptfNjP5Utu8mJn8ZW3zYmbypbb50szkl7XNl2YmL9rmSzMTftcGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDg5F8etQ3/3cyE/65tvtQ2L2YmL9rmxczkS23zYmbyYmbyl7XNi5nJl9rmL2sb/ruZyYsNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyb98bGbyy9rml81MvtQ2L2Ym/Hdt88va5sXM5Je1zYuZyYu2eTEzeTEzedE2f9nM5Je1zZc2AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJ/8CD9rmS23zpZnJl2YmL9rmxczkRdt8qW2+NDN5MTP50szkS23zYmbyom34uzYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAn/wIfmpm8aJsvtc2LmcmXZiYv2ubFzOSXtc2LtnkxM3nRNr9sZgJf2QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJz8y8faht81M/nSzORF2/yytvnSzORF23xpZvJiZvKibV60zS+bmfCdtuG/2wAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJz8y6OZCX9X27yYmbxomxczkxdt88tmJi/a5sXM5EXbfKltXsxMXrTNi5nJi7b5Utu8mJn8spkJ39kAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACc/Gsb+ErbvJiZvGibFzOTX9Y2L2YmL9rmxczkRdv8spnJi7Z5MTPhv2sbftcGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZJI0D9rmxcyE/65t+O9mJl9qm182M/lS27yYmbxomy/NTF60zYuZyYu2+ctmJvx3bfOlDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkkaR60Dd+ZmfxlbfNiZvKibb40M/lS27yYmXypbV7MTOCvapsXM5Mvtc2LDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMn0//JgZvKibf6ymQl/V9v8spnJl9rmxcyE39U2X5qZvGibL81MvtQ2L2YmX9oAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcTP8vH5qZvGibL81MXrTNl2YmL9rmxcyE/65tXsxMXrTNXzYz+VLb/LKZyZfa5sXM5EXbfGlm8qJtftnM5MUGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDg5N/M5EXbvGibL81MXrTNi5nJl9rmxczkl7XNi5nJL2ubFzOTF23zYmbCfzcz+WVt86W2eTEzedE2f9nM5EsbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAk0nS/GFt82Jm8qJt/rKZyYu2eTEzedE2X5qZ/LK2eTEz+VLbvJiZfKltvjQzedE2fGdm8qJtXsxMXrTNiw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJv7Z5MTN50TZfmpl8aWbyom2+NDP5y2YmX2qbFzOTF23zYmbyom1ezEy+1Da/bGbypZnJi7b5y2Ymf9nM5MUGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDg5F8etc0va5sXM5MXbfNiZvKibfi72ubFzORF27yYmfxlM5Nf1jYvZiZfmpm8aJtf1ja/rG1ebAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE4mSfOHtc2XZiYv2ubFzORF2/xlM5MXbfNiZvKltnkxM/llbcN3Zia/rG1ezExetM2LmclftgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADj51zYvZia/bGbyom1etM2X2ubFzOQva5tf1jZ/Wdt8aWbyy9rml7XNXzYz+VLbvJiZvGibFxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTf/lY2/xlM5Mvtc0va5sXM5MvzUy+NDP5y2YmL9rmS23zpZnJi7Z50TZfmpm8aJsXbfNiZvKXzUxebAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE7+5VHbfGlm8qJtXsxMXrTNl2YmL9rmxczkxczkRdu8mJn8srb50szkl81MvjQz+VLb/LKZyS+bmfDftc2LDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMm/mQn/Xdu8mJl8qW1ezExetM2Lmckva5sXM5MvzUxetM2XZiYv2ubFzORF23xpZsJ/NzP5y2Ymv2wDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwMv2/PJiZ8N+1zV82M3nRNi9mJi/a5sXM5Ett86WZyZfa5sXM5Je1zYuZyYu2+dLM5Ett88tmJi/a5kszkxcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAk0nSPGibFzOTF23zYmbyl7XNl2YmL9rmSzOTF23zYmbypbZ5MTN50Tb8dzOTF23zpZnJi7b50szkRdv8ZTOTF23zYgMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHDyr21ezEz+srb5y2YmL9rmL5uZfKltftnM5EXb/LKZyZdmJr9sZvKibV60zZdmJi/a5i/bAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnPzLo7Z5MTN5MTN50TZfmpl8qW1etM2Lmclf1jYvZiZ/Wdu8mJm8aJtf1ja/bGbyom1ezExetM2LmcmLtvnSzORF23xpAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcDJJmg+1zYuZyS9rmy/NTF60zZdmJi/a5kszk1/WNi9mJl9qmxczky+1zYuZyS9rmxczkxdt82Jm8qJtXsxMXrTNi5nJi7b50gYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkkjQP2ubFzORF27yYmbxomxczkxdt85fNTL7UNi9mJi/a5i+bmfxlbfOlmcmLtvllM5Mvtc2XZiZ/2QYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkkjQP2uZLM5MXbfNiZvKibX7ZzOQva5tfNjN50TZfmpm8aJsXM5Nf1jZfmpl8qW2+NDPhO23zYgMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHAySZoHbfNiZvKibV7MTF60zYuZyZfa5kszk7+sbX7ZzORF27yYmXypbV7MTF60zS+bmbxomxczE/ivNgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACf/2uZLbfOltvlS23xpZvKibb7UNi9mJi/a5sXM5EXb8HfNTH5Z2/yytvllM5MXbfOlmcmLtnmxAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAOPk3M+F3tc2LtvllM5MXbfNiZvKibV7MTP6ytnkxM3kxM3nRNr9sZsJ/NzN50TZ/Wdu8mJm82AAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJz8y6O24b+bmXxpZvLL2uZLbfNiZvKXzUxetM0vm5n8srbhv2sbftcGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDg5F8+NjP5ZW3zl7XNi5nJl2YmX2qbL81MXrTNL2ubFzOTF23zpZnJl2Ymv2xmwn83M3nRNi/a5sUGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDgZAMAwMkGAICTDQAAJxsAAE42AACcbAAAONkAAHCyAQDg5F/gwczkRdv8ZTOTL7XNl2YmX2qbL81MXrTNl2YmX2qbFzOTX9Y2L2YmX2qbX7YBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA42QAAcLIBAOBkAwDAyQYAgJMNAAAnGwAATjYAAJxsAAA4+Rd40DYvZiZ/Wdu8mJm8mJm8aJsXbfNiZvKltuHvapsvzUxetM2LmcmLtvnSzOTFBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4ORfPtY2fKdtXsxMvtQ2X5qZ/LK2+dLM5EszE/67tnkxM3kxM/llM5MXbfOltnkxM3nRNl/aAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnPzLo5kJv2tm8pfNTL40M/nSzOQva5svzUxetM1f1jYvZia/bGbyom1ezExetM2LmcmXNgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACcbAABONgAAnGwAADjZAABwsgEA4GQDAMDJBgCAkw0AACf/A/2hv8Y3aFg+AAAAAElFTkSuQmCC","secret":"LNASAT3PGQDTE5J4M4YDCTTOPZGBCAIW","uri":"otpauth://totp/WorkOS:some_user?secret=LNASAT3PGQDTE5J4M4YDCTTOPZGBCAIW&issuer=WorkOS"}}' - http_version: - recorded_at: Sun, 27 Mar 2022 04:40:00 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml b/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml deleted file mode 100644 index f7e1a16f..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/get_factor_invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/auth/factors/auth_factor_invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Sun, 27 Mar 2022 19:13:46 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 420e600d-eefe-4d5a-9553-ecd64696df9a - Etag: - - W/"81-gfVNI7PEuzipMtQc8g0k4FkGMX4" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rs%2Bgf1yWJ3sruiTdP60bWgdBvyit6Pwe097bf8zWCXoc9vNlILeU5%2B3GUsiiT7cIgs8Uz%2FXhFrYCGD%2FegiqaotpP2Te7Blj2JYFSJydjQndRo2t6MHFS5kQ4NHn4ES%2B8%2BQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f2a71f749c5601c-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"message":"Authentication Factor not found: ''auth_factor_invalid''.","code":"entity_not_found","entity_id":"auth_factor_invalid"}' - http_version: - recorded_at: Sun, 27 Mar 2022 19:13:46 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml deleted file mode 100644 index 37ff9691..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/get_factor_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/auth/factors/auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Sun, 27 Mar 2022 19:11:09 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 5766763a-5aaf-4892-8ae9-2f929398230e - Etag: - - W/"ef-wqcMjWChK4ut5ZQqtU8qO89bfTU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=7FLax7DlJtEaLUKB4v2ggq5QhJ9I9geEoDfZJd7em4t8cEqamHvfjLoLu7SkHbLzHSs%2FiaBNO7Ux9D4ESkvvw50exovd2wNpO%2B96U79ZYnWqtijqucWaL4jBB2aJ2jhdUQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f2a6e231fc039fc-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"authentication_factor","id":"auth_factor_01FZ4WMXXA09XF6NK1XMKNWB3M","created_at":"2022-03-27T05:12:43.689Z","updated_at":"2022-03-27T05:12:43.689Z","type":"generic_otp"}' - http_version: - recorded_at: Sun, 27 Mar 2022 19:11:09 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml b/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml deleted file mode 100644 index ceffcad8..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_expired.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/challenges/auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J/verify - body: - encoding: UTF-8 - string: '{"code":"897792"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Sun, 27 Mar 2022 05:54:30 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '167' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 3bf7c473-ef39-4a3f-85fa-609ab4fcfdb4 - Etag: - - W/"a7-3Az5u04ipYu1XY+wqhSwUOFImFI" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=gQNkvWQQyL0h1kES333sXgQvo4JV9Bzm%2Bre%2BzJSsD8l%2F4sVjZ1ehj0dDfP40lHYCwx%2FLZ93avI155XM9JkY%2BxYyCAlRXobk2DfsyKmkTkhnWR4AxV%2BTWECeARqtTewSryA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25df294a253a32-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"code":"authentication_challenge_expired","message":"The - authentication challenge ''auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J'' has - expired."}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:54:30 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml b/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml deleted file mode 100644 index 25118022..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_invalid.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/challenges/auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J/verify - body: - encoding: UTF-8 - string: '{"code":"897792"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Sun, 27 Mar 2022 05:54:30 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '167' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 3bf7c473-ef39-4a3f-85fa-609ab4fcfdb4 - Etag: - - W/"a7-3Az5u04ipYu1XY+wqhSwUOFImFI" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=gQNkvWQQyL0h1kES333sXgQvo4JV9Bzm%2Bre%2BzJSsD8l%2F4sVjZ1ehj0dDfP40lHYCwx%2FLZ93avI155XM9JkY%2BxYyCAlRXobk2DfsyKmkTkhnWR4AxV%2BTWECeARqtTewSryA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25df294a253a32-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"code":"authentication_challenge_previously_verified","message":"The - authentication challenge ''auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J'' has - already been verified."}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:54:30 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml b/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml deleted file mode 100644 index abf1dc8a..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/challenges/auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J/verify - body: - encoding: UTF-8 - string: '{"code":"897792"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:53:03 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '317' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 78db6375-0b0a-4492-a913-5e0802a721b7 - Etag: - - W/"13d-MlhrtKBkD4LjqRYZFv0nos58XA8" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bN92hPz7GN42QtyRg4YR%2BKMTuzd3R241D6A2ktALsB%2F%2FaFwI%2BeJHUMZ9G0oXrDbp%2Binu76aBI%2FC0ICO2Tr0zc8fi9tF1q4XnqyLfgosTjaDE%2BNDcPlRmaduFoDmkc28D4w%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25dd0d0882dee9-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"challenge":{"object":"authentication_challenge","id":"auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J","created_at":"2022-03-27T05:51:24.531Z","updated_at":"2022-03-27T05:51:24.531Z","expires_at":"2022-03-27T06:01:24.532Z","code":"897792","authentication_factor_id":"auth_factor_01FZ4YVH2XFQBJXJ4NQVJSSY8Q"},"valid":true}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:53:03 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml b/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml deleted file mode 100644 index c6d7dd3f..00000000 --- a/spec/support/fixtures/vcr_cassettes/mfa/verify_challenge_generic_valid_is_false.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/auth/challenges/auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J/verify - body: - encoding: UTF-8 - string: '{"code":"897792"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.1.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Sun, 27 Mar 2022 05:53:03 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '317' - Connection: - - keep-alive - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - X-Request-Id: - - 78db6375-0b0a-4492-a913-5e0802a721b7 - Etag: - - W/"13d-MlhrtKBkD4LjqRYZFv0nos58XA8" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bN92hPz7GN42QtyRg4YR%2BKMTuzd3R241D6A2ktALsB%2F%2FaFwI%2BeJHUMZ9G0oXrDbp%2Binu76aBI%2FC0ICO2Tr0zc8fi9tF1q4XnqyLfgosTjaDE%2BNDcPlRmaduFoDmkc28D4w%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 6f25dd0d0882dee9-SEA - Alt-Svc: - - h3=":443"; ma=86400, h3-29=":443"; ma=86400 - body: - encoding: UTF-8 - string: '{"challenge":{"object":"authentication_challenge","id":"auth_challenge_01FZ4YVRBMXP5ZM0A7BP4AJ12J","created_at":"2022-03-27T05:51:24.531Z","updated_at":"2022-03-27T05:51:24.531Z","expires_at":"2022-03-27T06:01:24.532Z","code":"897792","authentication_factor_id":"auth_factor_01FZ4YVH2XFQBJXJ4NQVJSSY8Q"},"valid":false}' - http_version: - recorded_at: Sun, 27 Mar 2022 05:53:03 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/create.yml b/spec/support/fixtures/vcr_cassettes/organization/create.yml deleted file mode 100644 index c95e6284..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/create.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.io"],"name":"Test Organization"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Mon, 09 Aug 2021 21:55:02 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '282' - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 6483f5a5-7111-4a7c-8d37-bbd8b11d9cf6 - Etag: - - W/"11a-W3HwT5v+4QMV1RW0fsNqZgToUYw" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ykoyQ2sd754E5iwEQ0DlRIKT%2F16ZGCpmRzGV8bqw4IjGX7xZqUcjJ13W8dCryN3JXAKfNnlhUehDTJRODkBDqdKsPQQEbEtocrtdlj%2F8hh6tHOSXVxVFgez6oCnbyY7qF%2BK3KkHhiXLXBq4eVQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c439f51d8f2ece-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: UTF-8 - string: '{"object":"organization","id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2021-08-09T21:55:02.755Z","updated_at":"2021-08-09T21:55:02.755Z","domains":[{"object":"organization_domain","id":"org_domain_01FCPEJXF4CTFEDFEGDTRN1MZG","domain":"example.io"}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 21:55:02 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml b/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml deleted file mode 100644 index 610b6fe1..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/create_invalid.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.com"],"name":"Test Organization 2"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.5.0 - Authorization: - - Bearer - response: - status: - code: 409 - message: Conflict - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 929940d6-33dd-404c-9856-eca6cc606d28 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '73' - Etag: - - W/"49-8i1S2EtfSciiA8rvGWbYFNlSlhw" - Date: - - Wed, 09 Sep 2020 21:26:03 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"An Organization with the domain example.com already exists."}' - http_version: - recorded_at: Wed, 09 Sep 2020 21:26:03 GMT -recorded_with: VCR 5.0.0 \ No newline at end of file diff --git a/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml b/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml deleted file mode 100644 index 4e866144..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_different_payload.yml +++ /dev/null @@ -1,155 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.me"],"name":"Test Organization","allow_profiles_outside_organization":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.5.1 - Authorization: - - Bearer - Idempotency-Key: - - bar - response: - status: - code: 201 - message: Created - headers: - Date: - - Fri, 19 Aug 2022 13:40:02 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '326' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"146-afNLOMwUQIrtlSBL9lu7IDJkGmE" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - e9f565ee-a58a-b2a1-5e71-93f14afdd747 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Server: - - cloudflare - Cf-Ray: - - 73d34c789f228e9c-DEN - body: - encoding: UTF-8 - string: '{"object":"organization","id":"org_01GAV5A1WPHEZSV53EAPCTBR9B","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2022-08-19T13:40:02.070Z","updated_at":"2022-08-19T13:40:02.070Z","domains":[{"object":"organization_domain","id":"org_domain_01GAV5A1ZFCW6RQDRV10ZE483J","domain":"example.me"}]}' - http_version: - recorded_at: Fri, 19 Aug 2022 13:40:02 GMT -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.me"],"name":"Organization Test","allow_profiles_outside_organization":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.5.1 - Authorization: - - Bearer - Idempotency-Key: - - bar - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Fri, 19 Aug 2022 13:40:02 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '128' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"80-jILfJK6SRXhN8oqz8Na6yutVwHM" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - afbf7322-2e3e-22ae-62a6-08ecdd247a30 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Server: - - cloudflare - Cf-Ray: - - 73d34c7a6b778e9c-DEN - body: - encoding: UTF-8 - string: '{"message":"Another idempotency key (bar) with different request parameters - was found. Please use a different idempotency key."}' - http_version: - recorded_at: Fri, 19 Aug 2022 13:40:02 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml b/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml deleted file mode 100644 index c9537095..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/create_with_duplicate_idempotency_key_and_payload.yml +++ /dev/null @@ -1,154 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.com"],"name":"Test Organization","allow_profiles_outside_organization":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.5.1 - Authorization: - - Bearer - Idempotency-Key: - - foo - response: - status: - code: 201 - message: Created - headers: - Date: - - Fri, 19 Aug 2022 13:40:01 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '327' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"147-YF7FuE2/wP7OMOkruNN4e9OkzCY" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 6162afb9-dba5-9e18-7d3a-f373facb51e1 - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Server: - - cloudflare - Cf-Ray: - - 73d34c747c868eaa-DEN - body: - encoding: UTF-8 - string: '{"object":"organization","id":"org_01GAV5A1B248PX6WRB13XARPTZ","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2022-08-19T13:40:01.505Z","updated_at":"2022-08-19T13:40:01.505Z","domains":[{"object":"organization_domain","id":"org_domain_01GAV5A1BBGR8WCV5971BFZAQX","domain":"example.com"}]}' - http_version: - recorded_at: Fri, 19 Aug 2022 13:40:01 GMT -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.com"],"name":"Test Organization","allow_profiles_outside_organization":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.5.1 - Authorization: - - Bearer - Idempotency-Key: - - foo - response: - status: - code: 201 - message: Created - headers: - Date: - - Fri, 19 Aug 2022 13:40:01 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '327' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"147-6F+ebkGefNxiuuyTjUt6cZjj5f4" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 04aa9022-1a6a-8041-ec60-e218f5fd8ffa - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Server: - - cloudflare - Cf-Ray: - - 73d34c765de88ea8-DEN - body: - encoding: UTF-8 - string: '{"id":"org_01GAV5A1B248PX6WRB13XARPTZ","name":"Test Organization","object":"organization","domains":[{"id":"org_domain_01GAV5A1BBGR8WCV5971BFZAQX","domain":"example.com","object":"organization_domain"}],"created_at":"2022-08-19T13:40:01.505Z","updated_at":"2022-08-19T13:40:01.505Z","allow_profiles_outside_organization":false}' - http_version: - recorded_at: Fri, 19 Aug 2022 13:40:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml b/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml deleted file mode 100644 index 82599a97..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/create_with_idempotency_key.yml +++ /dev/null @@ -1,79 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/organizations - body: - encoding: UTF-8 - string: '{"domains":["example.io"],"name":"Test Organization","allow_profiles_outside_organization":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; x86_64-darwin19; v2.5.1 - Authorization: - - Bearer - Idempotency-Key: - - key - response: - status: - code: 201 - message: Created - headers: - Date: - - Fri, 19 Aug 2022 13:40:01 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '326' - Connection: - - keep-alive - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Etag: - - W/"146-1Y3p/YYf611sd+3wEGWn2SaT/YM" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (a302eeabfffb) - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 47225769-fc34-e3c4-f4bd-b98b85e438bb - X-Xss-Protection: - - '0' - Cf-Cache-Status: - - DYNAMIC - Server: - - cloudflare - Cf-Ray: - - 73d34c722ae5c7b9-DEN - body: - encoding: UTF-8 - string: '{"object":"organization","id":"org_01GAV5A104T7PM2DHC3VQH8MP6","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2022-08-19T13:40:01.155Z","updated_at":"2022-08-19T13:40:01.155Z","domains":[{"object":"organization_domain","id":"org_domain_01GAV5A10EA6R0YNJR5H5A9N6C","domain":"example.io"}]}' - http_version: - recorded_at: Fri, 19 Aug 2022 13:40:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/delete.yml b/spec/support/fixtures/vcr_cassettes/organization/delete.yml deleted file mode 100644 index 05a05274..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/delete.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/organizations/org_01F4A8TD0B4N1Y9SJ8SH635HDB - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.1.0 - Authorization: - - Bearer - response: - status: - code: 202 - message: Accepted - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Content-Type: - - text/plain; charset=utf-8 - Content-Length: - - '8' - Etag: - - W/"8-YaBXLEiT7zQxEyDYTILfiL6oPhE" - Date: - - Mon, 24 May 2021 21:07:34 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: Accepted - http_version: - recorded_at: Mon, 24 May 2021 21:07:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml b/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml deleted file mode 100644 index 26db383b..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/delete_invalid.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/organizations/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.1.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Mon, 24 May 2021 21:07:34 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Mon, 24 May 2021 21:07:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/get.yml b/spec/support/fixtures/vcr_cassettes/organization/get.yml deleted file mode 100644 index aefafc64..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/get.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/organizations/org_01F9293WD2PDEEV4Y625XPZVG7 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 21:53:34 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - d94b1563-0d09-48cd-810e-d29847b44711 - Etag: - - W/"113-c2EcE6OaGdH7UcEB3NeDrhAgRVw" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ZxchjMhoCSe%2Bpd%2B6InVLLWbhBhjiQRmhAg90mBPrrr0RtaQpZHdrbD%2BYSZUuOHhzOf2ik65mfrqNkaOoYX%2FpystsKQc1ZlsU%2FttVfaMeK9pUcLSW%2BMG2ZZhwqj%2Fl7REqbI36LFacoSb%2BcPXijw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c437cb99bd0f22-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"organization","id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Foo - Corp","allow_profiles_outside_organization":false,"created_at":"2021-06-25T19:07:33.155Z","updated_at":"2021-06-25T19:07:33.155Z","domains":[{"object":"organization_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 21:53:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml b/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml deleted file mode 100644 index 7083c97f..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/get_invalid.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/organizations/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v0.11.1 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Mon, 10 May 2021 17:21:43 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Mon, 10 May 2021 17:21:43 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/list.yml b/spec/support/fixtures/vcr_cassettes/organization/list.yml deleted file mode 100644 index 95e432b2..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/list.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/organizations?order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 21:55:03 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 51340d5e-8bf4-46b7-bd98-d8bd341c31fd - Etag: - - W/"66d-kHGfUV7VPT8Z9tinExkUpFHsUCg" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8pFemWbyzUcoSyVJie5nWnOSzuP36h%2F6bRGTgFS15DxCcqa4S%2BGaKYUuU9EjHvoWAE3hHKc7ciNjiDrA3TXyazf6C5ZdTMfLIdtOB6dq1oUf4EPBq%2Bs%2B6t5nHMKqRexVozFykpBbx0rDKPBwxA%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c439f788cc2832-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"organization","id":"org_01FCPEJXEZR4DSBA625YMGQT9N","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2021-08-09T21:55:02.755Z","updated_at":"2021-08-09T21:55:02.755Z","domains":[{"object":"organization_domain","id":"org_domain_01FCPEJXF4CTFEDFEGDTRN1MZG","domain":"example.io"}]},{"object":"organization","id":"org_01F9293WD2PDEEV4Y625XPZVG7","name":"Foo - Corp","allow_profiles_outside_organization":false,"created_at":"2021-06-25T19:07:33.155Z","updated_at":"2021-06-25T19:07:33.155Z","domains":[{"object":"organization_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}]},{"object":"organization","id":"org_01F8873JSZWN1MJCDN537FEK1H","name":"Example - Organization","allow_profiles_outside_organization":false,"created_at":"2021-06-15T16:12:10.942Z","updated_at":"2021-06-15T16:12:10.942Z","domains":[]},{"object":"organization","id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","name":"gmail.com","allow_profiles_outside_organization":false,"created_at":"2021-06-03T22:18:01.100Z","updated_at":"2021-06-03T22:18:01.100Z","domains":[{"object":"organization_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}]},{"object":"organization","id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2021-05-27T15:24:25.670Z","updated_at":"2021-08-09T21:53:34.525Z","domains":[{"object":"organization_domain","id":"org_domain_01FCPEG7BAYMQ4CHMG41Y2VNHF","domain":"example.me"}]},{"object":"organization","id":"org_01F6Q6NGZS8R5ZTH3C1XR96JK7","name":"WorkOS","allow_profiles_outside_organization":false,"created_at":"2021-05-27T15:21:43.160Z","updated_at":"2021-05-27T15:21:43.160Z","domains":[{"object":"organization_domain","id":"org_domain_01F6Q6NGZZ54WSX1XCMCKSC4DA","domain":"workos.com"}]}],"listMetadata":{"before":"before-id","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 21:55:03 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/organization/update.yml b/spec/support/fixtures/vcr_cassettes/organization/update.yml deleted file mode 100644 index a6bb9460..00000000 --- a/spec/support/fixtures/vcr_cassettes/organization/update.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://api.workos.com/organizations/org_01F6Q6TFP7RD2PF6J03ANNWDKV - body: - encoding: UTF-8 - string: '{"domains":["example.me"],"name":"Test Organization"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 21:53:34 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - b8c5da9a-d1f7-470c-abbd-a2de3f2edf77 - Etag: - - W/"11a-SLpC9UGp2O5SWQr5VJZSNCpOF/Q" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=jh1EtP1h1CwA2nWmx0cvFGD5NdEiga3dbTCmcQH%2BgrdDPGqko8R8mehU9ywQ%2BW1AKKTGWbmRNHiRXpVhaJTNrULEuLt9TpGVoDH0IrixJhVS4N0Czi7n2UfPL0m684giLJtD2t7EVEj1XeeLlQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c437cdde060bb8-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"organization","id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","name":"Test - Organization","allow_profiles_outside_organization":false,"created_at":"2021-05-27T15:24:25.670Z","updated_at":"2021-08-09T21:53:34.525Z","domains":[{"object":"organization_domain","id":"org_domain_01FCPEG7BAYMQ4CHMG41Y2VNHF","domain":"example.me"}]}' - http_version: - recorded_at: Mon, 09 Aug 2021 21:53:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml b/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml deleted file mode 100644 index 7d974763..00000000 --- a/spec/support/fixtures/vcr_cassettes/passwordless/create_session.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/passwordless/sessions - body: - encoding: UTF-8 - string: '{"email":"demo@workos-okta.com","type":"MagicLink"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 611c2a85-84e1-4bad-a2ec-43cf8371f134 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '238' - Etag: - - W/"ee-6KkIusxSXraxKqTLP+31C0PeHDU" - Date: - - Wed, 16 Sep 2020 15:39:08 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"object":"passwordless_session","id":"passwordless_session_01EJBS3JSXFE2DP6JC6ZVBZ095","email":"demo@workos-okta.com","expires_at":"2020-09-16T15:44:08.475Z","link":"https://api.workos.com/passwordless/ZBxkn2ZTUYqa82ky6QEYecemI/confirm"}' - http_version: - recorded_at: Wed, 16 Sep 2020 15:39:08 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml b/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml deleted file mode 100644 index be934f89..00000000 --- a/spec/support/fixtures/vcr_cassettes/passwordless/create_session_invalid.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/passwordless/sessions - body: - encoding: UTF-8 - string: "{}" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0 - Authorization: - - Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87 - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - e3ca7215-2b2d-45cf-a04f-90279225f27e - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '150' - Etag: - - W/"96-O5ltHaJ3rEQ8+dqFwhN+Lhmgdb0" - Date: - - Wed, 16 Sep 2020 17:34:07 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Validation failed","errors":[{"field":"email","code":"email - must be a string"},{"field":"type","code":"type must be a valid enum value"}]}' - http_version: - recorded_at: Wed, 16 Sep 2020 17:34:07 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml b/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml deleted file mode 100644 index a8ac69a1..00000000 --- a/spec/support/fixtures/vcr_cassettes/passwordless/send_session.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/passwordless/sessions/passwordless_session_01EJC0F4KH42T11Y2DHPEB09BM/send - body: - encoding: UTF-8 - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0 - Authorization: - - Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87 - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - d7d72520-9223-4145-b34e-df5e80a776d6 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '16' - Etag: - - W/"10-oV4hJxRVSENxc/wX8+mA4/Pe4tA" - Date: - - Wed, 16 Sep 2020 17:47:47 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"success":true}' - http_version: - recorded_at: Wed, 16 Sep 2020 17:47:47 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml b/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml deleted file mode 100644 index 396f6501..00000000 --- a/spec/support/fixtures/vcr_cassettes/passwordless/send_session_invalid.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/passwordless/sessions/session_123/send - body: - encoding: UTF-8 - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.7.0 - Authorization: - - Bearer sk_4q5ka3d9bx0XJiZhkKmUIOG87 - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 6c22578f-9d49-4118-a7bd-18014d447aad - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '79' - Etag: - - W/"4f-NjqaLicbRDM9SfS5gYKHlSgozt0" - Date: - - Wed, 16 Sep 2020 17:52:24 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"The passwordless session ''session_123'' has expired or - is invalid."}' - http_version: - recorded_at: Wed, 16 Sep 2020 17:52:24 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml b/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml deleted file mode 100644 index b1703296..00000000 --- a/spec/support/fixtures/vcr_cassettes/portal/generate_link_audit_logs.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/portal/generate_link - body: - encoding: UTF-8 - string: '{"intent":"audit_logs","organization":"org_01EHQMYV6MBK39QC5PZXHY59C3","return_url":null,"success_url":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - X-Dns-Prefetch-Control: - - "off" - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - "0" - X-Request-Id: - - 5cf84612-cd60-4d91-9c7e-e1e11bb6b074 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "319" - Etag: - - W/"13f-riW7JK+w7gdYvKYPzZmuQc+wFXk" - Date: - - Wed, 03 Mar 2021 22:08:00 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}' - http_version: - recorded_at: Wed, 03 Mar 2021 22:08:00 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml b/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml deleted file mode 100644 index 1d17d24a..00000000 --- a/spec/support/fixtures/vcr_cassettes/portal/generate_link_dsync.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/portal/generate_link - body: - encoding: UTF-8 - string: '{"intent":"dsync","organization":"org_01EHQMYV6MBK39QC5PZXHY59C3","return_url":null,"success_url":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.1 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 5cf84612-cd60-4d91-9c7e-e1e11bb6b074 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '319' - Etag: - - W/"13f-riW7JK+w7gdYvKYPzZmuQc+wFXk" - Date: - - Wed, 03 Mar 2021 22:08:00 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}' - http_version: - recorded_at: Wed, 03 Mar 2021 22:08:00 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml b/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml deleted file mode 100644 index 817c1e6a..00000000 --- a/spec/support/fixtures/vcr_cassettes/portal/generate_link_invalid.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/portal/generate_link - body: - encoding: UTF-8 - string: '{"intent":"sso","organization":"bogus-id","return_url":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.5.0 - Authorization: - - Bearer - response: - status: - code: 400 - message: Bad Request - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - f1c46aa5-0d87-4d9a-b2ce-dc0505eb8f75 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '67' - Etag: - - W/"43-kRRkij6uWMfZoSUJpiGbSXw7SNc" - Date: - - Thu, 10 Sep 2020 16:14:41 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Could not find an organization with the id, bogus-id."}' - http_version: - recorded_at: Thu, 10 Sep 2020 16:14:41 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml b/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml deleted file mode 100644 index befde7cc..00000000 --- a/spec/support/fixtures/vcr_cassettes/portal/generate_link_sso.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/portal/generate_link - body: - encoding: UTF-8 - string: '{"intent":"sso","organization":"org_01EHQMYV6MBK39QC5PZXHY59C3","return_url":null,"success_url":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.5.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - cb9ad5cf-243a-4084-a4f6-2d7d2b097b8b - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '79' - Etag: - - W/"4f-NN86NUZRu/GQgPAYTexTS6/9DnM" - Date: - - Wed, 09 Sep 2020 23:43:07 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"link":"https://id.workos.com/portal/launch?secret=secret"}' - http_version: - recorded_at: Wed, 09 Sep 2020 23:43:07 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml b/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml deleted file mode 100644 index fa237067..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_invalid_id.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/connections/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Thu, 04 Feb 2021 17:20:08 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Thu, 04 Feb 2021 17:20:08 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml b/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml deleted file mode 100644 index 2c739955..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/delete_connection_with_valid_id.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/connections/conn_01EX55FRVN1V2PCA9YWTMZQMMQ - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.0 - Authorization: - - Bearer - response: - status: - code: 204 - message: No Content - headers: - Server: - - Cowboy - Content-Length: - - '0' - Connection: - - keep-alive - Vary: - - Origin - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Etag: - - W/"a-bAsFyilMr4Ra1hIU5PyoyFRunpI" - Date: - - Thu, 04 Feb 2021 17:20:08 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Thu, 04 Feb 2021 17:20:08 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml b/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml deleted file mode 100644 index b8d9fd4c..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_invalid_id.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/2.7.1; x86_64-darwin19; v0.10.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '23' - Etag: - - W/"17-SuRA/yvUWUo8rK6x7dKURLeBo+0" - Date: - - Fri, 29 Jan 2021 15:36:23 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: '{"message":"Not Found"}' - http_version: - recorded_at: Fri, 29 Jan 2021 15:36:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml b/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml deleted file mode 100644 index be3f1548..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/get_connection_with_valid_id.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections/conn_01FA3WGCWPCCY1V2FGES2FDNP7 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:17 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - c49f3ab1-1103-4834-a164-c341615b173a - Etag: - - W/"89d-wOSqRmSA/e8kfF0JMEPulcmeRsI" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=qimXmLGVK0egx58Jw3RuvjdRR0akAgiuCs122xhYanp3wX54yh2cQoWCPGDIZdbHk%2Bu%2B88TZVUbZkaARB%2BpWNabnkDXUlP7VR2bzs0JuqpXxrIJigJrMcFtC5qXv9RLNLFyBAgGhBdmm%2F0JaZw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c443190cf30e62-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"connection","id":"conn_01FA3WGCWPCCY1V2FGES2FDNP7","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","connection_type":"OktaSAML","name":"Foo - Corp","state":"active","created_at":"2021-07-08T20:21:22.437Z","updated_at":"2021-07-08T20:24:38.887Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk2d7kaj52WBRvhU4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_blairdemoandteststagingworkostestapp_1/exk2d7kaj52WBRvhU4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\r\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\r\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\r\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\r\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\r\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\r\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\r\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\r\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\r\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\r\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\r\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\r\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\r\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\r\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\r\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\r\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\r\n-----END - CERTIFICATE-----\n"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:17 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml deleted file mode 100644 index 4a0d0066..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_after.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?after=conn_01FA3WGCWPCCY1V2FGES2FDNP7&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:16 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - f0ca1391-24f7-42ab-96e1-03708170a415 - Etag: - - W/"59a-ZIKgWSqL79Vk1PhmBPwwz8b4bhU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=zcH%2FppoPRB%2BmUlJabP9ZSUe5cPHU7%2FBBbFhBBbfnttHbFCsiSIpwTqTp4tefv%2BR6SEeQEpNhai3Ra7Zs7YmwYxdAw0ECz4bFh9D1NJeV%2BBEvWpoaIj475X5J%2FiPdUkqGAhTQ9nKkIeMW4MJIkw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c443171d2b0f22-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FBQN064TFAT9A3KYPPP85VXK","organization_id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","connection_type":"MagicLink","name":"MagicLink","state":"active","created_at":"2021-07-28T22:50:41.632Z","updated_at":"2021-07-28T22:50:41.632Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FAK8CHVMK2QVT20ZG7ZQ1JVX","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","connection_type":"ShibbolethSAML","name":"Shibboleth","state":"inactive","created_at":"2021-07-14T19:37:35.856Z","updated_at":"2021-07-14T19:37:35.856Z","status":"unlinked","domains":[],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"https://auth.workos.email/XLvFXZ1tssoaiUkU60IcagSQQ","saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}],"listMetadata":{"before":"conn_01FAK8CHVMK2QVT20ZG7ZQ1JVX","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:16 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml deleted file mode 100644 index 574c80f6..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_before.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?before=conn_01FA3WGCWPCCY1V2FGES2FDNP7&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:16 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 80b9d46c-ab79-41a0-ac63-0afab5dbe8f4 - Etag: - - W/"a75-HKo0bWjw/aMpbUHuuusiqqwVe+k" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ElnTPt%2BZ5sT5Jj3gdjDAvKRuAIl%2F9MW4GqdQ8Km6HNrcSRKBuCuTDkf27hpLIdGsX5YHaZlIjfcNVU1YuhqD0TyUtOuTkwMAwU79bYb%2FRCzVbOngrvJhhtMjmvaZ9cmGjSDH02dUC9%2BzxFbjlg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44313882128d1-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01F79Z8TJP48W73H0F879S7TAP","organization_id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-06-03T22:18:01.115Z","updated_at":"2021-06-03T22:18:01.115Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"},{"object":"connection","id":"conn_01F6Q6TKSG0YPYM41D51Z2VXKQ","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-05-27T15:24:29.812Z","updated_at":"2021-05-27T15:24:29.812Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01FCPEG7BAYMQ4CHMG41Y2VNHF","domain":"example.me"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"},{"object":"connection","id":"conn_01F6Q6NPK0G2198KKK4G9E03A6","organization_id":"org_01F6Q6NGZS8R5ZTH3C1XR96JK7","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-05-27T15:21:48.837Z","updated_at":"2021-05-27T15:21:48.837Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F6Q6NGZZ54WSX1XCMCKSC4DA","domain":"workos.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"}],"listMetadata":{"before":null,"after":"conn_01F79Z8TJP48W73H0F879S7TAP"}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:16 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml deleted file mode 100644 index db89e1e7..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_connection_type.yml +++ /dev/null @@ -1,90 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?connection_type=OktaSAML&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:14 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 7058469e-045f-4742-8f53-eb76129f1798 - Etag: - - W/"2d96-v9q8E6Hhaoenezek+rLrpCbNXas" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FaQyOnAlqvcP1wdJdjCJ3bZqgNuUnIadrUvZuZgYBVLUuLaOITOVJbynFbstpEZFAzrZ3%2BoFu6xLJZRdGGnEnm0qHvhJt%2FSZoCozDg3WJSirjySp0xJmyzzYjT2Ugjsw%2BPFVM93c2FRePzdmxg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44307caf42ee9-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FCP832EJXY0XGA7KHSY4TR1Z","organization_id":"org_01FCP82TN6M8Z1MMYD8KNAFK9K","connection_type":"OktaSAML","name":"demo-1628539283","state":"inactive","created_at":"2021-08-09T20:01:31.988Z","updated_at":"2021-08-09T20:01:31.988Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCP82TPXNSMGX7J152ZCAPZZ","domain":"demo-1628539283.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCP2QYEPS1DB3XBC7BAQCMEJ","organization_id":"org_01FCP2QN01T5SSFBTSRR4WAEEB","connection_type":"OktaSAML","name":"demo-1628533674835","state":"inactive","created_at":"2021-08-09T18:28:04.688Z","updated_at":"2021-08-09T18:28:04.688Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCP2QN077A256HSKQ8SSRSJ6","domain":"demo-1628533674835.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCP09066HGAJ4PHQP0RV6S9X","organization_id":"org_01FCP08FE35AVZSGSN3D0KAPXV","connection_type":"OktaSAML","name":"demo-1628531080559","state":"inactive","created_at":"2021-08-09T17:44:57.793Z","updated_at":"2021-08-09T17:44:57.793Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCP08FEAJC8GNDNHGSG7JPSV","domain":"demo-1628531080559.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNWFDKC05NA7276PXFWASSG","organization_id":"org_01FCNWEX3GMQT5M4ABPRA40KXE","connection_type":"OktaSAML","name":"demo-1628527096","state":"active","created_at":"2021-08-09T16:38:33.834Z","updated_at":"2021-08-09T16:38:35.045Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01FCNWEX57RE3NEA9X5J8XKN4E","domain":"demo-1628527096.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk43g6nngUr0YT3B4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_demo1628527096stagingworkostestapp_1/exk43g6nngUr0YT3B4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\n-----END - CERTIFICATE-----"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNS1WR28HVSFB3Z1AHBQJ3B","organization_id":"org_01FCNS1GZSB9XTWPRS8NK9HW4K","connection_type":"OktaSAML","name":"demo-1628523512","state":"inactive","created_at":"2021-08-09T15:38:44.861Z","updated_at":"2021-08-09T15:38:44.861Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCNS1H1H0X7ZDMGTSCJS39R9","domain":"demo-1628523512.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNRJVGVA1C33W3B2KC2QS9A","organization_id":"org_01FCNRJJH4THHVBR6JWWX3ZJ5Y","connection_type":"OktaSAML","name":"team_lcPvqVaZp1rExEnjjZYxiS04","state":"inactive","created_at":"2021-08-09T15:30:32.085Z","updated_at":"2021-08-09T15:30:32.085Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCNRJJHAJQ9C09F46KE0JT0G","domain":"lcPvqVaZp1rExEnjjZYxiS04.vercel"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNQNT12QQAZG79Q4ZGS1QSV","organization_id":"org_01FCNQN278D9DFTG47DBE8ZYS8","connection_type":"OktaSAML","name":"demo-1628522055","state":"inactive","created_at":"2021-08-09T15:14:40.284Z","updated_at":"2021-08-09T15:14:40.284Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCNQN290BKE936XBM330PMAP","domain":"demo-1628522055.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNFFB4XTTEBQZKF41FZWFWE","organization_id":"org_01FCNFEE3TBRDRMN311RCK3HZR","connection_type":"OktaSAML","name":"demo-1628513449","state":"inactive","created_at":"2021-08-09T12:51:19.832Z","updated_at":"2021-08-09T12:51:19.832Z","status":"unlinked","domains":[{"object":"connection_domain","id":"org_domain_01FCNFEE5K9CJE1J4RGJNHYBHM","domain":"demo-1628513449.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCNCC3N129W1M0HYMGTTSSS2","organization_id":"org_01FCNCC3METTBSXR8AEV680SR9","connection_type":"OktaSAML","name":"FooCorp","state":"active","created_at":"2021-08-09T11:57:08.125Z","updated_at":"2021-08-09T11:57:10.874Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01FCNCC3MQE1Y7ENVVP3HH60KA","domain":"foo-corp.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk43cj5tqUvJXYfb4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_pitchstagingworkostestapp_1/exk43cj5tqUvJXYfb4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\n-----END - CERTIFICATE-----"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FCN5ZCK6GG2M8D84VW4T6MWH","organization_id":"org_01FCN5Y5PQ3DA8QYSSY09MFKGE","connection_type":"OktaSAML","name":"The - best workspace ever","state":"active","created_at":"2021-08-09T10:05:19.842Z","updated_at":"2021-08-09T10:08:35.130Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01FCN5Y5PYJCBAVEFWHACWX0CJ","domain":"coolestworkspace.dev"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk1ficbhpjz8xVVh5d7","saml_idp_url":"https://dev-94282250.okta.com/app/dev-94282250_pitch_2/exk1ficbhpjz8xVVh5d7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDqDCCApCgAwIBAgIGAXsc4wsnMA0GCSqGSIb3DQEBCwUAMIGUMQswCQYDVQQGEwJVUzETMBEG\r\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\r\nMBIGA1UECwwLU1NPUHJvdmlkZXIxFTATBgNVBAMMDGRldi05NDI4MjI1MDEcMBoGCSqGSIb3DQEJ\r\nARYNaW5mb0Bva3RhLmNvbTAeFw0yMTA4MDYxOTEzMDZaFw0zMTA4MDYxOTE0MDZaMIGUMQswCQYD\r\nVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsG\r\nA1UECgwET2t0YTEUMBIGA1UECwwLU1NPUHJvdmlkZXIxFTATBgNVBAMMDGRldi05NDI4MjI1MDEc\r\nMBoGCSqGSIb3DQEJARYNaW5mb0Bva3RhLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC\r\nggEBAMKJPo2wg37/5C5Iho0unQLY+ZpgWEEy7f5Ckgjjo2iKRIr5K+SncU7EJ8Fw1TP8TU//Hmx9\r\nHzN3cj9l4d0LJ7xQAp2RLgHooDB2u/zkvb4KQJM3wDwWdfZAATHcG7OJfo+vEFTciqGVSrB8Ibac\r\ny0WEazbxfX7GAGHqf8SaEmzPm9j3moh0LC84HzI4JfDBhJumoSCqr+aDimV7DAG3IV4dFXy+SaQq\r\nDYkDllPPWy2/JwirerVKFH/9akLjRLVxT1JuF0j6TTtz6sUf7JuUdaul3OOCNGOfL+/q+2lv9E1V\r\nXQkNJ82U6ebcAhy3qA4+hMPtqTm6Ia/wbLNuqqAj+8cCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEA\r\nbUJTOUx3SxktI/iOrZN0b9ExhHqnumSqSFOhq1i0a9pA10Cq10fZK+ewfcCWEQik4ea9qX0FBio0\r\nNmO5o+SvGBOw6zAsfq5yFmZTH5AJnqSa/PRiw45s43rA9yzYQEELfn5Yh9YI5WNr71lP1T778pbh\r\nhu4Apk+O01ZXRkpJ2VqHTJiKiM8OnIe2Ysv4OqcmhRY8xZI0IQk/Faqwd+pzKJKO1EkoeHT0Id+7\r\nwaDRPwC//I+irql8Crr3WgcWn0Ios7FgguUeJN9wa5Tt1Vn85WzeljuVwAxn9UQ7wtYQWDRtaD4V\r\nFa6ZdvTarfbBL2G4nbbUD0Zt3wZA+Iesi+sDsg==\r\n-----END - CERTIFICATE-----\n"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}],"listMetadata":{"before":"conn_01FCN5ZCK6GG2M8D84VW4T6MWH","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:14 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml deleted file mode 100644 index 4fedc2c7..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_domain.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?domain=foo-corp.com&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:14 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 24492041-6fa0-45c9-b58b-62cdd41d86de - Etag: - - W/"8d4-KLH/pb5+0Lb31ZpVOsvjdPi7hcY" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=jqUpn%2FQ6EQmSEkHPIQv4Sko133YccSCQTxa%2Ffw5dC%2BTURs2kugUy0otw7ybSthyR0o1Jp%2BejA4lZeMyHm3JafVzdj10nK%2BQm0VmAfMx9NaPMUsFgWvqpZDAZK3eu99kuWhyUQ1N6iq%2FcuQJTTw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c4430badd028b7-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FA3WGCWPCCY1V2FGES2FDNP7","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","connection_type":"OktaSAML","name":"Foo - Corp","state":"active","created_at":"2021-07-08T20:21:22.437Z","updated_at":"2021-07-08T20:24:38.887Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk2d7kaj52WBRvhU4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_blairdemoandteststagingworkostestapp_1/exk2d7kaj52WBRvhU4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\r\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\r\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\r\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\r\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\r\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\r\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\r\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\r\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\r\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\r\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\r\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\r\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\r\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\r\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\r\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\r\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\r\n-----END - CERTIFICATE-----\n"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}],"listMetadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:15 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml deleted file mode 100644 index c2941dad..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_limit.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?limit=2&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:15 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - d4eb0623-1466-4e99-a500-119612d6bc9b - Etag: - - W/"59a-ZIKgWSqL79Vk1PhmBPwwz8b4bhU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=qHLXTh7d4n3QFt805M6FLecdsq2AJM19ZHRepY4aqLg0e0zMYCudz5G%2BnGfWrzEGzYsUocUIx%2FVfp2D6Rsmy1ZR6mSeySF59z%2FGLEuruXgkqf3VOxMz1BBXe9iE%2B4kUeeFrG0Hzw9NuXkPSmhQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44310a9ba2f79-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FBQN064TFAT9A3KYPPP85VXK","organization_id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","connection_type":"MagicLink","name":"MagicLink","state":"active","created_at":"2021-07-28T22:50:41.632Z","updated_at":"2021-07-28T22:50:41.632Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FAK8CHVMK2QVT20ZG7ZQ1JVX","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","connection_type":"ShibbolethSAML","name":"Shibboleth","state":"inactive","created_at":"2021-07-14T19:37:35.856Z","updated_at":"2021-07-14T19:37:35.856Z","status":"unlinked","domains":[],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"https://auth.workos.email/XLvFXZ1tssoaiUkU60IcagSQQ","saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}],"listMetadata":{"before":"conn_01FAK8CHVMK2QVT20ZG7ZQ1JVX","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:15 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml deleted file mode 100644 index 1fb014a6..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_no_options.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:13 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - fdf4c9b7-8f95-4369-8a99-9b11639967b3 - Etag: - - W/"183d-yb1W7y6dzIHej2T2YBC3d5jdQ8k" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=9yHZIP2Ra%2FPNVnT63DAi%2FFOoC9AFPN3fWmhHpdAK9e%2FgpbAIgzbtWpbC%2BRcGyEtldiseJd1pubYlfopmHWmOQairCjGsmPRbz6rimyHZc3eyp%2FKZmjd%2FjBnaSSChh1lpLUhwI8rZJdxeA2V68A%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44301bde50bf7-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FBQN064TFAT9A3KYPPP85VXK","organization_id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","connection_type":"MagicLink","name":"MagicLink","state":"active","created_at":"2021-07-28T22:50:41.632Z","updated_at":"2021-07-28T22:50:41.632Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FAK8CHVMK2QVT20ZG7ZQ1JVX","organization_id":"org_01F8873JSZWN1MJCDN537FEK1H","connection_type":"ShibbolethSAML","name":"Shibboleth","state":"inactive","created_at":"2021-07-14T19:37:35.856Z","updated_at":"2021-07-14T19:37:35.856Z","status":"unlinked","domains":[],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"https://auth.workos.email/XLvFXZ1tssoaiUkU60IcagSQQ","saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01FA3WGCWPCCY1V2FGES2FDNP7","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","connection_type":"OktaSAML","name":"Foo - Corp","state":"active","created_at":"2021-07-08T20:21:22.437Z","updated_at":"2021-07-08T20:24:38.887Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk2d7kaj52WBRvhU4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_blairdemoandteststagingworkostestapp_1/exk2d7kaj52WBRvhU4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\r\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\r\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\r\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\r\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\r\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\r\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\r\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\r\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\r\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\r\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\r\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\r\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\r\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\r\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\r\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\r\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\r\n-----END - CERTIFICATE-----\n"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null},{"object":"connection","id":"conn_01F79Z8TJP48W73H0F879S7TAP","organization_id":"org_01F79Z8TGGTA8Q67Q50FDXAYN3","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-06-03T22:18:01.115Z","updated_at":"2021-06-03T22:18:01.115Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F79Z8TGS4VYFX0246RAWSZMP","domain":"gmail.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"},{"object":"connection","id":"conn_01F6Q6TKSG0YPYM41D51Z2VXKQ","organization_id":"org_01F6Q6TFP7RD2PF6J03ANNWDKV","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-05-27T15:24:29.812Z","updated_at":"2021-05-27T15:24:29.812Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01FCPEG7BAYMQ4CHMG41Y2VNHF","domain":"example.me"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"},{"object":"connection","id":"conn_01F6Q6NPK0G2198KKK4G9E03A6","organization_id":"org_01F6Q6NGZS8R5ZTH3C1XR96JK7","connection_type":"GoogleOAuth","name":"Google - OAuth","state":"active","created_at":"2021-05-27T15:21:48.837Z","updated_at":"2021-05-27T15:21:48.837Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F6Q6NGZZ54WSX1XCMCKSC4DA","domain":"workos.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":null,"saml_idp_url":null,"saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":null,"oauth_uid":"950693390536-3t7scpogivcoap4bomkshfgbajpq8ifb.apps.googleusercontent.com","oauth_secret":"1fu91TBNiOLUIVxP1_zIkw53","oauth_redirect_uri":"https://auth.workos.com/sso/oauth/google/aOrKxybKyAsKIcgwYGG0WyIaq/callback"}],"listMetadata":{"before":"before_id","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:14 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml b/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml deleted file mode 100644 index cc38865d..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/list_connections/with_organization_id.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/connections?order=desc&organization_id=org_01F9293WD2PDEEV4Y625XPZVG7 - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:15 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 838c7c5c-4e59-4985-bbfc-a9dc991251a2 - Etag: - - W/"8d4-KLH/pb5+0Lb31ZpVOsvjdPi7hcY" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=5AOf5zrSQvY37vWuZbR73i3BCZAOyMn15ntBUVxQIgGNHftGH9tQH1HyvVd0IgcmwVrb4wEhDNkSLkPGiue%2FoVc%2FAuXD9en2pk4wnUCDpxR%2B9MWAVnpxz8I74Jl6kK0cEh55FsFnlc7k%2BMsFZw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c4430d7d2d286f-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"data":[{"object":"connection","id":"conn_01FA3WGCWPCCY1V2FGES2FDNP7","organization_id":"org_01F9293WD2PDEEV4Y625XPZVG7","connection_type":"OktaSAML","name":"Foo - Corp","state":"active","created_at":"2021-07-08T20:21:22.437Z","updated_at":"2021-07-08T20:24:38.887Z","status":"linked","domains":[{"object":"connection_domain","id":"org_domain_01F9293WD8KZAS4ESBK57SZ4D8","domain":"foo-corp.com"}],"oidc_client_id":null,"oidc_client_secret":null,"oidc_discovery_endpoint":null,"oidc_redirect_uri":null,"saml_entity_id":"http://www.okta.com/exk2d7kaj52WBRvhU4x7","saml_idp_url":"https://foo-corp.okta.com/app/foo-corp_blairdemoandteststagingworkostestapp_1/exk2d7kaj52WBRvhU4x7/sso/saml","saml_relying_party_private_key":null,"saml_relying_party_public_key":null,"saml_x509_certs":["-----BEGIN - CERTIFICATE-----\nMIIDoDCCAoigAwIBAgIGAXAljl6nMA0GCSqGSIb3DQEBCwUAMIGQMQswCQYDVQQGEwJVUzETMBEG\r\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\r\nMBIGA1UECwwLU1NPUHJvdmlkZXIxETAPBgNVBAMMCGZvby1jb3JwMRwwGgYJKoZIhvcNAQkBFg1p\r\nbmZvQG9rdGEuY29tMB4XDTIwMDIwODE2MDYzMloXDTMwMDIwODE2MDczMlowgZAxCzAJBgNVBAYT\r\nAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQ0wCwYDVQQK\r\nDARPa3RhMRQwEgYDVQQLDAtTU09Qcm92aWRlcjERMA8GA1UEAwwIZm9vLWNvcnAxHDAaBgkqhkiG\r\n9w0BCQEWDWluZm9Ab2t0YS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDm1D64\r\nRglMbkUbbSFWCDnlQQ4Ocj++/DJQUsdi1imh2H3mUWj+BhYo3FPqLxnEklo1UnJk4ZgUK6DotefP\r\nl5eH0/tX2m0xYs94Uu+aHEiz8c2QjVNJrLHpoXLYdBaeh/cdDJiLic0XVCHpW9HeghtMW44IFK/3\r\n9uNhF/n2BTz0jCP7bmmds3ATNguaAelri3YPXDZ3Kl4WTzxm5M73ygfkeeNIVYC5Mh2Z454L8iTu\r\ndauu3BfAuVDXXmOshGd2Nwo9bR5SqxYpCbXwztXU25mO0hCuSVdEke7qelz3nPd3B9urc6vbOv2B\r\n2yEfvlqUQhG6LUV+NwfKADDJ4crGcjAnAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAKKtksfJZ9cd\r\nKO1hMvlX+CWdHdxllYFc9aReMfOhHEnMK2mhN3KMs8T3rcNqX8Z98L31hJ/6EYzMYP+/ayEXJ5if\r\nKRIpR07FC2Cy4oYQUNED5aP008dSB9dCVW5SeZbHMgS1S3qVlh1f7i8NENBgAWnFVpGvtGFM6AfY\r\nsPxIY8qhkzTdhz7glv231ftytXqXKJIxRd7fhoJmnt+f2g62NhAEsx9wGFfDH8IoX+3hi47iuOzo\r\nT/Bz8dz5fpjjq8ic2F0uowfVQaI3c4zCpSVtmVyGA0hkIsjrpjP1z3fE/Kv8d4XVlTLS8saWlvFL\r\nMSLmMqACEOKSuGjX2YFh8cnm+3I=\r\n-----END - CERTIFICATE-----\n"],"oauth_uid":null,"oauth_secret":null,"oauth_redirect_uri":null}],"listMetadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:15 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/sso/profile.yml b/spec/support/fixtures/vcr_cassettes/sso/profile.yml deleted file mode 100644 index 585f6991..00000000 --- a/spec/support/fixtures/vcr_cassettes/sso/profile.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/sso/profile - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; arm64-darwin20; v1.0.0 - Authorization: - - Bearer access_token - response: - status: - code: 200 - message: OK - headers: - Server: - - Cowboy - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - X-Dns-Prefetch-Control: - - "off" - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - "0" - X-Request-Id: - - 45f253d6-51bb-4171-879a-d532f0275044 - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "545" - Etag: - - W/"221-LoXMZbv3vrn7lnJvNn6G/pqr7+c" - Date: - - Tue, 18 May 2021 22:55:21 GMT - Via: - - 1.1 vegur - body: - encoding: UTF-8 - string: - '{"object":"profile","id":"prof_01EEJTY9SZ1R350RB7B73SNBKF","organization_id":"org_01FG53X8636WSNW2WEKB2C31ZB","connection_id":"conn_01E83FVYZHY7DM4S9503JHV0R5","connection_type":"GoogleOAuth","idp_id":"116485463307139932699","email":"bob.loblaw@workos.com","first_name":"Bob","last_name":"Loblaw","raw_attributes":{"hd":"workos.com","id":"116485463307139932699","name":"Bob - Loblaw","email":"bob.loblaw@workos.com","locale":"en","picture":"https://lh3.googleusercontent.com/a-/AOh14GyO2hLlgZvteDQ3Ldi3_-RteZLya0hWH7247Cam=s96-c","given_name":"Bob","family_name":"Loblaw","verified_email":true}}' - http_version: - recorded_at: Tue, 18 May 2021 22:55:21 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml deleted file mode 100644 index 5e98f9c5..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/invalid.yml +++ /dev/null @@ -1,84 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"invalid","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"authorization_code"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "92" - Connection: - - keep-alive - Cf-Ray: - - 7fef92211809c715-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"5c-iYZxvYBkO+QosPHgQENUzbE8Uac" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 470506e4-7be1-464c-8d2c-8ce98207bff6 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=T4FglgOdveH_UrrH3p1bZTMlmgx6dOp6MwUIacX.Ilw-1693425111-0-AeeLZFZ2Ai2iZTCSKu01aHk1f9fy95FYgYE79bYIpSi63zy8YTFMKhaIQlHj2CfrK485zE0frTrbD+76Rve+trw=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: - '{"error":"invalid_grant","error_description":"The code ''452079'' has - expired or is invalid."}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml deleted file mode 100644 index 275ee799..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"01H93ZZHA0JBHFJH9RR11S83YN","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"authorization_code"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef921deeca091f-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"13b-pHataL1lHEvsW5EO4vq5QgAdcWw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 630bec5a-5a13-4311-a0b7-958889a3bbb2 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=o5KBdIAUFZp0azSQnnd1GlQcIlcPCz95uFg6hFNnKM8-1693425111-0-ARSauqdojZdKD6Z7vp12JBrxCp6wE1s0JzEhaN0XE2DqME76OnJiDJugj2TsbNGXtqWaH3By7XHUXVZDf+AdFxU=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml deleted file mode 100644 index 30d13c4f..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_code/valid_with_impersonator.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: '{"code":"01HRX85ATQB2MN40K4FZ9C2HFR","client_id":"client_01GS91XFB2YPR1C0NR5SH758Q0","client_secret":"","ip_address":null,"user_agent":null,"grant_type":"authorization_code"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.1.1; arm64-darwin21; v4.0.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 14 Mar 2024 01:10:34 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '875' - Connection: - - keep-alive - Cf-Ray: - - 8640628169fa0d54-LAX - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"47c-66YSPNMN47PZx4ahCgTQvmryR90" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f22ea52f-bf1a-4d5e-acb1-10b2e99ffbe5 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=pYiV6zsrN3V8vd8vKA_bp0qN2LYd1HUQAIVHcevLYw4-1710378634-1.0.1.1-wNPVRK6jpySHc7bqiAVCtM6T64oKxFAjrcvJNJAPU.RhZFRgPfQRGWYbC4l0ckcsyhZ2_I7GTu17yNowC.smHA; - path=/; expires=Thu, 14-Mar-24 01:40:34 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=914cc38ede83520e897d1eaef25a8e5daa4975d0-1710378634; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"},"impersonator":{"email":"admin@foocorp.com","reason":"For testing."},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Thu, 14 Mar 2024 01:10:34 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml deleted file mode 100644 index 014c4487..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/invalid.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"invalid","client_id":"client_123","client_secret":"","grant_type":"urn:workos:oauth:grant-type:email-verification:code", "pending_authentication_token="pending_authentication_token_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef921deeca091f-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"13b-pHataL1lHEvsW5EO4vq5QgAdcWw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 630bec5a-5a13-4311-a0b7-958889a3bbb2 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=o5KBdIAUFZp0azSQnnd1GlQcIlcPCz95uFg6hFNnKM8-1693425111-0-ARSauqdojZdKD6Z7vp12JBrxCp6wE1s0JzEhaN0XE2DqME76OnJiDJugj2TsbNGXtqWaH3By7XHUXVZDf+AdFxU=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: - '{"error":"invalid_grant","error_description":"The code ''452079'' has - expired or is invalid."}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml deleted file mode 100644 index 25cdf812..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_email_verification/valid.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"123456","client_id":"client_123","client_secret":"","grant_type":"urn:workos:oauth:grant-type:email-verification:code", "pending_authentication_token="pending_authentication_token_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef921deeca091f-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"13b-pHataL1lHEvsW5EO4vq5QgAdcWw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 630bec5a-5a13-4311-a0b7-958889a3bbb2 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=o5KBdIAUFZp0azSQnnd1GlQcIlcPCz95uFg6hFNnKM8-1693425111-0-ARSauqdojZdKD6Z7vp12JBrxCp6wE1s0JzEhaN0XE2DqME76OnJiDJugj2TsbNGXtqWaH3By7XHUXVZDf+AdFxU=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml deleted file mode 100644 index 85d2da91..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"invalid","email":"test@workos.com","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"urn:workos:oauth:grant-type:magic-auth:code"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Wed, 30 Aug 2023 18:58:01 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef4344cb386811-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"86-X4Q7F02iXed9FifFtOSpB/M42Bc" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 4d33111f-a488-4250-a946-7dceb07af151 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=vPqfj2Z.hrS6vFkS6IuPzCyzTvKEzqKRxfwaaFAaaO8-1693421881-0-AUTukg7nPdQwavyZXIMKFWXnk+xXmC4q0ioe3Jalz3feLjTbouHB5lBI/Qp99KfZyslQxRxMlvJPeDo2iBOYbGs=; - path=/; expires=Wed, 30-Aug-23 19:28:01 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=16391e6119f12d4d9bca79552f799341cb54e8ef-1693421881; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''user_01H93WD0R0KWF8Q7BK02C0RPY''.","code":"entity_not_found","entity_id":"user_01H93WD0R0KWF8Q7BK02C0RPY"}' - http_version: - recorded_at: Wed, 30 Aug 2023 18:58:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml deleted file mode 100644 index 22b23850..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_magic_auth/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"452079","email":"test@workos.com","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"urn:workos:oauth:grant-type:magic-auth:code"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Wed, 30 Aug 2023 18:58:00 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef43410e21ec40-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"178-SVaSEtrIczZQlwnTK57+aDrxt/g" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - ba8fd1ed-34e6-408e-afe0-75e16e6cf3cb - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=ltLsz5yJcK6FuzoGfz2T0FBF9H_Lii_9fMu.1kAgrw8-1693421880-0-AR414sJ/FdSxY+N35vtic7XqJ78+FE0W2D5l5tR5eJbVJcm2X5/eqNg9xzMprMd1J1Eegol3Qa1KMntgknAj9l8=; - path=/; expires=Wed, 30-Aug-23 19:28:00 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=d0c3b10fd259e1dd63341e19d261a235baabb4af-1693421880; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Wed, 30 Aug 2023 18:58:00 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/invalid.yml deleted file mode 100644 index 3b7ef234..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/invalid.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: '{"client_id":"project_01EGKAEB7G5N88E83MF99J785F","client_secret":"","ip_address":null,"user_agent":null,"grant_type":"urn:workos:oauth:grant-type:organization-selection","organization_id":"invalid_org_id","pending_authentication_token":"pending_authentication_token_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.6; arm64-darwin23; v2.16.0 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Wed, 20 Dec 2023 22:00:13 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '155' - Connection: - - keep-alive - Cf-Ray: - - 838b28288bab1588-SJC - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"9b-OK0o7f8HUr1VD42cGHuyxEaTUsQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - be14dde8-2d00-4b00-8619-4586c0d811af - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=7BxHtdm8uv2CHfYDw8rzp4.OIRtS41sROdLi.QeBoos-1703109613-1-AZjOgJ3uXY3OUH0x0E2p9lf4mQWAiN95j2vUJ2WZTkH/bRMjJMiKm0bBtrV4A8ok8elfmr34+mQGJaTw4FHR7ww=; - path=/; expires=Wed, 20-Dec-23 22:30:13 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=71b77aa5ec84c0fc82c02ff4d4fc8e8ae6d37ee3-1703109613; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"code":"invalid_pending_authentication_token","message":"The pending_authentication_token - ''pending_authentication_token_1234'' has expired or is invalid."}' - http_version: - recorded_at: Wed, 20 Dec 2023 22:00:13 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml deleted file mode 100644 index 61b18750..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_organization_selection/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"client_id":"project_01EGKAEB7G5N88E83MF99J785F","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"urn:workos:oauth:grant-type:organization-selection","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","pending_authentication_token":"pending_authentication_token_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.6; arm64-darwin23; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Wed, 20 Dec 2023 22:00:12 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "155" - Connection: - - keep-alive - Cf-Ray: - - 838b2825b878fad6-SJC - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"9b-OK0o7f8HUr1VD42cGHuyxEaTUsQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 63def249-6e78-46d3-8289-939aab5b232e - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=VFWq3DG4vQE5c_IcmK6dGE.XEoss3DhFFsaogQ1KgCc-1703109612-1-AbJic+K1H2u1qaFULTbKzgQYpgyHIjzHB8DM2tkKUcC3nMNsOXV0WlSYcRS4s3l4BAMeAjDsdjllwxm3CLN063E=; - path=/; expires=Wed, 20-Dec-23 22:30:12 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=ca64bb4ffb95b2c79caf4149a1944be0a9d16462-1703109612; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@workos.app","email_verified":true,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Wed, 20 Dec 2023 22:00:12 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml deleted file mode 100644 index 472422db..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"client_id":"client_123","client_secret":"","email":"invalid@workos.app","password":"invalid","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"password"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Tue, 29 Aug 2023 00:24:25 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fe0a6a5aff008df-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"68-vJ+qM+jhqT7OYdncb+ks9c+Wbao" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 0ed3cdf7-03f9-4b37-bbc8-b86834679ed9 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=_uZ1fHEnPVRWYuwQtAju5yf86eP5qqgBjNwvB2Albts-1693268665-0-Ads+iW6svcBYUZvMoNJBzxcUx+KQnhea78QwLCa2DUxT70OtGFXL95y+5BVHtkU4+a0vq1478vpuWzCr/dUzHls=; - path=/; expires=Tue, 29-Aug-23 00:54:25 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=beafd87202de7b7d34fd4a1af55696cb5d19364d-1693268665; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''other@blips.app''.","code":"entity_not_found","entity_id":"other@blips.app"}' - http_version: - recorded_at: Tue, 29 Aug 2023 00:24:25 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml deleted file mode 100644 index f7180823..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_password/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"client_id":"client_123","client_secret":"","email":"test@workos.app","password":"7YtYic00VWcXatPb","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"password"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 29 Aug 2023 00:24:25 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fe0a6a27b0bc39c-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"16e-hoaHaR0EhmAH7TaNBOF8B2OHJq4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 62990367-ddaf-46b3-a32f-38fc4f29d581 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=IiwoT1XAlPdVWj334oRTocU7zZyvKgYw61o0UoA7GtE-1693268665-0-AZTn/iGDfGV6R5j3aj7lcPod7FB9P3cbHc9pD1oN/U5ZmnUYvpCecp6AL+8p/+/bMuwwGqXGNMSa/eIpa0TVm+I=; - path=/; expires=Tue, 29-Aug-23 00:54:25 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=beafd87202de7b7d34fd4a1af55696cb5d19364d-1693268665; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"test@workos.app","email_verified":true,"first_name":null,"last_name":null,"created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-28T15:56:19.798Z","user_type":"unmanaged","email_verified_at":"2023-08-22T11:18:01.850Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Tue, 29 Aug 2023 00:24:25 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml deleted file mode 100644 index e29809e0..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_code/invalid.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: '{"refresh_token":"invalid","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"refresh_token"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.2.2; arm64-darwin22; v4.0.0 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Tue, 19 Mar 2024 16:06:37 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '70' - Connection: - - keep-alive - Cf-Ray: - - 866eb5f11e5f5304-SLC - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"46-6ugkBnqF9SxNnhijAAHjGcT083A" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 32619697-61a5-4ad1-80ab-9d26a6a74d12 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=QdnPZspsJTPGj.ljZ.hfxMSzw0C1in.rjVkGjY75Ht8-1710864397-1.0.1.1-dA2qdL_CwORHen0HwGvbeJXGixoc_htTepIFYUnChePSsMpTdvHI7pWe0ddNWtrRbDD6GEK7TkgM7qPdAXVsaw; - path=/; expires=Tue, 19-Mar-24 16:36:37 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=a7cc4637e2746cb557755f0665c5f2a6206b907a-1710864397; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"error":"invalid_grant","error_description":"Invalid refresh token."}' - http_version: - recorded_at: Tue, 19 Mar 2024 16:06:37 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml deleted file mode 100644 index e8381d6a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_refresh_token/valid.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: '{"refresh_token":"some_refresh_token","client_id":"client_123","client_secret":"","ip_address":"200.240.210.16","user_agent":"Mozilla/5.0 - (Macintosh; Intel Mac OS X 10_15_7) Chrome/108.0.0.0 Safari/537.36","grant_type":"refresh_token"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.2.2; arm64-darwin22; v4.0.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 18 Mar 2024 19:00:53 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 866777d63b4627e8-SLC - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"335-M3MDQYhs5724SayBHHCwnBDn3qA" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 995ed1ed-e892-4049-86c9-0e07baa6cc4b - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=2NHqv1cd1BisOc8KKcQ0oNzFxZZT4OHQd6c2QDuGnUU-1710788453-1.0.1.1-4BxBRzVrhL7rCH895PcfORXr_6Rnj3Oh5w1YG4xi7X1st62LMzb5dHZO7u7P.V1P8nBDAAt3Wbz7xsDTWrfWJg; - path=/; expires=Mon, 18-Mar-24 19:30:53 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=06035c17e9b60a1d7a42a5b568146a0bb71a06dc-1710788453; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"access_token":"","refresh_token":""}' - http_version: - recorded_at: Mon, 18 Mar 2024 19:00:53 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml deleted file mode 100644 index 0be3127f..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/invalid.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"invalid","client_id":"client_123","client_secret":"","grant_type":"urn:workos:oauth:grant-type:mfa-totp", "pending_authentication_token="pending_authentication_token_1234", "authentication_challenge_id": "authentication_challenge_id_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef921deeca091f-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"13b-pHataL1lHEvsW5EO4vq5QgAdcWw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 630bec5a-5a13-4311-a0b7-958889a3bbb2 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=o5KBdIAUFZp0azSQnnd1GlQcIlcPCz95uFg6hFNnKM8-1693425111-0-ARSauqdojZdKD6Z7vp12JBrxCp6wE1s0JzEhaN0XE2DqME76OnJiDJugj2TsbNGXtqWaH3By7XHUXVZDf+AdFxU=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: - '{"error":"invalid_grant","error_description":"The code ''452079'' has - expired or is invalid."}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml deleted file mode 100644 index a7b36591..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/authenticate_with_totp/valid.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/authenticate - body: - encoding: UTF-8 - string: - '{"code":"123456","client_id":"client_123","client_secret":"","grant_type":"urn:workos:oauth:grant-type:mfa-totp", "pending_authentication_token="pending_authentication_token_1234", "authentication_challenge_id": "authentication_challenge_id_1234"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - response: - status: - code: 200 - message: OK - headers: - Date: - - Wed, 30 Aug 2023 19:51:51 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fef921deeca091f-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"13b-pHataL1lHEvsW5EO4vq5QgAdcWw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 630bec5a-5a13-4311-a0b7-958889a3bbb2 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=o5KBdIAUFZp0azSQnnd1GlQcIlcPCz95uFg6hFNnKM8-1693425111-0-ARSauqdojZdKD6Z7vp12JBrxCp6wE1s0JzEhaN0XE2DqME76OnJiDJugj2TsbNGXtqWaH3By7XHUXVZDf+AdFxU=; - path=/; expires=Wed, 30-Aug-23 20:21:51 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=3e9a5d359ba92753e7626245fef8b2f1ee096477-1693425111; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"user":{"object":"user","id":"user_01H93ZY4F80YZRRS6N59Z2HFVS","email":"test@workos.app","email_verified":false,"first_name":"Lucille","last_name":"Bluth","created_at":"2023-08-30T19:50:13.214Z","updated_at":"2023-08-30T19:50:13.214Z","user_type":"managed","sso_profile_id":"prof_01H93ZTVWYPAT4RKDSPFPPXH0J"},"access_token":"","refresh_token":""}' - http_version: - recorded_at: Wed, 30 Aug 2023 19:51:51 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml deleted file mode 100644 index e944c016..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/confirm - body: - encoding: UTF-8 - string: '{"token":"bogus_token","new_password":"new_password"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin23; v2.16.0 - Authorization: - - 'Bearer ' - response: - status: - code: 401 - message: Unauthorized - headers: - Date: - - Sat, 25 Nov 2023 21:46:08 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '26' - Connection: - - keep-alive - Cf-Ray: - - 82bd15298d6aa562-GRU - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f1a0b3f8-67fb-4885-81f8-18a40a4dd2c5 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=bOqLLKZ3OqpZ3OPfDa2w7klrkJKdkS9Y9apX.l.nSYU-1700948768-0-AbdBkjCZaXQcftSAC9N6KB1K0k2BGHaZZkJ2fqyngyDfWsGZiI9MnCe7HXBU8jhuevFp6MC8kxfWFY3tgW2hFZI=; - path=/; expires=Sat, 25-Nov-23 22:16:08 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=7aeaa81f9fe2d2f5c00011adcc897a137e871796-1700948768; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"message":"Unauthorized"}' - http_version: - recorded_at: Sat, 25 Nov 2023 21:46:08 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml deleted file mode 100644 index ad91e49a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/confirm_password_reset/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/confirm - body: - encoding: UTF-8 - string: '{"token":"eEgAgvAE0blvU1zWV3yWVAD22","new_password":"very_cool_new_pa$$word"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin23; v2.16.0 - Authorization: - - 'Bearer ' - response: - status: - code: 401 - message: Unauthorized - headers: - Date: - - Sat, 25 Nov 2023 21:46:08 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '26' - Connection: - - keep-alive - Cf-Ray: - - 82bd15254f97a56e-GRU - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 7b813ca7-add6-4a7f-a7de-62b6a888543a - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=hmCZ.6OoiqzmwuUv6cpz.7XUdZcGTwNtfljW2v0dgPU-1700948768-0-ARWxWopNivTNFw8yWMnXuWh02wkLM9ahNWpAbgpDrKDdgzjMG7NPI1AQS81qrJakN4McyBudLtMYxrrVSoLm0I0=; - path=/; expires=Sat, 25-Nov-23 22:16:08 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=7aeaa81f9fe2d2f5c00011adcc897a137e871796-1700948768; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"message":"Unauthorized"}' - http_version: - recorded_at: Sat, 25 Nov 2023 21:46:07 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml deleted file mode 100644 index c11c81c1..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/invalid.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/organization_memberships - body: - encoding: UTF-8 - string: '{"user_id":"","organization_id":""}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Wed, 16 Aug 2023 22:20:27 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '159' - Connection: - - keep-alive - Cf-Ray: - - 7f7d108dbb190c96-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"9f-BfzHwYu4Bw+fPyyn8hWTmMF4Lio" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 2613d428-dfcc-4a40-8a32-d8b5634ad25e - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=A.5rC7UV26nOVmm0JDUdbBqITMPrX4eH4TaWgNTR8vw-1692224427-0-Abv9MzVBcqqhkKXLp7mgiOMgg+6rW9W3BKhbbhAR3P3msKzRNGsvztll65omw63yshr4A4S4FTvipQJGajpKRws=; - path=/; expires=Wed, 16-Aug-23 22:50:27 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=e57296bbc6ac05c18bc3a943f7bfc936fa954094-1692224427; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"code":"invalid_request_parameters","message":"Validation failed","errors":[{"code":"user_id_string_required","message":"User ID - should be a non-empty string."}]}' - http_version: - recorded_at: Wed, 16 Aug 2023 22:20:27 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml deleted file mode 100644 index 63bd3bb2..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/create_organization_membership/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/organization_memberships - body: - encoding: UTF-8 - string: '{"user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 17 Aug 2023 14:20:07 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '335' - Connection: - - keep-alive - Cf-Ray: - - 7f828e50ac5dc41d-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"14f-2n2KgFcHBXf1Yz7SYqzpAxR3E/E" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 8d277b87-b703-40d2-95ac-5f40bf96fcbf - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=Pd2y8tPXDzQthhv7HAd93AsNAjT9V0tbWdH6PzS_iyA-1692282007-0-AUsV9W08vMNk02vMMYwMWj3KVIAJtXMGZdhGaWVL9yL3e4S5D1cGL2925nELffPsxoejtsVqyeqdvIixzD7UnL8=; - path=/; expires=Thu, 17-Aug-23 14:50:07 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=432b4f1724bbd993a76e1e2e8c4d5e2381680fb1-1692282007; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status":"active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}' - http_version: - recorded_at: Thu, 17 Aug 2023 14:20:07 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml deleted file mode 100644 index 2a23e25b..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/create_user_invalid.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users - body: - encoding: UTF-8 - string: '{"email":"","password":null,"first_name":null,"last_name":null,"email_verified":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Wed, 16 Aug 2023 22:20:27 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '159' - Connection: - - keep-alive - Cf-Ray: - - 7f7d108dbb190c96-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"9f-BfzHwYu4Bw+fPyyn8hWTmMF4Lio" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 2613d428-dfcc-4a40-8a32-d8b5634ad25e - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=A.5rC7UV26nOVmm0JDUdbBqITMPrX4eH4TaWgNTR8vw-1692224427-0-Abv9MzVBcqqhkKXLp7mgiOMgg+6rW9W3BKhbbhAR3P3msKzRNGsvztll65omw63yshr4A4S4FTvipQJGajpKRws=; - path=/; expires=Wed, 16-Aug-23 22:50:27 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=e57296bbc6ac05c18bc3a943f7bfc936fa954094-1692224427; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"code":"invalid_request_parameters","message":"Validation failed","errors":[{"code":"email_string_required","message":"Email - should be a non-empty string."}]}' - http_version: - recorded_at: Wed, 16 Aug 2023 22:20:27 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml deleted file mode 100644 index b137655a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/create_user_valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users - body: - encoding: UTF-8 - string: '{"email":"foo@example.com","password":null,"first_name":"Foo","last_name":"Bar","email_verified":true}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 17 Aug 2023 14:20:07 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '335' - Connection: - - keep-alive - Cf-Ray: - - 7f828e50ac5dc41d-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"14f-2n2KgFcHBXf1Yz7SYqzpAxR3E/E" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 8d277b87-b703-40d2-95ac-5f40bf96fcbf - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=Pd2y8tPXDzQthhv7HAd93AsNAjT9V0tbWdH6PzS_iyA-1692282007-0-AUsV9W08vMNk02vMMYwMWj3KVIAJtXMGZdhGaWVL9yL3e4S5D1cGL2925nELffPsxoejtsVqyeqdvIixzD7UnL8=; - path=/; expires=Thu, 17-Aug-23 14:50:07 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=432b4f1724bbd993a76e1e2e8c4d5e2381680fb1-1692282007; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"user","id":"user_01H81XWBPCV7Y9Q3DHCZHZ9SF8","email":"foo@example.com","first_name":"Foo","last_name":"Bar","created_at":"2023-08-17T14:20:07.199Z","updated_at":"2023-08-17T14:20:07.199Z","email_verified":true}' - http_version: - recorded_at: Thu, 17 Aug 2023 14:20:07 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml deleted file mode 100644 index 99e5e407..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/user_management/organization_memberships/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Fri, 25 Aug 2023 21:38:47 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fc6fbe4ef26ec80-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"58-5GtYccQgavNavjEU+gaKkOl1gq4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f3bf3ce2-ed1c-4fdf-9bba-065c2ab4e5e3 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=VyJvcfBZAdCVUhGKRtHsl9enJXaR64T8urur5ClUQWY-1692999527-0-AahBwhyZ59RlA2LkZ5bsanqtnkJWCPSngTzr7vokapEBcsZzjppDl90U6KcM3t3w2iZ0p7uHvZZ5zI0G74Wlmg4=; - path=/; expires=Fri, 25-Aug-23 22:08:47 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=1a7b02324f49135ba91ab0fc79714ad620549ae5-1692999527; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"Organization Membership not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Fri, 25 Aug 2023 21:38:47 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml deleted file mode 100644 index 5077ad98..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/delete_organization_membership/valid.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/user_management/organization_memberships/om_01H5JQDV7R7ATEYZDEG0W5PRYS - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Fri, 25 Aug 2023 21:34:33 GMT - Content-Length: - - '0' - Connection: - - keep-alive - Cf-Ray: - - 7fc6f5b3099d27a1-SEA - Cf-Cache-Status: - - DYNAMIC - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 4360f118-e0a2-4268-b151-8d1937827fd6 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=oqV.TgF_9o3H.4tP5C9YodhA7dHiTLAoyxSgwfAobDU-1692999273-0-Abnb1JhKF9MP9ocItBnZFluz3W6rf1OEScevjc0NSioiyzuNkPdZLYPhsH0i388aVh6BWD+iLCQW3WgdYviU0DE=; - path=/; expires=Fri, 25-Aug-23 22:04:33 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=74c71c5ec19f5cb375dcedb89bcdb04a1d40efd6-1692999273; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Fri, 25 Aug 2023 21:34:33 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml deleted file mode 100644 index 69561c09..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/delete_user/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/user_management/users/invalid - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Fri, 25 Aug 2023 21:38:47 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fc6fbe4ef26ec80-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"58-5GtYccQgavNavjEU+gaKkOl1gq4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f3bf3ce2-ed1c-4fdf-9bba-065c2ab4e5e3 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=VyJvcfBZAdCVUhGKRtHsl9enJXaR64T8urur5ClUQWY-1692999527-0-AahBwhyZ59RlA2LkZ5bsanqtnkJWCPSngTzr7vokapEBcsZzjppDl90U6KcM3t3w2iZ0p7uHvZZ5zI0G74Wlmg4=; - path=/; expires=Fri, 25-Aug-23 22:08:47 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=1a7b02324f49135ba91ab0fc79714ad620549ae5-1692999527; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Fri, 25 Aug 2023 21:38:47 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml deleted file mode 100644 index d7326bbb..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/delete_user/valid.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -http_interactions: -- request: - method: delete - uri: https://api.workos.com/user_management/users/user_01H7WRJBPAAHX1BYRQHEK7QC4A - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Fri, 25 Aug 2023 21:34:33 GMT - Content-Length: - - '0' - Connection: - - keep-alive - Cf-Ray: - - 7fc6f5b3099d27a1-SEA - Cf-Cache-Status: - - DYNAMIC - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 4360f118-e0a2-4268-b151-8d1937827fd6 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=oqV.TgF_9o3H.4tP5C9YodhA7dHiTLAoyxSgwfAobDU-1692999273-0-Abnb1JhKF9MP9ocItBnZFluz3W6rf1OEScevjc0NSioiyzuNkPdZLYPhsH0i388aVh6BWD+iLCQW3WgdYviU0DE=; - path=/; expires=Fri, 25-Aug-23 22:04:33 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=74c71c5ec19f5cb375dcedb89bcdb04a1d40efd6-1692999273; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Fri, 25 Aug 2023 21:34:33 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml deleted file mode 100644 index 74964278..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44/auth_factors - body: - encoding: US-ASCII - string: '{"type":"totp"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - 'Bearer ' - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Thu, 31 Aug 2023 23:40:52 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '26' - Connection: - - keep-alive - Cf-Ray: - - 7ff91efd88d838e1-YYZ - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 8eae4ac4-8213-4f3f-966f-a2421a113bf8 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=M_MJukGgDu7U9.wmReWdBW.NzCb1vSBzW1fvbnNPkMo-1693525252-0-AUtIKPsJjb1vSM1Q+ny4TPcpo5BpudZWt0gRLw9x5pZpvSPmYrftp68dc2cjpbRaKieTinfRpgEccLO5HiThNbQ=; - path=/; expires=Fri, 01-Sep-23 00:10:52 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=8d5f43bf29ca9bafc65d9794d1c54d31c49ef1bf-1693525252; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"message":"Unauthorized"}' - http_version: - recorded_at: Thu, 31 Aug 2023 23:40:52 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml deleted file mode 100644 index 96a6cd04..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/enroll_auth_factor/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44/auth_factors - body: - encoding: UTF-8 - string: '{"type":"totp"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: OK - headers: - Date: - - Fri, 25 Aug 2023 23:37:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fc7a9287d0330ba-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"153-w5d8Z7u7b9Obt9NziECtNSAY9Ac" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - b333b9e1-c9ec-4e99-ae4f-17a854859cf1 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=adC6w3NUNGTpdZDzNn39guANJ9wi798uCuqc_EI8190-1693006624-0-AcpsuyzFE/KdM7ev5pSVTt2vnGqCSZBOuQYZ0iKFiJT0mBlAuNITn3hICEKvcZ4LH7JUIyjnEOWfq2w7JyRmrJ4=; - path=/; expires=Sat, 26-Aug-23 00:07:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=1d0cc3edf886cc7b90bd0c9c3226f5611a385c1a-1693006624; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{ "authentication_factor": { "object": "authentication_factor", "id": "auth_factor_01H96FETXENNY99ARX0GRC804C", "user_id": "user_01H96FETWYSJMJEGF0Q3ZB272F", "type": "totp", "totp": { "issuer": "Foo Corp", "qr_code": "data:image/png;base64,iVBOR...", "secret": "OFAFOQAPHR6XMQKAIYMWU72XIE3DGI3P", "uri": "otpauth://totp/Foo%20Corp:user@foo-corp.com?secret=OFAFOQAPHR6XMQKAIYMWU72XIE3DGI3P&issuer=Foo%20Corp&algorithm=SHA1&digits=6&period=30", "user": "user@foo-corp.com" }, "created_at": "2023-08-31T18:59:57.962Z", "updated_at": "2023-08-31T18:59:57.962Z" }, "authentication_challenge": { "object": "authentication_challenge", "id": "auth_challenge_01H96FETXGTW1QMBSBT2T36PW0", "authentication_factor_id": "auth_factor_01H96FETXENNY99ARX0GRC804C", "expires_at": "2023-08-31T19:09:57.999Z", "created_at": "2023-08-31T18:59:57.962Z", "updated_at": "2023-08-31T18:59:57.962Z" } }' - http_version: - recorded_at: Fri, 25 Aug 2023 23:37:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml deleted file mode 100644 index 492b60d6..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/user_management/invitations/invalid - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Mon, 14 Aug 2023 21:42:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f6c5d952da1431b-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"141-O6DsNeF3SRNndlNrActm2XgXhM8" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - d774318d-c77b-47eb-9974-47e587a5242e - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=BV7wg6GRB.g.PmjVqpTueEgpVm4zhgL.Jb_FhpUkQDc-1692049324-0-AXZinFJJ+pibtaAcxVXaSSRque4aiUt1xUih81Q0oIyBpuoQFVT1fZc5kmyCUhdM/7VR/NhM818gxjJLjAC0BHE=; - path=/; expires=Mon, 14-Aug-23 22:12:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=5c73c06a5245951a8821c4d8302ae7be643317b4-1692049324; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"Invitation not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Mon, 14 Aug 2023 21:42:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml deleted file mode 100644 index 4cd2766c..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/get_invitation/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/user_management/invitations/invitation_01H5JQDV7R7ATEYZDEG0W5PRYS - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 14 Aug 2023 21:42:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f6c5d952da1431b-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"141-O6DsNeF3SRNndlNrActm2XgXhM8" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - d774318d-c77b-47eb-9974-47e587a5242e - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=BV7wg6GRB.g.PmjVqpTueEgpVm4zhgL.Jb_FhpUkQDc-1692049324-0-AXZinFJJ+pibtaAcxVXaSSRque4aiUt1xUih81Q0oIyBpuoQFVT1fZc5kmyCUhdM/7VR/NhM818gxjJLjAC0BHE=; - path=/; expires=Mon, 14-Aug-23 22:12:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=5c73c06a5245951a8821c4d8302ae7be643317b4-1692049324; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}' - http_version: - recorded_at: Mon, 14 Aug 2023 21:42:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml b/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml deleted file mode 100644 index 8945d140..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/get_organization_membership.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/user_management/organization_memberships/om_01H5JQDV7R7ATEYZDEG0W5PRYS - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 14 Aug 2023 21:42:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f6c5d952da1431b-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"141-O6DsNeF3SRNndlNrActm2XgXhM8" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - d774318d-c77b-47eb-9974-47e587a5242e - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=BV7wg6GRB.g.PmjVqpTueEgpVm4zhgL.Jb_FhpUkQDc-1692049324-0-AXZinFJJ+pibtaAcxVXaSSRque4aiUt1xUih81Q0oIyBpuoQFVT1fZc5kmyCUhdM/7VR/NhM818gxjJLjAC0BHE=; - path=/; expires=Mon, 14-Aug-23 22:12:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=5c73c06a5245951a8821c4d8302ae7be643317b4-1692049324; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object": "organization_membership", "id": "om_01H5JQDV7R7ATEYZDEG0W5PRYS", "user_id": "user_01H5JQDV7R7ATEYZDEG0W5PRYS", "organization_id": "organization_01H5JQDV7R7ATEYZDEG0W5PRYS", "status": "active", "created_at": "2023-07-18T02:07:19.911Z", "updated_at": "2023-07-18T02:07:19.911Z"}' - http_version: - recorded_at: Mon, 14 Aug 2023 21:42:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/get_user.yml b/spec/support/fixtures/vcr_cassettes/user_management/get_user.yml deleted file mode 100644 index 4455e22e..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/get_user.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/users/user_01HP0B4ZV2FWWVY0BF16GFDAER - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.1.1; arm64-darwin21; v3.0.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 06 Feb 2024 23:16:59 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 85171aa13cb71017-LAX - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"fc-DvbCxkCW5Wocu/IoMzE4Fvwf0ns" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - d889e317-2368-4fe7-b0a2-1c47be3d9ca3 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=zsxf6bU0PO_IAuZj57IP3Rk5q298HNg4.dSEXeYctso-1707261419-1-AdcDe/e31u5UfcVRh4MJqIcXlsdh/l5nwm8LpGN+dPD9ouq8nTzZ4nfMdt4Ukpc91Tohr0dOd9F6590AmrTiLUM=; - path=/; expires=Tue, 06-Feb-24 23:46:59 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=60c1b96c058658fb8ea6f02357a98f597642db51-1707261419; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"user","id":"user_01HP0B4ZV2FWWVY0BF16GFDAER","email":"bob@example.com","email_verified":false,"first_name":"Bob","last_name":"Loblaw","profile_picture_url":null,"created_at":"2024-02-06T23:13:18.137Z","updated_at":"2024-02-06T23:13:36.946Z"}' - http_version: - recorded_at: Tue, 06 Feb 2024 23:16:59 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml deleted file mode 100644 index 0115eb5a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44/auth_factors - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - 'Bearer ' - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Thu, 31 Aug 2023 23:40:52 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '26' - Connection: - - keep-alive - Cf-Ray: - - 7ff91efd88d838e1-YYZ - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"1a-pljHtlo127JYJR4E/RYOPb6ucbw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 8eae4ac4-8213-4f3f-966f-a2421a113bf8 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=M_MJukGgDu7U9.wmReWdBW.NzCb1vSBzW1fvbnNPkMo-1693525252-0-AUtIKPsJjb1vSM1Q+ny4TPcpo5BpudZWt0gRLw9x5pZpvSPmYrftp68dc2cjpbRaKieTinfRpgEccLO5HiThNbQ=; - path=/; expires=Fri, 01-Sep-23 00:10:52 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=8d5f43bf29ca9bafc65d9794d1c54d31c49ef1bf-1693525252; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"message":"Unauthorized"}' - http_version: - recorded_at: Thu, 31 Aug 2023 23:40:52 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml deleted file mode 100644 index 10aa1cf5..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_auth_factors/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44/auth_factors - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 15 Aug 2023 16:37:20 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f72dc925ef34288-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"18f-HNgxIMGB3lWwWoxKErsd68S0puU" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 18685295-6afd-47bd-9cc2-e16850f607de - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=hzs97IV1P8X7vKS74iCCMRDY7sFzoYGcysP2LGdKV4c-1692117440-0-AVjOj8T6njnoEKqAZOnpqnTNC2ufENAOsWFxOZ9qjDN/s/IkKgauQmDgEimgKTQ9w6YFRg7dX1fOt25dRgyLJ/U=; - path=/; expires=Tue, 15-Aug-23 17:07:20 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c652b2f4b8b1daf1d2315e44c356d62a89c8d451-1692117440; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object": "list", "data":[{ "object": "authentication_factor", "id": "auth_factor_01H96FETXENNY99ARX0GRC804C", "user_id": "user_01H96FETWYSJMJEGF0Q3ZB272F", "type": "totp", "totp": { "issuer": "Foo Corp", "user": "user@foo-corp.com" }, "created_at": "2023-08-31T18:59:57.962Z", "updated_at": "2023-08-31T18:59:57.962Z" }], "list_metadata": {"before":null, "after":null}}' - http_version: - recorded_at: Tue, 15 Aug 2023 16:37:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml deleted file mode 100644 index 1023acc2..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_after.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/invitations?after=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:16 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - f0ca1391-24f7-42ab-96e1-03708170a415 - Etag: - - W/"59a-ZIKgWSqL79Vk1PhmBPwwz8b4bhU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=zcH%2FppoPRB%2BmUlJabP9ZSUe5cPHU7%2FBBbFhBBbfnttHbFCsiSIpwTqTp4tefv%2BR6SEeQEpNhai3Ra7Zs7YmwYxdAw0ECz4bFh9D1NJeV%2BBEvWpoaIj475X5J%2FiPdUkqGAhTQ9nKkIeMW4MJIkw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c443171d2b0f22-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:16 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml deleted file mode 100644 index 311c35de..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_before.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/invitations?before=invitation_01H5JQDV7R7ATEYZDEG0W5PRYS&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:16 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 80b9d46c-ab79-41a0-ac63-0afab5dbe8f4 - Etag: - - W/"a75-HKo0bWjw/aMpbUHuuusiqqwVe+k" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ElnTPt%2BZ5sT5Jj3gdjDAvKRuAIl%2F9MW4GqdQ8Km6HNrcSRKBuCuTDkf27hpLIdGsX5YHaZlIjfcNVU1YuhqD0TyUtOuTkwMAwU79bYb%2FRCzVbOngrvJhhtMjmvaZ9cmGjSDH02dUC9%2BzxFbjlg%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44313882128d1-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test3@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:16 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml deleted file mode 100644 index 0de8e454..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_limit.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/invitations?limit=2&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:15 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - d4eb0623-1466-4e99-a500-119612d6bc9b - Etag: - - W/"59a-ZIKgWSqL79Vk1PhmBPwwz8b4bhU" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=qHLXTh7d4n3QFt805M6FLecdsq2AJM19ZHRepY4aqLg0e0zMYCudz5G%2BnGfWrzEGzYsUocUIx%2FVfp2D6Rsmy1ZR6mSeySF59z%2FGLEuruXgkqf3VOxMz1BBXe9iE%2B4kUeeFrG0Hzw9NuXkPSmhQ%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44310a9ba2f79-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test2@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:15 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml deleted file mode 100644 index b86f264b..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_no_options.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/invitations?order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:13 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - fdf4c9b7-8f95-4369-8a99-9b11639967b3 - Etag: - - W/"183d-yb1W7y6dzIHej2T2YBC3d5jdQ8k" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=9yHZIP2Ra%2FPNVnT63DAi%2FFOoC9AFPN3fWmhHpdAK9e%2FgpbAIgzbtWpbC%2BRcGyEtldiseJd1pubYlfopmHWmOQairCjGsmPRbz6rimyHZc3eyp%2FKZmjd%2FjBnaSSChh1lpLUhwI8rZJdxeA2V68A%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c44301bde50bf7-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_02H5JQDV7R7ATEYZDEG0W5PRYS","email":"john@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_02H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_03H5JQDV7R7ATEYZDEG0W5PRYS","email":"jane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_03H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_04H5JQDV7R7ATEYZDEG0W5PRYS","email":"emma@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_04H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"},{"object":"invitation","id":"invitation_05H5JQDV7R7ATEYZDEG0W5PRYS","email":"alex@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_05H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before_id","after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:14 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml deleted file mode 100644 index 4ab7f8fb..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_invitations/with_organization_id.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/invitations?order=desc&organization_id=org_01H5JQDV7R7ATEYZDEG0W5PRYS - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.1; x86_64-darwin19; v1.4.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 09 Aug 2021 22:01:15 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - X-Dns-Prefetch-Control: - - 'off' - Expect-Ct: - - max-age=0 - X-Frame-Options: - - SAMEORIGIN - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - X-Download-Options: - - noopen - X-Content-Type-Options: - - nosniff - X-Permitted-Cross-Domain-Policies: - - none - Referrer-Policy: - - no-referrer - X-Xss-Protection: - - '0' - X-Request-Id: - - 838c7c5c-4e59-4985-bbfc-a9dc991251a2 - Etag: - - W/"8d4-KLH/pb5+0Lb31ZpVOsvjdPi7hcY" - Via: - - 1.1 vegur - Cf-Cache-Status: - - DYNAMIC - Report-To: - - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=5AOf5zrSQvY37vWuZbR73i3BCZAOyMn15ntBUVxQIgGNHftGH9tQH1HyvVd0IgcmwVrb4wEhDNkSLkPGiue%2FoVc%2FAuXD9en2pk4wnUCDpxR%2B9MWAVnpxz8I74Jl6kK0cEh55FsFnlc7k%2BMsFZw%3D%3D"}],"group":"cf-nel","max_age":604800}' - Nel: - - '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}' - Server: - - cloudflare - Cf-Ray: - - 67c4430d7d2d286f-DFW - Alt-Svc: - - h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; - ma=86400 - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"dane@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Mon, 09 Aug 2021 22:01:15 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml deleted file mode 100644 index 4ef7a878..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/no_options.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/user_management/organization_memberships?order=desc - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 15 Aug 2023 14:12:43 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f7208b9af6541cf-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"2d1-u275JFe/r7mH64R8Evuu34AnYmE" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 28b84ff5-db0c-410f-b9a4-18df7eb917a8 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=wMmnd1gfGjxBRGzSo8Dwzn9FC6zW5RxBoKOWZSwPLGw-1692108763-0-AWO+Bvuk5v7ZV5lVHwZjiPTItOBLT92RlkSQAEdkMc1s27v3kioQDDJXQATNMEwdtmPlvULWS6fUDnREJLP8rik=; - path=/; expires=Tue, 15-Aug-23 14:42:43 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=97d5345d27145cb1d89e42374c4e9de181f7f60d-1692108763; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}, {"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":"before-id","after":null}}' - http_version: - recorded_at: Tue, 15 Aug 2023 14:12:43 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml deleted file mode 100644 index 8d2aec8a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_organization_memberships/with_options.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/organization_memberships?limit=5&order=desc&user_id=user_01H5JQDV7R7ATEYZDEG0W5PRYS - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 15 Aug 2023 16:37:20 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f72dc925ef34288-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"18f-HNgxIMGB3lWwWoxKErsd68S0puU" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 18685295-6afd-47bd-9cc2-e16850f607de - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=hzs97IV1P8X7vKS74iCCMRDY7sFzoYGcysP2LGdKV4c-1692117440-0-AVjOj8T6njnoEKqAZOnpqnTNC2ufENAOsWFxOZ9qjDN/s/IkKgauQmDgEimgKTQ9w6YFRg7dX1fOt25dRgyLJ/U=; - path=/; expires=Tue, 15-Aug-23 17:07:20 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c652b2f4b8b1daf1d2315e44c356d62a89c8d451-1692117440; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"organization_membership","id":"om_01H5JQDV7R7ATEYZDEG0W5PRYS","user_id":"user_01H5JQDV7R7ATEYZDEG0W5PRYS","organization_id":"organization_01H5JQDV7R7ATEYZDEG0W5PRYS","status": "active","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Tue, 15 Aug 2023 16:37:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml deleted file mode 100644 index 74e6e730..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_users/no_options.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: get - uri: https://api.workos.com/user_management/users?order=desc - body: - encoding: US-ASCII - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 15 Aug 2023 14:12:43 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f7208b9af6541cf-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"2d1-u275JFe/r7mH64R8Evuu34AnYmE" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 28b84ff5-db0c-410f-b9a4-18df7eb917a8 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=wMmnd1gfGjxBRGzSo8Dwzn9FC6zW5RxBoKOWZSwPLGw-1692108763-0-AWO+Bvuk5v7ZV5lVHwZjiPTItOBLT92RlkSQAEdkMc1s27v3kioQDDJXQATNMEwdtmPlvULWS6fUDnREJLP8rik=; - path=/; expires=Tue, 15-Aug-23 14:42:43 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=97d5345d27145cb1d89e42374c4e9de181f7f60d-1692108763; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"user","id":"user_01H7WRJBPAAHX1BYRQHEK7QC4A","email":"lucy.lawless@example.com","first_name":"Lucy","last_name":"Lawless","created_at":"2023-08-15T14:11:04.519Z","updated_at":"2023-08-15T14:11:04.519Z","email_verified":false},{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"bob@loblaw.com","first_name":"Bob","last_name":"Loblaw","created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-14T20:28:58.929Z","email_verified":false}],"list_metadata":{"before":"before-id","after":null}}' - http_version: - recorded_at: Tue, 15 Aug 2023 14:12:43 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml b/spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml deleted file mode 100644 index 049d6a67..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/list_users/with_options.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: get - uri: https://api.workos.com/user_management/users?email=lucy.lawless@example.com&limit=5&order=desc - body: - encoding: US-ASCII - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Tue, 15 Aug 2023 16:37:20 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7f72dc925ef34288-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"18f-HNgxIMGB3lWwWoxKErsd68S0puU" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 18685295-6afd-47bd-9cc2-e16850f607de - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=hzs97IV1P8X7vKS74iCCMRDY7sFzoYGcysP2LGdKV4c-1692117440-0-AVjOj8T6njnoEKqAZOnpqnTNC2ufENAOsWFxOZ9qjDN/s/IkKgauQmDgEimgKTQ9w6YFRg7dX1fOt25dRgyLJ/U=; - path=/; expires=Tue, 15-Aug-23 17:07:20 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c652b2f4b8b1daf1d2315e44c356d62a89c8d451-1692117440; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"list","data":[{"object":"user","id":"user_01H7WRJBPAAHX1BYRQHEK7QC4A","email":"lucy.lawless@example.com","first_name":"Lucy","last_name":"Lawless","created_at":"2023-08-15T14:11:04.519Z","updated_at":"2023-08-15T14:11:04.519Z","email_verified":false}],"list_metadata":{"before":null,"after":null}}' - http_version: - recorded_at: Tue, 15 Aug 2023 16:37:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml deleted file mode 100644 index df17b8ef..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/reset_password/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/confirm - body: - encoding: UTF-8 - string: '{"token":"bogus_token","new_password":"new_password"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Tue, 22 Aug 2023 20:37:23 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fade9d76fd5c443-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"6e-ewNsQiFn+97Q628gVxOcxYY8/4k" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 6de35dcb-7631-4ffe-95f7-2e0f45fa4fe0 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=3YpjDFO_KeR0V.HElgb4nKH0.Ixe_Kr3uSwR.sbSmsM-1692736643-0-AV69ETcL8wiAv3YIQ5mB+YssIizhLxQx5gSh4jLBpVKsr/fLS5pivrU+7BBuCSl8xrrR4HGvB8ijEIYiYyF0P7I=; - path=/; expires=Tue, 22-Aug-23 21:07:23 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=d094d0e9ed722cc5178c6d8aa368d9761b1b2e5c-1692736643; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"Could not locate user with provided token: ''bogus_token''","code":"password_reset_token_not_found"}' - http_version: - recorded_at: Tue, 22 Aug 2023 20:37:23 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml deleted file mode 100644 index 54d37b00..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/reset_password/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/confirm - body: - encoding: UTF-8 - string: '{"token":"eEgAgvAE0blvU1zWV3yWVAD22","new_password":"very_cool_new_pa$$word"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Tue, 22 Aug 2023 20:35:40 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '327' - Connection: - - keep-alive - Cf-Ray: - - 7fade751ac5ec468-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"147-j3/W7XHKx6tuvwZhBiKvsK7XVG4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - c921b63e-c9ec-4397-bfc4-cfb7a740880d - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=HGGZ5slgbvhqsmhXQpwInebeKVPg5gvChLNIPC_O46g-1692736540-0-AbnpCKW5I+JexTqMQiWhaBv7h2Ohf7MQTC+2iUFEVvL/NLbuOx4BWhvPhUN3TM8jUgIuAcldYOWjKuxfZfVL+rE=; - path=/; expires=Tue, 22-Aug-23 21:05:40 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=d4db2e7c2f1e661b363d5566a7aa592cc5e1710e-1692736540; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"user","id":"user_01H7WRJBPAAHX1BYRQHEK7QC4A","email":"lucy.lawless@example.com","first_name":"Lucy","last_name":"Lawless","created_at":"2023-08-15T14:11:04.519Z","updated_at":"2023-08-22T20:34:49.277Z","email_verified":false}' - http_version: - recorded_at: Tue, 22 Aug 2023 20:35:40 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml deleted file mode 100644 index bad8352e..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/invitations/invalid_id/revoke - body: - encoding: UTF-8 - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Mon, 21 Aug 2023 18:28:05 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fa4ef0eeafe8c12-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"56-2Auj80JGmZ1uWGCY950ud8v4KLQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f5f06564-2f73-4b73-989b-b577cfbdaa9a - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=v55WlV2dq1rXkfx9668LFtglSD5c9292fFLKsviMegY-1692642485-0-AWmCDzQSIwCjWvanffzmFA5KJT/nWucOWyv7i3fyyXeH+i5iM9ZusABSbNOUR6zO2mcugNYr/TRj6ltRmm8eC3M=; - path=/; expires=Mon, 21-Aug-23 18:58:05 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=bea6b3e4c8ea6479881eb565b1ab9a0b6deabae9-1692642485; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"Invitation not found: ''invalid_id''.","code":"entity_not_found","entity_id":"bad_id"}' - http_version: - recorded_at: Mon, 21 Aug 2023 18:28:05 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml deleted file mode 100644 index a50bf876..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/revoke_invitation/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/invitations/invitation_01H5JQDV7R7ATEYZDEG0W5PRYS/revoke - body: - encoding: UTF-8 - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 31 Aug 2023 16:41:46 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "376" - Connection: - - keep-alive - Cf-Ray: - - 7ff6b9122b60f8dd-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"178-SVaSEtrIczZQlwnTK57+aDrxt/g" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - df30b890-b6d9-494f-b59c-317e85b5b5f0 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=9k_hHql8o3VCr_ugrzhVkuvFJBIFO5rLKq88Tg1FQzI-1693500106-0-AWUpQpsgsfMWdRySOy7cT3NmqbANvylwBZn7ontxTsDKPijdiGDVMsPih2HAbK3+ldKDe9A1Ul6Mf2+9mfyLrjQ=; - path=/; expires=Thu, 31-Aug-23 17:11:46 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=40a4c5b06423ba61b4c78144e7e0eddc58e13ff4-1693500106; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}' - http_version: - recorded_at: Thu, 31 Aug 2023 16:41:46 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml b/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml deleted file mode 100644 index 9d80c301..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/not_found.yml +++ /dev/null @@ -1,80 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/sessions/revoke - body: - encoding: UTF-8 - string: '{"session_id":"session_01H5JQDV7R7ATEYZDEG0W5PRYS"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.1.4; arm64-darwin22; v4.2.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Thu, 11 Apr 2024 22:36:42 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 872e74fd9ed6db9e-LAX - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"91-9u3slgvENRDVFp/62vKalhPzVuw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - bc0771a4-8d66-4b34-809c-d3d8976af390 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=iJMFbMBT_gDvh2ZbVYwAWHii9wrMPSJJeFQ3sXKSNNw-1712875002-1.0.1.1-d0033NtW0ShwCrgulDZg60Nw0yfEROthaCZQWVIAnWbbmaoa5HDqSkl4DsECxoAaZNdoLWqOxi9YXtZx9FqVSA; - path=/; expires=Thu, 11-Apr-24 23:06:42 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c2a61e4869ba7669d8dd1d11a8e59bba189e21ba-1712875002; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"Session not found: ''session_01H5JQDV7R7ATEYZDEG0W5PRYS''.","code":"entity_not_found","entity_id":"session_01H5JQDV7R7ATEYZDEG0W5PRYS"}' - http_version: - recorded_at: Thu, 11 Apr 2024 22:36:42 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml deleted file mode 100644 index 74377de9..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/revoke_session/valid.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/sessions/revoke - body: - encoding: UTF-8 - string: '{"session_id":"session_01HRX85ATNADY1GQ053AHRFFN6"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.1.4; arm64-darwin22; v4.2.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 11 Apr 2024 22:36:42 GMT - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 872e74fc2ee3092d-LAX - Cf-Cache-Status: - - DYNAMIC - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 1b04e560-4438-40ba-97d2-05ae571aeedf - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=lXssAzjuk1ajbWnDLtD_SUYIufESNBd9WVxCY8MCxJU-1712875002-1.0.1.1-oBbEhifco.kAMIrc30VrsrzW8tP4OpouniBD3jTd.5UowyS_IWs6ah59yKeFO9X6IqMLjlJt6n5O9lTpN0.2fw; - path=/; expires=Thu, 11-Apr-24 23:06:42 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c2a61e4869ba7669d8dd1d11a8e59bba189e21ba-1712875002; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Thu, 11 Apr 2024 22:36:42 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml deleted file mode 100644 index e97d2d21..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/invitations - body: - encoding: UTF-8 - string: '{"email":"invalid@workos.com"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 409 - message: Conflict - headers: - Date: - - Tue, 22 Aug 2023 15:17:55 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '185' - Connection: - - keep-alive - Cf-Ray: - - 7fac15db0d8878d0-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"b9-MwpjOZS5P8vwlJwJ2Wcz1gYyf6Y" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 2b2e336d-0505-43c3-9cc5-4b18841bd31c - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=RJi4ZoHPaRE92J8Hyh7jvHe9uc55nnVpOMBuQKZfCb8-1692717475-0-AeTId8BwH1uElzCNWtu+dsvrIY89q9vKqVJ8qd0hEON/AbMwDbsLatlPjyGecK9XamUFzX78taIjJLW5cRIxLF8=; - path=/; expires=Tue, 22-Aug-23 15:47:55 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=67a732b1ed159ca5729e30e84c73587d61e22441-1692717475; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"message":"An Invitation with the email invalid@workos.com already exists."}' - http_version: - recorded_at: Tue, 22 Aug 2023 15:17:55 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml deleted file mode 100644 index 9a0ed704..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_invitation/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/invitations - body: - encoding: UTF-8 - string: '{"email":"test@workos.com"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Tue, 22 Aug 2023 15:17:54 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '372' - Connection: - - keep-alive - Cf-Ray: - - 7fac15d95b344307-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"174-DVzVYOTqyX3q/AyatAXKdpEIXt0" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 81a9837a-98c2-4672-b676-c0373801bee7 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=umdTRtFxoQN.4ktEcYtcbX1s8jKssJoHPtyhIn6WTks-1692717474-0-AdDIQx1e2bzuszzeXKtvCNRha0v3k93d1P8K+nwBMI2ZwMwU28jXRrsrZibk4tPRFo9wk5sXm2BSyKn+cb8wH+o=; - path=/; expires=Tue, 22-Aug-23 15:47:54 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=18d4d766679a0d25305751659ba8551c12a6ab44-1692717474; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"object":"invitation","id":"invitation_01H5JQDV7R7ATEYZDEG0W5PRYS","email":"test@workos.com","state":"pending","accepted_at":"2023-07-18T02:07:19.911Z","revoked_at":"2023-07-18T02:07:19.911Z","expires_at":"2023-07-18T02:07:19.911Z","organization_id":"org_01H5JQDV7R7ATEYZDEG0W5PRYS","token":"Z1uX3RbwcIl5fIGJJJCXXisdI","created_at":"2023-07-18T02:07:19.911Z","updated_at":"2023-07-18T02:07:19.911Z"}' - http_version: - recorded_at: Tue, 22 Aug 2023 15:17:54 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml deleted file mode 100644 index 83d7fc2a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_magic_auth_code/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/magic_auth/send - body: - encoding: UTF-8 - string: '{"email":"test@gmail.com"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Thu, 31 Aug 2023 16:32:01 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7ff6aac8a91ceb47-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"178-SVaSEtrIczZQlwnTK57+aDrxt/g" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - da040d8f-af6a-4e18-b3c2-b6699af7192f - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=_w1FUKj.vmq5qCPLMdQK1z.IYo.DZCBbMuv5f_MLM9c-1693499521-0-AbZOZE8BJY6cjmbbx648+DYgD0U58SwqkYxCyk0G4ZHpWcMYzo4q+XXLUXdX1Ru4vLjg7F3Ph7ubEUkplQ0vUaU=; - path=/; expires=Thu, 31-Aug-23 17:02:01 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=7aa6c21d75500d36fdd87e87095d451bcaaa7136-1693499521; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: "" - http_version: - recorded_at: Thu, 31 Aug 2023 16:32:01 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/invalid.yml deleted file mode 100644 index e3ebeb8d..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/invalid.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/send - body: - encoding: UTF-8 - string: '{"email":"foo@bar.com","password_reset_url":""}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 422 - message: Unprocessable Entity - headers: - Date: - - Tue, 22 Aug 2023 15:17:55 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '185' - Connection: - - keep-alive - Cf-Ray: - - 7fac15db0d8878d0-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"b9-MwpjOZS5P8vwlJwJ2Wcz1gYyf6Y" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 2b2e336d-0505-43c3-9cc5-4b18841bd31c - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=RJi4ZoHPaRE92J8Hyh7jvHe9uc55nnVpOMBuQKZfCb8-1692717475-0-AeTId8BwH1uElzCNWtu+dsvrIY89q9vKqVJ8qd0hEON/AbMwDbsLatlPjyGecK9XamUFzX78taIjJLW5cRIxLF8=; - path=/; expires=Tue, 22-Aug-23 15:47:55 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=67a732b1ed159ca5729e30e84c73587d61e22441-1692717475; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"code":"invalid_request_parameters","message":"Validation failed","errors":[{"code":"password_reset_url_string_required","message":"Password - Reset Url should be a non-empty string."}]}' - http_version: - recorded_at: Tue, 22 Aug 2023 15:17:55 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml deleted file mode 100644 index 4217e677..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_password_reset_email/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/password_reset/send - body: - encoding: UTF-8 - string: '{"email":"lucy.lawless@example.com","password_reset_url":"https://example.com/reset"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Tue, 22 Aug 2023 15:17:54 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '372' - Connection: - - keep-alive - Cf-Ray: - - 7fac15d95b344307-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"174-DVzVYOTqyX3q/AyatAXKdpEIXt0" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 81a9837a-98c2-4672-b676-c0373801bee7 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=umdTRtFxoQN.4ktEcYtcbX1s8jKssJoHPtyhIn6WTks-1692717474-0-AdDIQx1e2bzuszzeXKtvCNRha0v3k93d1P8K+nwBMI2ZwMwU28jXRrsrZibk4tPRFo9wk5sXm2BSyKn+cb8wH+o=; - path=/; expires=Tue, 22-Aug-23 15:47:54 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=18d4d766679a0d25305751659ba8551c12a6ab44-1692717474; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '' - http_version: - recorded_at: Tue, 22 Aug 2023 15:17:54 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml deleted file mode 100644 index bee7673a..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users/bad_id/email_verification/send - body: - encoding: UTF-8 - string: '' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin22; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Mon, 21 Aug 2023 18:28:05 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fa4ef0eeafe8c12-EWR - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"56-2Auj80JGmZ1uWGCY950ud8v4KLQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - f5f06564-2f73-4b73-989b-b577cfbdaa9a - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=v55WlV2dq1rXkfx9668LFtglSD5c9292fFLKsviMegY-1692642485-0-AWmCDzQSIwCjWvanffzmFA5KJT/nWucOWyv7i3fyyXeH+i5iM9ZusABSbNOUR6zO2mcugNYr/TRj6ltRmm8eC3M=; - path=/; expires=Mon, 21-Aug-23 18:58:05 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=bea6b3e4c8ea6479881eb565b1ab9a0b6deabae9-1692642485; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''bad_id''.","code":"entity_not_found","entity_id":"bad_id"}' - http_version: - recorded_at: Mon, 21 Aug 2023 18:28:05 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml deleted file mode 100644 index 61657244..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/send_verification_email/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/users/user_01H93WD0R0KWF8Q7BK02C0RPYJ/email_verification/send - body: - encoding: UTF-8 - string: "" - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 31 Aug 2023 16:41:46 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "376" - Connection: - - keep-alive - Cf-Ray: - - 7ff6b9122b60f8dd-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"178-SVaSEtrIczZQlwnTK57+aDrxt/g" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - df30b890-b6d9-494f-b59c-317e85b5b5f0 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=9k_hHql8o3VCr_ugrzhVkuvFJBIFO5rLKq88Tg1FQzI-1693500106-0-AWUpQpsgsfMWdRySOy7cT3NmqbANvylwBZn7ontxTsDKPijdiGDVMsPih2HAbK3+ldKDe9A1Ul6Mf2+9mfyLrjQ=; - path=/; expires=Thu, 31-Aug-23 17:11:46 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=40a4c5b06423ba61b4c78144e7e0eddc58e13ff4-1693500106; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"user":{"object":"user","id":"user_01H93WD0R0KWF8Q7BK02C0RPYJ","email":"test@gmail.com","email_verified":true,"first_name":"Adam","last_name":"Zinder","created_at":"2023-08-30T18:48:26.517Z","updated_at":"2023-08-30T18:58:00.821Z","user_type":"unmanaged","email_verified_at":"2023-08-30T18:58:00.915Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}}' - http_version: - recorded_at: Thu, 31 Aug 2023 16:41:46 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml deleted file mode 100644 index 397a89c3..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/update_user/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://api.workos.com/user_management/users/invalid - body: - encoding: UTF-8 - string: '{"first_name":null,"last_name":null,"email_verified":null}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Fri, 25 Aug 2023 23:37:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fc7a92b09d3c72d-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"58-5GtYccQgavNavjEU+gaKkOl1gq4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 38ca771a-8830-4cd3-8ad8-24301b84227e - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=.ejt2HnS5CltjCokoiWNGvcelIrjbEeJt_eLx7pUehg-1693006624-0-AXDxxrtQzE1gAyhllC75t08lyrxEweakQ266OP/kDgQfbJorvG+W03Wu5hNHlt2KlL1DbgqS+HFDMVQV3oS40lM=; - path=/; expires=Sat, 26-Aug-23 00:07:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=1d0cc3edf886cc7b90bd0c9c3226f5611a385c1a-1693006624; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Fri, 25 Aug 2023 23:37:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml deleted file mode 100644 index 34bff4b8..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/update_user/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://api.workos.com/user_management/users/user_01H7TVSKS45SDHN5V9XPSM6H44 - body: - encoding: UTF-8 - string: '{"first_name":"Jane","last_name":"Doe","email_verified":false}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Fri, 25 Aug 2023 23:37:04 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fc7a9287d0330ba-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"153-w5d8Z7u7b9Obt9NziECtNSAY9Ac" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - b333b9e1-c9ec-4e99-ae4f-17a854859cf1 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=adC6w3NUNGTpdZDzNn39guANJ9wi798uCuqc_EI8190-1693006624-0-AcpsuyzFE/KdM7ev5pSVTt2vnGqCSZBOuQYZ0iKFiJT0mBlAuNITn3hICEKvcZ4LH7JUIyjnEOWfq2w7JyRmrJ4=; - path=/; expires=Sat, 26-Aug-23 00:07:04 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=1d0cc3edf886cc7b90bd0c9c3226f5611a385c1a-1693006624; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"willman@blips.app","email_verified":false,"first_name":"Jane","last_name":"Doe","created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-25T22:57:44.262Z","user_type":"unmanaged","email_verified_at":null,"google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}' - http_version: - recorded_at: Fri, 25 Aug 2023 23:37:04 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml b/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml deleted file mode 100644 index 15b34c62..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/invalid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: put - uri: https://api.workos.com/users/invalid/password - body: - encoding: UTF-8 - string: '{"password":"7YtYic00VWcXatPb"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Mon, 28 Aug 2023 15:56:20 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fddbe61b8b0c640-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"58-5GtYccQgavNavjEU+gaKkOl1gq4" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 98c19433-0f41-41a1-a537-d13f945e13e9 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=oxMduXqG4tJltur4hhHtf228S1C4mqCCiDS7tkuookU-1693238180-0-AY4QB0e2vOlrEMOJ+fitseU1NpLX+wPTazEyzqNWSHAskugsJudUH9ez7hjqC3LUQzPDFcDmyPfRogmfWrQPYrA=; - path=/; expires=Mon, 28-Aug-23 16:26:20 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=e3feded68c14c8d3436b33fb36466e0939556da0-1693238180; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''invalid''.","code":"entity_not_found","entity_id":"invalid"}' - http_version: - recorded_at: Mon, 28 Aug 2023 15:56:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml deleted file mode 100644 index a758fa9d..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/update_user_password/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: put - uri: https://api.workos.com/users/user_01H7TVSKS45SDHN5V9XPSM6H44/password - body: - encoding: UTF-8 - string: '{"password":"7YtYic00VWcXatPb"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 200 - message: OK - headers: - Date: - - Mon, 28 Aug 2023 15:56:19 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7fddbe5dfc1216d9-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"165-qp1dXUlqqjv5X1XvmWqlvZ/NGSQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - fbce9361-1d65-4b3c-8cbd-f0095f3e4141 - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=J3vNmHK1YPJVev.rkMAZ9FTLeJzcHKsk3guGQi775Ho-1693238179-0-AUdn0HNzvr6HUmQ4AXUyJZ61yHDc4Xs+XSI4hvhcGZ9jxsCJD4JhJmknzcIY4wELXZDlnn2QD2+EOsLZVoGsVqI=; - path=/; expires=Mon, 28-Aug-23 16:26:19 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=43d140b605df7e6da0318c6a7d599e333d850c2f-1693238179; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"object":"user","id":"user_01H7TVSKS45SDHN5V9XPSM6H44","email":"test@workos.app","email_verified":true,"first_name":null,"last_name":null,"created_at":"2023-08-14T20:28:58.929Z","updated_at":"2023-08-28T15:56:19.798Z","user_type":"unmanaged","email_verified_at":"2023-08-22T11:18:01.850Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}' - http_version: - recorded_at: Mon, 28 Aug 2023 15:56:20 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml b/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml deleted file mode 100644 index 23a83d07..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_code.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users/user_01H93WD0R0KWF8Q7BK02C0RPYJ/email_verification/confirm - body: - encoding: UTF-8 - string: '{"code":"000000"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 400 - message: Bad Request - headers: - Date: - - Thu, 31 Aug 2023 16:41:48 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - '94' - Connection: - - keep-alive - Cf-Ray: - - 7ff6b919e9c6ec80-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"5e-7Q2jqJ24EIqia0hYl0f8UavvB1I" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - e10e2199-a4e7-44aa-90ee-2fe45664072a - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=K_MuDGjknjAqXvlYf4m0s0631OeP.NrWvWqpautzf30-1693500108-0-AUJxSZYXznSY1XVyINUTW2SRmVzo5ZJIok/2RhQxEp3BgajU95DdohdoKzTpP+T853TpyFOe+3VxXUC3KzvQY8I=; - path=/; expires=Thu, 31-Aug-23 17:11:48 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=4f30d39edf87ebcadd84f444fe0c4a5270a3a340-1693500108; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"code":"email_verification_code_incorrect","message":"Email verification - code is incorrect."}' - http_version: - recorded_at: Thu, 31 Aug 2023 16:41:48 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml b/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml deleted file mode 100644 index b288ca5f..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/invalid_magic_auth_challenge.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: -- request: - method: post - uri: https://api.workos.com/user_management/users/bad_id/email_verification/confirm - body: - encoding: UTF-8 - string: '{"code":"966451"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 404 - message: Not Found - headers: - Date: - - Thu, 31 Aug 2023 16:41:47 GMT - Content-Type: - - application/json; charset=utf-8 - Transfer-Encoding: - - chunked - Connection: - - keep-alive - Cf-Ray: - - 7ff6b917481c6838-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"56-2Auj80JGmZ1uWGCY950ud8v4KLQ" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - 'true' - Content-Security-Policy: - - 'default-src ''self'';base-uri ''self'';block-all-mixed-content;font-src ''self'' - https: data:;frame-ancestors ''self'';img-src ''self'' data:;object-src ''none'';script-src - ''self'';script-src-attr ''none'';style-src ''self'' https: ''unsafe-inline'';upgrade-insecure-requests' - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - 'off' - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 1e92992d-56ff-4cbd-b5c3-d46fa80ad644 - X-Xss-Protection: - - '0' - Set-Cookie: - - __cf_bm=HBWNGnIi1vRLIjXGSjll8e1OmwUgBMqolzrm6HX.U2U-1693500107-0-AVQrm4b4jzM89RlujwEH0Q8i8Crxh09SatSNDcbSeG6X2NOyK7q6s6xWIYhoeGHvSI3mgjOsdqWmPG0I7YY/YN0=; - path=/; expires=Thu, 31-Aug-23 17:11:47 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=c0487a301adbc3ab2d5cea66fcddff76943f422f-1693500107; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: ASCII-8BIT - string: '{"message":"User not found: ''bad_id''.","code":"entity_not_found","entity_id":"bad_id"}' - http_version: - recorded_at: Thu, 31 Aug 2023 16:41:47 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml b/spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml deleted file mode 100644 index 15bcd861..00000000 --- a/spec/support/fixtures/vcr_cassettes/user_management/verify_email/valid.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -http_interactions: - - request: - method: post - uri: https://api.workos.com/user_management/users/user_01H968BR1R84DSPYS9QR5PM6RZ/email_verification/confirm - body: - encoding: UTF-8 - string: '{"code":"333495"}' - headers: - Content-Type: - - application/json - Accept-Encoding: - - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 - Accept: - - "*/*" - User-Agent: - - WorkOS; ruby/3.0.2; arm64-darwin21; v2.16.0 - Authorization: - - Bearer - response: - status: - code: 201 - message: Created - headers: - Date: - - Thu, 31 Aug 2023 16:57:30 GMT - Content-Type: - - application/json; charset=utf-8 - Content-Length: - - "375" - Connection: - - keep-alive - Cf-Ray: - - 7ff6d01c4853c71d-SEA - Cf-Cache-Status: - - DYNAMIC - Etag: - - W/"177-YBu4ZtIor9/cOTTWMVDcStQWgKw" - Strict-Transport-Security: - - max-age=15552000; includeSubDomains - Vary: - - Origin, Accept-Encoding - Via: - - 1.1 spaces-router (devel) - Access-Control-Allow-Credentials: - - "true" - Content-Security-Policy: - - "default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' - https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src - 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests" - Expect-Ct: - - max-age=0 - Referrer-Policy: - - no-referrer - X-Content-Type-Options: - - nosniff - X-Dns-Prefetch-Control: - - "off" - X-Download-Options: - - noopen - X-Frame-Options: - - SAMEORIGIN - X-Permitted-Cross-Domain-Policies: - - none - X-Request-Id: - - 04bda556-68f2-4d4a-bf9a-4c062ef6a74c - X-Xss-Protection: - - "0" - Set-Cookie: - - __cf_bm=qyedAgoptBqJ5xN5lPHoIU9qwCUCQvbE3HD8c76nhUk-1693501050-0-AcNrMwoG1S+cyYFaLGGofemD2IQZEpdx4y1XWCEMFHec7s4VMppzx23C+RjWZW2swKRgz9N172Txwwh4bPatEvQ=; - path=/; expires=Thu, 31-Aug-23 17:27:30 GMT; domain=.workos.com; HttpOnly; - Secure; SameSite=None - - __cfruid=682f9a6af8fd91f62014876911781063f77faebe-1693501050; path=/; domain=.workos.com; - HttpOnly; Secure; SameSite=None - Server: - - cloudflare - body: - encoding: UTF-8 - string: '{"user":{"object":"user","id":"user_01H968BR1R84DSPYS9QR5PM6RZ","email":"test@workos.com","email_verified":true,"first_name":"Adam","last_name":"Test","created_at":"2023-08-31T16:55:56.619Z","updated_at":"2023-08-31T16:57:30.574Z","user_type":"unmanaged","email_verified_at":"2023-08-31T16:57:30.628Z","google_oauth_profile_id":null,"microsoft_oauth_profile_id":null}}' - http_version: - recorded_at: Thu, 31 Aug 2023 16:57:30 GMT -recorded_with: VCR 5.0.0 diff --git a/spec/support/profile.txt b/spec/support/profile.txt deleted file mode 100644 index 79deaa1d..00000000 --- a/spec/support/profile.txt +++ /dev/null @@ -1 +0,0 @@ -{"profile":{"object":"profile","id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","organization_id":"org_01FG53X8636WSNW2WEKB2C31ZB","connection_id":"conn_01EMH8WAK20T42N2NBMNBCYHAG","connection_type":"OktaSAML","last_name":"Demo","groups":["Admins","Developers"],"idp_id":"00u1klkowm8EGah2H357","raw_attributes":{"id":"prof_01DRA1XNSJDZ19A31F183ECQW5","email":"demo@workos-okta.com","first_name":"WorkOS","last_name":"Demo","groups":["Admins","Developers"],"idp_id":"00u1klkowm8EGah2H357"}},"access_token":"01DVX6QBS3EG6FHY2ESAA5Q65X"} diff --git a/spec/support/shared_examples/client_spec.rb b/spec/support/shared_examples/client_spec.rb deleted file mode 100644 index dc2a7dab..00000000 --- a/spec/support/shared_examples/client_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -RSpec.shared_examples 'client' do - subject(:client) { described_class.client } - - it { is_expected.to be_kind_of(Net::HTTP) } - - it 'assigns use_ssl' do - expect(client.use_ssl?).to be true - end - - it 'returns new instance' do - expect(described_class.client.object_id).to_not eq described_class.client.object_id - end - - if RUBY_VERSION >= '2.6.0' - it 'sets the timeouts, including the write timeout' do - expect(described_class.client.open_timeout).to_not be_nil - expect(described_class.client.read_timeout).to_not be_nil - expect(described_class.client.write_timeout).to_not be_nil - end - else - it 'sets the open and read timeouts, but not the write timeout' do - expect(described_class.client.open_timeout).to_not be_nil - expect(described_class.client.read_timeout).to_not be_nil - expect(described_class.client.write_timeout).to be_nil - end - end -end diff --git a/spec/support/webhook_payload.txt b/spec/support/webhook_payload.txt deleted file mode 100644 index f1afd35a..00000000 --- a/spec/support/webhook_payload.txt +++ /dev/null @@ -1 +0,0 @@ -{"id": "wh_123","data":{"id":"directory_user_01FAEAJCR3ZBZ30D8BD1924TVG","state":"active","emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"idp_id":"00u1e8mutl6wlH3lL4x7","object":"directory_user","username":"blair@foo-corp.com","last_name":"Lunchford","first_name":"Blair","directory_id":"directory_01F9M7F68PZP8QXP8G7X5QRHS7","raw_attributes":{"name":{"givenName":"Blair","familyName":"Lunchford","middleName":"Elizabeth","honorificPrefix":"Ms."},"title":"Developer Success Engineer","active":true,"emails":[{"type":"work","value":"blair@foo-corp.com","primary":true}],"groups":[],"locale":"en-US","schemas":["urn:ietf:params:scim:schemas:core:2.0:User","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"],"userName":"blair@foo-corp.com","addresses":[{"region":"CA","primary":true,"locality":"San Francisco","postalCode":"94016"}],"externalId":"00u1e8mutl6wlH3lL4x7","displayName":"Blair Lunchford","urn:ietf:params:scim:schemas:extension:enterprise:2.0:User":{"manager":{"value":"2","displayName":"Kate Chapman"},"division":"Engineering","department":"Customer Success"}}},"event":"dsync.user.created","created_at":"2021-06-25T19:07:33.155Z"} diff --git a/test/test_helper.rb b/test/test_helper.rb new file mode 100644 index 00000000..f67d0d33 --- /dev/null +++ b/test/test_helper.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# @oagen-ignore-file — hand-maintained runtime +$LOAD_PATH.unshift(File.expand_path("../lib", __dir__)) + +require "minitest/autorun" +require "webmock/minitest" +require "json" +require "workos" + +module FixtureHelper + FIXTURES_DIR = File.expand_path("fixtures", __dir__) + + def load_fixture(name) + path = File.join(FIXTURES_DIR, name) + return {} unless File.exist?(path) + + JSON.parse(File.read(path)) + end +end diff --git a/test/workos/test_actions.rb b/test/workos/test_actions.rb new file mode 100644 index 00000000..2481fde6 --- /dev/null +++ b/test/workos/test_actions.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "openssl" +require "json" + +class ActionsTest < Minitest::Test + SECRET = "as_test_actions_secret" + + def setup + @client = WorkOS::Client.new(api_key: "sk_test") + @actions = @client.actions + end + + def signed(payload, ts: now_ms, secret: SECRET) + sig = OpenSSL::HMAC.hexdigest("SHA256", secret, "#{ts}.#{payload}") + "t=#{ts}, v1=#{sig}" + end + + def now_ms + (Time.now.to_f * 1000).to_i + end + + def test_actions_accessor_exists + assert_equal WorkOS::Actions, @actions + end + + def test_construct_action_returns_parsed_payload + payload = '{"object":"authentication_action_context","user":{"email":"a@b.com"}}' + action = @actions.construct_action(payload: payload, sig_header: signed(payload), secret: SECRET) + assert_equal "authentication_action_context", action["object"] + assert_equal "a@b.com", action["user"]["email"] + end + + def test_verify_header_raises_on_bad_signature + payload = '{"x":1}' + assert_raises(WorkOS::SignatureVerificationError) do + @actions.verify_header(payload: payload, sig_header: "t=#{now_ms}, v1=cafef00d", secret: SECRET) + end + end + + def test_verify_header_uses_30s_default_tolerance + payload = '{"x":1}' + old_ts = now_ms - 60_000 + sig = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{old_ts}.#{payload}") + assert_raises(WorkOS::SignatureVerificationError) do + @actions.verify_header(payload: payload, sig_header: "t=#{old_ts}, v1=#{sig}", secret: SECRET) + end + end + + def test_verify_header_raises_on_future_timestamp + payload = '{"x":1}' + future_ts = now_ms + 60_000 # 60s ahead, beyond default 30s tolerance + sig = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{future_ts}.#{payload}") + assert_raises(WorkOS::SignatureVerificationError) do + @actions.verify_header(payload: payload, sig_header: "t=#{future_ts}, v1=#{sig}", secret: SECRET) + end + end + + def test_sign_response_authentication_allow + resp = @actions.sign_response(action_type: "authentication", verdict: "Allow", secret: SECRET) + assert_equal "authentication_action_response", resp["object"] + assert_equal "Allow", resp["payload"]["verdict"] + refute_nil resp["payload"]["timestamp"] + refute_nil resp["signature"] + payload_json = JSON.generate(resp["payload"]) + expected = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{resp["payload"]["timestamp"]}.#{payload_json}") + assert_equal expected, resp["signature"] + end + + def test_sign_response_user_registration_deny_with_error + resp = @actions.sign_response( + action_type: "user_registration", verdict: "Deny", + error_message: "blocked", secret: SECRET + ) + assert_equal "user_registration_action_response", resp["object"] + assert_equal "Deny", resp["payload"]["verdict"] + assert_equal "blocked", resp["payload"]["error_message"] + end + + def test_sign_response_rejects_unknown_action_type + assert_raises(ArgumentError) do + @actions.sign_response(action_type: "bogus", verdict: "Allow", secret: SECRET) + end + end +end diff --git a/test/workos/test_admin_portal.rb b/test/workos/test_admin_portal.rb new file mode 100644 index 00000000..77d1f561 --- /dev/null +++ b/test/workos/test_admin_portal.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class AdminPortalTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_generate_link_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/portal/generate_link(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.admin_portal.generate_link(organization: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :generate_link, verb: :post, url: %r{\Ahttps://api\.workos\.com/portal/generate_link(\?|\z)}, args: {organization: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.admin_portal.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_api_keys.rb b/test/workos/test_api_keys.rb new file mode 100644 index 00000000..f2695f69 --- /dev/null +++ b/test/workos/test_api_keys.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class ApiKeysTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_organization_api_keys_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.api_keys.list_organization_api_keys(organization_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_organization_api_key_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.api_keys.create_organization_api_key(organization_id: "stub", name: "stub") + refute_nil result + end + + def test_create_validation_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.api_keys.create_validation(value: "stub") + refute_nil result + end + + def test_delete_api_key_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.api_keys.delete_api_key(id: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_organization_api_keys, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}, args: {organization_id: "stub"}}, + {name: :create_organization_api_key, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/api_keys(\?|\z)}, args: {organization_id: "stub", name: "stub"}}, + {name: :create_validation, verb: :post, url: %r{\Ahttps://api\.workos\.com/api_keys/validations(\?|\z)}, args: {value: "stub"}}, + {name: :delete_api_key, verb: :delete, url: %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.api_keys.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_audit_logs.rb b/test/workos/test_audit_logs.rb new file mode 100644 index 00000000..764e2674 --- /dev/null +++ b/test/workos/test_audit_logs.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class AuditLogsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_get_organization_audit_logs_retention_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.get_organization_audit_logs_retention(id: "stub") + refute_nil result + end + + def test_update_organization_audit_logs_retention_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.update_organization_audit_logs_retention(id: "stub", retention_period_in_days: 1) + refute_nil result + end + + def test_list_actions_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/audit_logs/actions(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.audit_logs.list_actions + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_action_schemas_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.audit_logs.list_action_schemas(action_name: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_schema_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.create_schema(action_name: "stub", targets: [{}]) + refute_nil result + end + + def test_create_event_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/audit_logs/events(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.create_event(organization_id: "stub", event: {}) + refute_nil result + end + + def test_create_export_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/audit_logs/exports(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.create_export(organization_id: "stub", range_start: "stub", range_end: "stub") + refute_nil result + end + + def test_get_export_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/audit_logs/exports/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.audit_logs.get_export(audit_log_export_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :get_organization_audit_logs_retention, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub"}}, + {name: :update_organization_audit_logs_retention, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_logs_retention(\?|\z)}, args: {id: "stub", retention_period_in_days: 1}}, + {name: :list_actions, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions(\?|\z)}}, + {name: :list_action_schemas, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub"}}, + {name: :create_schema, verb: :post, url: %r{\Ahttps://api\.workos\.com/audit_logs/actions/stub/schemas(\?|\z)}, args: {action_name: "stub", targets: [{}]}}, + {name: :create_event, verb: :post, url: %r{\Ahttps://api\.workos\.com/audit_logs/events(\?|\z)}, args: {organization_id: "stub", event: {}}}, + {name: :create_export, verb: :post, url: %r{\Ahttps://api\.workos\.com/audit_logs/exports(\?|\z)}, args: {organization_id: "stub", range_start: "stub", range_end: "stub"}}, + {name: :get_export, verb: :get, url: %r{\Ahttps://api\.workos\.com/audit_logs/exports/stub(\?|\z)}, args: {audit_log_export_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.audit_logs.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_authkit_helpers.rb b/test/workos/test_authkit_helpers.rb new file mode 100644 index 00000000..076dd533 --- /dev/null +++ b/test/workos/test_authkit_helpers.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "uri" + +class AuthKitHelpersTest < Minitest::Test + def setup + @client = WorkOS::Client.new(api_key: "sk_test_authkit", client_id: "client_001") + @um = @client.user_management + end + + # H09 + def test_get_authorization_url_returns_string_no_http + url = @um.get_authorization_url( + redirect_uri: "https://app.example.com/cb", + provider: "GoogleOAuth" + ) + assert_kind_of String, url + parsed = URI.parse(url) + params = URI.decode_www_form(parsed.query).to_h + assert_equal "client_001", params["client_id"] + assert_equal "https://app.example.com/cb", params["redirect_uri"] + assert_equal "code", params["response_type"] + assert_equal "GoogleOAuth", params["provider"] + assert_equal "/user_management/authorize", parsed.path + end + + def test_get_authorization_url_requires_client_id + client = WorkOS::Client.new(api_key: "k", client_id: nil) + err = assert_raises(ArgumentError) do + client.user_management.get_authorization_url(redirect_uri: "x", provider: "GoogleOAuth") + end + assert_match(/client_id is required/, err.message) + end + + def test_get_authorization_url_requires_provider_or_connection_or_org + err = assert_raises(ArgumentError) do + @um.get_authorization_url(redirect_uri: "x") + end + assert_match(/provider, connection_id, or organization_id required/, err.message) + end + + # H10 + def test_get_authorization_url_with_pkce_returns_url_verifier_state + url, verifier, state = @um.get_authorization_url_with_pkce( + redirect_uri: "https://app.example.com/cb", + provider: "GoogleOAuth" + ) + assert_kind_of String, url + assert_kind_of String, verifier + assert_kind_of String, state + parsed = URI.parse(url) + params = URI.decode_www_form(parsed.query).to_h + assert_equal "S256", params["code_challenge_method"] + expected_challenge = WorkOS::PKCE.generate_code_challenge(verifier) + assert_equal expected_challenge, params["code_challenge"] + end + + # H11 + def test_authenticate_with_code_pkce_posts_correct_body + stub = stub_request(:post, "https://api.workos.com/user_management/authenticate") + .with(body: hash_including( + "grant_type" => "authorization_code", + "client_id" => "client_001", + "code" => "auth_code_xyz", + "code_verifier" => "verifier_abc" + )) + .to_return(status: 200, body: '{"user":{"id":"u_1","email":"a@b","first_name":null,"last_name":null,"email_verified":true,"profile_picture_url":null,"created_at":"x","updated_at":"y","object":"user","external_id":null,"last_sign_in_at":null}}') + @um.authenticate_with_code_pkce(code: "auth_code_xyz", code_verifier: "verifier_abc") + assert_requested(stub) + end + + # H12 + def test_authorize_device_initiates_device_flow + stub = stub_request(:post, "https://api.workos.com/oauth2/device_authorization") + .with(body: hash_including("client_id" => "client_001")) + .to_return(status: 200, body: '{"device_code":"d_1","user_code":"ABCD","verification_uri":"u","verification_uri_complete":"uc","expires_in":600,"interval":5}') + resp = @um.authorize_device + refute_nil resp + assert_requested(stub) + end + + # H13 + def test_get_jwks_url_builds_string + url = @um.get_jwks_url + assert_equal "https://api.workos.com/sso/jwks/client_001", url + end + + def test_get_jwks_url_accepts_explicit_client_id + assert_equal "https://api.workos.com/sso/jwks/abc", @um.get_jwks_url(client_id: "abc") + end + + # get_logout_url + def test_get_logout_url_builds_url + url = @um.get_logout_url(session_id: "session_01H93ZY4F80QPBEZ1R5B2SHQG8") + parsed = URI.parse(url) + params = URI.decode_www_form(parsed.query).to_h + assert_equal "/user_management/sessions/logout", parsed.path + assert_equal "session_01H93ZY4F80QPBEZ1R5B2SHQG8", params["session_id"] + end + + def test_get_logout_url_includes_return_to + url = @um.get_logout_url(session_id: "sid_1", return_to: "https://example.com") + parsed = URI.parse(url) + params = URI.decode_www_form(parsed.query).to_h + assert_equal "https://example.com", params["return_to"] + end +end diff --git a/test/workos/test_authorization.rb b/test/workos/test_authorization.rb new file mode 100644 index 00000000..3f074b6c --- /dev/null +++ b/test/workos/test_authorization.rb @@ -0,0 +1,403 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class AuthorizationTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_check_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/check(\?|\z)}) + .with(body: hash_including("permission_slug" => "stub", "resource_id" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.check(organization_membership_id: "stub", permission_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")) + refute_nil result + end + + def test_check_with_resource_target_by_external_id_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/check(\?|\z)}) + .with(body: hash_including("permission_slug" => "stub", "resource_external_id" => "stub", "resource_type_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.check(organization_membership_id: "stub", permission_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetByExternalId.new(resource_external_id: "stub", resource_type_slug: "stub")) + refute_nil result + end + + def test_list_resources_for_membership_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_resources_for_membership(organization_membership_id: "stub", permission_slug: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")) + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_resources_for_membership_with_parent_resource_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_resources_for_membership(organization_membership_id: "stub", permission_slug: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_type_slug: "stub", parent_resource_external_id: "stub")) + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_effective_permissions_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources/stub/permissions(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_effective_permissions(organization_membership_id: "stub", resource_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_effective_permissions_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources/stub/stub/permissions(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_effective_permissions_by_external_id(organization_membership_id: "stub", resource_type_slug: "stub", external_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_role_assignments_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_role_assignments(organization_membership_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_assign_role_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}) + .with(body: hash_including("role_slug" => "stub", "resource_id" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.assign_role(organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")) + refute_nil result + end + + def test_assign_role_with_resource_target_by_external_id_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}) + .with(body: hash_including("role_slug" => "stub", "resource_external_id" => "stub", "resource_type_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.assign_role(organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetByExternalId.new(resource_external_id: "stub", resource_type_slug: "stub")) + refute_nil result + end + + def test_remove_role_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.remove_role(organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")) + assert_nil result + end + + def test_remove_role_with_resource_target_by_external_id_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.remove_role(organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetByExternalId.new(resource_external_id: "stub", resource_type_slug: "stub")) + assert_nil result + end + + def test_remove_role_assignment_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.remove_role_assignment(organization_membership_id: "stub", role_assignment_id: "stub") + assert_nil result + end + + def test_list_organization_roles_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.list_organization_roles(organization_id: "stub") + refute_nil result + end + + def test_create_organization_role_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_organization_role(organization_id: "stub", name: "stub") + refute_nil result + end + + def test_get_organization_role_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_organization_role(organization_id: "stub", slug: "stub") + refute_nil result + end + + def test_update_organization_role_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_organization_role(organization_id: "stub", slug: "stub") + refute_nil result + end + + def test_delete_organization_role_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_organization_role(organization_id: "stub", slug: "stub") + assert_nil result + end + + def test_add_organization_role_permission_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.add_organization_role_permission(organization_id: "stub", slug: "stub", body_slug: "stub") + refute_nil result + end + + def test_set_organization_role_permissions_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.set_organization_role_permissions(organization_id: "stub", slug: "stub", permissions: ["stub"]) + refute_nil result + end + + def test_remove_organization_role_permission_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.remove_organization_role_permission(organization_id: "stub", slug: "stub", permission_slug: "stub") + refute_nil result + end + + def test_get_resource_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub") + refute_nil result + end + + def test_update_resource_by_external_id_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}) + .with(body: hash_including("parent_resource_id" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")) + refute_nil result + end + + def test_update_resource_by_external_id_with_parent_resource_by_external_id_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}) + .with(body: hash_including("parent_resource_external_id" => "stub", "parent_resource_type_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_external_id: "stub", parent_resource_type_slug: "stub")) + refute_nil result + end + + def test_delete_resource_by_external_id_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub") + assert_nil result + end + + def test_list_memberships_for_resource_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub/organization_memberships(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_memberships_for_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub", permission_slug: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_role_assignments_for_resource_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub/role_assignments(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_role_assignments_for_resource_by_external_id(organization_id: "stub", resource_type_slug: "stub", external_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_resources_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_resources(parent: WorkOS::Authorization::ParentById.new(parent_resource_id: "stub")) + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_resources_with_parent_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_resources(parent: WorkOS::Authorization::ParentByExternalId.new(parent_resource_type_slug: "stub", parent_external_id: "stub")) + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_resource_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}) + .with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "parent_resource_id" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")) + refute_nil result + end + + def test_create_resource_with_parent_resource_by_external_id_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}) + .with(body: hash_including("external_id" => "stub", "name" => "stub", "resource_type_slug" => "stub", "organization_id" => "stub", "parent_resource_external_id" => "stub", "parent_resource_type_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_resource(external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_external_id: "stub", parent_resource_type_slug: "stub")) + refute_nil result + end + + def test_get_resource_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_resource(resource_id: "stub") + refute_nil result + end + + def test_update_resource_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}) + .with(body: hash_including("parent_resource_id" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")) + refute_nil result + end + + def test_update_resource_with_parent_resource_by_external_id_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}) + .with(body: hash_including("parent_resource_external_id" => "stub", "parent_resource_type_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_resource(resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceByExternalId.new(parent_resource_external_id: "stub", parent_resource_type_slug: "stub")) + refute_nil result + end + + def test_delete_resource_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_resource(resource_id: "stub") + assert_nil result + end + + def test_list_memberships_for_resource_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/resources/stub/organization_memberships(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_memberships_for_resource(resource_id: "stub", permission_slug: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_role_assignments_for_resource_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/resources/stub/role_assignments(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_role_assignments_for_resource(resource_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_environment_roles_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/roles(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.list_environment_roles + refute_nil result + end + + def test_create_environment_role_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/roles(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_environment_role(slug: "stub", name: "stub") + refute_nil result + end + + def test_get_environment_role_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/roles/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_environment_role(slug: "stub") + refute_nil result + end + + def test_update_environment_role_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/roles/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_environment_role(slug: "stub") + refute_nil result + end + + def test_add_environment_role_permission_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/roles/stub/permissions(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.add_environment_role_permission(slug: "stub", body_slug: "stub") + refute_nil result + end + + def test_set_environment_role_permissions_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/authorization/roles/stub/permissions(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.set_environment_role_permissions(slug: "stub", permissions: ["stub"]) + refute_nil result + end + + def test_list_permissions_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/permissions(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_permissions + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_permission_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/permissions(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_permission(slug: "stub", name: "stub") + refute_nil result + end + + def test_get_permission_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_permission(slug: "stub") + refute_nil result + end + + def test_update_permission_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.update_permission(slug: "stub") + refute_nil result + end + + def test_delete_permission_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_permission(slug: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :check, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/check(\?|\z)}, args: {organization_membership_id: "stub", permission_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")}}, + {name: :list_resources_for_membership, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources(\?|\z)}, args: {organization_membership_id: "stub", permission_slug: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")}}, + {name: :list_effective_permissions, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources/stub/permissions(\?|\z)}, args: {organization_membership_id: "stub", resource_id: "stub"}}, + {name: :list_effective_permissions_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources/stub/stub/permissions(\?|\z)}, args: {organization_membership_id: "stub", resource_type_slug: "stub", external_id: "stub"}}, + {name: :list_role_assignments, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}, args: {organization_membership_id: "stub"}}, + {name: :assign_role, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}, args: {organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")}}, + {name: :remove_role, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments(\?|\z)}, args: {organization_membership_id: "stub", role_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")}}, + {name: :remove_role_assignment, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/role_assignments/stub(\?|\z)}, args: {organization_membership_id: "stub", role_assignment_id: "stub"}}, + {name: :list_organization_roles, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles(\?|\z)}, args: {organization_id: "stub"}}, + {name: :create_organization_role, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles(\?|\z)}, args: {organization_id: "stub", name: "stub"}}, + {name: :get_organization_role, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :update_organization_role, verb: :patch, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :delete_organization_role, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}}, + {name: :add_organization_role_permission, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions(\?|\z)}, args: {organization_id: "stub", slug: "stub", body_slug: "stub"}}, + {name: :set_organization_role_permissions, verb: :put, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions(\?|\z)}, args: {organization_id: "stub", slug: "stub", permissions: ["stub"]}}, + {name: :remove_organization_role_permission, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/roles/stub/permissions/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub", permission_slug: "stub"}}, + {name: :get_resource_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}, args: {organization_id: "stub", resource_type_slug: "stub", external_id: "stub"}}, + {name: :update_resource_by_external_id, verb: :patch, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}, args: {organization_id: "stub", resource_type_slug: "stub", external_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")}}, + {name: :delete_resource_by_external_id, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub(\?|\z)}, args: {organization_id: "stub", resource_type_slug: "stub", external_id: "stub"}}, + {name: :list_memberships_for_resource_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub/organization_memberships(\?|\z)}, args: {organization_id: "stub", resource_type_slug: "stub", external_id: "stub", permission_slug: "stub"}}, + {name: :list_role_assignments_for_resource_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organizations/stub/resources/stub/stub/role_assignments(\?|\z)}, args: {organization_id: "stub", resource_type_slug: "stub", external_id: "stub"}}, + {name: :list_resources, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}, args: {parent: WorkOS::Authorization::ParentById.new(parent_resource_id: "stub")}}, + {name: :create_resource, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/resources(\?|\z)}, args: {external_id: "stub", name: "stub", resource_type_slug: "stub", organization_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")}}, + {name: :get_resource, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}, args: {resource_id: "stub"}}, + {name: :update_resource, verb: :patch, url: %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}, args: {resource_id: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")}}, + {name: :delete_resource, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/resources/stub(\?|\z)}, args: {resource_id: "stub"}}, + {name: :list_memberships_for_resource, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/resources/stub/organization_memberships(\?|\z)}, args: {resource_id: "stub", permission_slug: "stub"}}, + {name: :list_role_assignments_for_resource, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/resources/stub/role_assignments(\?|\z)}, args: {resource_id: "stub"}}, + {name: :list_environment_roles, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/roles(\?|\z)}}, + {name: :create_environment_role, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/roles(\?|\z)}, args: {slug: "stub", name: "stub"}}, + {name: :get_environment_role, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/roles/stub(\?|\z)}, args: {slug: "stub"}}, + {name: :update_environment_role, verb: :patch, url: %r{\Ahttps://api\.workos\.com/authorization/roles/stub(\?|\z)}, args: {slug: "stub"}}, + {name: :add_environment_role_permission, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/roles/stub/permissions(\?|\z)}, args: {slug: "stub", body_slug: "stub"}}, + {name: :set_environment_role_permissions, verb: :put, url: %r{\Ahttps://api\.workos\.com/authorization/roles/stub/permissions(\?|\z)}, args: {slug: "stub", permissions: ["stub"]}}, + {name: :list_permissions, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/permissions(\?|\z)}}, + {name: :create_permission, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/permissions(\?|\z)}, args: {slug: "stub", name: "stub"}}, + {name: :get_permission, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}, args: {slug: "stub"}}, + {name: :update_permission, verb: :patch, url: %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}, args: {slug: "stub"}}, + {name: :delete_permission, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/permissions/stub(\?|\z)}, args: {slug: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.authorization.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_base_client.rb b/test/workos/test_base_client.rb new file mode 100644 index 00000000..773620f7 --- /dev/null +++ b/test/workos/test_base_client.rb @@ -0,0 +1,217 @@ +# frozen_string_literal: true + +require "test_helper" + +class BaseClientTest < Minitest::Test + class RecordingClient < WorkOS::BaseClient + attr_reader :calls + + def initialize(**kwargs) + super + @calls = [] + end + + def get_request(**kwargs) + @calls << [:get, kwargs] + Net::HTTP::Get.new(kwargs[:path]) + end + + def post_request(**kwargs) + @calls << [:post, kwargs] + Net::HTTP::Post.new(kwargs[:path]) + end + + def put_request(**kwargs) + @calls << [:put, kwargs] + Net::HTTP::Put.new(kwargs[:path]) + end + + def patch_request(**kwargs) + @calls << [:patch, kwargs] + Net::HTTP::Patch.new(kwargs[:path]) + end + + def delete_request(**kwargs) + @calls << [:delete, kwargs] + Net::HTTP::Delete.new(kwargs[:path]) + end + + def execute_request(request:, request_options: nil) + [request.method, request_options] + end + end + + class CapturingLogger + attr_reader :events + + def initialize + @events = [] + end + + def debug(message) + @events << [:debug, message] + end + + def info(message) + @events << [:info, message] + end + + def warn(message) + @events << [:warn, message] + end + + def error(message) + @events << [:error, message] + end + end + + class FakeConnection + attr_reader :finished + + def initialize(started: true) + @started = started + @finished = false + end + + def started? + @started + end + + def finish + @finished = true + end + end + + def setup + @client = WorkOS::BaseClient.new(api_key: "sk_test_123", max_retries: 1) + end + + def test_request_dispatches_known_methods + client = RecordingClient.new(api_key: "sk_test_123") + + assert_equal ["GET", {timeout: 5}], client.request(method: :get, path: "/get", request_options: {timeout: 5}) + assert_equal ["POST", {}], client.request(method: :post, path: "/post", body: {ok: true}) + assert_equal ["PUT", {}], client.request(method: :put, path: "/put", body: {ok: true}) + assert_equal ["PATCH", {}], client.request(method: :patch, path: "/patch", body: {ok: true}) + assert_equal ["DELETE", {}], client.request(method: :delete, path: "/delete") + assert_equal %i[get post put patch delete], client.calls.map(&:first) + end + + def test_request_rejects_unknown_method + error = assert_raises(ArgumentError) do + @client.request(method: :trace, path: "/widgets") + end + + assert_equal "unsupported method", error.message + end + + def test_post_request_reads_idempotency_key_from_request_options + request = @client.post_request(path: "/widgets", auth: true, body: {name: "widget"}, request_options: {idempotency_key: "idem_123"}) + + assert_equal "idem_123", request["Idempotency-Key"] + end + + def test_retry_path_generates_idempotency_key_for_mutating_requests + stub_request(:post, "https://api.workos.com/widgets") + .to_return({status: 500, body: '{"message":"retry"}'}, {status: 200, body: "{}"}) + + @client.singleton_class.define_method(:sleep) { |_duration| nil } + @client.request(method: :post, path: "/widgets", body: {name: "widget"}) + + assert_requested(:post, "https://api.workos.com/widgets", times: 2) + assert_requested(:post, "https://api.workos.com/widgets", headers: {"Idempotency-Key" => /.+/}, times: 1) + end + + def test_409_idempotency_error_raises_specific_error + stub_request(:post, "https://api.workos.com/widgets") + .to_return(status: 409, body: '{"code":"idempotency_error","message":"conflict"}') + + assert_raises(WorkOS::IdempotencyError) do + @client.request(method: :post, path: "/widgets", body: {name: "widget"}) + end + end + + def test_api_error_rescues_http_errors_but_not_connection_errors + stub_request(:get, "https://api.workos.com/widgets") + .to_return(status: 401, body: '{"message":"Unauthorized"}') + + raised = assert_raises(WorkOS::APIError) do + @client.request(method: :get, path: "/widgets") + end + + assert_kind_of WorkOS::AuthenticationError, raised + refute WorkOS::APIConnectionError <= WorkOS::APIError + refute WorkOS::SignatureVerificationError <= WorkOS::APIError + end + + def test_log_level_is_a_threshold + logger = CapturingLogger.new + client = WorkOS::BaseClient.new(api_key: "sk_test_123", logger: logger, log_level: :warn) + + client.send(:log, :debug, "debug line") + client.send(:log, :info, "info line") + client.send(:log, :warn, "warn line") + client.send(:log, :error, "error line") + + assert_equal [[:warn, "warn line"], [:error, "error line"]], logger.events + end + + def test_evict_connection_removes_matching_pooled_connections + keep = FakeConnection.new + evict = FakeConnection.new + thread_connections = @client.send(:thread_connections) + thread_connections["https:api.workos.com:443:30"] = evict + thread_connections["https:other.workos.com:443:30"] = keep + + @client.send(:evict_connection, "https://api.workos.com") + + refute thread_connections.key?("https:api.workos.com:443:30") + assert thread_connections.key?("https:other.workos.com:443:30") + assert evict.finished + refute keep.finished + end + + def test_redact_path_strips_invitation_token_segment + redacted = @client.send(:redact_path, "/user_management/invitations/by_token/invtoken_secret123") + assert_equal "/user_management/invitations/by_token/[REDACTED]", redacted + end + + def test_redact_path_strips_magic_auth_token_segment + redacted = @client.send(:redact_path, "/user_management/magic_auth/magic_secret/extra") + assert_equal "/user_management/magic_auth/[REDACTED]/[REDACTED]", redacted + end + + def test_redact_path_preserves_non_token_paths + assert_equal "/organizations/org_123", @client.send(:redact_path, "/organizations/org_123") + end + + def test_redact_path_preserves_query_string + redacted = @client.send(:redact_path, "/user_management/invitations/by_token/secret?foo=bar") + assert_equal "/user_management/invitations/by_token/[REDACTED]?foo=bar", redacted + end + + def test_redact_path_handles_nil_and_empty + assert_nil @client.send(:redact_path, nil) + assert_equal "", @client.send(:redact_path, "") + end + + def test_redact_path_scrubs_sensitive_query_params + redacted = @client.send(:redact_path, "/user_management/sessions/logout?session_id=ses_abc123&return_to=https://app.example.com") + assert_equal "/user_management/sessions/logout?session_id=[REDACTED]&return_to=https://app.example.com", redacted + end + + def test_redact_path_scrubs_authorize_code_query_param + redacted = @client.send(:redact_path, "/user_management/authorize?client_id=client_1&code=auth_code_secret&state=xyz") + assert_equal "/user_management/authorize?client_id=client_1&code=[REDACTED]&state=xyz", redacted + end + + def test_redact_path_leaves_non_sensitive_query_params_untouched + redacted = @client.send(:redact_path, "/user_management/users?limit=10&order=desc") + assert_equal "/user_management/users?limit=10&order=desc", redacted + end + + def test_redact_path_scrubs_query_alongside_path_segment_redaction + redacted = @client.send(:redact_path, "/user_management/magic_auth/magic_secret?token=qs_token") + assert_equal "/user_management/magic_auth/[REDACTED]?token=[REDACTED]", redacted + end +end diff --git a/test/workos/test_connect.rb b/test/workos/test_connect.rb new file mode 100644 index 00000000..5c1d2dbb --- /dev/null +++ b/test/workos/test_connect.rb @@ -0,0 +1,127 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class ConnectTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_complete_oauth2_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authkit/oauth2/complete(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.complete_oauth2(external_auth_id: "stub", user: {}) + refute_nil result + end + + def test_list_applications_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.connect.list_applications + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_application_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.create_application(name: "stub", application_type: "oauth", is_first_party: true) + refute_nil result + end + + def test_create_oauth_application_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.create_oauth_application(name: "stub", is_first_party: true) + refute_nil result + end + + def test_create_oauth_application_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.connect.create_oauth_application(name: "stub", is_first_party: true) + end + end + + def test_create_m2m_application_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.create_m2m_application(name: "stub", organization_id: "stub") + refute_nil result + end + + def test_create_m2m_application_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.connect.create_m2m_application(name: "stub", organization_id: "stub") + end + end + + def test_get_application_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.get_application(id: "stub") + refute_nil result + end + + def test_update_application_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.update_application(id: "stub") + refute_nil result + end + + def test_delete_application_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.delete_application(id: "stub") + assert_nil result + end + + def test_list_application_client_secrets_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/connect/applications/stub/client_secrets(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.list_application_client_secrets(id: "stub") + refute_nil result + end + + def test_create_application_client_secret_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/connect/applications/stub/client_secrets(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.create_application_client_secret(id: "stub") + refute_nil result + end + + def test_delete_client_secret_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/connect/client_secrets/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.connect.delete_client_secret(id: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :complete_oauth2, verb: :post, url: %r{\Ahttps://api\.workos\.com/authkit/oauth2/complete(\?|\z)}, args: {external_auth_id: "stub", user: {}}}, + {name: :list_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}}, + {name: :create_application, verb: :post, url: %r{\Ahttps://api\.workos\.com/connect/applications(\?|\z)}, args: {name: "stub", application_type: "oauth", is_first_party: true}}, + {name: :get_application, verb: :get, url: %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}, args: {id: "stub"}}, + {name: :update_application, verb: :put, url: %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_application, verb: :delete, url: %r{\Ahttps://api\.workos\.com/connect/applications/stub(\?|\z)}, args: {id: "stub"}}, + {name: :list_application_client_secrets, verb: :get, url: %r{\Ahttps://api\.workos\.com/connect/applications/stub/client_secrets(\?|\z)}, args: {id: "stub"}}, + {name: :create_application_client_secret, verb: :post, url: %r{\Ahttps://api\.workos\.com/connect/applications/stub/client_secrets(\?|\z)}, args: {id: "stub"}}, + {name: :delete_client_secret, verb: :delete, url: %r{\Ahttps://api\.workos\.com/connect/client_secrets/stub(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.connect.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_directory_sync.rb b/test/workos/test_directory_sync.rb new file mode 100644 index 00000000..574ec0ee --- /dev/null +++ b/test/workos/test_directory_sync.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class DirectorySyncTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_directories_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directories(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.directory_sync.list_directories + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_get_directory_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.directory_sync.get_directory(id: "stub") + refute_nil result + end + + def test_delete_directory_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.directory_sync.delete_directory(id: "stub") + assert_nil result + end + + def test_list_groups_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.directory_sync.list_groups + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_get_group_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_groups/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.directory_sync.get_group(id: "stub") + refute_nil result + end + + def test_list_users_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_users(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.directory_sync.list_users + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_get_user_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/directory_users/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.directory_sync.get_user(id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_directories, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories(\?|\z)}}, + {name: :get_directory, verb: :get, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_directory, verb: :delete, url: %r{\Ahttps://api\.workos\.com/directories/stub(\?|\z)}, args: {id: "stub"}}, + {name: :list_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups(\?|\z)}}, + {name: :get_group, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_groups/stub(\?|\z)}, args: {id: "stub"}}, + {name: :list_users, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_users(\?|\z)}}, + {name: :get_user, verb: :get, url: %r{\Ahttps://api\.workos\.com/directory_users/stub(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.directory_sync.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_encryptors_aes_gcm.rb b/test/workos/test_encryptors_aes_gcm.rb new file mode 100644 index 00000000..24e87280 --- /dev/null +++ b/test/workos/test_encryptors_aes_gcm.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "base64" +require "json" +require "openssl" +require "securerandom" + +class EncryptorsAesGcmTest < Minitest::Test + PASSWORD = "test-cookie-password-at-least-32" + + def setup + @enc = WorkOS::Encryptors::AesGcm.new + end + + def test_seal_unseal_round_trip_hash + data = {"access_token" => "tok_abc", "refresh_token" => "ref_xyz"} + sealed = @enc.seal(data, PASSWORD) + assert_instance_of String, sealed + assert_equal data, @enc.unseal(sealed, PASSWORD) + end + + def test_seal_unseal_round_trip_string + sealed = @enc.seal("hello world", PASSWORD) + assert_equal "hello world", @enc.unseal(sealed, PASSWORD) + end + + def test_unseal_with_wrong_key_raises + sealed = @enc.seal({"x" => 1}, PASSWORD) + # Wrong key is the same length (>= 32 bytes) so the length guard doesn't + # short-circuit; we want to assert the underlying cipher rejection. + assert_raises(OpenSSL::Cipher::CipherError) do + @enc.unseal(sealed, "wrong-cookie-password-32-bytes--") + end + end + + def test_unseal_rejects_short_key + sealed = @enc.seal({"x" => 1}, PASSWORD) + assert_raises(ArgumentError) do + @enc.unseal(sealed, "too-short") + end + end + + def test_seal_rejects_short_key + assert_raises(ArgumentError) { @enc.seal({"x" => 1}, "too-short") } + assert_raises(ArgumentError) { @enc.seal({"x" => 1}, nil) } + assert_raises(ArgumentError) { @enc.seal({"x" => 1}, "") } + end + + def test_unseal_rejects_short_payload + assert_raises(ArgumentError) do + @enc.unseal(Base64.strict_encode64("short"), PASSWORD) + end + end + + def test_unseal_rejects_unknown_version + sealed = @enc.seal("data", PASSWORD) + raw = Base64.decode64(sealed) + tampered = Base64.strict_encode64("\x99".b + raw.b[1..]) + assert_raises(ArgumentError) do + @enc.unseal(tampered, PASSWORD) + end + end + + def test_each_seal_produces_unique_output + data = {"key" => "value"} + sealed1 = @enc.seal(data, PASSWORD) + sealed2 = @enc.seal(data, PASSWORD) + refute_equal sealed1, sealed2 + end + + def test_unseal_reads_legacy_v6_payload + data = {"access_token" => "tok_abc", "refresh_token" => "ref_xyz"} + sealed = legacy_v6_seal(data, PASSWORD) + assert_equal data, @enc.unseal(sealed, PASSWORD) + end + + private + + def legacy_v6_seal(data, key) + cipher = OpenSSL::Cipher.new("aes-256-gcm").encrypt + iv = SecureRandom.random_bytes(12) + cipher.key = key + cipher.iv = iv + ciphertext = cipher.update(JSON.generate(data)) + cipher.final + + Base64.encode64(iv + ciphertext + cipher.auth_tag) + end +end diff --git a/test/workos/test_events.rb b/test/workos/test_events.rb new file mode 100644 index 00000000..5e9b92ec --- /dev/null +++ b/test/workos/test_events.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class EventsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_events_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/events(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.events.list_events + assert_kind_of WorkOS::Types::ListStruct, result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_events, verb: :get, url: %r{\Ahttps://api\.workos\.com/events(\?|\z)}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.events.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_feature_flags.rb b/test/workos/test_feature_flags.rb new file mode 100644 index 00000000..0a231e52 --- /dev/null +++ b/test/workos/test_feature_flags.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class FeatureFlagsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_feature_flags_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/feature-flags(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.feature_flags.list_feature_flags + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_get_feature_flag_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/feature-flags/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.feature_flags.get_feature_flag(slug: "stub") + refute_nil result + end + + def test_disable_feature_flag_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/feature-flags/stub/disable(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.feature_flags.disable_feature_flag(slug: "stub") + refute_nil result + end + + def test_enable_feature_flag_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/feature-flags/stub/enable(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.feature_flags.enable_feature_flag(slug: "stub") + refute_nil result + end + + def test_add_flag_target_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/feature-flags/stub/targets/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.feature_flags.add_flag_target(resource_id: "stub", slug: "stub") + assert_nil result + end + + def test_remove_flag_target_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/feature-flags/stub/targets/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.feature_flags.remove_flag_target(resource_id: "stub", slug: "stub") + assert_nil result + end + + def test_list_organization_feature_flags_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/feature-flags(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.feature_flags.list_organization_feature_flags(organization_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_user_feature_flags_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/feature-flags(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.feature_flags.list_user_feature_flags(user_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_feature_flags, verb: :get, url: %r{\Ahttps://api\.workos\.com/feature-flags(\?|\z)}}, + {name: :get_feature_flag, verb: :get, url: %r{\Ahttps://api\.workos\.com/feature-flags/stub(\?|\z)}, args: {slug: "stub"}}, + {name: :disable_feature_flag, verb: :put, url: %r{\Ahttps://api\.workos\.com/feature-flags/stub/disable(\?|\z)}, args: {slug: "stub"}}, + {name: :enable_feature_flag, verb: :put, url: %r{\Ahttps://api\.workos\.com/feature-flags/stub/enable(\?|\z)}, args: {slug: "stub"}}, + {name: :add_flag_target, verb: :post, url: %r{\Ahttps://api\.workos\.com/feature-flags/stub/targets/stub(\?|\z)}, args: {resource_id: "stub", slug: "stub"}}, + {name: :remove_flag_target, verb: :delete, url: %r{\Ahttps://api\.workos\.com/feature-flags/stub/targets/stub(\?|\z)}, args: {resource_id: "stub", slug: "stub"}}, + {name: :list_organization_feature_flags, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/feature-flags(\?|\z)}, args: {organization_id: "stub"}}, + {name: :list_user_feature_flags, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/feature-flags(\?|\z)}, args: {user_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.feature_flags.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_groups.rb b/test/workos/test_groups.rb new file mode 100644 index 00000000..cc61912f --- /dev/null +++ b/test/workos/test_groups.rb @@ -0,0 +1,89 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class GroupsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_organization_groups_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/groups(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.groups.list_organization_groups(organization_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_organization_group_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/groups(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.create_organization_group(organization_id: "stub", name: "stub") + refute_nil result + end + + def test_get_organization_group_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.get_organization_group(organization_id: "stub", group_id: "stub") + refute_nil result + end + + def test_update_organization_group_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.update_organization_group(organization_id: "stub", group_id: "stub") + refute_nil result + end + + def test_delete_organization_group_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.delete_organization_group(organization_id: "stub", group_id: "stub") + assert_nil result + end + + def test_list_group_organization_memberships_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.groups.list_group_organization_memberships(organization_id: "stub", group_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_group_organization_membership_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.create_group_organization_membership(organization_id: "stub", group_id: "stub", organization_membership_id: "stub") + refute_nil result + end + + def test_delete_group_organization_membership_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.groups.delete_group_organization_membership(organization_id: "stub", group_id: "stub", om_id: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_organization_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups(\?|\z)}, args: {organization_id: "stub"}}, + {name: :create_organization_group, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups(\?|\z)}, args: {organization_id: "stub", name: "stub"}}, + {name: :get_organization_group, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}, args: {organization_id: "stub", group_id: "stub"}}, + {name: :update_organization_group, verb: :patch, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}, args: {organization_id: "stub", group_id: "stub"}}, + {name: :delete_organization_group, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub(\?|\z)}, args: {organization_id: "stub", group_id: "stub"}}, + {name: :list_group_organization_memberships, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships(\?|\z)}, args: {organization_id: "stub", group_id: "stub"}}, + {name: :create_group_organization_membership, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships(\?|\z)}, args: {organization_id: "stub", group_id: "stub", organization_membership_id: "stub"}}, + {name: :delete_group_organization_membership, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub/groups/stub/organization-memberships/stub(\?|\z)}, args: {organization_id: "stub", group_id: "stub", om_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.groups.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_list_struct.rb b/test/workos/test_list_struct.rb new file mode 100644 index 00000000..dd12d2a9 --- /dev/null +++ b/test/workos/test_list_struct.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require "test_helper" + +class ListStructTest < Minitest::Test + def test_next_page_uses_after_cursor + next_page = WorkOS::Types::ListStruct.new(data: [2], list_metadata: {}) + list = WorkOS::Types::ListStruct.new( + data: [1], + list_metadata: {"after" => "cursor_after"}, + fetch_next: lambda { |cursor| + assert_equal "cursor_after", cursor + next_page + } + ) + + assert_same next_page, list.next_page + end + + def test_previous_page_uses_before_cursor + previous_page = WorkOS::Types::ListStruct.new(data: [0], list_metadata: {}) + list = WorkOS::Types::ListStruct.new( + data: [1], + list_metadata: {"before" => "cursor_before"}, + fetch_previous: lambda { |cursor| + assert_equal "cursor_before", cursor + previous_page + } + ) + + assert_same previous_page, list.previous_page + end + + def test_next_page_returns_nil_without_cursor + list = WorkOS::Types::ListStruct.new(data: [1], list_metadata: {}, fetch_next: lambda { |_cursor| flunk("should not fetch") }) + + assert_nil list.next_page + end +end diff --git a/test/workos/test_model_round_trip.rb b/test/workos/test_model_round_trip.rb new file mode 100644 index 00000000..1df43396 --- /dev/null +++ b/test/workos/test_model_round_trip.rb @@ -0,0 +1,7337 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class ModelRoundTripTest < Minitest::Test + def test_user_object_round_trip + fixture = { + "id" => "stub", + "email" => "stub", + "first_name" => "stub", + "last_name" => "stub", + "metadata" => {} + } + model = WorkOS::UserObject.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_consent_option_round_trip + fixture = { + "claim" => "stub", + "type" => "enum", + "label" => "stub", + "choices" => [] + } + model = WorkOS::UserConsentOption.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["claim"], json[:claim] + assert_equal fixture["label"], json[:label] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_management_login_request_round_trip + fixture = { + "external_auth_id" => "stub", + "user" => {}, + "user_consent_options" => [] + } + model = WorkOS::UserManagementLoginRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["external_auth_id"], json[:external_auth_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_validate_api_key_round_trip + fixture = { + "value" => "stub" + } + model = WorkOS::ValidateApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["value"], json[:value] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_redirect_uri_input_round_trip + fixture = { + "uri" => "stub", + "default" => nil + } + model = WorkOS::RedirectUriInput.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["uri"], json[:uri] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_oauth_application_round_trip + fixture = { + "name" => "stub", + "application_type" => "oauth", + "description" => nil, + "scopes" => nil, + "redirect_uris" => nil, + "uses_pkce" => nil, + "is_first_party" => true, + "organization_id" => nil + } + model = WorkOS::CreateOAuthApplication.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + assert_equal fixture["is_first_party"], json[:is_first_party] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_m2m_application_round_trip + fixture = { + "name" => "stub", + "application_type" => "m2m", + "description" => nil, + "scopes" => nil, + "organization_id" => "stub" + } + model = WorkOS::CreateM2MApplication.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_oauth_application_round_trip + fixture = { + "name" => "stub", + "description" => nil, + "scopes" => nil, + "redirect_uris" => nil + } + model = WorkOS::UpdateOAuthApplication.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_application_secret_round_trip + model = WorkOS::CreateApplicationSecret.new("{}") + json = model.to_h + assert_kind_of Hash, json + end + + def test_audit_log_event_actor_round_trip + fixture = { + "id" => "stub", + "type" => "stub", + "name" => "stub", + "metadata" => {} + } + model = WorkOS::AuditLogEventActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["type"], json[:type] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_event_target_round_trip + fixture = { + "id" => "stub", + "type" => "stub", + "name" => "stub", + "metadata" => {} + } + model = WorkOS::AuditLogEventTarget.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["type"], json[:type] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_event_context_round_trip + fixture = { + "location" => "stub", + "user_agent" => "stub" + } + model = WorkOS::AuditLogEventContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["location"], json[:location] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_event_round_trip + fixture = { + "action" => "stub", + "occurred_at" => "stub", + "actor" => {}, + "targets" => [], + "context" => {}, + "metadata" => {}, + "version" => 1 + } + model = WorkOS::AuditLogEvent.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["action"], json[:action] + assert_equal fixture["occurred_at"], json[:occurred_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_event_ingestion_round_trip + fixture = { + "organization_id" => "stub", + "event" => {} + } + model = WorkOS::AuditLogEventIngestion.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_export_creation_round_trip + fixture = { + "organization_id" => "stub", + "range_start" => "stub", + "range_end" => "stub", + "actions" => [], + "actors" => [], + "actor_names" => [], + "actor_ids" => [], + "targets" => [] + } + model = WorkOS::AuditLogExportCreation.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["range_start"], json[:range_start] + assert_equal fixture["range_end"], json[:range_end] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_audit_logs_retention_round_trip + fixture = { + "retention_period_in_days" => 1 + } + model = WorkOS::UpdateAuditLogsRetention.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["retention_period_in_days"], json[:retention_period_in_days] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_actor_round_trip + fixture = { + "metadata" => {} + } + model = WorkOS::AuditLogSchemaActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_target_round_trip + fixture = { + "type" => "stub", + "metadata" => {} + } + model = WorkOS::AuditLogSchemaTarget.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["type"], json[:type] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_round_trip + fixture = { + "actor" => {}, + "targets" => [], + "metadata" => {} + } + model = WorkOS::AuditLogSchema.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_challenge_authentication_factor_round_trip + fixture = { + "sms_template" => "stub" + } + model = WorkOS::ChallengeAuthenticationFactor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_check_authorization_round_trip + fixture = { + "permission_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::CheckAuthorization.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["permission_slug"], json[:permission_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_assign_role_round_trip + fixture = { + "role_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::AssignRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["role_slug"], json[:role_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_remove_role_round_trip + fixture = { + "role_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::RemoveRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["role_slug"], json[:role_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_set_role_permissions_round_trip + fixture = { + "permissions" => [] + } + model = WorkOS::SetRolePermissions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_add_role_permission_round_trip + fixture = { + "slug" => "stub" + } + model = WorkOS::AddRolePermission.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_organization_role_round_trip + fixture = { + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub" + } + model = WorkOS::CreateOrganizationRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_organization_role_round_trip + fixture = { + "name" => "stub", + "description" => nil + } + model = WorkOS::UpdateOrganizationRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_authorization_permission_round_trip + fixture = { + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub" + } + model = WorkOS::CreateAuthorizationPermission.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_authorization_permission_round_trip + fixture = { + "name" => "stub", + "description" => nil + } + model = WorkOS::UpdateAuthorizationPermission.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_role_round_trip + fixture = { + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub" + } + model = WorkOS::CreateRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_role_round_trip + fixture = { + "name" => "stub", + "description" => nil + } + model = WorkOS::UpdateRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_authorization_resource_round_trip + fixture = { + "name" => "stub", + "description" => nil, + "parent_resource_id" => "stub", + "parent_resource_external_id" => "stub", + "parent_resource_type_slug" => "stub" + } + model = WorkOS::UpdateAuthorizationResource.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_authorization_resource_round_trip + fixture = { + "external_id" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub", + "organization_id" => "stub", + "parent_resource_id" => nil, + "parent_resource_external_id" => "stub", + "parent_resource_type_slug" => "stub" + } + model = WorkOS::CreateAuthorizationResource.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["external_id"], json[:external_id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_cors_origin_round_trip + fixture = { + "origin" => "stub" + } + model = WorkOS::CreateCORSOrigin.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["origin"], json[:origin] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_group_membership_round_trip + fixture = { + "organization_membership_id" => "stub" + } + model = WorkOS::CreateGroupMembership.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_membership_id"], json[:organization_membership_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_group_round_trip + fixture = { + "name" => "stub", + "description" => nil + } + model = WorkOS::CreateGroup.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_group_round_trip + fixture = { + "name" => "stub", + "description" => nil + } + model = WorkOS::UpdateGroup.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_jwt_template_round_trip + fixture = { + "content" => "stub" + } + model = WorkOS::UpdateJWTTemplate.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["content"], json[:content] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_organization_domain_round_trip + fixture = { + "domain" => "stub", + "organization_id" => "stub" + } + model = WorkOS::CreateOrganizationDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_organization_api_key_round_trip + fixture = { + "name" => "stub", + "permissions" => [] + } + model = WorkOS::CreateOrganizationApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_data_round_trip + fixture = { + "domain" => "stub", + "state" => "stub" + } + model = WorkOS::OrganizationDomainData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_input_round_trip + fixture = { + "name" => "stub", + "allow_profiles_outside_organization" => true, + "domains" => [], + "domain_data" => [], + "metadata" => nil, + "external_id" => nil + } + model = WorkOS::OrganizationInput.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_organization_round_trip + fixture = { + "name" => "stub", + "allow_profiles_outside_organization" => true, + "domains" => [], + "domain_data" => [], + "stripe_customer_id" => "stub", + "metadata" => nil, + "external_id" => nil + } + model = WorkOS::UpdateOrganization.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_intent_options_round_trip + fixture = { + "bookmark_slug" => "stub", + "provider_type" => "GoogleSAML" + } + model = WorkOS::SSOIntentOptions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_domain_verification_intent_options_round_trip + fixture = { + "domain_name" => "stub" + } + model = WorkOS::DomainVerificationIntentOptions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_intent_options_round_trip + fixture = { + "sso" => {}, + "domain_verification" => {} + } + model = WorkOS::IntentOptions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_generate_link_round_trip + fixture = { + "return_url" => "stub", + "success_url" => "stub", + "organization" => "stub", + "intent" => "stub", + "intent_options" => {}, + "it_contact_emails" => [] + } + model = WorkOS::GenerateLink.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization"], json[:organization] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_redirect_uri_round_trip + fixture = { + "uri" => "stub" + } + model = WorkOS::CreateRedirectUri.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["uri"], json[:uri] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_enroll_user_authentication_factor_round_trip + fixture = { + "type" => "totp", + "totp_issuer" => "stub", + "totp_user" => "stub", + "totp_secret" => "stub" + } + model = WorkOS::EnrollUserAuthenticationFactor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_magic_code_and_return_round_trip + fixture = { + "email" => "stub", + "invitation_token" => "stub" + } + model = WorkOS::CreateMagicCodeAndReturn.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_user_invite_options_round_trip + fixture = { + "email" => "stub", + "organization_id" => "stub", + "role_slug" => "stub", + "expires_in_days" => 1, + "inviter_user_id" => "stub", + "locale" => "stub" + } + model = WorkOS::CreateUserInviteOptions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_resend_user_invite_options_round_trip + fixture = { + "locale" => "stub" + } + model = WorkOS::ResendUserInviteOptions.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_user_organization_membership_round_trip + fixture = { + "user_id" => "stub", + "organization_id" => "stub", + "role_slug" => "stub", + "role_slugs" => [] + } + model = WorkOS::CreateUserOrganizationMembership.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_user_organization_membership_round_trip + fixture = { + "role_slug" => "stub", + "role_slugs" => [] + } + model = WorkOS::UpdateUserOrganizationMembership.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_user_api_key_round_trip + fixture = { + "name" => "stub", + "organization_id" => "stub", + "permissions" => [] + } + model = WorkOS::CreateUserApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_user_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil, + "email_verified" => nil, + "metadata" => nil, + "external_id" => nil, + "password" => nil, + "password_hash" => "stub", + "password_hash_type" => "stub" + } + model = WorkOS::CreateUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_user_round_trip + fixture = { + "email" => "stub", + "first_name" => "stub", + "last_name" => "stub", + "email_verified" => true, + "metadata" => nil, + "external_id" => nil, + "locale" => nil, + "password" => "stub", + "password_hash" => "stub", + "password_hash_type" => "stub" + } + model = WorkOS::UpdateUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_verify_email_address_round_trip + fixture = { + "code" => "stub" + } + model = WorkOS::VerifyEmailAddress.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_password_reset_token_round_trip + fixture = { + "email" => "stub" + } + model = WorkOS::CreatePasswordResetToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_password_reset_round_trip + fixture = { + "token" => "stub", + "new_password" => "stub" + } + model = WorkOS::CreatePasswordReset.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["token"], json[:token] + assert_equal fixture["new_password"], json[:new_password] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_send_email_change_round_trip + fixture = { + "new_email" => "stub" + } + model = WorkOS::SendEmailChange.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["new_email"], json[:new_email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_confirm_email_change_round_trip + fixture = { + "code" => "stub" + } + model = WorkOS::ConfirmEmailChange.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_revoke_session_round_trip + fixture = { + "session_id" => "stub", + "return_to" => "stub" + } + model = WorkOS::RevokeSession.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["session_id"], json[:session_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_create_webhook_endpoint_round_trip + fixture = { + "endpoint_url" => "stub", + "events" => [] + } + model = WorkOS::CreateWebhookEndpoint.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["endpoint_url"], json[:endpoint_url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_update_webhook_endpoint_round_trip + fixture = { + "endpoint_url" => "stub", + "status" => "stub", + "events" => [] + } + model = WorkOS::UpdateWebhookEndpoint.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_widget_session_token_round_trip + fixture = { + "organization_id" => "stub", + "user_id" => "stub", + "scopes" => [] + } + model = WorkOS::WidgetSessionToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_token_query_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "code" => "stub", + "grant_type" => "authorization_code" + } + model = WorkOS::TokenQuery.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_external_auth_complete_response_round_trip + fixture = { + "redirect_uri" => "stub" + } + model = WorkOS::ExternalAuthCompleteResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["redirect_uri"], json[:redirect_uri] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_validation_response_round_trip + fixture = { + "api_key" => nil + } + model = WorkOS::ApiKeyValidationResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connect_application_round_trip + fixture = { + "object" => "connect_application", + "id" => "stub", + "client_id" => "stub", + "description" => nil, + "name" => "stub", + "scopes" => [], + "created_at" => "stub", + "updated_at" => "stub", + "application_type" => "m2m", + "organization_id" => "stub" + } + model = WorkOS::ConnectApplication.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["client_id"], json[:client_id] + assert_nil json[:description] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_new_connect_application_secret_round_trip + fixture = { + "object" => "connect_application_secret", + "id" => "stub", + "secret_hint" => "stub", + "last_used_at" => nil, + "created_at" => "stub", + "updated_at" => "stub", + "secret" => "stub" + } + model = WorkOS::NewConnectApplicationSecret.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["secret_hint"], json[:secret_hint] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["secret"], json[:secret] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_event_create_response_round_trip + fixture = { + "success" => true + } + model = WorkOS::AuditLogEventCreateResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["success"], json[:success] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_export_json_round_trip + fixture = { + "object" => "audit_log_export", + "id" => "stub", + "state" => "stub", + "url" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuditLogExportJson.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_logs_retention_json_round_trip + fixture = { + "retention_period_in_days" => nil + } + model = WorkOS::AuditLogsRetentionJson.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:retention_period_in_days] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_json_round_trip + fixture = { + "object" => "audit_log_schema", + "version" => 1, + "actor" => {}, + "targets" => [], + "metadata" => {}, + "created_at" => "stub" + } + model = WorkOS::AuditLogSchemaJson.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["version"], json[:version] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_action_json_round_trip + fixture = { + "object" => "audit_log_action", + "name" => "stub", + "schema" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuditLogActionJson.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_challenge_round_trip + fixture = { + "object" => "authentication_challenge", + "id" => "stub", + "expires_at" => "stub", + "code" => "stub", + "authentication_factor_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuthenticationChallenge.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["authentication_factor_id"], json[:authentication_factor_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_challenge_verify_response_round_trip + fixture = { + "challenge" => {}, + "valid" => true + } + model = WorkOS::AuthenticationChallengeVerifyResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["valid"], json[:valid] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_enrolled_round_trip + fixture = { + "object" => "authentication_factor", + "id" => "stub", + "type" => "stub", + "user_id" => "stub", + "sms" => {}, + "totp" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuthenticationFactorEnrolled.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_round_trip + fixture = { + "object" => "authentication_factor", + "id" => "stub", + "type" => "stub", + "user_id" => "stub", + "sms" => {}, + "totp" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuthenticationFactor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authorization_check_round_trip + fixture = { + "authorized" => true + } + model = WorkOS::AuthorizationCheck.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["authorized"], json[:authorized] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authorization_resource_round_trip + fixture = { + "object" => "authorization_resource", + "name" => "stub", + "description" => nil, + "organization_id" => "stub", + "parent_resource_id" => nil, + "id" => "stub", + "external_id" => "stub", + "resource_type_slug" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuthorizationResource.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["organization_id"], json[:organization_id] + assert_nil json[:parent_resource_id] + assert_equal fixture["id"], json[:id] + assert_equal fixture["external_id"], json[:external_id] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authorization_permission_round_trip + fixture = { + "object" => "permission", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "system" => true, + "resource_type_slug" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::AuthorizationPermission.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["system"], json[:system] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_slim_role_round_trip + fixture = { + "slug" => "stub" + } + model = WorkOS::SlimRole.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_role_assignment_round_trip + fixture = { + "object" => "role_assignment", + "id" => "stub", + "organization_membership_id" => "stub", + "role" => {}, + "resource" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::UserRoleAssignment.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_membership_id"], json[:organization_membership_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_round_trip + fixture = { + "slug" => "stub", + "object" => "role", + "id" => "stub", + "name" => "stub", + "description" => nil, + "type" => "stub", + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Role.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_list_round_trip + fixture = { + "object" => "list", + "data" => [] + } + model = WorkOS::RoleList.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_round_trip + fixture = { + "object" => "user", + "id" => "stub", + "first_name" => nil, + "last_name" => nil, + "profile_picture_url" => nil, + "email" => "stub", + "email_verified" => true, + "external_id" => nil, + "metadata" => {}, + "last_sign_in_at" => nil, + "locale" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::User.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:first_name] + assert_nil json[:last_name] + assert_nil json[:profile_picture_url] + assert_equal fixture["email"], json[:email] + assert_equal fixture["email_verified"], json[:email_verified] + assert_nil json[:external_id] + assert_nil json[:last_sign_in_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_round_trip + fixture = { + "object" => "connection", + "id" => "stub", + "organization_id" => "stub", + "connection_type" => "stub", + "name" => "stub", + "state" => "stub", + "status" => "stub", + "domains" => [], + "options" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Connection.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_cors_origin_response_round_trip + fixture = { + "object" => "cors_origin", + "id" => "stub", + "origin" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::CORSOriginResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["origin"], json[:origin] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_round_trip + fixture = { + "object" => "directory", + "id" => "stub", + "organization_id" => "stub", + "external_key" => "stub", + "type" => "stub", + "state" => "stub", + "name" => "stub", + "domain" => "stub", + "metadata" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Directory.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["external_key"], json[:external_key] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_group_round_trip + fixture = { + "object" => "directory_group", + "id" => "stub", + "idp_id" => "stub", + "directory_id" => "stub", + "organization_id" => "stub", + "name" => "stub", + "raw_attributes" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::DirectoryGroup.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_equal fixture["directory_id"], json[:directory_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_user_with_groups_round_trip + fixture = { + "object" => "directory_user", + "id" => "stub", + "directory_id" => "stub", + "organization_id" => "stub", + "idp_id" => "stub", + "email" => nil, + "first_name" => nil, + "last_name" => nil, + "name" => nil, + "emails" => [], + "job_title" => nil, + "username" => nil, + "state" => "stub", + "raw_attributes" => {}, + "custom_attributes" => {}, + "role" => {}, + "roles" => [], + "created_at" => "stub", + "updated_at" => "stub", + "groups" => [] + } + model = WorkOS::DirectoryUserWithGroups.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["directory_id"], json[:directory_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_nil json[:email] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_round_trip + fixture = { + "object" => "group", + "id" => "stub", + "organization_id" => "stub", + "name" => "stub", + "description" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Group.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_context_actor_round_trip + fixture = { + "id" => "stub", + "source" => "stub", + "name" => nil + } + model = WorkOS::EventContextActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_context_round_trip + fixture = { + "google_analytics_client_id" => "stub", + "google_analytics_sessions" => [], + "ajs_anonymous_id" => "stub", + "client_id" => "stub", + "actor" => {}, + "previous_attributes" => {} + } + model = WorkOS::EventContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_user_round_trip + fixture = { + "object" => "directory_user", + "id" => "stub", + "directory_id" => "stub", + "organization_id" => "stub", + "idp_id" => "stub", + "email" => nil, + "first_name" => nil, + "last_name" => nil, + "name" => nil, + "emails" => [], + "job_title" => nil, + "username" => nil, + "state" => "stub", + "raw_attributes" => {}, + "custom_attributes" => {}, + "role" => {}, + "roles" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::DirectoryUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["directory_id"], json[:directory_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_nil json[:email] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_waitlist_user_round_trip + fixture = { + "object" => "waitlist_user", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "approved_at" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::WaitlistUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:approved_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_schema_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "stub", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::EventSchema.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["event"], json[:event] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_action_authentication_denied_round_trip + fixture = { + "id" => "stub", + "event" => "action.authentication.denied", + "data" => {}, + "context" => {}, + "created_at" => "stub", + "object" => "event" + } + model = WorkOS::ActionAuthenticationDenied.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_action_authentication_denied_data_round_trip + fixture = { + "action_endpoint_id" => "stub", + "action_execution_id" => "stub", + "type" => "authentication", + "verdict" => "Deny", + "user_id" => "stub", + "organization_id" => nil, + "email" => "stub", + "ip_address" => nil, + "user_agent" => nil + } + model = WorkOS::ActionAuthenticationDeniedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["action_endpoint_id"], json[:action_endpoint_id] + assert_equal fixture["action_execution_id"], json[:action_execution_id] + assert_equal fixture["user_id"], json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["email"], json[:email] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_action_user_registration_denied_round_trip + fixture = { + "id" => "stub", + "event" => "action.user_registration.denied", + "data" => {}, + "context" => {}, + "created_at" => "stub", + "object" => "event" + } + model = WorkOS::ActionUserRegistrationDenied.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_action_user_registration_denied_data_round_trip + fixture = { + "action_endpoint_id" => "stub", + "action_execution_id" => "stub", + "type" => "user_registration", + "verdict" => "Deny", + "organization_id" => nil, + "email" => "stub", + "ip_address" => nil, + "user_agent" => nil + } + model = WorkOS::ActionUserRegistrationDeniedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["action_endpoint_id"], json[:action_endpoint_id] + assert_equal fixture["action_execution_id"], json[:action_execution_id] + assert_nil json[:organization_id] + assert_equal fixture["email"], json[:email] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_created_round_trip + fixture = { + "id" => "stub", + "event" => "api_key.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ApiKeyCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_created_data_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ApiKeyCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_created_data_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::ApiKeyCreatedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_created_data_owner_round_trip + fixture = { + "type" => "user", + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::UserApiKeyCreatedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_revoked_round_trip + fixture = { + "id" => "stub", + "event" => "api_key.revoked", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ApiKeyRevoked.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_revoked_data_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ApiKeyRevokedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_revoked_data_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::ApiKeyRevokedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_revoked_data_owner_round_trip + fixture = { + "type" => "user", + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::UserApiKeyRevokedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_email_verification_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.email_verification_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationEmailVerificationFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_email_verification_failed_data_round_trip + fixture = { + "type" => "email_verification", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationEmailVerificationFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_email_verification_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationEmailVerificationFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_email_verification_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.email_verification_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationEmailVerificationSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_email_verification_succeeded_data_round_trip + fixture = { + "type" => "email_verification", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationEmailVerificationSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_magic_auth_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.magic_auth_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationMagicAuthFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_magic_auth_failed_data_round_trip + fixture = { + "type" => "magic_auth", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationMagicAuthFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_magic_auth_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationMagicAuthFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_magic_auth_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.magic_auth_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationMagicAuthSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_magic_auth_succeeded_data_round_trip + fixture = { + "type" => "magic_auth", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationMagicAuthSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_mfa_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.mfa_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationMFAFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_mfa_failed_data_round_trip + fixture = { + "type" => "mfa", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationMFAFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_mfa_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationMFAFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_mfa_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.mfa_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationMFASucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_mfa_succeeded_data_round_trip + fixture = { + "type" => "mfa", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationMFASucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_oauth_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.oauth_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationOAuthFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_oauth_failed_data_round_trip + fixture = { + "type" => "oauth", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationOAuthFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_oauth_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationOAuthFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_oauth_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.oauth_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationOAuthSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_oauth_succeeded_data_round_trip + fixture = { + "type" => "oauth", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => "stub" + } + model = WorkOS::AuthenticationOAuthSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_passkey_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.passkey_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationPasskeyFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_passkey_failed_data_round_trip + fixture = { + "type" => "passkey", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationPasskeyFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_passkey_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationPasskeyFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_passkey_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.passkey_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationPasskeySucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_passkey_succeeded_data_round_trip + fixture = { + "type" => "passkey", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationPasskeySucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_password_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.password_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationPasswordFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_password_failed_data_round_trip + fixture = { + "type" => "password", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "error" => {} + } + model = WorkOS::AuthenticationPasswordFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_password_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationPasswordFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_password_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.password_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationPasswordSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_password_succeeded_data_round_trip + fixture = { + "type" => "password", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationPasswordSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_radar_risk_detected_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.radar_risk_detected", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationRadarRiskDetected.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_radar_risk_detected_data_round_trip + fixture = { + "auth_method" => "stub", + "action" => "stub", + "control" => nil, + "blocklist_type" => nil, + "ip_address" => nil, + "user_agent" => nil, + "user_id" => "stub", + "email" => "stub" + } + model = WorkOS::AuthenticationRadarRiskDetectedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["auth_method"], json[:auth_method] + assert_nil json[:control] + assert_nil json[:blocklist_type] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_failed_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.sso_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationSSOFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_failed_data_round_trip + fixture = { + "type" => "sso", + "status" => "failed", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "sso" => {}, + "error" => {} + } + model = WorkOS::AuthenticationSSOFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_failed_data_sso_round_trip + fixture = { + "organization_id" => nil, + "connection_id" => nil, + "session_id" => nil + } + model = WorkOS::AuthenticationSSOFailedDataSSO.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:organization_id] + assert_nil json[:connection_id] + assert_nil json[:session_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_failed_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationSSOFailedDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_started_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.sso_started", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationSSOStarted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_started_data_round_trip + fixture = { + "type" => "sso", + "status" => "started", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "sso" => {} + } + model = WorkOS::AuthenticationSSOStartedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_started_data_sso_round_trip + fixture = { + "organization_id" => nil, + "connection_id" => nil, + "session_id" => nil + } + model = WorkOS::AuthenticationSSOStartedDataSSO.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:organization_id] + assert_nil json[:connection_id] + assert_nil json[:session_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.sso_succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationSSOSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_succeeded_data_round_trip + fixture = { + "type" => "sso", + "status" => "succeeded", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => "stub", + "sso" => {} + } + model = WorkOS::AuthenticationSSOSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_succeeded_data_sso_round_trip + fixture = { + "organization_id" => nil, + "connection_id" => nil, + "session_id" => nil + } + model = WorkOS::AuthenticationSSOSucceededDataSSO.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:organization_id] + assert_nil json[:connection_id] + assert_nil json[:session_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_timed_out_round_trip + fixture = { + "id" => "stub", + "event" => "authentication.sso_timed_out", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::AuthenticationSSOTimedOut.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_timed_out_data_round_trip + fixture = { + "type" => "sso", + "status" => "timed_out", + "ip_address" => nil, + "user_agent" => nil, + "user_id" => nil, + "email" => nil, + "sso" => {}, + "error" => {} + } + model = WorkOS::AuthenticationSSOTimedOutData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_nil json[:user_id] + assert_nil json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_timed_out_data_sso_round_trip + fixture = { + "organization_id" => nil, + "connection_id" => nil, + "session_id" => nil + } + model = WorkOS::AuthenticationSSOTimedOutDataSSO.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:organization_id] + assert_nil json[:connection_id] + assert_nil json[:session_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_sso_timed_out_data_error_round_trip + fixture = { + "code" => "stub", + "message" => "stub" + } + model = WorkOS::AuthenticationSSOTimedOutDataError.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_activated_round_trip + fixture = { + "id" => "stub", + "event" => "connection.activated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ConnectionActivated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_activated_data_round_trip + fixture = { + "object" => "connection", + "id" => "stub", + "state" => "stub", + "name" => "stub", + "connection_type" => "stub", + "organization_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "external_key" => "stub", + "status" => "stub", + "domains" => [] + } + model = WorkOS::ConnectionActivatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["external_key"], json[:external_key] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_activated_data_domain_round_trip + fixture = { + "object" => "connection_domain", + "id" => "stub", + "domain" => "stub" + } + model = WorkOS::ConnectionActivatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_deactivated_round_trip + fixture = { + "id" => "stub", + "event" => "connection.deactivated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ConnectionDeactivated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_deactivated_data_round_trip + fixture = { + "object" => "connection", + "id" => "stub", + "state" => "stub", + "name" => "stub", + "connection_type" => "stub", + "organization_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "external_key" => "stub", + "status" => "stub", + "domains" => [] + } + model = WorkOS::ConnectionDeactivatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["external_key"], json[:external_key] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_deactivated_data_domain_round_trip + fixture = { + "object" => "connection_domain", + "id" => "stub", + "domain" => "stub" + } + model = WorkOS::ConnectionDeactivatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "connection.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ConnectionDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_deleted_data_round_trip + fixture = { + "object" => "connection", + "id" => "stub", + "state" => "stub", + "name" => "stub", + "connection_type" => "stub", + "organization_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ConnectionDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewal_required_round_trip + fixture = { + "id" => "stub", + "event" => "connection.saml_certificate_renewal_required", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ConnectionSAMLCertificateRenewalRequired.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewal_required_data_round_trip + fixture = { + "connection" => {}, + "certificate" => {}, + "days_until_expiry" => 1 + } + model = WorkOS::ConnectionSAMLCertificateRenewalRequiredData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["days_until_expiry"], json[:days_until_expiry] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewal_required_data_connection_round_trip + fixture = { + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataConnection.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewal_required_data_certificate_round_trip + fixture = { + "certificate_type" => "stub", + "expiry_date" => "stub", + "is_expired" => true + } + model = WorkOS::ConnectionSAMLCertificateRenewalRequiredDataCertificate.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["expiry_date"], json[:expiry_date] + assert_equal fixture["is_expired"], json[:is_expired] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewed_round_trip + fixture = { + "id" => "stub", + "event" => "connection.saml_certificate_renewed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::ConnectionSAMLCertificateRenewed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewed_data_round_trip + fixture = { + "connection" => {}, + "certificate" => {}, + "renewed_at" => "stub" + } + model = WorkOS::ConnectionSAMLCertificateRenewedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["renewed_at"], json[:renewed_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewed_data_connection_round_trip + fixture = { + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::ConnectionSAMLCertificateRenewedDataConnection.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_saml_certificate_renewed_data_certificate_round_trip + fixture = { + "certificate_type" => "stub", + "expiry_date" => "stub" + } + model = WorkOS::ConnectionSAMLCertificateRenewedDataCertificate.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["expiry_date"], json[:expiry_date] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_activated_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.activated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncActivated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_activated_data_round_trip + fixture = { + "object" => "directory", + "id" => "stub", + "organization_id" => "stub", + "type" => "stub", + "state" => "stub", + "name" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "external_key" => "stub", + "domains" => [] + } + model = WorkOS::DsyncActivatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["external_key"], json[:external_key] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_activated_data_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "domain" => "stub" + } + model = WorkOS::DsyncActivatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_deactivated_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.deactivated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncDeactivated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_deactivated_data_round_trip + fixture = { + "object" => "directory", + "id" => "stub", + "organization_id" => "stub", + "type" => "stub", + "state" => "stub", + "name" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "external_key" => "stub", + "domains" => [] + } + model = WorkOS::DsyncDeactivatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["external_key"], json[:external_key] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_deactivated_data_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "domain" => "stub" + } + model = WorkOS::DsyncDeactivatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_deleted_data_round_trip + fixture = { + "object" => "directory", + "id" => "stub", + "organization_id" => "stub", + "type" => "stub", + "state" => "stub", + "name" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::DsyncDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_created_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.group.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncGroupCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.group.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncGroupDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_updated_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.group.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncGroupUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_updated_data_round_trip + fixture = { + "object" => "directory_group", + "id" => "stub", + "idp_id" => "stub", + "directory_id" => "stub", + "organization_id" => "stub", + "name" => "stub", + "raw_attributes" => {}, + "created_at" => "stub", + "updated_at" => "stub", + "previous_attributes" => {} + } + model = WorkOS::DsyncGroupUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_equal fixture["directory_id"], json[:directory_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_user_added_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.group.user_added", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncGroupUserAdded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_user_added_data_round_trip + fixture = { + "directory_id" => "stub", + "user" => {}, + "group" => {} + } + model = WorkOS::DsyncGroupUserAddedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["directory_id"], json[:directory_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_user_created_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.user.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncUserCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_user_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.user.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncUserDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_user_removed_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.group.user_removed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncGroupUserRemoved.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_group_user_removed_data_round_trip + fixture = { + "directory_id" => "stub", + "user" => {}, + "group" => {} + } + model = WorkOS::DsyncGroupUserRemovedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["directory_id"], json[:directory_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_user_updated_round_trip + fixture = { + "id" => "stub", + "event" => "dsync.user.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::DsyncUserUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_user_updated_data_round_trip + fixture = { + "object" => "directory_user", + "id" => "stub", + "directory_id" => "stub", + "organization_id" => "stub", + "idp_id" => "stub", + "email" => nil, + "first_name" => nil, + "last_name" => nil, + "name" => nil, + "emails" => [], + "job_title" => nil, + "username" => nil, + "state" => "stub", + "raw_attributes" => {}, + "custom_attributes" => {}, + "role" => {}, + "roles" => [], + "created_at" => "stub", + "updated_at" => "stub", + "previous_attributes" => {} + } + model = WorkOS::DsyncUserUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["directory_id"], json[:directory_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_nil json[:email] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_dsync_user_updated_data_email_round_trip + fixture = { + "primary" => true, + "type" => "stub", + "value" => nil + } + model = WorkOS::DsyncUserUpdatedDataEmail.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_verification_created_round_trip + fixture = { + "id" => "stub", + "event" => "email_verification.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::EmailVerificationCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_verification_created_data_round_trip + fixture = { + "object" => "email_verification", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::EmailVerificationCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_created_round_trip + fixture = { + "id" => "stub", + "event" => "flag.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::FlagCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_created_data_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "environment_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::FlagCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["environment_id"], json[:environment_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_created_data_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FlagCreatedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_created_context_round_trip + fixture = { + "client_id" => "stub", + "actor" => {} + } + model = WorkOS::FlagCreatedContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_created_context_actor_round_trip + fixture = { + "id" => "stub", + "source" => "stub", + "name" => nil + } + model = WorkOS::FlagCreatedContextActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "flag.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::FlagDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_deleted_data_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "environment_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::FlagDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["environment_id"], json[:environment_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_deleted_data_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FlagDeletedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_deleted_context_round_trip + fixture = { + "client_id" => "stub", + "actor" => {} + } + model = WorkOS::FlagDeletedContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_deleted_context_actor_round_trip + fixture = { + "id" => "stub", + "source" => "stub", + "name" => nil + } + model = WorkOS::FlagDeletedContextActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_round_trip + fixture = { + "id" => "stub", + "event" => "flag.rule_updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::FlagRuleUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_data_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "environment_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::FlagRuleUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["environment_id"], json[:environment_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_data_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FlagRuleUpdatedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_round_trip + fixture = { + "client_id" => "stub", + "actor" => {}, + "access_type" => "stub", + "configured_targets" => {}, + "previous_attributes" => {} + } + model = WorkOS::FlagRuleUpdatedContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_actor_round_trip + fixture = { + "id" => "stub", + "source" => "stub", + "name" => nil + } + model = WorkOS::FlagRuleUpdatedContextActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_configured_target_round_trip + fixture = { + "organizations" => [], + "users" => [] + } + model = WorkOS::FlagRuleUpdatedContextConfiguredTarget.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_configured_target_organization_round_trip + fixture = { + "id" => "stub", + "name" => "stub" + } + model = WorkOS::FlagRuleUpdatedContextConfiguredTargetOrganization.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_configured_target_user_round_trip + fixture = { + "id" => "stub", + "email" => "stub" + } + model = WorkOS::FlagRuleUpdatedContextConfiguredTargetUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_round_trip + fixture = { + "data" => {}, + "context" => {} + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttribute.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_data_round_trip + fixture = { + "enabled" => true, + "default_value" => true + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttributeData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_context_round_trip + fixture = { + "access_type" => "stub", + "configured_targets" => {} + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttributeContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_context_configured_target_round_trip + fixture = { + "organizations" => [], + "users" => [] + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTarget.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_context_configured_target_organization_round_trip + fixture = { + "id" => "stub", + "name" => "stub" + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetOrganization.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_rule_updated_context_previous_attribute_context_configured_target_user_round_trip + fixture = { + "id" => "stub", + "email" => "stub" + } + model = WorkOS::FlagRuleUpdatedContextPreviousAttributeContextConfiguredTargetUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_round_trip + fixture = { + "id" => "stub", + "event" => "flag.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::FlagUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_data_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "environment_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::FlagUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["environment_id"], json[:environment_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_data_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FlagUpdatedDataOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_context_round_trip + fixture = { + "client_id" => "stub", + "actor" => {}, + "previous_attributes" => {} + } + model = WorkOS::FlagUpdatedContext.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_context_actor_round_trip + fixture = { + "id" => "stub", + "source" => "stub", + "name" => nil + } + model = WorkOS::FlagUpdatedContextActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_context_previous_attribute_round_trip + fixture = { + "data" => {} + } + model = WorkOS::FlagUpdatedContextPreviousAttribute.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_updated_context_previous_attribute_data_round_trip + fixture = { + "name" => "stub", + "description" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true + } + model = WorkOS::FlagUpdatedContextPreviousAttributeData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_created_round_trip + fixture = { + "id" => "stub", + "event" => "group.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::GroupCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "group.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::GroupDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_member_added_round_trip + fixture = { + "id" => "stub", + "event" => "group.member_added", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::GroupMemberAdded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_member_added_data_round_trip + fixture = { + "group_id" => "stub", + "organization_membership_id" => "stub" + } + model = WorkOS::GroupMemberAddedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["group_id"], json[:group_id] + assert_equal fixture["organization_membership_id"], json[:organization_membership_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_member_removed_round_trip + fixture = { + "id" => "stub", + "event" => "group.member_removed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::GroupMemberRemoved.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_member_removed_data_round_trip + fixture = { + "group_id" => "stub", + "organization_membership_id" => "stub" + } + model = WorkOS::GroupMemberRemovedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["group_id"], json[:group_id] + assert_equal fixture["organization_membership_id"], json[:organization_membership_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_group_updated_round_trip + fixture = { + "id" => "stub", + "event" => "group.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::GroupUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_accepted_round_trip + fixture = { + "id" => "stub", + "event" => "invitation.accepted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::InvitationAccepted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_accepted_data_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::InvitationAcceptedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_created_round_trip + fixture = { + "id" => "stub", + "event" => "invitation.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::InvitationCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_created_data_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::InvitationCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_resent_round_trip + fixture = { + "id" => "stub", + "event" => "invitation.resent", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::InvitationResent.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_resent_data_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::InvitationResentData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_revoked_round_trip + fixture = { + "id" => "stub", + "event" => "invitation.revoked", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::InvitationRevoked.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_revoked_data_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::InvitationRevokedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_magic_auth_created_round_trip + fixture = { + "id" => "stub", + "event" => "magic_auth.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::MagicAuthCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_magic_auth_created_data_round_trip + fixture = { + "object" => "magic_auth", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::MagicAuthCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_created_round_trip + fixture = { + "id" => "stub", + "event" => "organization.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_created_data_round_trip + fixture = { + "object" => "organization", + "id" => "stub", + "name" => "stub", + "domains" => [], + "metadata" => {}, + "external_id" => nil, + "stripe_customer_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:external_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_created_data_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationCreatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "organization.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_deleted_data_round_trip + fixture = { + "object" => "organization", + "id" => "stub", + "name" => "stub", + "domains" => [], + "metadata" => {}, + "external_id" => nil, + "stripe_customer_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:external_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_deleted_data_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDeletedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_created_round_trip + fixture = { + "id" => "stub", + "event" => "organization_domain.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDomainCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_created_data_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "organization_domain.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDomainDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_deleted_data_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_updated_round_trip + fixture = { + "id" => "stub", + "event" => "organization_domain.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDomainUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_updated_data_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_verification_failed_round_trip + fixture = { + "id" => "stub", + "event" => "organization_domain.verification_failed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDomainVerificationFailed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_verification_failed_data_round_trip + fixture = { + "reason" => "stub", + "organization_domain" => {} + } + model = WorkOS::OrganizationDomainVerificationFailedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_verification_failed_data_organization_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainVerificationFailedDataOrganizationDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_verified_round_trip + fixture = { + "id" => "stub", + "event" => "organization_domain.verified", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationDomainVerified.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_verified_data_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainVerifiedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_created_round_trip + fixture = { + "id" => "stub", + "event" => "organization_membership.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationMembershipCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_created_data_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "role" => {}, + "roles" => [], + "custom_attributes" => {}, + "directory_managed" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationMembershipCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "organization_membership.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationMembershipDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_deleted_data_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "role" => {}, + "roles" => [], + "custom_attributes" => {}, + "directory_managed" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationMembershipDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_updated_round_trip + fixture = { + "id" => "stub", + "event" => "organization_membership.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationMembershipUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_updated_data_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "role" => {}, + "roles" => [], + "custom_attributes" => {}, + "directory_managed" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationMembershipUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_created_round_trip + fixture = { + "id" => "stub", + "event" => "organization_role.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationRoleCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_created_data_round_trip + fixture = { + "object" => "organization_role", + "organization_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationRoleCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "organization_role.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationRoleDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_deleted_data_round_trip + fixture = { + "object" => "organization_role", + "organization_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationRoleDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_updated_round_trip + fixture = { + "id" => "stub", + "event" => "organization_role.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationRoleUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_role_updated_data_round_trip + fixture = { + "object" => "organization_role", + "organization_id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationRoleUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_updated_round_trip + fixture = { + "id" => "stub", + "event" => "organization.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::OrganizationUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_updated_data_round_trip + fixture = { + "object" => "organization", + "id" => "stub", + "name" => "stub", + "domains" => [], + "metadata" => {}, + "external_id" => nil, + "stripe_customer_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:external_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_updated_data_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationUpdatedDataDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_reset_created_round_trip + fixture = { + "id" => "stub", + "event" => "password_reset.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::PasswordResetCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_reset_created_data_round_trip + fixture = { + "object" => "password_reset", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub" + } + model = WorkOS::PasswordResetCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_reset_succeeded_round_trip + fixture = { + "id" => "stub", + "event" => "password_reset.succeeded", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::PasswordResetSucceeded.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_reset_succeeded_data_round_trip + fixture = { + "object" => "password_reset", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub" + } + model = WorkOS::PasswordResetSucceededData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_created_round_trip + fixture = { + "id" => "stub", + "event" => "permission.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::PermissionCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_created_data_round_trip + fixture = { + "object" => "permission", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "system" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::PermissionCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["system"], json[:system] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "permission.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::PermissionDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_deleted_data_round_trip + fixture = { + "object" => "permission", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "system" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::PermissionDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["system"], json[:system] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_updated_round_trip + fixture = { + "id" => "stub", + "event" => "permission.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::PermissionUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_updated_data_round_trip + fixture = { + "object" => "permission", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "system" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::PermissionUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["system"], json[:system] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_created_round_trip + fixture = { + "id" => "stub", + "event" => "role.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::RoleCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_created_data_round_trip + fixture = { + "object" => "role", + "slug" => "stub", + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::RoleCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "role.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::RoleDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_deleted_data_round_trip + fixture = { + "object" => "role", + "slug" => "stub", + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::RoleDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_updated_round_trip + fixture = { + "id" => "stub", + "event" => "role.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::RoleUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_role_updated_data_round_trip + fixture = { + "object" => "role", + "slug" => "stub", + "resource_type_slug" => "stub", + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::RoleUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_created_round_trip + fixture = { + "id" => "stub", + "event" => "session.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::SessionCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_created_data_round_trip + fixture = { + "object" => "session", + "id" => "stub", + "impersonator" => {}, + "ip_address" => nil, + "organization_id" => "stub", + "user_agent" => nil, + "user_id" => "stub", + "auth_method" => "stub", + "status" => "stub", + "expires_at" => "stub", + "ended_at" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::SessionCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:ended_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_created_data_impersonator_round_trip + fixture = { + "email" => "stub", + "reason" => nil + } + model = WorkOS::SessionCreatedDataImpersonator.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:reason] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_revoked_round_trip + fixture = { + "id" => "stub", + "event" => "session.revoked", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::SessionRevoked.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_revoked_data_round_trip + fixture = { + "object" => "session", + "id" => "stub", + "impersonator" => {}, + "ip_address" => nil, + "organization_id" => "stub", + "user_agent" => nil, + "user_id" => "stub", + "auth_method" => "stub", + "status" => "stub", + "expires_at" => "stub", + "ended_at" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::SessionRevokedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:ended_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_session_revoked_data_impersonator_round_trip + fixture = { + "email" => "stub", + "reason" => nil + } + model = WorkOS::SessionRevokedDataImpersonator.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:reason] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_created_round_trip + fixture = { + "id" => "stub", + "event" => "user.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::UserCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "user.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::UserDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_updated_round_trip + fixture = { + "id" => "stub", + "event" => "user.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::UserUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_byok_key_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "vault.byok_key.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultByokKeyDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_byok_key_deleted_data_round_trip + fixture = { + "organization_id" => "stub", + "key_provider" => "stub" + } + model = WorkOS::VaultByokKeyDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_byok_key_verification_completed_round_trip + fixture = { + "id" => "stub", + "event" => "vault.byok_key.verification_completed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultByokKeyVerificationCompleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_byok_key_verification_completed_data_round_trip + fixture = { + "organization_id" => "stub", + "key_provider" => "stub", + "verified" => true + } + model = WorkOS::VaultByokKeyVerificationCompletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["verified"], json[:verified] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_created_round_trip + fixture = { + "id" => "stub", + "event" => "vault.data.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDataCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_created_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "kv_name" => "stub", + "key_id" => "stub", + "key_context" => {} + } + model = WorkOS::VaultDataCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["kv_name"], json[:kv_name] + assert_equal fixture["key_id"], json[:key_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_deleted_round_trip + fixture = { + "id" => "stub", + "event" => "vault.data.deleted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDataDeleted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_deleted_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "kv_name" => "stub" + } + model = WorkOS::VaultDataDeletedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["kv_name"], json[:kv_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_read_round_trip + fixture = { + "id" => "stub", + "event" => "vault.data.read", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDataRead.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_read_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "kv_name" => "stub", + "key_id" => "stub" + } + model = WorkOS::VaultDataReadData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["kv_name"], json[:kv_name] + assert_equal fixture["key_id"], json[:key_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_updated_round_trip + fixture = { + "id" => "stub", + "event" => "vault.data.updated", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDataUpdated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_data_updated_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "kv_name" => "stub", + "key_id" => "stub", + "key_context" => {} + } + model = WorkOS::VaultDataUpdatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["kv_name"], json[:kv_name] + assert_equal fixture["key_id"], json[:key_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_dek_decrypted_round_trip + fixture = { + "id" => "stub", + "event" => "vault.dek.decrypted", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDekDecrypted.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_dek_decrypted_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "key_id" => "stub" + } + model = WorkOS::VaultDekDecryptedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["key_id"], json[:key_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_dek_read_round_trip + fixture = { + "id" => "stub", + "event" => "vault.dek.read", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultDekRead.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_dek_read_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "key_ids" => [], + "key_context" => {} + } + model = WorkOS::VaultDekReadData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_kek_created_round_trip + fixture = { + "id" => "stub", + "event" => "vault.kek.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultKekCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_kek_created_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "key_name" => "stub", + "key_id" => "stub" + } + model = WorkOS::VaultKekCreatedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["key_name"], json[:key_name] + assert_equal fixture["key_id"], json[:key_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_metadata_read_round_trip + fixture = { + "id" => "stub", + "event" => "vault.metadata.read", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultMetadataRead.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_metadata_read_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub", + "kv_name" => "stub" + } + model = WorkOS::VaultMetadataReadData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + assert_equal fixture["kv_name"], json[:kv_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_names_listed_round_trip + fixture = { + "id" => "stub", + "event" => "vault.names.listed", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::VaultNamesListed.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_vault_names_listed_data_round_trip + fixture = { + "actor_id" => "stub", + "actor_source" => "stub", + "actor_name" => "stub" + } + model = WorkOS::VaultNamesListedData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["actor_id"], json[:actor_id] + assert_equal fixture["actor_name"], json[:actor_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_waitlist_user_approved_round_trip + fixture = { + "id" => "stub", + "event" => "waitlist_user.approved", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::WaitlistUserApproved.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_waitlist_user_created_round_trip + fixture = { + "id" => "stub", + "event" => "waitlist_user.created", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::WaitlistUserCreated.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_waitlist_user_denied_round_trip + fixture = { + "id" => "stub", + "event" => "waitlist_user.denied", + "data" => {}, + "created_at" => "stub", + "context" => {}, + "object" => "event" + } + model = WorkOS::WaitlistUserDenied.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_stand_alone_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomainStandAlone.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Flag.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_api_key_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_api_key_with_value_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub", + "value" => "stub" + } + model = WorkOS::OrganizationApiKeyWithValue.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["value"], json[:value] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_round_trip + fixture = { + "object" => "organization", + "id" => "stub", + "name" => "stub", + "domains" => [], + "metadata" => {}, + "external_id" => nil, + "stripe_customer_id" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "allow_profiles_outside_organization" => true + } + model = WorkOS::Organization.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:external_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_configuration_round_trip + fixture = { + "organization_id" => "stub", + "retention_period_in_days" => 1, + "state" => "stub", + "log_stream" => {} + } + model = WorkOS::AuditLogConfiguration.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["retention_period_in_days"], json[:retention_period_in_days] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integration_authorize_url_response_round_trip + fixture = { + "url" => "stub" + } + model = WorkOS::DataIntegrationAuthorizeUrlResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["url"], json[:url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integration_access_token_response_round_trip + fixture = { + "active" => true, + "access_token" => {}, + "error" => "stub" + } + model = WorkOS::DataIntegrationAccessTokenResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connected_account_round_trip + fixture = { + "object" => "connected_account", + "id" => "stub", + "user_id" => nil, + "organization_id" => nil, + "scopes" => [], + "state" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ConnectedAccount.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_round_trip + fixture = { + "object" => "list", + "data" => [] + } + model = WorkOS::DataIntegrationsListResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_portal_link_response_round_trip + fixture = { + "link" => "stub" + } + model = WorkOS::PortalLinkResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["link"], json[:link] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_standalone_response_round_trip + fixture = { + "verdict" => "stub", + "reason" => "stub", + "attempt_id" => "stub", + "control" => "stub", + "blocklist_type" => "stub" + } + model = WorkOS::RadarStandaloneResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["reason"], json[:reason] + assert_equal fixture["attempt_id"], json[:attempt_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_list_entry_already_present_response_round_trip + fixture = { + "message" => "stub" + } + model = WorkOS::RadarListEntryAlreadyPresentResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["message"], json[:message] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_redirect_uri_round_trip + fixture = { + "object" => "redirect_uri", + "id" => "stub", + "uri" => "stub", + "default" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::RedirectUri.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["uri"], json[:uri] + assert_equal fixture["default"], json[:default] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_authentication_factor_enroll_response_round_trip + fixture = { + "authentication_factor" => {}, + "authentication_challenge" => {} + } + model = WorkOS::UserAuthenticationFactorEnrollResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_magic_auth_round_trip + fixture = { + "object" => "magic_auth", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "code" => "stub" + } + model = WorkOS::MagicAuth.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_invite_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub", + "token" => "stub", + "accept_invitation_url" => "stub" + } + model = WorkOS::UserInvite.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["token"], json[:token] + assert_equal fixture["accept_invitation_url"], json[:accept_invitation_url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_organization_membership_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "directory_managed" => true, + "organization_name" => "stub", + "custom_attributes" => {}, + "created_at" => "stub", + "updated_at" => "stub", + "role" => {}, + "user" => {} + } + model = WorkOS::UserOrganizationMembership.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::UserApiKey.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_with_value_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub", + "value" => "stub" + } + model = WorkOS::UserApiKeyWithValue.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_equal fixture["obfuscated_value"], json[:obfuscated_value] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["value"], json[:value] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_verification_round_trip + fixture = { + "object" => "email_verification", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "code" => "stub" + } + model = WorkOS::EmailVerification.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_send_verification_email_response_round_trip + fixture = { + "user" => {} + } + model = WorkOS::SendVerificationEmailResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_verify_email_response_round_trip + fixture = { + "user" => {} + } + model = WorkOS::VerifyEmailResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_reset_round_trip + fixture = { + "object" => "password_reset", + "id" => "stub", + "user_id" => "stub", + "email" => "stub", + "expires_at" => "stub", + "created_at" => "stub", + "password_reset_token" => "stub", + "password_reset_url" => "stub" + } + model = WorkOS::PasswordReset.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["email"], json[:email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["password_reset_token"], json[:password_reset_token] + assert_equal fixture["password_reset_url"], json[:password_reset_url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_reset_password_response_round_trip + fixture = { + "user" => {} + } + model = WorkOS::ResetPasswordResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_change_round_trip + fixture = { + "object" => "email_change", + "user" => {}, + "new_email" => "stub", + "expires_at" => "stub", + "created_at" => "stub" + } + model = WorkOS::EmailChange.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["new_email"], json[:new_email] + assert_equal fixture["expires_at"], json[:expires_at] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authenticate_response_round_trip + fixture = { + "user" => {}, + "organization_id" => "stub", + "authkit_authorization_code" => "stub", + "access_token" => "stub", + "refresh_token" => "stub", + "authentication_method" => "stub", + "impersonator" => {}, + "oauth_tokens" => {} + } + model = WorkOS::AuthenticateResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["access_token"], json[:access_token] + assert_equal fixture["refresh_token"], json[:refresh_token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_device_authorization_response_round_trip + fixture = { + "device_code" => "stub", + "user_code" => "stub", + "verification_uri" => "stub", + "verification_uri_complete" => "stub", + "expires_in" => 1.0, + "interval" => 1.0 + } + model = WorkOS::DeviceAuthorizationResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["device_code"], json[:device_code] + assert_equal fixture["user_code"], json[:user_code] + assert_equal fixture["verification_uri"], json[:verification_uri] + assert_equal fixture["expires_in"], json[:expires_in] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_webhook_endpoint_json_round_trip + fixture = { + "object" => "webhook_endpoint", + "id" => "stub", + "endpoint_url" => "stub", + "secret" => "stub", + "status" => "stub", + "events" => [], + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::WebhookEndpointJson.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["endpoint_url"], json[:endpoint_url] + assert_equal fixture["secret"], json[:secret] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_widget_session_token_response_round_trip + fixture = { + "token" => "stub" + } + model = WorkOS::WidgetSessionTokenResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["token"], json[:token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_authorize_url_response_round_trip + fixture = { + "url" => "stub" + } + model = WorkOS::SSOAuthorizeUrlResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["url"], json[:url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_profile_round_trip + fixture = { + "object" => "profile", + "id" => "stub", + "organization_id" => nil, + "connection_id" => "stub", + "connection_type" => "stub", + "idp_id" => "stub", + "email" => "stub", + "first_name" => nil, + "last_name" => nil, + "name" => nil, + "role" => nil, + "roles" => nil, + "groups" => [], + "custom_attributes" => {}, + "raw_attributes" => {} + } + model = WorkOS::Profile.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:organization_id] + assert_equal fixture["connection_id"], json[:connection_id] + assert_equal fixture["idp_id"], json[:idp_id] + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + assert_nil json[:name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_token_response_round_trip + fixture = { + "token_type" => "Bearer", + "access_token" => "stub", + "expires_in" => 1, + "profile" => {}, + "oauth_tokens" => {} + } + model = WorkOS::SSOTokenResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["access_token"], json[:access_token] + assert_equal fixture["expires_in"], json[:expires_in] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_logout_authorize_response_round_trip + fixture = { + "logout_url" => "stub", + "logout_token" => "stub" + } + model = WorkOS::SSOLogoutAuthorizeResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["logout_url"], json[:logout_url] + assert_equal fixture["logout_token"], json[:logout_token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_jwks_response_round_trip + fixture = { + "keys" => [] + } + model = WorkOS::JwksResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_jwt_template_response_round_trip + fixture = { + "object" => "jwt_template", + "content" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::JWTTemplateResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["content"], json[:content] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_jwks_response_keys_round_trip + fixture = { + "alg" => "RS256", + "kty" => "RSA", + "use" => "sig", + "x5c" => [], + "n" => "stub", + "e" => "stub", + "kid" => "stub", + "x5t#S256" => "stub" + } + model = WorkOS::JwksResponseKeys.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["n"], json[:n] + assert_equal fixture["e"], json[:e] + assert_equal fixture["kid"], json[:kid] + assert_equal fixture["x5t#S256"], json["x5t#S256"] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_token_response_oauth_token_round_trip + fixture = { + "provider" => "stub", + "refresh_token" => "stub", + "access_token" => "stub", + "expires_at" => 1, + "scopes" => [] + } + model = WorkOS::SSOTokenResponseOAuthToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["provider"], json[:provider] + assert_equal fixture["refresh_token"], json[:refresh_token] + assert_equal fixture["access_token"], json[:access_token] + assert_equal fixture["expires_at"], json[:expires_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authenticate_response_impersonator_round_trip + fixture = { + "email" => "stub", + "reason" => nil + } + model = WorkOS::AuthenticateResponseImpersonator.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:reason] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authenticate_response_oauth_token_round_trip + fixture = { + "provider" => "stub", + "refresh_token" => "stub", + "access_token" => "stub", + "expires_at" => 1, + "scopes" => [] + } + model = WorkOS::AuthenticateResponseOAuthToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["provider"], json[:provider] + assert_equal fixture["refresh_token"], json[:refresh_token] + assert_equal fixture["access_token"], json[:access_token] + assert_equal fixture["expires_at"], json[:expires_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_with_value_owner_round_trip + fixture = { + "type" => "user", + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::UserApiKeyWithValueOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_api_key_owner_round_trip + fixture = { + "type" => "user", + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::UserApiKeyOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_data_round_trip + fixture = { + "object" => "data_provider", + "id" => "stub", + "name" => "stub", + "description" => nil, + "slug" => "stub", + "integration_type" => "stub", + "credentials_type" => "stub", + "scopes" => nil, + "ownership" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "connected_account" => nil + } + model = WorkOS::DataIntegrationsListResponseData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["integration_type"], json[:integration_type] + assert_equal fixture["credentials_type"], json[:credentials_type] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integration_access_token_response_access_token_round_trip + fixture = { + "object" => "access_token", + "access_token" => "stub", + "expires_at" => nil, + "scopes" => [], + "missing_scopes" => [] + } + model = WorkOS::DataIntegrationAccessTokenResponseAccessToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["access_token"], json[:access_token] + assert_nil json[:expires_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_configuration_log_stream_round_trip + fixture = { + "id" => "stub", + "type" => "stub", + "state" => "stub", + "last_synced_at" => nil, + "created_at" => "stub" + } + model = WorkOS::AuditLogConfigurationLogStream.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:last_synced_at] + assert_equal fixture["created_at"], json[:created_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_domain_round_trip + fixture = { + "object" => "organization_domain", + "id" => "stub", + "organization_id" => "stub", + "domain" => "stub", + "state" => "stub", + "verification_prefix" => "stub", + "verification_token" => "stub", + "verification_strategy" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::OrganizationDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["domain"], json[:domain] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_api_key_with_value_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::OrganizationApiKeyWithValueOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_api_key_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::OrganizationApiKeyOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_flag_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FlagOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_list_list_metadata_round_trip + fixture = { + "after" => nil + } + model = WorkOS::EventListListMetadata.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:after] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_user_email_round_trip + fixture = { + "primary" => true, + "type" => "stub", + "value" => nil + } + model = WorkOS::DirectoryUserEmail.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_event_context_google_analytics_session_round_trip + fixture = { + "containerId" => "stub", + "sessionId" => "stub", + "sessionNumber" => "stub" + } + model = WorkOS::EventContextGoogleAnalyticsSession.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["containerId"], json[:containerId] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_organization_membership_base_list_data_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "directory_managed" => true, + "organization_name" => "stub", + "custom_attributes" => {}, + "created_at" => "stub", + "updated_at" => "stub", + "user" => {} + } + model = WorkOS::UserOrganizationMembershipBaseListData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_user_with_groups_email_round_trip + fixture = { + "primary" => true, + "type" => "stub", + "value" => nil + } + model = WorkOS::DirectoryUserWithGroupsEmail.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_metadata_round_trip + fixture = { + "users" => {}, + "groups" => 1 + } + model = WorkOS::DirectoryMetadata.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["groups"], json[:groups] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_domain_round_trip + fixture = { + "id" => "stub", + "object" => "connection_domain", + "domain" => "stub" + } + model = WorkOS::ConnectionDomain.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["domain"], json[:domain] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_connection_option_round_trip + fixture = { + "signing_cert" => nil + } + model = WorkOS::ConnectionOption.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_nil json[:signing_cert] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_role_assignment_resource_round_trip + fixture = { + "id" => "stub", + "external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::UserRoleAssignmentResource.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["external_id"], json[:external_id] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_sms_round_trip + fixture = { + "phone_number" => "stub" + } + model = WorkOS::AuthenticationFactorSms.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["phone_number"], json[:phone_number] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_totp_round_trip + fixture = { + "issuer" => "stub", + "user" => "stub" + } + model = WorkOS::AuthenticationFactorTotp.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["issuer"], json[:issuer] + assert_equal fixture["user"], json[:user] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_enrolled_sms_round_trip + fixture = { + "phone_number" => "stub" + } + model = WorkOS::AuthenticationFactorEnrolledSms.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["phone_number"], json[:phone_number] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factor_enrolled_totp_round_trip + fixture = { + "issuer" => "stub", + "user" => "stub", + "secret" => "stub", + "qr_code" => "stub", + "uri" => "stub" + } + model = WorkOS::AuthenticationFactorEnrolledTotp.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["issuer"], json[:issuer] + assert_equal fixture["user"], json[:user] + assert_equal fixture["secret"], json[:secret] + assert_equal fixture["qr_code"], json[:qr_code] + assert_equal fixture["uri"], json[:uri] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_json_actor_round_trip + fixture = { + "metadata" => {} + } + model = WorkOS::AuditLogSchemaJsonActor.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_audit_log_schema_json_target_round_trip + fixture = { + "type" => "stub", + "metadata" => {} + } + model = WorkOS::AuditLogSchemaJsonTarget.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["type"], json[:type] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authorized_connect_application_list_data_round_trip + fixture = { + "object" => "authorized_connect_application", + "id" => "stub", + "granted_scopes" => [], + "oauth_resource" => "stub", + "application" => {} + } + model = WorkOS::AuthorizedConnectApplicationListData.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_api_key_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::ApiKeyOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_consent_option_choice_round_trip + fixture = { + "value" => "stub", + "label" => "stub" + } + model = WorkOS::UserConsentOptionChoice.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_challenges_verify_request_round_trip + fixture = { + "code" => "stub" + } + model = WorkOS::AuthenticationChallengesVerifyRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authentication_factors_create_request_round_trip + fixture = { + "type" => "stub", + "phone_number" => "stub", + "totp_issuer" => "stub", + "totp_user" => "stub", + "user_id" => "stub" + } + model = WorkOS::AuthenticationFactorsCreateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_permission_round_trip + fixture = { + "object" => "permission", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "system" => true, + "resource_type_slug" => "stub", + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::Permission.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["system"], json[:system] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_application_credentials_list_item_round_trip + fixture = { + "object" => "connect_application_secret", + "id" => "stub", + "secret_hint" => "stub", + "last_used_at" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::ApplicationCredentialsListItem.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["secret_hint"], json[:secret_hint] + assert_nil json[:last_used_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_get_data_integration_authorize_url_request_round_trip + fixture = { + "user_id" => "stub", + "organization_id" => "stub", + "return_to" => "stub" + } + model = WorkOS::DataIntegrationsGetDataIntegrationAuthorizeUrlRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["user_id"], json[:user_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_get_user_token_request_round_trip + fixture = { + "user_id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["user_id"], json[:user_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_feature_flag_round_trip + fixture = { + "object" => "feature_flag", + "id" => "stub", + "slug" => "stub", + "name" => "stub", + "description" => nil, + "owner" => nil, + "tags" => [], + "enabled" => true, + "default_value" => true, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::FeatureFlag.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_nil json[:description] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["default_value"], json[:default_value] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_feature_flag_owner_round_trip + fixture = { + "email" => "stub", + "first_name" => nil, + "last_name" => nil + } + model = WorkOS::FeatureFlagOwner.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:first_name] + assert_nil json[:last_name] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_standalone_assess_request_round_trip + fixture = { + "ip_address" => "stub", + "user_agent" => "stub", + "email" => "stub", + "auth_method" => "stub", + "action" => "stub", + "device_fingerprint" => "stub", + "bot_score" => "stub" + } + model = WorkOS::RadarStandaloneAssessRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["ip_address"], json[:ip_address] + assert_equal fixture["user_agent"], json[:user_agent] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_standalone_update_radar_attempt_request_round_trip + fixture = { + "challenge_status" => "success", + "attempt_status" => "success" + } + model = WorkOS::RadarStandaloneUpdateRadarAttemptRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_standalone_update_radar_list_request_round_trip + fixture = { + "entry" => "stub" + } + model = WorkOS::RadarStandaloneUpdateRadarListRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["entry"], json[:entry] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_radar_standalone_delete_radar_list_entry_request_round_trip + fixture = { + "entry" => "stub" + } + model = WorkOS::RadarStandaloneDeleteRadarListEntryRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["entry"], json[:entry] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_logout_authorize_request_round_trip + fixture = { + "profile_id" => "stub" + } + model = WorkOS::SSOLogoutAuthorizeRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["profile_id"], json[:profile_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_authorization_code_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "authorization_code", + "code" => "stub", + "code_verifier" => "stub", + "invitation_token" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::AuthorizationCodeSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["code"], json[:code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_password_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "password", + "email" => "stub", + "password" => "stub", + "invitation_token" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::PasswordSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["email"], json[:email] + assert_equal fixture["password"], json[:password] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_refresh_token_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "refresh_token", + "refresh_token" => "stub", + "organization_id" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::RefreshTokenSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["refresh_token"], json[:refresh_token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_magic_auth_code_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "urn:workos:oauth:grant-type:magic-auth:code", + "code" => "stub", + "email" => "stub", + "invitation_token" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::MagicAuthCodeSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["code"], json[:code] + assert_equal fixture["email"], json[:email] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_verification_code_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "urn:workos:oauth:grant-type:email-verification:code", + "code" => "stub", + "pending_authentication_token" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::EmailVerificationCodeSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["code"], json[:code] + assert_equal fixture["pending_authentication_token"], json[:pending_authentication_token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_mfa_totp_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "urn:workos:oauth:grant-type:mfa-totp", + "code" => "stub", + "pending_authentication_token" => "stub", + "authentication_challenge_id" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::MFATotpSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["code"], json[:code] + assert_equal fixture["pending_authentication_token"], json[:pending_authentication_token] + assert_equal fixture["authentication_challenge_id"], json[:authentication_challenge_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_selection_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "client_secret" => "stub", + "grant_type" => "urn:workos:oauth:grant-type:organization-selection", + "pending_authentication_token" => "stub", + "organization_id" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::OrganizationSelectionSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["client_secret"], json[:client_secret] + assert_equal fixture["pending_authentication_token"], json[:pending_authentication_token] + assert_equal fixture["organization_id"], json[:organization_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_device_code_session_authenticate_request_round_trip + fixture = { + "client_id" => "stub", + "grant_type" => "urn:ietf:params:oauth:grant-type:device_code", + "device_code" => "stub", + "ip_address" => "stub", + "device_id" => "stub", + "user_agent" => "stub" + } + model = WorkOS::DeviceCodeSessionAuthenticateRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + assert_equal fixture["device_code"], json[:device_code] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_sso_device_authorization_request_round_trip + fixture = { + "client_id" => "stub" + } + model = WorkOS::SSODeviceAuthorizationRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["client_id"], json[:client_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_invitation_round_trip + fixture = { + "object" => "invitation", + "id" => "stub", + "email" => "stub", + "state" => "stub", + "accepted_at" => nil, + "revoked_at" => nil, + "expires_at" => "stub", + "organization_id" => nil, + "inviter_user_id" => nil, + "accepted_user_id" => nil, + "role_slug" => nil, + "created_at" => "stub", + "updated_at" => "stub", + "token" => "stub", + "accept_invitation_url" => "stub" + } + model = WorkOS::Invitation.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["email"], json[:email] + assert_nil json[:accepted_at] + assert_nil json[:revoked_at] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:organization_id] + assert_nil json[:inviter_user_id] + assert_nil json[:accepted_user_id] + assert_nil json[:role_slug] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_equal fixture["token"], json[:token] + assert_equal fixture["accept_invitation_url"], json[:accept_invitation_url] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_organization_membership_round_trip + fixture = { + "object" => "organization_membership", + "id" => "stub", + "user_id" => "stub", + "organization_id" => "stub", + "status" => "stub", + "directory_managed" => true, + "organization_name" => "stub", + "custom_attributes" => {}, + "created_at" => "stub", + "updated_at" => "stub", + "role" => {}, + "user" => {} + } + model = WorkOS::OrganizationMembership.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["directory_managed"], json[:directory_managed] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_change_confirmation_round_trip + fixture = { + "object" => "email_change_confirmation", + "user" => {} + } + model = WorkOS::EmailChangeConfirmation.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_email_change_confirmation_user_round_trip + fixture = { + "object" => "user", + "id" => "stub", + "first_name" => nil, + "last_name" => nil, + "profile_picture_url" => nil, + "email" => "stub", + "email_verified" => true, + "external_id" => nil, + "metadata" => {}, + "last_sign_in_at" => nil, + "locale" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::EmailChangeConfirmationUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:first_name] + assert_nil json[:last_name] + assert_nil json[:profile_picture_url] + assert_equal fixture["email"], json[:email] + assert_equal fixture["email_verified"], json[:email_verified] + assert_nil json[:external_id] + assert_nil json[:last_sign_in_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_identities_get_item_round_trip + fixture = { + "idp_id" => "stub", + "type" => "OAuth", + "provider" => "stub" + } + model = WorkOS::UserIdentitiesGetItem.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["idp_id"], json[:idp_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_sessions_list_item_round_trip + fixture = { + "object" => "session", + "id" => "stub", + "impersonator" => {}, + "ip_address" => nil, + "organization_id" => "stub", + "user_agent" => nil, + "user_id" => "stub", + "auth_method" => "stub", + "status" => "stub", + "expires_at" => "stub", + "ended_at" => nil, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::UserSessionsListItem.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:ip_address] + assert_nil json[:user_agent] + assert_equal fixture["user_id"], json[:user_id] + assert_equal fixture["expires_at"], json[:expires_at] + assert_nil json[:ended_at] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_user_sessions_impersonator_round_trip + fixture = { + "email" => "stub", + "reason" => nil + } + model = WorkOS::UserSessionsImpersonator.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["email"], json[:email] + assert_nil json[:reason] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_directory_metadata_user_round_trip + fixture = { + "active" => 1, + "inactive" => 1 + } + model = WorkOS::DirectoryMetadataUser.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["active"], json[:active] + assert_equal fixture["inactive"], json[:inactive] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integrations_list_response_data_connected_account_round_trip + fixture = { + "object" => "connected_account", + "id" => "stub", + "user_id" => nil, + "organization_id" => nil, + "scopes" => [], + "state" => "stub", + "created_at" => "stub", + "updated_at" => "stub", + "userlandUserId" => nil + } + model = WorkOS::DataIntegrationsListResponseDataConnectedAccount.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_nil json[:user_id] + assert_nil json[:organization_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + assert_nil json[:userlandUserId] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end +end diff --git a/test/workos/test_multi_factor_auth.rb b/test/workos/test_multi_factor_auth.rb new file mode 100644 index 00000000..73cf661d --- /dev/null +++ b/test/workos/test_multi_factor_auth.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class MultiFactorAuthTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_verify_challenge_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/auth/challenges/stub/verify(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.verify_challenge(id: "stub", code: "stub") + refute_nil result + end + + def test_enroll_factor_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/auth/factors/enroll(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.enroll_factor(type: "stub") + refute_nil result + end + + def test_get_factor_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/auth/factors/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.get_factor(id: "stub") + refute_nil result + end + + def test_delete_factor_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/auth/factors/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.delete_factor(id: "stub") + assert_nil result + end + + def test_challenge_factor_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/auth/factors/stub/challenge(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.challenge_factor(id: "stub") + refute_nil result + end + + def test_list_user_auth_factors_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/auth_factors(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.multi_factor_auth.list_user_auth_factors(userland_user_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_user_auth_factor_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/auth_factors(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.multi_factor_auth.create_user_auth_factor(userland_user_id: "stub", type: "totp") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :verify_challenge, verb: :post, url: %r{\Ahttps://api\.workos\.com/auth/challenges/stub/verify(\?|\z)}, args: {id: "stub", code: "stub"}}, + {name: :enroll_factor, verb: :post, url: %r{\Ahttps://api\.workos\.com/auth/factors/enroll(\?|\z)}, args: {type: "stub"}}, + {name: :get_factor, verb: :get, url: %r{\Ahttps://api\.workos\.com/auth/factors/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_factor, verb: :delete, url: %r{\Ahttps://api\.workos\.com/auth/factors/stub(\?|\z)}, args: {id: "stub"}}, + {name: :challenge_factor, verb: :post, url: %r{\Ahttps://api\.workos\.com/auth/factors/stub/challenge(\?|\z)}, args: {id: "stub"}}, + {name: :list_user_auth_factors, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/auth_factors(\?|\z)}, args: {userland_user_id: "stub"}}, + {name: :create_user_auth_factor, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/auth_factors(\?|\z)}, args: {userland_user_id: "stub", type: "totp"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.multi_factor_auth.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_organization_domains.rb b/test/workos/test_organization_domains.rb new file mode 100644 index 00000000..aa20584c --- /dev/null +++ b/test/workos/test_organization_domains.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class OrganizationDomainsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_create_organization_domain_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organization_domains(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organization_domains.create_organization_domain(domain: "stub", organization_id: "stub") + refute_nil result + end + + def test_get_organization_domain_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organization_domains/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organization_domains.get_organization_domain(id: "stub") + refute_nil result + end + + def test_delete_organization_domain_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/organization_domains/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organization_domains.delete_organization_domain(id: "stub") + assert_nil result + end + + def test_verify_organization_domain_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organization_domains/stub/verify(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organization_domains.verify_organization_domain(id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :create_organization_domain, verb: :post, url: %r{\Ahttps://api\.workos\.com/organization_domains(\?|\z)}, args: {domain: "stub", organization_id: "stub"}}, + {name: :get_organization_domain, verb: :get, url: %r{\Ahttps://api\.workos\.com/organization_domains/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_organization_domain, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organization_domains/stub(\?|\z)}, args: {id: "stub"}}, + {name: :verify_organization_domain, verb: :post, url: %r{\Ahttps://api\.workos\.com/organization_domains/stub/verify(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.organization_domains.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_organizations.rb b/test/workos/test_organizations.rb new file mode 100644 index 00000000..4ee3c2b7 --- /dev/null +++ b/test/workos/test_organizations.rb @@ -0,0 +1,81 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class OrganizationsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_organizations_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.organizations.list_organizations + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_organization_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/organizations(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.create_organization(name: "stub") + refute_nil result + end + + def test_get_organization_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/external_id/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.get_organization_by_external_id(external_id: "stub") + refute_nil result + end + + def test_get_organization_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.get_organization(id: "stub") + refute_nil result + end + + def test_update_organization_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.update_organization(id: "stub") + refute_nil result + end + + def test_delete_organization_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.delete_organization(id: "stub") + assert_nil result + end + + def test_get_audit_log_configuration_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/audit_log_configuration(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.organizations.get_audit_log_configuration(id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_organizations, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations(\?|\z)}}, + {name: :create_organization, verb: :post, url: %r{\Ahttps://api\.workos\.com/organizations(\?|\z)}, args: {name: "stub"}}, + {name: :get_organization_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/external_id/stub(\?|\z)}, args: {external_id: "stub"}}, + {name: :get_organization, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}}, + {name: :update_organization, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_organization, verb: :delete, url: %r{\Ahttps://api\.workos\.com/organizations/stub(\?|\z)}, args: {id: "stub"}}, + {name: :get_audit_log_configuration, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/audit_log_configuration(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.organizations.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_passwordless.rb b/test/workos/test_passwordless.rb new file mode 100644 index 00000000..aa4fd5b2 --- /dev/null +++ b/test/workos/test_passwordless.rb @@ -0,0 +1,59 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" + +class PasswordlessTest < Minitest::Test + def setup + @client = WorkOS::Client.new(api_key: "sk_test_passwordless") + end + + def test_passwordless_accessor_exists + assert_kind_of WorkOS::Passwordless, @client.passwordless + end + + def test_create_session_returns_passwordless_session_struct + payload = { + id: "passwordless_session_01", + email: "user@example.com", + expires_at: "2026-04-15T12:00:00Z", + link: "https://workos.com/magic/abc", + object: "passwordless_session" + } + stub_request(:post, "https://api.workos.com/passwordless/sessions") + .with(body: hash_including("email" => "user@example.com", "type" => "MagicLink")) + .to_return(status: 200, body: payload.to_json) + + result = @client.passwordless.create_session(email: "user@example.com") + assert_equal "passwordless_session_01", result.id + assert_equal "user@example.com", result.email + assert_equal "https://workos.com/magic/abc", result.link + assert_equal "passwordless_session", result.object + end + + def test_create_session_forwards_optional_params + stub_request(:post, "https://api.workos.com/passwordless/sessions") + .with(body: hash_including( + "email" => "user@example.com", + "redirect_uri" => "https://app.example.com/cb", + "state" => "xyz", + "connection" => "conn_123" + )) + .to_return(status: 200, body: '{"id":"s","email":"user@example.com","expires_at":"x","link":"y"}') + + @client.passwordless.create_session( + email: "user@example.com", + redirect_uri: "https://app.example.com/cb", + state: "xyz", + connection: "conn_123" + ) + end + + def test_send_session_posts_to_send_endpoint + stub_request(:post, "https://api.workos.com/passwordless/sessions/sess_42/send") + .to_return(status: 200, body: '{"success":true}') + + result = @client.passwordless.send_session("sess_42") + assert_equal({"success" => true}, result) + end +end diff --git a/test/workos/test_pipes.rb b/test/workos/test_pipes.rb new file mode 100644 index 00000000..a085fc40 --- /dev/null +++ b/test/workos/test_pipes.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class PipesTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_authorize_data_integration_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/authorize(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes.authorize_data_integration(slug: "stub", user_id: "stub") + refute_nil result + end + + def test_create_data_integration_token_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes.create_data_integration_token(slug: "stub", user_id: "stub") + refute_nil result + end + + def test_get_user_connected_account_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes.get_user_connected_account(user_id: "stub", slug: "stub") + refute_nil result + end + + def test_delete_user_connected_account_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes.delete_user_connected_account(user_id: "stub", slug: "stub") + assert_nil result + end + + def test_list_user_data_providers_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/data_providers(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes.list_user_data_providers(user_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :authorize_data_integration, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/authorize(\?|\z)}, args: {slug: "stub", user_id: "stub"}}, + {name: :create_data_integration_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {slug: "stub", user_id: "stub"}}, + {name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}}, + {name: :delete_user_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}}, + {name: :list_user_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/data_providers(\?|\z)}, args: {user_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.pipes.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_pkce.rb b/test/workos/test_pkce.rb new file mode 100644 index 00000000..90ef3e44 --- /dev/null +++ b/test/workos/test_pkce.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "base64" +require "digest" + +class PKCETest < Minitest::Test + def test_module_accessible_from_client + client = WorkOS::Client.new(api_key: "k") + assert_equal WorkOS::PKCE, client.pkce + end + + def test_generate_code_verifier_meets_rfc7636_minimum + v = WorkOS::PKCE.generate_code_verifier + assert v.length >= 43, "verifier too short: #{v.length}" + assert v.length <= 128, "verifier too long: #{v.length}" + assert_match(/\A[A-Za-z0-9_-]+\z/, v, "verifier must be base64url unreserved chars") + end + + def test_generate_code_verifier_is_random + refute_equal WorkOS::PKCE.generate_code_verifier, WorkOS::PKCE.generate_code_verifier + end + + def test_generate_code_challenge_is_s256_of_verifier + verifier = WorkOS::PKCE.generate_code_verifier + expected = Base64.urlsafe_encode64(Digest::SHA256.digest(verifier), padding: false) + assert_equal expected, WorkOS::PKCE.generate_code_challenge(verifier) + end + + def test_generate_pair_is_self_consistent + pair = WorkOS::PKCE.generate_pair + expected = WorkOS::PKCE.generate_code_challenge(pair[:code_verifier]) + assert_equal expected, pair[:code_challenge] + end + + def test_generate_pair_is_unique_per_call + refute_equal WorkOS::PKCE.generate_pair[:code_verifier], WorkOS::PKCE.generate_pair[:code_verifier] + end +end diff --git a/test/workos/test_public_client.rb b/test/workos/test_public_client.rb new file mode 100644 index 00000000..a08a6cbf --- /dev/null +++ b/test/workos/test_public_client.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" + +class PublicClientTest < Minitest::Test + def test_create_returns_workos_client_with_no_api_key + client = WorkOS::PublicClient.create(client_id: "client_001") + assert_kind_of WorkOS::Client, client + assert_equal "client_001", client.client_id + assert_nil client.api_key + end + + def test_create_requires_client_id + assert_raises(ArgumentError) { WorkOS::PublicClient.create(client_id: nil) } + assert_raises(ArgumentError) { WorkOS::PublicClient.create(client_id: "") } + end + + def test_public_client_request_omits_authorization_header + client = WorkOS::PublicClient.create(client_id: "client_001") + stub = stub_request(:post, "https://api.workos.com/oauth2/device_authorization") + .with { |req| !req.headers.key?("Authorization") } + .to_return(status: 200, body: '{"device_code":"d","user_code":"u","verification_uri":"v","verification_uri_complete":"vc","expires_in":10,"interval":5}') + client.user_management.authorize_device + assert_requested(stub) + end + + def test_public_client_can_build_pkce_authorization_url + client = WorkOS::PublicClient.create(client_id: "client_001") + url, verifier, _state = client.user_management.get_authorization_url_with_pkce( + redirect_uri: "https://app/cb", + provider: "GoogleOAuth" + ) + assert_match %r{client_id=client_001}, url + assert_match %r{code_challenge_method=S256}, url + assert verifier.length >= 43 + end +end diff --git a/test/workos/test_radar.rb b/test/workos/test_radar.rb new file mode 100644 index 00000000..017deea2 --- /dev/null +++ b/test/workos/test_radar.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class RadarTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_create_attempt_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/radar/attempts(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.radar.create_attempt(ip_address: "stub", user_agent: "stub", email: "stub", auth_method: "stub", action: "stub") + refute_nil result + end + + def test_update_attempt_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/radar/attempts/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.radar.update_attempt(id: "stub") + assert_nil result + end + + def test_add_list_entry_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/radar/lists/stub/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.radar.add_list_entry(type: "stub", action: "stub", entry: "stub") + refute_nil result + end + + def test_remove_list_entry_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/radar/lists/stub/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.radar.remove_list_entry(type: "stub", action: "stub", entry: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :create_attempt, verb: :post, url: %r{\Ahttps://api\.workos\.com/radar/attempts(\?|\z)}, args: {ip_address: "stub", user_agent: "stub", email: "stub", auth_method: "stub", action: "stub"}}, + {name: :update_attempt, verb: :put, url: %r{\Ahttps://api\.workos\.com/radar/attempts/stub(\?|\z)}, args: {id: "stub"}}, + {name: :add_list_entry, verb: :post, url: %r{\Ahttps://api\.workos\.com/radar/lists/stub/stub(\?|\z)}, args: {type: "stub", action: "stub", entry: "stub"}}, + {name: :remove_list_entry, verb: :delete, url: %r{\Ahttps://api\.workos\.com/radar/lists/stub/stub(\?|\z)}, args: {type: "stub", action: "stub", entry: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.radar.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_session.rb b/test/workos/test_session.rb new file mode 100644 index 00000000..25bfc134 --- /dev/null +++ b/test/workos/test_session.rb @@ -0,0 +1,493 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "json" +require "openssl" +require "jwt" +require "base64" +require "securerandom" + +class SessionTest < Minitest::Test + PASSWORD = "very-long-cookie-password-secret" + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_session", client_id: "client_001") + @sm = @client.session_manager + end + + # --- H06 raw seal/unseal round-trip --------------------------------------- + + def test_seal_then_unseal_round_trip_hash + sealed = @sm.seal_data({"a" => 1, "b" => "two"}, PASSWORD) + refute_equal "a", sealed + assert_equal({"a" => 1, "b" => "two"}, @sm.unseal_data(sealed, PASSWORD)) + end + + def test_unseal_with_wrong_key_raises + sealed = @sm.seal_data({"x" => 1}, PASSWORD) + # Wrong key is the same length (>= 32 bytes) so the length guard doesn't + # short-circuit; we want to assert the underlying cipher rejection. + assert_raises(OpenSSL::Cipher::CipherError) do + @sm.unseal_data(sealed, "wrong-cookie-password-32-bytes--") + end + end + + def test_unseal_with_short_key_raises_argument_error + sealed = @sm.seal_data({"x" => 1}, PASSWORD) + assert_raises(ArgumentError) { @sm.unseal_data(sealed, "too-short") } + end + + def test_seal_with_short_key_raises_argument_error + assert_raises(ArgumentError) { @sm.seal_data({"x" => 1}, "too-short") } + end + + def test_session_load_requires_min_length_cookie_password + short = "x" * 31 + assert_raises(ArgumentError) { @sm.load(seal_data: "x", cookie_password: short) } + end + + def test_unseal_rejects_short_payload + assert_raises(ArgumentError) do + @sm.unseal_data(Base64.strict_encode64("short"), PASSWORD) + end + end + + # --- H07 seal_session_from_auth_response ---------------------------------- + + def test_seal_session_from_auth_response_is_unsealable + sealed = @sm.seal_session_from_auth_response( + access_token: "access_xyz", + refresh_token: "refresh_xyz", + cookie_password: PASSWORD, + user: {"id" => "u_1", "email" => "a@b.com"} + ) + payload = @sm.unseal_data(sealed, PASSWORD) + assert_equal "access_xyz", payload["access_token"] + assert_equal "refresh_xyz", payload["refresh_token"] + assert_equal "u_1", payload["user"]["id"] + end + + # --- H04 Session#authenticate with stubbed JWKS --------------------------- + + def signing_key_pair + rsa = OpenSSL::PKey::RSA.generate(2048) + [rsa, rsa.public_key] + end + + def make_jwt(claims, rsa, kid: "test-key") + JWT.encode(claims, rsa, "RS256", {kid: kid}) + end + + def jwks_payload(public_key, kid: "test-key") + n = Base64.urlsafe_encode64(public_key.n.to_s(2), padding: false) + e = Base64.urlsafe_encode64(public_key.e.to_s(2), padding: false) + {"keys" => [{"kty" => "RSA", "alg" => "RS256", "use" => "sig", "kid" => kid, "n" => n, "e" => e}]} + end + + def test_authenticate_returns_success_with_decoded_claims + rsa, pub = signing_key_pair + access_token = make_jwt({"sid" => "session_42", "org_id" => "org_1", "exp" => Time.now.to_i + 60}, rsa) + sealed = @sm.seal_data({"access_token" => access_token, "user" => {"id" => "u_1"}}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::AuthSuccess, result + assert result.authenticated + assert_equal "session_42", result.session_id + assert_equal "org_1", result.organization_id + assert_equal "u_1", result.user["id"] + end + + def test_authenticate_reads_legacy_v6_sealed_session + rsa, pub = signing_key_pair + access_token = make_jwt({"sid" => "session_v6", "org_id" => "org_legacy", "exp" => Time.now.to_i + 60}, rsa) + sealed = legacy_v6_seal({"access_token" => access_token, "user" => {"id" => "u_legacy"}}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::AuthSuccess, result + assert result.authenticated + assert_equal "session_v6", result.session_id + assert_equal "org_legacy", result.organization_id + assert_equal "u_legacy", result.user["id"] + end + + def test_authenticate_merges_custom_claims_from_block + rsa, pub = signing_key_pair + access_token = make_jwt( + { + "sid" => "session_custom", + "org_id" => "org_custom", + "custom_claim" => "custom_value", + "another_claim" => 123, + "exp" => Time.now.to_i + 60 + }, + rsa + ) + sealed = @sm.seal_data({"access_token" => access_token, "user" => {"id" => "u_2"}}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) do |jwt| + { + my_custom_claim: jwt["custom_claim"], + my_other_claim: jwt["another_claim"] + } + end + + assert_kind_of WorkOS::SessionManager::AuthSuccess, result + assert_equal "custom_value", result[:my_custom_claim] + assert_equal 123, result[:my_other_claim] + assert_equal "custom_value", result.my_custom_claim + assert_equal "custom_value", result.to_h[:my_custom_claim] + end + + def test_authenticate_rejects_custom_claims_that_overwrite_reserved_keys + rsa, pub = signing_key_pair + access_token = make_jwt({"sid" => "session_reserved", "exp" => Time.now.to_i + 60}, rsa) + sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + error = assert_raises(ArgumentError) do + @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) do + {authenticated: false} + end + end + + assert_match(/reserved key/, error.message) + end + + def test_authenticate_returns_no_session_cookie_when_blank + result = @sm.authenticate(seal_data: "", cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::AuthError, result + refute result.authenticated + assert_equal WorkOS::SessionManager::NO_SESSION_COOKIE_PROVIDED, result.reason + end + + def test_authenticate_returns_invalid_session_cookie_on_garbage + result = @sm.authenticate(seal_data: "garbage", cookie_password: PASSWORD) + assert_equal WorkOS::SessionManager::INVALID_SESSION_COOKIE, result.reason + end + + def test_authenticate_returns_invalid_jwt_on_bad_signature + rsa, _pub = signing_key_pair + other = OpenSSL::PKey::RSA.generate(2048) + access_token = make_jwt({"sid" => "s", "exp" => Time.now.to_i + 60}, other) + sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(rsa.public_key).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) + assert_equal WorkOS::SessionManager::INVALID_JWT_SIGNATURE, result.reason + end + + def test_authenticate_returns_expired_jwt_when_expired_and_include_expired_is_false + rsa, pub = signing_key_pair + # Token expired 60 seconds ago + access_token = make_jwt({"sid" => "session_expired", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD, include_expired: false) + assert_equal WorkOS::SessionManager::EXPIRED_JWT, result.reason + refute result.authenticated + end + + def test_authenticate_returns_auth_success_with_authenticated_false_when_expired_and_include_expired_is_true + rsa, pub = signing_key_pair + # Token expired 60 seconds ago + access_token = make_jwt({"sid" => "session_expired", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = @sm.authenticate(seal_data: sealed, cookie_password: PASSWORD, include_expired: true) + assert_kind_of WorkOS::SessionManager::AuthSuccess, result + refute result.authenticated + assert_equal WorkOS::SessionManager::EXPIRED_JWT, result.reason + assert_equal "session_expired", result.session_id + end + + # --- get_logout_url ------------------------------------------------------- + + def test_get_logout_url_includes_session_id_from_authenticate + rsa, pub = signing_key_pair + access_token = make_jwt({"sid" => "session_logout", "exp" => Time.now.to_i + 60}, rsa) + sealed = @sm.seal_data({"access_token" => access_token}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + url = session.get_logout_url(return_to: "https://app/cb") + parsed = URI.parse(url) + assert_equal "/user_management/sessions/logout", parsed.path + params = URI.decode_www_form(parsed.query).to_h + assert_equal "session_logout", params["session_id"] + assert_equal "https://app/cb", params["return_to"] + end + + # --- Session#refresh ------------------------------------------------------- + + def test_refresh_seals_session_client_side_and_returns_refresh_success + rsa, pub = signing_key_pair + old_access = make_jwt({"sid" => "session_old", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => old_access, "refresh_token" => "rt_old", "user" => {"id" => "u_1"}}, PASSWORD) + + new_access = make_jwt({"sid" => "session_new", "org_id" => "org_1", "role" => "admin", "exp" => Time.now.to_i + 300}, rsa) + api_response = { + "access_token" => new_access, + "refresh_token" => "rt_new", + "user" => {"id" => "u_1", "email" => "a@b.com"}, + "impersonator" => nil + } + + stub_request(:post, "https://api.workos.com/user_management/authenticate") + .with(body: hash_including("grant_type" => "refresh_token", "refresh_token" => "rt_old")) + .to_return(status: 200, body: api_response.to_json) + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + result = session.refresh + + assert_kind_of WorkOS::SessionManager::RefreshSuccess, result + assert result.authenticated + assert_equal "session_new", result.session_id + assert_equal "org_1", result.organization_id + assert_equal "admin", result.role + assert_equal "u_1", result.user["id"] + + # sealed_session should be a non-empty string that round-trips + refute_empty result.sealed_session + unsealed = @sm.unseal_data(result.sealed_session, PASSWORD) + assert_equal new_access, unsealed["access_token"] + assert_equal "rt_new", unsealed["refresh_token"] + end + + def test_refresh_reads_legacy_v6_sealed_session + rsa, pub = signing_key_pair + old_access = make_jwt({"sid" => "session_old_v6", "exp" => Time.now.to_i - 60}, rsa) + sealed = legacy_v6_seal( + {"access_token" => old_access, "refresh_token" => "rt_old_v6", "user" => {"id" => "u_v6"}}, + PASSWORD + ) + + new_access = make_jwt({"sid" => "session_new_v6", "org_id" => "org_v6", "role" => "member", "exp" => Time.now.to_i + 300}, rsa) + api_response = { + "access_token" => new_access, + "refresh_token" => "rt_new_v6", + "user" => {"id" => "u_v6", "email" => "legacy@example.com"}, + "impersonator" => nil + } + + stub_request(:post, "https://api.workos.com/user_management/authenticate") + .with(body: hash_including("grant_type" => "refresh_token", "refresh_token" => "rt_old_v6")) + .to_return(status: 200, body: api_response.to_json) + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + result = session.refresh + + assert_kind_of WorkOS::SessionManager::RefreshSuccess, result + assert result.authenticated + assert_equal "session_new_v6", result.session_id + assert_equal "org_v6", result.organization_id + assert_equal "member", result.role + assert_equal "u_v6", result.user["id"] + + refute_empty result.sealed_session + unsealed = @sm.unseal_data(result.sealed_session, PASSWORD) + assert_equal new_access, unsealed["access_token"] + assert_equal "rt_new_v6", unsealed["refresh_token"] + assert_equal "u_v6", unsealed["user"]["id"] + end + + def test_refresh_updates_internal_seal_data_for_subsequent_authenticate + rsa, pub = signing_key_pair + old_access = make_jwt({"sid" => "session_old", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => old_access, "refresh_token" => "rt_old", "user" => {"id" => "u_1"}}, PASSWORD) + + new_access = make_jwt({"sid" => "session_refreshed", "org_id" => "org_2", "exp" => Time.now.to_i + 300}, rsa) + api_response = { + "access_token" => new_access, + "refresh_token" => "rt_new", + "user" => {"id" => "u_1"} + } + + stub_request(:post, "https://api.workos.com/user_management/authenticate") + .to_return(status: 200, body: api_response.to_json) + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + session.refresh + + # A subsequent authenticate should use the refreshed token + auth = session.authenticate + assert_kind_of WorkOS::SessionManager::AuthSuccess, auth + assert auth.authenticated + assert_equal "session_refreshed", auth.session_id + end + + def test_refresh_returns_error_on_invalid_cookie + result = @sm.refresh(seal_data: "garbage", cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::RefreshError, result + refute result.authenticated + assert_equal WorkOS::SessionManager::INVALID_SESSION_COOKIE, result.reason + end + + def test_refresh_raises_argument_error_for_short_cookie_password_override + sealed = @sm.seal_data({"access_token" => "at", "refresh_token" => "rt"}, PASSWORD) + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + err = assert_raises(ArgumentError) { session.refresh(cookie_password: "x" * 31) } + assert_match(/at least 32 bytes/, err.message) + end + + def test_refresh_raises_argument_error_for_empty_cookie_password_override + sealed = @sm.seal_data({"access_token" => "at", "refresh_token" => "rt"}, PASSWORD) + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + assert_raises(ArgumentError) { session.refresh(cookie_password: "") } + end + + def test_refresh_returns_error_when_no_refresh_token + sealed = @sm.seal_data({"access_token" => "at_only"}, PASSWORD) + result = @sm.refresh(seal_data: sealed, cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::RefreshError, result + assert_equal WorkOS::SessionManager::INVALID_SESSION_COOKIE, result.reason + end + + def test_refresh_does_not_send_session_param_to_api + rsa, pub = signing_key_pair + old_access = make_jwt({"sid" => "s", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => old_access, "refresh_token" => "rt_x", "user" => {"id" => "u"}}, PASSWORD) + + new_access = make_jwt({"sid" => "s2", "exp" => Time.now.to_i + 300}, rsa) + api_response = {"access_token" => new_access, "refresh_token" => "rt_y", "user" => {"id" => "u"}} + + stub = stub_request(:post, "https://api.workos.com/user_management/authenticate") + .with { |req| !req.body.include?("seal_session") } + .to_return(status: 200, body: api_response.to_json) + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + session.refresh + + assert_requested(stub) + end + + def test_refresh_persists_seal_data_even_when_access_token_decode_fails + rsa, pub = signing_key_pair + old_access = make_jwt({"sid" => "session_old", "exp" => Time.now.to_i - 60}, rsa) + sealed = @sm.seal_data({"access_token" => old_access, "refresh_token" => "rt_old", "user" => {"id" => "u_1"}}, PASSWORD) + + api_response = { + "access_token" => "not-a-valid-jwt", + "refresh_token" => "rt_new", + "user" => {"id" => "u_1"} + } + + stub_request(:post, "https://api.workos.com/user_management/authenticate") + .to_return(status: 200, body: api_response.to_json) + stub_request(:get, "https://api.workos.com/sso/jwks/client_001") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + session = @sm.load(seal_data: sealed, cookie_password: PASSWORD) + result = session.refresh + + assert_kind_of WorkOS::SessionManager::RefreshError, result + refute result.authenticated + + # Session state IS updated to the freshly-sealed cookie before decode runs, + # so a transient JWT/JWKS failure leaves a usable seal the caller can + # re-#authenticate against rather than half-updated state pinned to the + # stale (already-rotated) refresh token. + refute_equal sealed, session.seal_data + refute_nil session.seal_data + + # The rotated cookie is also reachable through the RefreshError result, so a + # caller that doesn't retain the Session object across requests (typical in + # a Rails request cycle) can still write the new cookie back to the browser + # rather than re-sending the now-revoked refresh token on the next request. + assert_equal session.seal_data, result.sealed_session + end + + # --- Session constructor validation --------------------------------------- + + def test_session_load_requires_cookie_password + assert_raises(ArgumentError) { @sm.load(seal_data: "x", cookie_password: nil) } + assert_raises(ArgumentError) { @sm.load(seal_data: "x", cookie_password: "") } + end + + # --- BYO encryptor --------------------------------------------------------- + + def test_custom_encryptor_is_used_for_seal_and_unseal + custom = Object.new + def custom.seal(data, _key) + Base64.strict_encode64(JSON.generate(data)) + end + + def custom.unseal(sealed, _key) + JSON.parse(Base64.decode64(sealed)) + end + + sm = WorkOS::Client.new(api_key: "sk_test_enc", client_id: "client_enc") + .session_manager(encryptor: custom) + + sealed = sm.seal_data({"a" => 1}, PASSWORD) + assert_equal({"a" => 1}, JSON.parse(Base64.decode64(sealed))) + assert_equal({"a" => 1}, sm.unseal_data(sealed, PASSWORD)) + end + + def test_custom_encryptor_authenticate_round_trip + custom = Object.new + + def custom.seal(data, _key) + Base64.strict_encode64(data.is_a?(String) ? data : JSON.generate(data)) + end + + def custom.unseal(sealed, _key) + JSON.parse(Base64.decode64(sealed)) + end + + sm = WorkOS::Client.new(api_key: "sk_test_enc2", client_id: "client_enc2") + .session_manager(encryptor: custom) + + rsa, pub = signing_key_pair + access_token = make_jwt({"sid" => "s_custom", "org_id" => "org_c", "exp" => Time.now.to_i + 60}, rsa) + sealed = sm.seal_data({"access_token" => access_token, "user" => {"id" => "u_c"}}, PASSWORD) + + stub_request(:get, "https://api.workos.com/sso/jwks/client_enc2") + .to_return(status: 200, body: jwks_payload(pub).to_json) + + result = sm.authenticate(seal_data: sealed, cookie_password: PASSWORD) + assert_kind_of WorkOS::SessionManager::AuthSuccess, result + assert_equal "s_custom", result.session_id + end + + private + + def legacy_v6_seal(data, key) + cipher = OpenSSL::Cipher.new("aes-256-gcm").encrypt + iv = SecureRandom.random_bytes(12) + cipher.key = key + cipher.iv = iv + ciphertext = cipher.update(JSON.generate(data)) + cipher.final + + Base64.encode64(iv + ciphertext + cipher.auth_tag) + end +end diff --git a/test/workos/test_sso.rb b/test/workos/test_sso.rb new file mode 100644 index 00000000..f6e16efb --- /dev/null +++ b/test/workos/test_sso.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class SSOTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_connections_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/connections(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.sso.list_connections + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_get_connection_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/connections/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.sso.get_connection(id: "stub") + refute_nil result + end + + def test_delete_connection_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/connections/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.sso.delete_connection(id: "stub") + assert_nil result + end + + def test_authorize_logout_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/sso/logout/authorize(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.sso.authorize_logout(profile_id: "stub") + refute_nil result + end + + def test_get_profile_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/sso/profile(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.sso.get_profile + refute_nil result + end + + def test_get_profile_and_token_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/sso/token(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.sso.get_profile_and_token(code: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_connections, verb: :get, url: %r{\Ahttps://api\.workos\.com/connections(\?|\z)}}, + {name: :get_connection, verb: :get, url: %r{\Ahttps://api\.workos\.com/connections/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_connection, verb: :delete, url: %r{\Ahttps://api\.workos\.com/connections/stub(\?|\z)}, args: {id: "stub"}}, + {name: :authorize_logout, verb: :post, url: %r{\Ahttps://api\.workos\.com/sso/logout/authorize(\?|\z)}, args: {profile_id: "stub"}}, + {name: :get_profile, verb: :get, url: %r{\Ahttps://api\.workos\.com/sso/profile(\?|\z)}}, + {name: :get_profile_and_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/sso/token(\?|\z)}, args: {code: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.sso.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_sso_helpers.rb b/test/workos/test_sso_helpers.rb new file mode 100644 index 00000000..35395a4b --- /dev/null +++ b/test/workos/test_sso_helpers.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "uri" + +class SSOHelpersTest < Minitest::Test + def setup + @client = WorkOS::Client.new(api_key: "sk_test_sso", client_id: "client_001") + @sso = @client.sso + end + + # H14 + def test_get_authorization_url_returns_string + url = @sso.get_authorization_url( + redirect_uri: "https://app.example.com/cb", + connection: "conn_001" + ) + parsed = URI.parse(url) + params = URI.decode_www_form(parsed.query).to_h + assert_equal "/sso/authorize", parsed.path + assert_equal "client_001", params["client_id"] + assert_equal "conn_001", params["connection"] + assert_equal "code", params["response_type"] + end + + def test_get_authorization_url_serializes_provider_scopes_csv + url = @sso.get_authorization_url( + redirect_uri: "x", + provider: "GoogleOAuth", + provider_scopes: ["openid", "email"] + ) + params = URI.decode_www_form(URI.parse(url).query).to_h + assert_equal "openid,email", params["provider_scopes"] + end + + def test_get_authorization_url_serializes_provider_query_params_json + url = @sso.get_authorization_url( + redirect_uri: "x", + provider: "GoogleOAuth", + provider_query_params: {"hd" => "example.com"} + ) + params = URI.decode_www_form(URI.parse(url).query).to_h + assert_equal({"hd" => "example.com"}, JSON.parse(params["provider_query_params"])) + end + + # H15 + def test_get_authorization_url_with_pkce_appends_challenge + url, verifier, state = @sso.get_authorization_url_with_pkce( + redirect_uri: "x", + connection: "conn_001" + ) + params = URI.decode_www_form(URI.parse(url).query).to_h + assert_equal "S256", params["code_challenge_method"] + assert_equal WorkOS::PKCE.generate_code_challenge(verifier), params["code_challenge"] + assert_equal state, params["state"] + end + + # H16 + def test_get_profile_and_token_with_pkce_posts_pkce_grant + stub = stub_request(:post, "https://api.workos.com/sso/token") + .with(body: hash_including( + "grant_type" => "authorization_code", + "client_id" => "client_001", + "code" => "code_xyz", + "code_verifier" => "v_abc" + )) + .to_return(status: 200, body: '{"profile":{"id":"prof_1","connection_id":"c","connection_type":"OktaSAML","email":"x@y","first_name":null,"last_name":null,"groups":null,"organization_id":null,"raw_attributes":null,"role":null,"custom_attributes":null,"object":"profile","idp_id":null},"access_token":"a","oauth_tokens":null,"impersonator":null}') + @sso.get_profile_and_token_with_pkce(code: "code_xyz", code_verifier: "v_abc") + assert_requested(stub) + end + + # H17 + def test_build_logout_url_returns_string_no_http + url = @sso.build_logout_url(token: "tok_xyz") + parsed = URI.parse(url) + assert_equal "/sso/logout", parsed.path + assert_equal "tok_xyz", URI.decode_www_form(parsed.query).to_h["token"] + end +end diff --git a/test/workos/test_sso_runtime.rb b/test/workos/test_sso_runtime.rb new file mode 100644 index 00000000..f9050c61 --- /dev/null +++ b/test/workos/test_sso_runtime.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +require "test_helper" + +class SSORuntimeTest < Minitest::Test + def setup + @client = WorkOS::Client.new(api_key: "sk_test_sso", client_id: "client_001") + end + + def test_get_profile_and_token_posts_code_in_body_only + stub = stub_request(:post, "https://api.workos.com/sso/token") + .with( + query: {}, + body: hash_including( + "grant_type" => "authorization_code", + "client_id" => "client_001", + "client_secret" => "sk_test_sso", + "code" => "code_123" + ) + ) + .to_return(status: 200, body: "{}") + + @client.sso.get_profile_and_token(code: "code_123") + + assert_requested(stub) + end + + def test_get_profile_and_token_uses_request_option_credentials + stub = stub_request(:post, "https://api.workos.com/sso/token") + .with( + body: hash_including( + "client_id" => "client_override", + "client_secret" => "sk_override" + ) + ) + .to_return(status: 200, body: "{}") + + @client.sso.get_profile_and_token( + code: "code_123", + request_options: {api_key: "sk_override", client_id: "client_override"} + ) + + assert_requested(stub) + end +end diff --git a/test/workos/test_user_management.rb b/test/workos/test_user_management.rb new file mode 100644 index 00000000..b2aebf55 --- /dev/null +++ b/test/workos/test_user_management.rb @@ -0,0 +1,533 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class UserManagementTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_get_jwks_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/sso/jwks/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_jwks(client_id: "stub") + refute_nil result + end + + def test_create_authenticate_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_authenticate(client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub") + refute_nil result + end + + def test_authenticate_with_password_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_password(email: "stub", password: "stub") + refute_nil result + end + + def test_authenticate_with_password_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_password(email: "stub", password: "stub") + end + end + + def test_authenticate_with_code_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_code(code: "stub") + refute_nil result + end + + def test_authenticate_with_code_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_code(code: "stub") + end + end + + def test_authenticate_with_refresh_token_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_refresh_token(refresh_token: "stub") + refute_nil result + end + + def test_authenticate_with_refresh_token_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_refresh_token(refresh_token: "stub") + end + end + + def test_authenticate_with_magic_auth_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_magic_auth(code: "stub", email: "stub") + refute_nil result + end + + def test_authenticate_with_magic_auth_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_magic_auth(code: "stub", email: "stub") + end + end + + def test_authenticate_with_email_verification_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_email_verification(code: "stub", pending_authentication_token: "stub") + refute_nil result + end + + def test_authenticate_with_email_verification_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_email_verification(code: "stub", pending_authentication_token: "stub") + end + end + + def test_authenticate_with_totp_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_totp(code: "stub", pending_authentication_token: "stub", authentication_challenge_id: "stub") + refute_nil result + end + + def test_authenticate_with_totp_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_totp(code: "stub", pending_authentication_token: "stub", authentication_challenge_id: "stub") + end + end + + def test_authenticate_with_organization_selection_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_organization_selection(pending_authentication_token: "stub", organization_id: "stub") + refute_nil result + end + + def test_authenticate_with_organization_selection_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_organization_selection(pending_authentication_token: "stub", organization_id: "stub") + end + end + + def test_authenticate_with_device_code_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.authenticate_with_device_code(device_code: "stub") + refute_nil result + end + + def test_authenticate_with_device_code_raises_authentication_error_on_401 + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.authenticate_with_device_code(device_code: "stub") + end + end + + def test_create_device_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_device(client_id: "stub") + refute_nil result + end + + def test_revoke_session_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.revoke_session(session_id: "stub") + assert_nil result + end + + def test_create_cors_origin_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_cors_origin(origin: "stub") + refute_nil result + end + + def test_get_email_verification_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/email_verification/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_email_verification(id: "stub") + refute_nil result + end + + def test_reset_password_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/password_reset(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.reset_password(email: "stub") + refute_nil result + end + + def test_confirm_password_reset_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/password_reset/confirm(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.confirm_password_reset(token: "stub", new_password: "stub") + refute_nil result + end + + def test_get_password_reset_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/password_reset/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_password_reset(id: "stub") + refute_nil result + end + + def test_list_users_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_users + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_user_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users(\?|\z)}) + .with(body: hash_including("email" => "stub", "password" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_user(email: "stub", password: WorkOS::UserManagement::PasswordPlaintext.new(password: "stub")) + refute_nil result + end + + def test_create_user_with_password_hashed_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users(\?|\z)}) + .with(body: hash_including("email" => "stub", "password_hash" => "stub", "password_hash_type" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_user(email: "stub", password: WorkOS::UserManagement::PasswordHashed.new(password_hash: "stub", password_hash_type: "stub")) + refute_nil result + end + + def test_get_user_by_external_id_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/external_id/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_user_by_external_id(external_id: "stub") + refute_nil result + end + + def test_get_user_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_user(id: "stub") + refute_nil result + end + + def test_update_user_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}) + .with(body: hash_including("password" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.update_user(id: "stub", password: WorkOS::UserManagement::PasswordPlaintext.new(password: "stub")) + refute_nil result + end + + def test_update_user_with_password_hashed_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}) + .with(body: hash_including("password_hash" => "stub", "password_hash_type" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.update_user(id: "stub", password: WorkOS::UserManagement::PasswordHashed.new(password_hash: "stub", password_hash_type: "stub")) + refute_nil result + end + + def test_delete_user_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.delete_user(id: "stub") + assert_nil result + end + + def test_confirm_email_change_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_change/confirm(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.confirm_email_change(id: "stub", code: "stub") + refute_nil result + end + + def test_send_email_change_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_change/send(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.send_email_change(id: "stub", new_email: "stub") + refute_nil result + end + + def test_verify_email_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_verification/confirm(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.verify_email(id: "stub", code: "stub") + refute_nil result + end + + def test_send_verification_email_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_verification/send(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.send_verification_email(id: "stub") + refute_nil result + end + + def test_get_user_identities_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/identities(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_user_identities(id: "stub") + refute_nil result + end + + def test_list_sessions_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/sessions(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_sessions(id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_list_invitations_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/invitations(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_invitations + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_send_invitation_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/invitations(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.send_invitation(email: "stub") + refute_nil result + end + + def test_find_invitation_by_token_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/invitations/by_token/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.find_invitation_by_token(token: "stub") + refute_nil result + end + + def test_get_invitation_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/invitations/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_invitation(id: "stub") + refute_nil result + end + + def test_accept_invitation_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/accept(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.accept_invitation(id: "stub") + refute_nil result + end + + def test_resend_invitation_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/resend(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.resend_invitation(id: "stub") + refute_nil result + end + + def test_revoke_invitation_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/revoke(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.revoke_invitation(id: "stub") + refute_nil result + end + + def test_list_jwt_template_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/jwt_template(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.list_jwt_template + refute_nil result + end + + def test_update_jwt_template_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/jwt_template(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.update_jwt_template(content: "stub") + refute_nil result + end + + def test_create_magic_auth_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/magic_auth(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_magic_auth(email: "stub") + refute_nil result + end + + def test_get_magic_auth_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/magic_auth/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_magic_auth(id: "stub") + refute_nil result + end + + def test_list_organization_memberships_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_organization_memberships + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_organization_membership_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships(\?|\z)}) + .with(body: hash_including("user_id" => "stub", "organization_id" => "stub", "role_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_organization_membership(user_id: "stub", organization_id: "stub", role: WorkOS::UserManagement::RoleSingle.new(role_slug: "stub")) + refute_nil result + end + + def test_create_organization_membership_with_role_multiple_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships(\?|\z)}) + .with(body: hash_including("user_id" => "stub", "organization_id" => "stub", "role_slugs" => ["stub"])) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_organization_membership(user_id: "stub", organization_id: "stub", role: WorkOS::UserManagement::RoleMultiple.new(role_slugs: ["stub"])) + refute_nil result + end + + def test_get_organization_membership_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.get_organization_membership(id: "stub") + refute_nil result + end + + def test_update_organization_membership_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}) + .with(body: hash_including("role_slug" => "stub")) + .to_return(body: "{}", status: 200) + result = @client.user_management.update_organization_membership(id: "stub", role: WorkOS::UserManagement::RoleSingle.new(role_slug: "stub")) + refute_nil result + end + + def test_update_organization_membership_with_role_multiple_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}) + .with(body: hash_including("role_slugs" => ["stub"])) + .to_return(body: "{}", status: 200) + result = @client.user_management.update_organization_membership(id: "stub", role: WorkOS::UserManagement::RoleMultiple.new(role_slugs: ["stub"])) + refute_nil result + end + + def test_delete_organization_membership_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.delete_organization_membership(id: "stub") + assert_nil result + end + + def test_deactivate_organization_membership_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/deactivate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.deactivate_organization_membership(id: "stub") + refute_nil result + end + + def test_reactivate_organization_membership_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/reactivate(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.reactivate_organization_membership(id: "stub") + refute_nil result + end + + def test_create_redirect_uri_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_redirect_uri(uri: "stub") + refute_nil result + end + + def test_list_user_authorized_applications_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_user_authorized_applications(user_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_delete_user_authorized_application_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.delete_user_authorized_application(application_id: "stub", user_id: "stub") + assert_nil result + end + + def test_list_user_api_keys_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management.list_user_api_keys(user_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_user_api_key_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.user_management.create_user_api_key(user_id: "stub", name: "stub", organization_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :get_jwks, verb: :get, url: %r{\Ahttps://api\.workos\.com/sso/jwks/stub(\?|\z)}, args: {client_id: "stub"}}, + {name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub"}}, + {name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}}, + {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}}, + {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}}, + {name: :get_email_verification, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/email_verification/stub(\?|\z)}, args: {id: "stub"}}, + {name: :reset_password, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/password_reset(\?|\z)}, args: {email: "stub"}}, + {name: :confirm_password_reset, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/password_reset/confirm(\?|\z)}, args: {token: "stub", new_password: "stub"}}, + {name: :get_password_reset, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/password_reset/stub(\?|\z)}, args: {id: "stub"}}, + {name: :list_users, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users(\?|\z)}}, + {name: :create_user, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users(\?|\z)}, args: {email: "stub", password: WorkOS::UserManagement::PasswordPlaintext.new(password: "stub")}}, + {name: :get_user_by_external_id, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/external_id/stub(\?|\z)}, args: {external_id: "stub"}}, + {name: :get_user, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}, args: {id: "stub"}}, + {name: :update_user, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}, args: {id: "stub", password: WorkOS::UserManagement::PasswordPlaintext.new(password: "stub")}}, + {name: :delete_user, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub(\?|\z)}, args: {id: "stub"}}, + {name: :confirm_email_change, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_change/confirm(\?|\z)}, args: {id: "stub", code: "stub"}}, + {name: :send_email_change, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_change/send(\?|\z)}, args: {id: "stub", new_email: "stub"}}, + {name: :verify_email, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_verification/confirm(\?|\z)}, args: {id: "stub", code: "stub"}}, + {name: :send_verification_email, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/email_verification/send(\?|\z)}, args: {id: "stub"}}, + {name: :get_user_identities, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/identities(\?|\z)}, args: {id: "stub"}}, + {name: :list_sessions, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/sessions(\?|\z)}, args: {id: "stub"}}, + {name: :list_invitations, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/invitations(\?|\z)}}, + {name: :send_invitation, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/invitations(\?|\z)}, args: {email: "stub"}}, + {name: :find_invitation_by_token, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/invitations/by_token/stub(\?|\z)}, args: {token: "stub"}}, + {name: :get_invitation, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/invitations/stub(\?|\z)}, args: {id: "stub"}}, + {name: :accept_invitation, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/accept(\?|\z)}, args: {id: "stub"}}, + {name: :resend_invitation, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/resend(\?|\z)}, args: {id: "stub"}}, + {name: :revoke_invitation, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/invitations/stub/revoke(\?|\z)}, args: {id: "stub"}}, + {name: :list_jwt_template, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/jwt_template(\?|\z)}}, + {name: :update_jwt_template, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/jwt_template(\?|\z)}, args: {content: "stub"}}, + {name: :create_magic_auth, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth(\?|\z)}, args: {email: "stub"}}, + {name: :get_magic_auth, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/magic_auth/stub(\?|\z)}, args: {id: "stub"}}, + {name: :list_organization_memberships, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships(\?|\z)}}, + {name: :create_organization_membership, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships(\?|\z)}, args: {user_id: "stub", organization_id: "stub", role: WorkOS::UserManagement::RoleSingle.new(role_slug: "stub")}}, + {name: :get_organization_membership, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}, args: {id: "stub"}}, + {name: :update_organization_membership, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}, args: {id: "stub", role: WorkOS::UserManagement::RoleSingle.new(role_slug: "stub")}}, + {name: :delete_organization_membership, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub(\?|\z)}, args: {id: "stub"}}, + {name: :deactivate_organization_membership, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/deactivate(\?|\z)}, args: {id: "stub"}}, + {name: :reactivate_organization_membership, verb: :put, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/reactivate(\?|\z)}, args: {id: "stub"}}, + {name: :create_redirect_uri, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/redirect_uris(\?|\z)}, args: {uri: "stub"}}, + {name: :list_user_authorized_applications, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications(\?|\z)}, args: {user_id: "stub"}}, + {name: :delete_user_authorized_application, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/authorized_applications/stub(\?|\z)}, args: {application_id: "stub", user_id: "stub"}}, + {name: :list_user_api_keys, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}, args: {user_id: "stub"}}, + {name: :create_user_api_key, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/api_keys(\?|\z)}, args: {user_id: "stub", name: "stub", organization_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_user_management_organization_membership_groups.rb b/test/workos/test_user_management_organization_membership_groups.rb new file mode 100644 index 00000000..b0f07081 --- /dev/null +++ b/test/workos/test_user_management_organization_membership_groups.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class UserManagementOrganizationMembershipGroupsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_organization_membership_groups_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/groups(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.user_management_organization_membership_groups.list_organization_membership_groups(om_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_organization_membership_groups, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/organization_memberships/stub/groups(\?|\z)}, args: {om_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.user_management_organization_membership_groups.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_vault.rb b/test/workos/test_vault.rb new file mode 100644 index 00000000..b5249465 --- /dev/null +++ b/test/workos/test_vault.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "base64" + +class VaultTest < Minitest::Test + def setup + @client = WorkOS::Client.new(api_key: "sk_test_vault") + end + + def test_vault_accessor_exists + assert_kind_of WorkOS::Vault, @client.vault + end + + def test_create_object_returns_metadata + body = { + "id" => "obj_01", "key_id" => "key_01", "version_id" => "v1", + "context" => {"tenant" => "t1"}, "environment_id" => "env_1", + "updated_at" => "2026-04-15T00:00:00Z", + "updated_by" => {"id" => "u1", "name" => "alice"} + } + stub_request(:post, "https://api.workos.com/vault/v1/kv") + .with(body: hash_including("name" => "secret", "value" => "hello")) + .to_return(status: 200, body: body.to_json) + + meta = @client.vault.create_object(name: "secret", value: "hello", key_context: {"tenant" => "t1"}) + assert_equal "obj_01", meta.id + assert_equal "v1", meta.version_id + assert_equal "alice", meta.updated_by.name + end + + def test_read_object_returns_decrypted_value + body = { + "id" => "obj_01", "name" => "secret", "value" => "hello", + "metadata" => { + "id" => "obj_01", "key_id" => "k", "version_id" => "v", + "context" => {}, "environment_id" => "env", + "updated_at" => "x", "updated_by" => {"id" => "u", "name" => "n"} + } + } + stub_request(:get, "https://api.workos.com/vault/v1/kv/obj_01") + .to_return(status: 200, body: body.to_json) + + obj = @client.vault.read_object(object_id: "obj_01") + assert_equal "hello", obj.value + assert_equal "secret", obj.name + end + + def test_list_objects_returns_digests + body = {"data" => [{"id" => "o1", "name" => "a", "updated_at" => "x"}, {"id" => "o2", "name" => "b", "updated_at" => "y"}]} + stub_request(:get, /vault\/v1\/kv\?/).to_return(status: 200, body: body.to_json) + + digests = @client.vault.list_objects(limit: 10) + assert_equal 2, digests.size + assert_equal "o1", digests.first.id + end + + def test_list_object_versions + body = {"data" => [{"id" => "v1", "created_at" => "x", "current_version" => true}]} + stub_request(:get, "https://api.workos.com/vault/v1/kv/obj_1/versions").to_return(status: 200, body: body.to_json) + + versions = @client.vault.list_object_versions(object_id: "obj_1") + assert_equal 1, versions.size + assert versions.first.current_version + end + + def test_get_object_metadata + body = {"id" => "obj_1", "name" => "n", "metadata" => { + "id" => "obj_1", "key_id" => "k", "version_id" => "v", + "context" => {}, "environment_id" => "env", + "updated_at" => "x", "updated_by" => {"id" => "u", "name" => "n"} + }} + stub_request(:get, "https://api.workos.com/vault/v1/kv/obj_1/metadata").to_return(status: 200, body: body.to_json) + + obj = @client.vault.get_object_metadata(object_id: "obj_1") + assert_nil obj.value + assert_equal "obj_1", obj.metadata.id + end + + def test_delete_object_returns_nil + stub_request(:delete, "https://api.workos.com/vault/v1/kv/obj_1").to_return(status: 200, body: "") + assert_nil @client.vault.delete_object(object_id: "obj_1") + end + + def test_update_object_with_version_check + body = {"id" => "obj_1", "name" => "n", "value" => "newval", "metadata" => nil} + stub_request(:put, "https://api.workos.com/vault/v1/kv/obj_1") + .with(body: hash_including("value" => "newval", "version_check" => "v1")) + .to_return(status: 200, body: body.to_json) + + obj = @client.vault.update_object(object_id: "obj_1", value: "newval", version_check: "v1") + assert_equal "newval", obj.value + end + + def test_create_data_key + body = {"context" => {"t" => "1"}, "id" => "dek_1", "data_key" => Base64.strict_encode64("k" * 32), "encrypted_keys" => Base64.strict_encode64("blob")} + stub_request(:post, "https://api.workos.com/vault/v1/keys/data-key") + .with(body: hash_including("context" => {"t" => "1"})) + .to_return(status: 200, body: body.to_json) + + pair = @client.vault.create_data_key(key_context: {"t" => "1"}) + assert_equal "dek_1", pair.data_key.id + assert_equal "blob", Base64.decode64(pair.encrypted_keys) + end + + def test_decrypt_data_key + body = {"id" => "dek_1", "data_key" => Base64.strict_encode64("k" * 32)} + stub_request(:post, "https://api.workos.com/vault/v1/keys/decrypt") + .with(body: hash_including("keys" => "abc")) + .to_return(status: 200, body: body.to_json) + + dk = @client.vault.decrypt_data_key(keys: "abc") + assert_equal "dek_1", dk.id + end + + def test_local_encrypt_then_decrypt_roundtrip + plaintext_key = "k" * 32 + create_resp = {"context" => {"t" => "1"}, "id" => "dek_1", + "data_key" => Base64.strict_encode64(plaintext_key), + "encrypted_keys" => Base64.strict_encode64("ENCRYPTED_BLOB")} + decrypt_resp = {"id" => "dek_1", "data_key" => Base64.strict_encode64(plaintext_key)} + + stub_request(:post, "https://api.workos.com/vault/v1/keys/data-key").to_return(status: 200, body: create_resp.to_json) + stub_request(:post, "https://api.workos.com/vault/v1/keys/decrypt").to_return(status: 200, body: decrypt_resp.to_json) + + payload = "the quick brown fox" + encrypted = @client.vault.encrypt(data: payload, key_context: {"t" => "1"}) + refute_equal payload, encrypted + + plaintext = @client.vault.decrypt(encrypted_data: encrypted) + assert_equal payload, plaintext + end + + def test_local_encrypt_with_associated_data + plaintext_key = "k" * 32 + create_resp = {"context" => {}, "id" => "dek", "data_key" => Base64.strict_encode64(plaintext_key), "encrypted_keys" => Base64.strict_encode64("BLOB")} + decrypt_resp = {"id" => "dek", "data_key" => Base64.strict_encode64(plaintext_key)} + + stub_request(:post, "https://api.workos.com/vault/v1/keys/data-key").to_return(status: 200, body: create_resp.to_json) + stub_request(:post, "https://api.workos.com/vault/v1/keys/decrypt").to_return(status: 200, body: decrypt_resp.to_json) + + encrypted = @client.vault.encrypt(data: "secret", key_context: {}, associated_data: "tenant=42") + plaintext = @client.vault.decrypt(encrypted_data: encrypted, associated_data: "tenant=42") + assert_equal "secret", plaintext + + assert_raises(OpenSSL::Cipher::CipherError) do + @client.vault.decrypt(encrypted_data: encrypted, associated_data: "wrong") + end + end +end diff --git a/test/workos/test_webhook_verify.rb b/test/workos/test_webhook_verify.rb new file mode 100644 index 00000000..b1e082e2 --- /dev/null +++ b/test/workos/test_webhook_verify.rb @@ -0,0 +1,95 @@ +# frozen_string_literal: true + +# @oagen-ignore-file +require "test_helper" +require "openssl" + +class WebhookVerifyTest < Minitest::Test + SECRET = "whsec_test_secret" + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_webhook") + @webhooks = @client.webhooks + end + + def signed(payload, ts: now_ms, secret: SECRET) + sig = OpenSSL::HMAC.hexdigest("SHA256", secret, "#{ts}.#{payload}") + "t=#{ts}, v1=#{sig}" + end + + def now_ms + (Time.now.to_f * 1000).to_i + end + + def test_verify_methods_exist + assert_respond_to @webhooks, :verify_event + assert_respond_to @webhooks, :verify_header + assert_respond_to @webhooks, :compute_signature + assert_respond_to @webhooks, :parse_signature_header + end + + def test_verify_event_returns_parsed_payload + payload = '{"id":"evt_1","event":"user.created"}' + sig_header = signed(payload) + event = @webhooks.verify_event(payload: payload, sig_header: sig_header, secret: SECRET) + assert_equal "evt_1", event["id"] + assert_equal "user.created", event["event"] + end + + def test_verify_header_passes_for_valid_signature + payload = '{"x":1}' + assert @webhooks.verify_header(payload: payload, sig_header: signed(payload), secret: SECRET) + end + + def test_verify_header_raises_on_bad_signature + payload = '{"x":1}' + bad = "t=#{now_ms}, v1=deadbeef" + assert_raises(WorkOS::SignatureVerificationError) do + @webhooks.verify_header(payload: payload, sig_header: bad, secret: SECRET) + end + end + + def test_verify_header_raises_on_stale_timestamp + payload = '{"x":1}' + old_ts = now_ms - (10 * 60 * 1000) # 10 minutes old + sig = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{old_ts}.#{payload}") + header = "t=#{old_ts}, v1=#{sig}" + err = assert_raises(WorkOS::SignatureVerificationError) do + @webhooks.verify_header(payload: payload, sig_header: header, secret: SECRET, tolerance: 60) + end + assert_match(/Timestamp outside the tolerance zone/, err.message) + end + + def test_verify_header_raises_on_future_timestamp + payload = '{"x":1}' + future_ts = now_ms + (10 * 60 * 1000) # 10 minutes ahead + sig = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{future_ts}.#{payload}") + header = "t=#{future_ts}, v1=#{sig}" + err = assert_raises(WorkOS::SignatureVerificationError) do + @webhooks.verify_header(payload: payload, sig_header: header, secret: SECRET, tolerance: 60) + end + assert_match(/Timestamp outside the tolerance zone/, err.message) + end + + def test_verify_header_raises_on_malformed_header + assert_raises(WorkOS::SignatureVerificationError) do + @webhooks.verify_header(payload: "{}", sig_header: "garbage", secret: SECRET) + end + assert_raises(WorkOS::SignatureVerificationError) do + @webhooks.verify_header(payload: "{}", sig_header: nil, secret: SECRET) + end + end + + def test_compute_signature_matches_manual_hmac + payload = "hello" + ts = "1700000000000" + expected = OpenSSL::HMAC.hexdigest("SHA256", SECRET, "#{ts}.#{payload}") + assert_equal expected, @webhooks.compute_signature(payload: payload, timestamp: ts, secret: SECRET) + end + + def test_parse_signature_header + ts, sig = @webhooks.parse_signature_header("t=12345, v1=abcdef") + assert_equal "12345", ts + assert_equal "abcdef", sig + end +end diff --git a/test/workos/test_webhooks.rb b/test/workos/test_webhooks.rb new file mode 100644 index 00000000..1a10bbf2 --- /dev/null +++ b/test/workos/test_webhooks.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class WebhooksTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_webhook_endpoints_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/webhook_endpoints(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.webhooks.list_webhook_endpoints + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_webhook_endpoint_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/webhook_endpoints(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.webhooks.create_webhook_endpoint(endpoint_url: "stub", events: ["stub"]) + refute_nil result + end + + def test_update_webhook_endpoint_returns_expected_result + stub_request(:patch, %r{\Ahttps://api\.workos\.com/webhook_endpoints/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.webhooks.update_webhook_endpoint(id: "stub") + refute_nil result + end + + def test_delete_webhook_endpoint_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/webhook_endpoints/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.webhooks.delete_webhook_endpoint(id: "stub") + assert_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_webhook_endpoints, verb: :get, url: %r{\Ahttps://api\.workos\.com/webhook_endpoints(\?|\z)}}, + {name: :create_webhook_endpoint, verb: :post, url: %r{\Ahttps://api\.workos\.com/webhook_endpoints(\?|\z)}, args: {endpoint_url: "stub", events: ["stub"]}}, + {name: :update_webhook_endpoint, verb: :patch, url: %r{\Ahttps://api\.workos\.com/webhook_endpoints/stub(\?|\z)}, args: {id: "stub"}}, + {name: :delete_webhook_endpoint, verb: :delete, url: %r{\Ahttps://api\.workos\.com/webhook_endpoints/stub(\?|\z)}, args: {id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.webhooks.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_widgets.rb b/test/workos/test_widgets.rb new file mode 100644 index 00000000..f8270c1e --- /dev/null +++ b/test/workos/test_widgets.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class WidgetsTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_create_token_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/widgets/token(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.widgets.create_token(organization_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :create_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/widgets/token(\?|\z)}, args: {organization_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.widgets.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/workos.gemspec b/workos.gemspec index 524c5a28..88a611fd 100644 --- a/workos.gemspec +++ b/workos.gemspec @@ -1,31 +1,36 @@ # frozen_string_literal: true -lib = File.expand_path('lib', __dir__) +require "English" + +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) -require 'workos/version' +require "workos/version" Gem::Specification.new do |spec| - spec.name = 'workos' + spec.name = "workos" spec.version = WorkOS::VERSION - spec.authors = ['WorkOS'] - spec.email = ['support@workos.com'] - spec.description = 'API client for WorkOS' - spec.summary = 'API client for WorkOS' - spec.homepage = 'https://github.com/workos-inc/workos-ruby' - spec.license = 'MIT' + spec.authors = ["WorkOS"] + spec.email = ["support@workos.com"] + spec.description = "API client for WorkOS" + spec.summary = "API client for WorkOS" + spec.homepage = "https://github.com/workos/workos-ruby" + spec.license = "MIT" spec.metadata = { - 'documentation_uri' => 'https://docs.workos.com/sdk/ruby', + "documentation_uri" => "https://docs.workos.com/sdk/ruby" } spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) - spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) - spec.require_paths = ['lib'] + spec.require_paths = ["lib"] + + spec.add_dependency "jwt", "~> 3.1" + spec.add_dependency "logger", "~> 1.7" + spec.add_dependency "zeitwerk", "~> 2.6" - spec.add_development_dependency 'bundler', '>= 2.0.1' - spec.add_development_dependency 'rspec', '~> 3.9.0' - spec.add_development_dependency 'rubocop', '~> 0.77' - spec.add_development_dependency 'vcr', '~> 5.0.0' - spec.add_development_dependency 'webmock' + spec.add_development_dependency "bundler", ">= 2.0.1" + spec.add_development_dependency "minitest", "~> 6.0" + spec.add_development_dependency "rake" + spec.add_development_dependency "standard", "~> 1.49" + spec.add_development_dependency "webmock", "~> 3.26" - spec.required_ruby_version = '>= 2.7' + spec.required_ruby_version = ">= 3.3" end