diff --git a/.changelog-pending/2026-06-03T19-21-00-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md b/.changelog-pending/2026-06-03T19-21-00-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md new file mode 100644 index 00000000..06042de5 --- /dev/null +++ b/.changelog-pending/2026-06-03T19-21-00-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md @@ -0,0 +1,31 @@ +* [#495](https://github.com/workos/workos-ruby/pull/495) feat(generated)!: regenerate from spec (8 changes) + + **⚠️ Breaking** + * **user_management:** Remove return_to param from revoke_session; add name field to user models + * Remove `return_to` parameter from `revoke_session` method (breaking change) + * Add optional `name` field to `User`, `CreateUser`, `UpdateUser`, and `EmailChangeConfirmationUser` models + * Update related `.rbi` type stubs to reflect signature changes + * **user_management:** Add UserApiKeyUpdatedDataOwner model + * Add `UserApiKeyUpdatedDataOwner` model for API key update events owned by users + + **Features** + * **api_keys:** Add API key expiration and update event support + * Add `create_api_key_expire` operation to expire API keys via `POST /api_keys/{id}/expire` + * Add `ApiKeyUpdated` event class with `ApiKeyUpdatedData` and related nested models for tracking API key update events + * Add new `expires_at` required field to `ApiKeyCreatedData` and `ApiKeyRevokedData` + * **directory_sync:** Remove DsyncDeactivated models; add DsyncToken events + * Remove `DsyncDeactivated`, `DsyncDeactivatedData`, and related enum classes (breaking change) + * Add `DsyncTokenCreated`, `DsyncTokenCreatedData`, `DsyncTokenRevoked`, and `DsyncTokenRevokedData` event models + * Support new directory token lifecycle events in webhooks + * **vault:** Rename ObjectModel class to VaultObject + * Rename `ObjectModel` class to `VaultObject` for consistency with vault service naming (breaking change) + * Update `get_name` and `get_kv` methods to return `VaultObject` instead of `ObjectModel` + * Remove `object` inflection mapping that no longer applies + * **connect:** Add name field to UserObject + * Add optional `name` field to `UserObject` model for Connect applications + * **groups:** Move UserOrganizationMembershipBaseListData from authorization to groups + * Relocate `UserOrganizationMembershipBaseListData` model from authorization service to groups service (organizational change) + * **types:** Add SNOWFLAKE log stream type; remove DOMAIN_SIGN_UP_RATE_LIMIT enum + * Add `SNOWFLAKE` value to `AuditLogConfigurationLogStreamType` enum + * Remove `DOMAIN_SIGN_UP_RATE_LIMIT` value from `RadarStandaloneResponseControl` enum (breaking at type level) + * Add `API_KEY_UPDATED` event type to webhook endpoint event enums diff --git a/.last-synced-sha b/.last-synced-sha index ad25d3d1..99cf20f6 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -cb6857d51b453e3cbdb5bf3647d3ca229dd8af65 +d8c5a7de598792b1cee18d4a9842825110e5c74a diff --git a/.oagen-manifest.json b/.oagen-manifest.json index 05b909db..ba413e7d 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,7 @@ { "version": 2, "language": "ruby", - "generatedAt": "2026-05-26T15:39:28.792Z", + "generatedAt": "2026-06-03T19:20:02.984Z", "files": [ "lib/workos.rb", "lib/workos/admin_portal.rb", @@ -19,8 +19,13 @@ "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_updated.rb", + "lib/workos/api_keys/api_key_updated_data.rb", + "lib/workos/api_keys/api_key_updated_data_owner.rb", + "lib/workos/api_keys/api_key_updated_data_previous_attribute.rb", "lib/workos/api_keys/api_key_validation_response.rb", "lib/workos/api_keys/create_organization_api_key.rb", + "lib/workos/api_keys/expire_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", @@ -75,7 +80,6 @@ "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", @@ -106,9 +110,6 @@ "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", @@ -119,6 +120,10 @@ "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_token_created.rb", + "lib/workos/directory_sync/dsync_token_created_data.rb", + "lib/workos/directory_sync/dsync_token_revoked.rb", + "lib/workos/directory_sync/dsync_token_revoked_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", @@ -168,6 +173,7 @@ "lib/workos/groups/create_group_membership.rb", "lib/workos/groups/group.rb", "lib/workos/groups/update_group.rb", + "lib/workos/groups/user_organization_membership_base_list_data.rb", "lib/workos/inflections.rb", "lib/workos/multi_factor_auth.rb", "lib/workos/multi_factor_auth/authentication_challenge.rb", @@ -336,8 +342,6 @@ "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", @@ -543,6 +547,7 @@ "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_updated_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", @@ -562,7 +567,6 @@ "lib/workos/vault/decrypt_request.rb", "lib/workos/vault/decrypt_response.rb", "lib/workos/vault/delete_object_response.rb", - "lib/workos/vault/object.rb", "lib/workos/vault/object_metadata.rb", "lib/workos/vault/object_summary.rb", "lib/workos/vault/object_version.rb", @@ -591,6 +595,7 @@ "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/vault/vault_object.rb", "lib/workos/vault/version_list_response.rb", "lib/workos/webhooks.rb", "lib/workos/webhooks/create_webhook_endpoint.rb", @@ -614,6 +619,10 @@ "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_updated.rbi", + "rbi/workos/api_key_updated_data.rbi", + "rbi/workos/api_key_updated_data_owner.rbi", + "rbi/workos/api_key_updated_data_previous_attribute.rbi", "rbi/workos/api_key_validation_response.rbi", "rbi/workos/api_keys.rbi", "rbi/workos/application_credentials_list_item.rbi", @@ -782,9 +791,6 @@ "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", @@ -795,6 +801,10 @@ "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_token_created.rbi", + "rbi/workos/dsync_token_created_data.rbi", + "rbi/workos/dsync_token_revoked.rbi", + "rbi/workos/dsync_token_revoked_data.rbi", "rbi/workos/dsync_user_created.rbi", "rbi/workos/dsync_user_deleted.rbi", "rbi/workos/dsync_user_updated.rbi", @@ -815,6 +825,7 @@ "rbi/workos/event_list_list_metadata.rbi", "rbi/workos/event_schema.rbi", "rbi/workos/events.rbi", + "rbi/workos/expire_api_key.rbi", "rbi/workos/external_auth_complete_response.rbi", "rbi/workos/feature_flag.rbi", "rbi/workos/feature_flag_owner.rbi", @@ -882,7 +893,6 @@ "rbi/workos/mfa_totp_session_authenticate_request.rbi", "rbi/workos/multi_factor_auth.rbi", "rbi/workos/new_connect_application_secret.rbi", - "rbi/workos/object.rbi", "rbi/workos/object_metadata.rbi", "rbi/workos/object_summary.rbi", "rbi/workos/object_version.rbi", @@ -1013,6 +1023,7 @@ "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_updated_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", @@ -1056,6 +1067,7 @@ "rbi/workos/vault_metadata_read_data.rbi", "rbi/workos/vault_names_listed.rbi", "rbi/workos/vault_names_listed_data.rbi", + "rbi/workos/vault_object.rbi", "rbi/workos/verify_email_address.rbi", "rbi/workos/verify_email_response.rbi", "rbi/workos/waitlist_user.rbi", @@ -1830,6 +1842,10 @@ "sdkMethod": "delete_api_key", "service": "api_keys" }, + "POST /api_keys/{id}/expire": { + "sdkMethod": "create_api_key_expire", + "service": "api_keys" + }, "GET /user_management/users/{userId}/api_keys": { "sdkMethod": "list_user_api_keys", "service": "user_management" diff --git a/lib/workos/api_keys.rb b/lib/workos/api_keys.rb index c605ac71..aaf22c61 100644 --- a/lib/workos/api_keys.rb +++ b/lib/workos/api_keys.rb @@ -127,5 +127,30 @@ def delete_api_key( ) nil end + + # Expire an API key + # @param id [String] The unique ID of the API key. + # @param expires_at [String, nil] When the API key should expire. If omitted or in the past, the key expires immediately. Use null to clear a scheduled future expiration. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ApiKey] + def create_api_key_expire( + id:, + expires_at: nil, + request_options: {} + ) + body = { + "expires_at" => expires_at + }.compact + response = @client.request( + method: :post, + path: "/api_keys/#{WorkOS::Util.encode_path(id)}/expire", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ApiKey.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/dsync_deactivated.rb b/lib/workos/api_keys/api_key_updated.rb similarity index 83% rename from lib/workos/directory_sync/dsync_deactivated.rb rename to lib/workos/api_keys/api_key_updated.rb index 2a25da19..65ccd085 100644 --- a/lib/workos/directory_sync/dsync_deactivated.rb +++ b/lib/workos/api_keys/api_key_updated.rb @@ -3,7 +3,7 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - class DsyncDeactivated < WorkOS::Types::BaseModel + class ApiKeyUpdated < WorkOS::Types::BaseModel HASH_ATTRS = { object: :object, id: :id, @@ -26,7 +26,7 @@ def initialize(json) @object = hash[:object] @id = hash[:id] @event = hash[:event] - @data = hash[:data] ? WorkOS::DsyncDeactivatedData.new(hash[:data]) : nil + @data = hash[:data] ? WorkOS::ApiKeyUpdatedData.new(hash[:data]) : nil @created_at = hash[:created_at] @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil end diff --git a/lib/workos/api_keys/api_key_updated_data.rb b/lib/workos/api_keys/api_key_updated_data.rb new file mode 100644 index 00000000..ddba6e68 --- /dev/null +++ b/lib/workos/api_keys/api_key_updated_data.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyUpdatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + owner: :owner, + name: :name, + obfuscated_value: :obfuscated_value, + last_used_at: :last_used_at, + expires_at: :expires_at, + permissions: :permissions, + created_at: :created_at, + updated_at: :updated_at, + previous_attributes: :previous_attributes + }.freeze + + attr_accessor \ + :object, + :id, + :owner, + :name, + :obfuscated_value, + :last_used_at, + :expires_at, + :permissions, + :created_at, + :updated_at, + :previous_attributes + + 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::ApiKeyUpdatedDataOwner.new(hash[:owner]) when "user" then WorkOS::UserApiKeyUpdatedDataOwner.new(hash[:owner]) else hash[:owner] end) : nil + @name = hash[:name] + @obfuscated_value = hash[:obfuscated_value] + @last_used_at = hash[:last_used_at] + @expires_at = hash[:expires_at] + @permissions = hash[:permissions] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @previous_attributes = hash[:previous_attributes] ? WorkOS::ApiKeyUpdatedDataPreviousAttribute.new(hash[:previous_attributes]) : nil + end + end +end diff --git a/lib/workos/directory_sync/dsync_deactivated_data_domain.rb b/lib/workos/api_keys/api_key_updated_data_owner.rb similarity index 64% rename from lib/workos/directory_sync/dsync_deactivated_data_domain.rb rename to lib/workos/api_keys/api_key_updated_data_owner.rb index e131f29d..c45f9f10 100644 --- a/lib/workos/directory_sync/dsync_deactivated_data_domain.rb +++ b/lib/workos/api_keys/api_key_updated_data_owner.rb @@ -3,5 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - DsyncDeactivatedDataDomain = DsyncActivatedDataDomain + ApiKeyUpdatedDataOwner = ApiKeyCreatedDataOwner end diff --git a/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb b/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb new file mode 100644 index 00000000..eeae2a35 --- /dev/null +++ b/lib/workos/api_keys/api_key_updated_data_previous_attribute.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ApiKeyUpdatedDataPreviousAttribute < WorkOS::Types::BaseModel + HASH_ATTRS = { + expires_at: :expires_at + }.freeze + + attr_accessor :expires_at + + def initialize(json) + hash = self.class.normalize(json) + @expires_at = hash[:expires_at] + end + end +end diff --git a/lib/workos/api_keys/expire_api_key.rb b/lib/workos/api_keys/expire_api_key.rb new file mode 100644 index 00000000..69142dc4 --- /dev/null +++ b/lib/workos/api_keys/expire_api_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ExpireApiKey < WorkOS::Types::BaseModel + HASH_ATTRS = { + expires_at: :expires_at + }.freeze + + attr_accessor :expires_at + + def initialize(json) + hash = self.class.normalize(json) + @expires_at = hash[:expires_at] + end + end +end diff --git a/lib/workos/authorization.rb b/lib/workos/authorization.rb index f41959d3..983b8e6a 100644 --- a/lib/workos/authorization.rb +++ b/lib/workos/authorization.rb @@ -93,7 +93,7 @@ def check( # @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 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). # @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) @@ -157,7 +157,7 @@ def list_resources_for_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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_effective_permissions( @@ -208,7 +208,7 @@ def list_effective_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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_effective_permissions_by_external_id( @@ -259,7 +259,7 @@ def list_effective_permissions_by_external_id( # @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 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). # @param resource_id [String, nil] Filter assignments by the ID of the resource. # @param resource_external_id [String, nil] Filter assignments by the external ID of the resource. # @param resource_type_slug [String, nil] Filter assignments by the slug of the resource type. @@ -706,7 +706,7 @@ def delete_resource_by_external_id( # @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 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). # @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) @@ -767,7 +767,7 @@ def list_memberships_for_resource_by_external_id( # @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 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). # @param role_slug [String, nil] Filter assignments by the slug of the role. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] @@ -821,7 +821,7 @@ def list_role_assignments_for_resource_by_external_id( # @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 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). # @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. @@ -1023,7 +1023,7 @@ def delete_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 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). # @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) @@ -1078,7 +1078,7 @@ def list_memberships_for_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 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). # @param role_slug [String, nil] Filter assignments by the slug of the role. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] @@ -1272,7 +1272,7 @@ def set_environment_role_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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_permissions( diff --git a/lib/workos/connect.rb b/lib/workos/connect.rb index 09bb810a..2a6d5214 100644 --- a/lib/workos/connect.rb +++ b/lib/workos/connect.rb @@ -43,7 +43,7 @@ def complete_oauth2( # @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 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). # @param organization_id [String, nil] Filter Connect Applications by organization ID. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] diff --git a/lib/workos/connect/user_object.rb b/lib/workos/connect/user_object.rb index 9d263482..9ba0f8ff 100644 --- a/lib/workos/connect/user_object.rb +++ b/lib/workos/connect/user_object.rb @@ -9,6 +9,7 @@ class UserObject < WorkOS::Types::BaseModel email: :email, first_name: :first_name, last_name: :last_name, + name: :name, metadata: :metadata }.freeze @@ -17,6 +18,7 @@ class UserObject < WorkOS::Types::BaseModel :email, :first_name, :last_name, + :name, :metadata def initialize(json) @@ -25,6 +27,7 @@ def initialize(json) @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] + @name = hash[:name] @metadata = hash[:metadata] || {} end end diff --git a/lib/workos/directory_sync.rb b/lib/workos/directory_sync.rb index ac473f94..578e2082 100644 --- a/lib/workos/directory_sync.rb +++ b/lib/workos/directory_sync.rb @@ -106,7 +106,7 @@ def delete_directory( # @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 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). # @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) @@ -177,7 +177,7 @@ def get_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 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). # @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) diff --git a/lib/workos/directory_sync/dsync_deactivated_data.rb b/lib/workos/directory_sync/dsync_deactivated_data.rb deleted file mode 100644 index afe57f6c..00000000 --- a/lib/workos/directory_sync/dsync_deactivated_data.rb +++ /dev/null @@ -1,46 +0,0 @@ -# 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_token_created.rb b/lib/workos/directory_sync/dsync_token_created.rb new file mode 100644 index 00000000..35b5a1bb --- /dev/null +++ b/lib/workos/directory_sync/dsync_token_created.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncTokenCreated < 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] ? WorkOS::DsyncTokenCreatedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/directory_sync/dsync_token_created_data.rb b/lib/workos/directory_sync/dsync_token_created_data.rb new file mode 100644 index 00000000..6ec8f0ad --- /dev/null +++ b/lib/workos/directory_sync/dsync_token_created_data.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncTokenCreatedData < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + directory_id: :directory_id, + organization_id: :organization_id, + token_suffix: :token_suffix, + created_at: :created_at + }.freeze + + attr_accessor \ + :object, + :id, + :directory_id, + :organization_id, + :token_suffix, + :created_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @directory_id = hash[:directory_id] + @organization_id = hash[:organization_id] + @token_suffix = hash[:token_suffix] + @created_at = hash[:created_at] + end + end +end diff --git a/lib/workos/directory_sync/dsync_token_revoked.rb b/lib/workos/directory_sync/dsync_token_revoked.rb new file mode 100644 index 00000000..7248bb1b --- /dev/null +++ b/lib/workos/directory_sync/dsync_token_revoked.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DsyncTokenRevoked < 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] ? WorkOS::DsyncTokenRevokedData.new(hash[:data]) : nil + @created_at = hash[:created_at] + @context = hash[:context] ? WorkOS::EventContext.new(hash[:context]) : nil + end + end +end diff --git a/lib/workos/types/dsync_deactivated_data_type.rb b/lib/workos/directory_sync/dsync_token_revoked_data.rb similarity index 57% rename from lib/workos/types/dsync_deactivated_data_type.rb rename to lib/workos/directory_sync/dsync_token_revoked_data.rb index 3ca02e36..84917a13 100644 --- a/lib/workos/types/dsync_deactivated_data_type.rb +++ b/lib/workos/directory_sync/dsync_token_revoked_data.rb @@ -3,7 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - module Types - DsyncDeactivatedDataType = DsyncActivatedDataType - end + DsyncTokenRevokedData = DsyncTokenCreatedData end diff --git a/lib/workos/events.rb b/lib/workos/events.rb index b8b97111..583f3050 100644 --- a/lib/workos/events.rb +++ b/lib/workos/events.rb @@ -14,7 +14,7 @@ def initialize(client) # @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 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). # @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. diff --git a/lib/workos/groups.rb b/lib/workos/groups.rb index 934f0e76..de6660ee 100644 --- a/lib/workos/groups.rb +++ b/lib/workos/groups.rb @@ -15,7 +15,7 @@ def initialize(client) # @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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_organization_groups( @@ -161,7 +161,7 @@ def delete_organization_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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_group_organization_memberships( diff --git a/lib/workos/authorization/user_organization_membership_base_list_data.rb b/lib/workos/groups/user_organization_membership_base_list_data.rb similarity index 100% rename from lib/workos/authorization/user_organization_membership_base_list_data.rb rename to lib/workos/groups/user_organization_membership_base_list_data.rb diff --git a/lib/workos/inflections.rb b/lib/workos/inflections.rb index 79e1d047..d72bf674 100644 --- a/lib/workos/inflections.rb +++ b/lib/workos/inflections.rb @@ -50,7 +50,6 @@ "create_oauth_application" => "CreateOAuthApplication", "jwt_template_response" => "JWTTemplateResponse", "mfa_totp_session_authenticate_request" => "MFATotpSessionAuthenticateRequest", - "object" => "ObjectModel", "pkce" => "PKCE", "sso" => "SSO", "sso_authorize_url_response" => "SSOAuthorizeUrlResponse", diff --git a/lib/workos/organization_membership_service.rb b/lib/workos/organization_membership_service.rb index 1210018d..8b9d5048 100644 --- a/lib/workos/organization_membership_service.rb +++ b/lib/workos/organization_membership_service.rb @@ -26,7 +26,7 @@ def initialize(client) # @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 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). # @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). @@ -228,7 +228,7 @@ def reactivate_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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_organization_membership_groups( diff --git a/lib/workos/organizations.rb b/lib/workos/organizations.rb index d03fd37b..8a595b52 100644 --- a/lib/workos/organizations.rb +++ b/lib/workos/organizations.rb @@ -14,7 +14,7 @@ def initialize(client) # @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 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). # @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) diff --git a/lib/workos/types/audit_log_configuration_log_stream_type.rb b/lib/workos/types/audit_log_configuration_log_stream_type.rb index 4cfaa09a..66cbaed4 100644 --- a/lib/workos/types/audit_log_configuration_log_stream_type.rb +++ b/lib/workos/types/audit_log_configuration_log_stream_type.rb @@ -10,8 +10,9 @@ class AuditLogConfigurationLogStreamType GENERIC_HTTPS = "GenericHttps" GOOGLE_CLOUD_STORAGE = "GoogleCloudStorage" S_3 = "S3" + SNOWFLAKE = "Snowflake" SPLUNK = "Splunk" - ALL = [AZURE_SENTINEL, DATADOG, GENERIC_HTTPS, GOOGLE_CLOUD_STORAGE, S_3, SPLUNK].freeze + ALL = [AZURE_SENTINEL, DATADOG, GENERIC_HTTPS, GOOGLE_CLOUD_STORAGE, S_3, SNOWFLAKE, SPLUNK].freeze end end end diff --git a/lib/workos/types/create_webhook_endpoint_events.rb b/lib/workos/types/create_webhook_endpoint_events.rb index 79ffd78a..9c312ac5 100644 --- a/lib/workos/types/create_webhook_endpoint_events.rb +++ b/lib/workos/types/create_webhook_endpoint_events.rb @@ -22,6 +22,7 @@ class CreateWebhookEndpointEvents AUTHENTICATION_RADAR_RISK_DETECTED = "authentication.radar_risk_detected" API_KEY_CREATED = "api_key.created" API_KEY_REVOKED = "api_key.revoked" + API_KEY_UPDATED = "api_key.updated" CONNECTION_ACTIVATED = "connection.activated" CONNECTION_DEACTIVATED = "connection.deactivated" CONNECTION_SAML_CERTIFICATE_RENEWAL_REQUIRED = "connection.saml_certificate_renewal_required" @@ -85,7 +86,7 @@ class CreateWebhookEndpointEvents 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, PIPES_CONNECTED_ACCOUNT_CONNECTED, PIPES_CONNECTED_ACCOUNT_DISCONNECTED, PIPES_CONNECTED_ACCOUNT_REAUTHORIZATION_NEEDED, SESSION_CREATED, SESSION_REVOKED, WAITLIST_USER_APPROVED, WAITLIST_USER_CREATED, WAITLIST_USER_DENIED].freeze + 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, API_KEY_UPDATED, 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, PIPES_CONNECTED_ACCOUNT_CONNECTED, PIPES_CONNECTED_ACCOUNT_DISCONNECTED, PIPES_CONNECTED_ACCOUNT_REAUTHORIZATION_NEEDED, SESSION_CREATED, SESSION_REVOKED, WAITLIST_USER_APPROVED, WAITLIST_USER_CREATED, WAITLIST_USER_DENIED].freeze end end end diff --git a/lib/workos/types/radar_standalone_response_control.rb b/lib/workos/types/radar_standalone_response_control.rb index ea1dc897..e0e68b5b 100644 --- a/lib/workos/types/radar_standalone_response_control.rb +++ b/lib/workos/types/radar_standalone_response_control.rb @@ -7,13 +7,12 @@ module Types class RadarStandaloneResponseControl BOT_DETECTION = "bot_detection" BRUTE_FORCE_ATTACK = "brute_force_attack" - DOMAIN_SIGN_UP_RATE_LIMIT = "domain_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, DOMAIN_SIGN_UP_RATE_LIMIT, IMPOSSIBLE_TRAVEL, REPEAT_SIGN_UP, STALE_ACCOUNT, UNRECOGNIZED_DEVICE, RESTRICTION].freeze + ALL = [BOT_DETECTION, BRUTE_FORCE_ATTACK, IMPOSSIBLE_TRAVEL, REPEAT_SIGN_UP, STALE_ACCOUNT, UNRECOGNIZED_DEVICE, RESTRICTION].freeze end end end diff --git a/lib/workos/user_management.rb b/lib/workos/user_management.rb index 85d5c39e..44de878f 100644 --- a/lib/workos/user_management.rb +++ b/lib/workos/user_management.rb @@ -432,18 +432,15 @@ def create_device( # 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 + "session_id" => session_id + } @client.request( method: :post, path: "/user_management/sessions/revoke", @@ -568,7 +565,7 @@ def get_password_reset( # @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 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). # @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. @@ -624,6 +621,7 @@ def list_users( # @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 name [String, nil] The user's full name. # @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. @@ -634,6 +632,7 @@ def create_user( email:, first_name: nil, last_name: nil, + name: nil, email_verified: nil, metadata: nil, external_id: nil, @@ -644,6 +643,7 @@ def create_user( "email" => email, "first_name" => first_name, "last_name" => last_name, + "name" => name, "email_verified" => email_verified, "metadata" => metadata, "external_id" => external_id @@ -714,6 +714,7 @@ def get_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 name [String, nil] The user's full name. # @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. @@ -726,6 +727,7 @@ def update_user( email: nil, first_name: nil, last_name: nil, + name: nil, email_verified: nil, metadata: nil, external_id: nil, @@ -737,6 +739,7 @@ def update_user( "email" => email, "first_name" => first_name, "last_name" => last_name, + "name" => name, "email_verified" => email_verified, "metadata" => metadata, "external_id" => external_id, @@ -899,7 +902,7 @@ def get_user_identities( # @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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_sessions( @@ -945,7 +948,7 @@ def list_sessions( # @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 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). # @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) @@ -1243,7 +1246,7 @@ def create_redirect_uri( # @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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_user_authorized_applications( diff --git a/lib/workos/user_management/create_user.rb b/lib/workos/user_management/create_user.rb index b729884f..fb85a6c6 100644 --- a/lib/workos/user_management/create_user.rb +++ b/lib/workos/user_management/create_user.rb @@ -8,6 +8,7 @@ class CreateUser < WorkOS::Types::BaseModel email: :email, first_name: :first_name, last_name: :last_name, + name: :name, email_verified: :email_verified, metadata: :metadata, external_id: :external_id, @@ -20,6 +21,7 @@ class CreateUser < WorkOS::Types::BaseModel :email, :first_name, :last_name, + :name, :email_verified, :metadata, :external_id, @@ -32,6 +34,7 @@ def initialize(json) @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] + @name = hash[:name] @email_verified = hash[:email_verified] @metadata = hash[:metadata] || {} @external_id = hash[:external_id] diff --git a/lib/workos/user_management/email_change_confirmation_user.rb b/lib/workos/user_management/email_change_confirmation_user.rb index b6c0ac2c..2430349d 100644 --- a/lib/workos/user_management/email_change_confirmation_user.rb +++ b/lib/workos/user_management/email_change_confirmation_user.rb @@ -9,6 +9,7 @@ class EmailChangeConfirmationUser < WorkOS::Types::BaseModel id: :id, first_name: :first_name, last_name: :last_name, + name: :name, profile_picture_url: :profile_picture_url, email: :email, email_verified: :email_verified, @@ -25,6 +26,7 @@ class EmailChangeConfirmationUser < WorkOS::Types::BaseModel :id, :first_name, :last_name, + :name, :profile_picture_url, :email, :email_verified, @@ -41,6 +43,7 @@ def initialize(json) @id = hash[:id] @first_name = hash[:first_name] @last_name = hash[:last_name] + @name = hash[:name] @profile_picture_url = hash[:profile_picture_url] @email = hash[:email] @email_verified = hash[:email_verified] diff --git a/lib/workos/user_management/revoke_session.rb b/lib/workos/user_management/revoke_session.rb index 337432f5..85be8073 100644 --- a/lib/workos/user_management/revoke_session.rb +++ b/lib/workos/user_management/revoke_session.rb @@ -5,18 +5,14 @@ module WorkOS class RevokeSession < WorkOS::Types::BaseModel HASH_ATTRS = { - session_id: :session_id, - return_to: :return_to + session_id: :session_id }.freeze - attr_accessor \ - :session_id, - :return_to + attr_accessor :session_id 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/update_user.rb b/lib/workos/user_management/update_user.rb index 6dfb19c7..f8338103 100644 --- a/lib/workos/user_management/update_user.rb +++ b/lib/workos/user_management/update_user.rb @@ -8,6 +8,7 @@ class UpdateUser < WorkOS::Types::BaseModel email: :email, first_name: :first_name, last_name: :last_name, + name: :name, email_verified: :email_verified, metadata: :metadata, external_id: :external_id, @@ -21,6 +22,7 @@ class UpdateUser < WorkOS::Types::BaseModel :email, :first_name, :last_name, + :name, :email_verified, :metadata, :external_id, @@ -34,6 +36,7 @@ def initialize(json) @email = hash[:email] @first_name = hash[:first_name] @last_name = hash[:last_name] + @name = hash[:name] @email_verified = hash[:email_verified] @metadata = hash[:metadata] || {} @external_id = hash[:external_id] diff --git a/lib/workos/types/dsync_deactivated_data_state.rb b/lib/workos/user_management/user_api_key_updated_data_owner.rb similarity index 57% rename from lib/workos/types/dsync_deactivated_data_state.rb rename to lib/workos/user_management/user_api_key_updated_data_owner.rb index 33e4814e..2a9c408f 100644 --- a/lib/workos/types/dsync_deactivated_data_state.rb +++ b/lib/workos/user_management/user_api_key_updated_data_owner.rb @@ -3,7 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - module Types - DsyncDeactivatedDataState = DsyncActivatedDataState - end + UserApiKeyUpdatedDataOwner = UserApiKeyCreatedDataOwner end diff --git a/lib/workos/vault.rb b/lib/workos/vault.rb index 67829f62..7c36e614 100644 --- a/lib/workos/vault.rb +++ b/lib/workos/vault.rb @@ -169,7 +169,7 @@ def create_kv( # Read an object by name # @param name [String] Unique name of the object. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) - # @return [WorkOS::ObjectModel] + # @return [WorkOS::VaultObject] def get_name( name:, request_options: {} @@ -180,7 +180,7 @@ def get_name( auth: true, request_options: request_options ) - result = WorkOS::ObjectModel.new(response.body) + result = WorkOS::VaultObject.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 @@ -188,7 +188,7 @@ def get_name( # Read an object by ID # @param id [String] Unique identifier of the object. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) - # @return [WorkOS::ObjectModel] + # @return [WorkOS::VaultObject] def get_kv( id:, request_options: {} @@ -199,7 +199,7 @@ def get_kv( auth: true, request_options: request_options ) - result = WorkOS::ObjectModel.new(response.body) + result = WorkOS::VaultObject.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 diff --git a/lib/workos/vault/object.rb b/lib/workos/vault/vault_object.rb similarity index 91% rename from lib/workos/vault/object.rb rename to lib/workos/vault/vault_object.rb index 10b99f3e..58966544 100644 --- a/lib/workos/vault/object.rb +++ b/lib/workos/vault/vault_object.rb @@ -3,7 +3,7 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - class ObjectModel < WorkOS::Types::BaseModel + class VaultObject < WorkOS::Types::BaseModel HASH_ATTRS = { id: :id, metadata: :metadata, diff --git a/lib/workos/webhooks.rb b/lib/workos/webhooks.rb index e6d5644d..75c9ca29 100644 --- a/lib/workos/webhooks.rb +++ b/lib/workos/webhooks.rb @@ -15,7 +15,7 @@ def initialize(client) # @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 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). # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::Types::ListStruct] def list_webhook_endpoints( diff --git a/rbi/workos/dsync_deactivated.rbi b/rbi/workos/api_key_updated.rbi similarity index 87% rename from rbi/workos/dsync_deactivated.rbi rename to rbi/workos/api_key_updated.rbi index e0ba5898..53f3a023 100644 --- a/rbi/workos/dsync_deactivated.rbi +++ b/rbi/workos/api_key_updated.rbi @@ -5,7 +5,7 @@ # typed: strong module WorkOS - class DsyncDeactivated + class ApiKeyUpdated sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } def initialize(json); end @@ -27,10 +27,10 @@ module WorkOS sig { params(value: String).returns(String) } def event=(value); end - sig { returns(WorkOS::DsyncDeactivatedData) } + sig { returns(WorkOS::ApiKeyUpdatedData) } def data; end - sig { params(value: WorkOS::DsyncDeactivatedData).returns(WorkOS::DsyncDeactivatedData) } + sig { params(value: WorkOS::ApiKeyUpdatedData).returns(WorkOS::ApiKeyUpdatedData) } def data=(value); end sig { returns(String) } diff --git a/rbi/workos/api_key_updated_data.rbi b/rbi/workos/api_key_updated_data.rbi new file mode 100644 index 00000000..f7de3a73 --- /dev/null +++ b/rbi/workos/api_key_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 ApiKeyUpdatedData + 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::ApiKeyUpdatedDataOwner, WorkOS::UserApiKeyUpdatedDataOwner)) } + def owner; end + + sig { params(value: T.any(WorkOS::ApiKeyUpdatedDataOwner, WorkOS::UserApiKeyUpdatedDataOwner)).returns(T.any(WorkOS::ApiKeyUpdatedDataOwner, WorkOS::UserApiKeyUpdatedDataOwner)) } + 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.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 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(WorkOS::ApiKeyUpdatedDataPreviousAttribute) } + def previous_attributes; end + + sig { params(value: WorkOS::ApiKeyUpdatedDataPreviousAttribute).returns(WorkOS::ApiKeyUpdatedDataPreviousAttribute) } + 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/api_key_updated_data_owner.rbi b/rbi/workos/api_key_updated_data_owner.rbi new file mode 100644 index 00000000..d75459c7 --- /dev/null +++ b/rbi/workos/api_key_updated_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 ApiKeyUpdatedDataOwner + 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_updated_data_previous_attribute.rbi b/rbi/workos/api_key_updated_data_previous_attribute.rbi new file mode 100644 index 00000000..5d715447 --- /dev/null +++ b/rbi/workos/api_key_updated_data_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 ApiKeyUpdatedDataPreviousAttribute + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); 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::Hash[Symbol, T.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 index 982fa5c8..9f5a6da4 100644 --- a/rbi/workos/api_keys.rbi +++ b/rbi/workos/api_keys.rbi @@ -48,5 +48,14 @@ module WorkOS end def delete_api_key(id:, request_options:); end + sig do + params( + id: String, + expires_at: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ApiKey) + end + def create_api_key_expire(id:, expires_at:, request_options:); end + end end diff --git a/rbi/workos/create_user.rbi b/rbi/workos/create_user.rbi index 74d7b3b1..37dd7d18 100644 --- a/rbi/workos/create_user.rbi +++ b/rbi/workos/create_user.rbi @@ -27,6 +27,12 @@ module WorkOS 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::Boolean)) } def email_verified; end diff --git a/rbi/workos/dsync_token_created.rbi b/rbi/workos/dsync_token_created.rbi new file mode 100644 index 00000000..47ba0343 --- /dev/null +++ b/rbi/workos/dsync_token_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 DsyncTokenCreated + 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(WorkOS::DsyncTokenCreatedData) } + def data; end + + sig { params(value: WorkOS::DsyncTokenCreatedData).returns(WorkOS::DsyncTokenCreatedData) } + 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(T::Hash[Symbol, T.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_token_created_data.rbi similarity index 59% rename from rbi/workos/dsync_deactivated_data.rbi rename to rbi/workos/dsync_token_created_data.rbi index 056bc3f5..0a82bfc7 100644 --- a/rbi/workos/dsync_deactivated_data.rbi +++ b/rbi/workos/dsync_token_created_data.rbi @@ -5,7 +5,7 @@ # typed: strong module WorkOS - class DsyncDeactivatedData + class DsyncTokenCreatedData sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } def initialize(json); end @@ -21,29 +21,23 @@ module WorkOS 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 + def directory_id; end sig { params(value: String).returns(String) } - def type=(value); end + def directory_id=(value); end - sig { returns(String) } - def state; end + sig { returns(T.nilable(String)) } + def organization_id; end - sig { params(value: String).returns(String) } - def state=(value); end + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def organization_id=(value); end sig { returns(String) } - def name; end + def token_suffix; end sig { params(value: String).returns(String) } - def name=(value); end + def token_suffix=(value); end sig { returns(String) } def created_at; end @@ -51,24 +45,6 @@ module WorkOS 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 diff --git a/rbi/workos/dsync_token_revoked.rbi b/rbi/workos/dsync_token_revoked.rbi new file mode 100644 index 00000000..fb3675d3 --- /dev/null +++ b/rbi/workos/dsync_token_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 DsyncTokenRevoked + 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(WorkOS::DsyncTokenRevokedData) } + def data; end + + sig { params(value: WorkOS::DsyncTokenRevokedData).returns(WorkOS::DsyncTokenRevokedData) } + 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(T::Hash[Symbol, T.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_token_revoked_data.rbi b/rbi/workos/dsync_token_revoked_data.rbi new file mode 100644 index 00000000..7417cdc2 --- /dev/null +++ b/rbi/workos/dsync_token_revoked_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 DsyncTokenRevokedData + 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(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 token_suffix; end + + sig { params(value: String).returns(String) } + def token_suffix=(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_user.rbi b/rbi/workos/email_change_confirmation_user.rbi index 67fbca88..a822432f 100644 --- a/rbi/workos/email_change_confirmation_user.rbi +++ b/rbi/workos/email_change_confirmation_user.rbi @@ -33,6 +33,12 @@ module WorkOS 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(String)) } def profile_picture_url; end diff --git a/rbi/workos/expire_api_key.rbi b/rbi/workos/expire_api_key.rbi new file mode 100644 index 00000000..36cb4ac0 --- /dev/null +++ b/rbi/workos/expire_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 ExpireApiKey + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); 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::Hash[Symbol, T.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 index 666aa43c..0b7420a8 100644 --- a/rbi/workos/revoke_session.rbi +++ b/rbi/workos/revoke_session.rbi @@ -15,12 +15,6 @@ module WorkOS 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 diff --git a/rbi/workos/update_user.rbi b/rbi/workos/update_user.rbi index e4311c0a..bed44907 100644 --- a/rbi/workos/update_user.rbi +++ b/rbi/workos/update_user.rbi @@ -27,6 +27,12 @@ module WorkOS 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::Boolean)) } def email_verified; end diff --git a/rbi/workos/user.rbi b/rbi/workos/user.rbi index 91856669..4669a12a 100644 --- a/rbi/workos/user.rbi +++ b/rbi/workos/user.rbi @@ -33,6 +33,12 @@ module WorkOS 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(String)) } def profile_picture_url; end diff --git a/rbi/workos/dsync_deactivated_data_domain.rbi b/rbi/workos/user_api_key_updated_data_owner.rbi similarity index 81% rename from rbi/workos/dsync_deactivated_data_domain.rbi rename to rbi/workos/user_api_key_updated_data_owner.rbi index c8f60862..c85cc31e 100644 --- a/rbi/workos/dsync_deactivated_data_domain.rbi +++ b/rbi/workos/user_api_key_updated_data_owner.rbi @@ -5,15 +5,15 @@ # typed: strong module WorkOS - class DsyncDeactivatedDataDomain + class UserApiKeyUpdatedDataOwner sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } def initialize(json); end sig { returns(String) } - def object; end + def type; end sig { params(value: String).returns(String) } - def object=(value); end + def type=(value); end sig { returns(String) } def id; end @@ -22,10 +22,10 @@ module WorkOS def id=(value); end sig { returns(String) } - def domain; end + def organization_id; end sig { params(value: String).returns(String) } - def domain=(value); end + def organization_id=(value); end sig { returns(T::Hash[Symbol, T.untyped]) } def to_h; end diff --git a/rbi/workos/user_management.rbi b/rbi/workos/user_management.rbi index 7f603588..9f176e3a 100644 --- a/rbi/workos/user_management.rbi +++ b/rbi/workos/user_management.rbi @@ -72,11 +72,10 @@ module WorkOS 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 + def revoke_session(session_id:, request_options:); end sig do params( @@ -138,6 +137,7 @@ module WorkOS email: String, first_name: T.nilable(String), last_name: T.nilable(String), + name: T.nilable(String), email_verified: T.nilable(T::Boolean), metadata: T.nilable(T::Hash[String, String]), external_id: T.nilable(String), @@ -145,7 +145,7 @@ module WorkOS 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 + def create_user(email:, first_name:, last_name:, name:, email_verified:, metadata:, external_id:, password:, request_options:); end sig do params( @@ -169,6 +169,7 @@ module WorkOS email: T.nilable(String), first_name: T.nilable(String), last_name: T.nilable(String), + name: T.nilable(String), email_verified: T.nilable(T::Boolean), metadata: T.nilable(T::Hash[String, String]), external_id: T.nilable(String), @@ -177,7 +178,7 @@ module WorkOS 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 + def update_user(id:, email:, first_name:, last_name:, name:, email_verified:, metadata:, external_id:, locale:, password:, request_options:); end sig do params( diff --git a/rbi/workos/user_object.rbi b/rbi/workos/user_object.rbi index 4e44fc89..4dc966b1 100644 --- a/rbi/workos/user_object.rbi +++ b/rbi/workos/user_object.rbi @@ -33,6 +33,12 @@ module WorkOS 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::Hash[String, String])) } def metadata; end diff --git a/rbi/workos/vault.rbi b/rbi/workos/vault.rbi index a9a1fedc..2996c812 100644 --- a/rbi/workos/vault.rbi +++ b/rbi/workos/vault.rbi @@ -61,7 +61,7 @@ module WorkOS params( name: String, request_options: T::Hash[Symbol, T.untyped] - ).returns(WorkOS::ObjectModel) + ).returns(WorkOS::VaultObject) end def get_name(name:, request_options:); end @@ -69,7 +69,7 @@ module WorkOS params( id: String, request_options: T::Hash[Symbol, T.untyped] - ).returns(WorkOS::ObjectModel) + ).returns(WorkOS::VaultObject) end def get_kv(id:, request_options:); end diff --git a/rbi/workos/object.rbi b/rbi/workos/vault_object.rbi similarity index 97% rename from rbi/workos/object.rbi rename to rbi/workos/vault_object.rbi index 716eca76..0ed4de99 100644 --- a/rbi/workos/object.rbi +++ b/rbi/workos/vault_object.rbi @@ -5,7 +5,7 @@ # typed: strong module WorkOS - class ObjectModel + class VaultObject sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } def initialize(json); end diff --git a/test/workos/test_api_keys.rb b/test/workos/test_api_keys.rb index f2695f69..402acf2d 100644 --- a/test/workos/test_api_keys.rb +++ b/test/workos/test_api_keys.rb @@ -39,12 +39,20 @@ def test_delete_api_key_returns_expected_result assert_nil result end + def test_create_api_key_expire_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/api_keys/stub/expire(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.api_keys.create_api_key_expire(id: "stub") + refute_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"}} + {name: :delete_api_key, verb: :delete, url: %r{\Ahttps://api\.workos\.com/api_keys/stub(\?|\z)}, args: {id: "stub"}}, + {name: :create_api_key_expire, verb: :post, url: %r{\Ahttps://api\.workos\.com/api_keys/stub/expire(\?|\z)}, args: {id: "stub"}} ].each do |spec| define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do stub_request(spec[:verb], spec[:url]) diff --git a/test/workos/test_model_round_trip.rb b/test/workos/test_model_round_trip.rb index e8d400e2..004281be 100644 --- a/test/workos/test_model_round_trip.rb +++ b/test/workos/test_model_round_trip.rb @@ -11,6 +11,7 @@ def test_user_object_round_trip "email" => "stub", "first_name" => "stub", "last_name" => "stub", + "name" => "stub", "metadata" => {} } model = WorkOS::UserObject.new(fixture.to_json) @@ -60,6 +61,16 @@ def test_validate_api_key_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end + def test_expire_api_key_round_trip + fixture = { + "expires_at" => nil + } + model = WorkOS::ExpireApiKey.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_redirect_uri_input_round_trip fixture = { "uri" => "stub", @@ -730,6 +741,7 @@ def test_create_user_round_trip "email" => "stub", "first_name" => nil, "last_name" => nil, + "name" => nil, "email_verified" => nil, "metadata" => nil, "external_id" => nil, @@ -749,6 +761,7 @@ def test_update_user_round_trip "email" => "stub", "first_name" => "stub", "last_name" => "stub", + "name" => "stub", "email_verified" => true, "metadata" => nil, "external_id" => nil, @@ -822,8 +835,7 @@ def test_confirm_email_change_round_trip def test_revoke_session_round_trip fixture = { - "session_id" => "stub", - "return_to" => "stub" + "session_id" => "stub" } model = WorkOS::RevokeSession.new(fixture.to_json) json = model.to_h @@ -986,14 +998,14 @@ def test_error_response_round_trip fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end - def test_object_round_trip + def test_vault_object_round_trip fixture = { "id" => "stub", "metadata" => {}, "name" => "stub", "value" => "stub" } - model = WorkOS::ObjectModel.new(fixture.to_json) + model = WorkOS::VaultObject.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] @@ -1540,6 +1552,7 @@ def test_user_round_trip "id" => "stub", "first_name" => nil, "last_name" => nil, + "name" => nil, "profile_picture_url" => nil, "email" => "stub", "email_verified" => true, @@ -1965,6 +1978,7 @@ def test_api_key_created_data_round_trip assert_equal fixture["name"], json[:name] assert_equal fixture["obfuscated_value"], json[:obfuscated_value] assert_nil json[:last_used_at] + assert_nil 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}" } @@ -2033,6 +2047,7 @@ def test_api_key_revoked_data_round_trip assert_equal fixture["name"], json[:name] assert_equal fixture["obfuscated_value"], json[:obfuscated_value] assert_nil json[:last_used_at] + assert_nil 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}" } @@ -2064,6 +2079,87 @@ def test_user_api_key_revoked_data_owner_round_trip 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_updated_round_trip + fixture = { + "object" => "event", + "id" => "stub", + "event" => "api_key.updated", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + model = WorkOS::ApiKeyUpdated.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_updated_data_round_trip + fixture = { + "object" => "api_key", + "id" => "stub", + "owner" => {}, + "name" => "stub", + "obfuscated_value" => "stub", + "last_used_at" => nil, + "expires_at" => nil, + "permissions" => [], + "created_at" => "stub", + "updated_at" => "stub", + "previous_attributes" => {} + } + model = WorkOS::ApiKeyUpdatedData.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_nil 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_api_key_updated_data_owner_round_trip + fixture = { + "type" => "organization", + "id" => "stub" + } + model = WorkOS::ApiKeyUpdatedDataOwner.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_updated_data_owner_round_trip + fixture = { + "type" => "user", + "id" => "stub", + "organization_id" => "stub" + } + model = WorkOS::UserApiKeyUpdatedDataOwner.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_updated_data_previous_attribute_round_trip + fixture = { + "expires_at" => nil + } + model = WorkOS::ApiKeyUpdatedDataPreviousAttribute.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + 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_authentication_email_verification_failed_round_trip fixture = { "object" => "event", @@ -3172,16 +3268,16 @@ def test_dsync_activated_data_domain_round_trip 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 + def test_dsync_deleted_round_trip fixture = { "object" => "event", "id" => "stub", - "event" => "dsync.deactivated", + "event" => "dsync.deleted", "data" => {}, "created_at" => "stub", "context" => {} } - model = WorkOS::DsyncDeactivated.new(fixture.to_json) + model = WorkOS::DsyncDeleted.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] @@ -3189,7 +3285,7 @@ def test_dsync_deactivated_round_trip 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 + def test_dsync_deleted_data_round_trip fixture = { "object" => "directory", "id" => "stub", @@ -3198,45 +3294,45 @@ def test_dsync_deactivated_data_round_trip "state" => "stub", "name" => "stub", "created_at" => "stub", - "updated_at" => "stub", - "external_key" => "stub", - "domains" => [] + "updated_at" => "stub" } - model = WorkOS::DsyncDeactivatedData.new(fixture.to_json) + 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] - 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 + def test_dsync_group_created_round_trip fixture = { - "object" => "organization_domain", + "object" => "event", "id" => "stub", - "domain" => "stub" + "event" => "dsync.group.created", + "data" => {}, + "created_at" => "stub", + "context" => {} } - model = WorkOS::DsyncDeactivatedDataDomain.new(fixture.to_json) + 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["domain"], json[:domain] + 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_round_trip + def test_dsync_group_deleted_round_trip fixture = { "object" => "event", "id" => "stub", - "event" => "dsync.deleted", + "event" => "dsync.group.deleted", "data" => {}, "created_at" => "stub", "context" => {} } - model = WorkOS::DsyncDeleted.new(fixture.to_json) + model = WorkOS::DsyncGroupDeleted.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] @@ -3244,37 +3340,59 @@ def test_dsync_deleted_round_trip 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 + def test_dsync_group_updated_round_trip fixture = { - "object" => "directory", + "object" => "event", + "id" => "stub", + "event" => "dsync.group.updated", + "data" => {}, + "created_at" => "stub", + "context" => {} + } + 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", - "type" => "stub", - "state" => "stub", "name" => "stub", + "raw_attributes" => {}, "created_at" => "stub", - "updated_at" => "stub" + "updated_at" => "stub", + "previous_attributes" => {} } - model = WorkOS::DsyncDeletedData.new(fixture.to_json) + 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_created_round_trip + def test_dsync_token_created_round_trip fixture = { "object" => "event", "id" => "stub", - "event" => "dsync.group.created", + "event" => "dsync.token.created", "data" => {}, "created_at" => "stub", "context" => {} } - model = WorkOS::DsyncGroupCreated.new(fixture.to_json) + model = WorkOS::DsyncTokenCreated.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] @@ -3282,33 +3400,35 @@ def test_dsync_group_created_round_trip 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 + def test_dsync_token_created_data_round_trip fixture = { - "object" => "event", + "object" => "directory_token", "id" => "stub", - "event" => "dsync.group.deleted", - "data" => {}, - "created_at" => "stub", - "context" => {} + "directory_id" => "stub", + "organization_id" => "stub", + "token_suffix" => "stub", + "created_at" => "stub" } - model = WorkOS::DsyncGroupDeleted.new(fixture.to_json) + model = WorkOS::DsyncTokenCreatedData.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["token_suffix"], json[:token_suffix] 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 + def test_dsync_token_revoked_round_trip fixture = { "object" => "event", "id" => "stub", - "event" => "dsync.group.updated", + "event" => "dsync.token.revoked", "data" => {}, "created_at" => "stub", "context" => {} } - model = WorkOS::DsyncGroupUpdated.new(fixture.to_json) + model = WorkOS::DsyncTokenRevoked.new(fixture.to_json) json = model.to_h assert_kind_of Hash, json assert_equal fixture["id"], json[:id] @@ -3316,29 +3436,22 @@ def test_dsync_group_updated_round_trip 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 + def test_dsync_token_revoked_data_round_trip fixture = { - "object" => "directory_group", + "object" => "directory_token", "id" => "stub", - "idp_id" => "stub", "directory_id" => "stub", "organization_id" => "stub", - "name" => "stub", - "raw_attributes" => {}, - "created_at" => "stub", - "updated_at" => "stub", - "previous_attributes" => {} + "token_suffix" => "stub", + "created_at" => "stub" } - model = WorkOS::DsyncGroupUpdatedData.new(fixture.to_json) + model = WorkOS::DsyncTokenRevokedData.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["token_suffix"], json[:token_suffix] 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 @@ -7581,6 +7694,7 @@ def test_email_change_confirmation_user_round_trip "id" => "stub", "first_name" => nil, "last_name" => nil, + "name" => nil, "profile_picture_url" => nil, "email" => "stub", "email_verified" => true, diff --git a/test/workos/test_vault.rb b/test/workos/test_vault.rb index b6677bec..b6e767e7 100644 --- a/test/workos/test_vault.rb +++ b/test/workos/test_vault.rb @@ -3,7 +3,6 @@ # This file is auto-generated by oagen. Do not edit. require "test_helper" -require "base64" class VaultTest < Minitest::Test include FixtureHelper