diff --git a/.changelog-pending/2026-06-17T21-07-19-0e1c039566c6e6c4061925ea050b1bf288163094.md b/.changelog-pending/2026-06-17T21-07-19-0e1c039566c6e6c4061925ea050b1bf288163094.md new file mode 100644 index 00000000..b50438ec --- /dev/null +++ b/.changelog-pending/2026-06-17T21-07-19-0e1c039566c6e6c4061925ea050b1bf288163094.md @@ -0,0 +1,53 @@ +- [#501](https://github.com/workos/workos-ruby/pull/501) feat(generated)!: regenerate from spec (12 changes) + + **Features** + - **[authorization](https://workos.com/docs/reference/fga)**: + - Added model `ReplaceGroupRoleAssignmentEntry` + - Added model `ReplaceGroupRoleAssignments` + - Added model `DeleteGroupRoleAssignmentsByCriteria` + - Added endpoint `POST /authorization/groups/{group_id}/role_assignments` + - Added endpoint `PUT /authorization/groups/{group_id}/role_assignments` + - Added endpoint `DELETE /authorization/groups/{group_id}/role_assignments` + - Added endpoint `GET /authorization/groups/{group_id}/role_assignments/{role_assignment_id}` + - Added endpoint `DELETE /authorization/groups/{group_id}/role_assignments/{role_assignment_id}` + - **[client](https://workos.com/docs/reference)**: + - Added model `ClientApiToken` + - Added model `ClientApiTokenResponse` + - Added service `Client` + - **[connect](https://workos.com/docs/reference/workos-connect/standalone)**: + - Added `auth_method` to `ConnectedAccount` + - Added `api_key_last_4` to `ConnectedAccount` + - Added enum `ConnectedAccountAuthMethod` + - **[groups](https://workos.com/docs/reference/groups)**: + - Added model `CreateGroupRoleAssignment` + - Added model `GroupRoleAssignment` + - Added model `GroupRoleAssignmentList` + - Added model `GroupRoleAssignmentResource` + - **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: + - Added model `UserOrganizationMembershipList` + - Added model `UserOrganizationMembershipListListMetadata` + - **[pipes](https://workos.com/docs/reference/pipes)**: + - Added model `DataIntegrationCredentials` + - Added model `DataIntegrationConfigurationResponse` + - Added model `DataIntegrationConfigurationListResponse` + - Added model `ConfigureDataIntegrationBody` + - Added `auth_methods` to `DataIntegrationsListResponseData` + - Added `auth_method` to `DataIntegrationsListResponseDataConnectedAccount` + - Added `api_key_last_4` to `DataIntegrationsListResponseDataConnectedAccount` + - Added enum `DataIntegrationCredentialsCredentialsType` + - Added enum `DataIntegrationsListResponseDataAuthMethods` + - Added enum `DataIntegrationsListResponseDataConnectedAccountAuthMethod` + - Added service `PipesProvider` + - **[user_management](https://workos.com/docs/reference/authkit/user)**: + - Added model `UserInviteList` + - Added model `UserInviteListListMetadata` + - Made `AuthorizationCodeSessionAuthenticateRequest.client_secret` optional + - Made `RefreshTokenSessionAuthenticateRequest.client_secret` optional + - **[widgets](https://workos.com/docs/reference/widgets)**: + - Added `widgets:pipes:manage` to `WidgetSessionTokenScopes` + + **Fixes** + - **[organization_membership](https://workos.com/docs/reference/authkit/organization-membership)**: + - Changed response of `UserManagementOrganizationMembership.list` from `UserOrganizationMembership` to `UserOrganizationMembershipList` + - **[user_management](https://workos.com/docs/reference/authkit/user)**: + - Changed response of `UserManagementInvitations.list` from `UserInvite` to `UserInviteList` diff --git a/.last-synced-sha b/.last-synced-sha index 99cf20f6..409f7391 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -d8c5a7de598792b1cee18d4a9842825110e5c74a +b6a68da8bd60c1478e0a86ca97c75448677e8871 diff --git a/.oagen-manifest.json b/.oagen-manifest.json index ba413e7d..1ebded19 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,7 @@ { "version": 2, "language": "ruby", - "generatedAt": "2026-06-03T19:20:02.984Z", + "generatedAt": "2026-06-17T21:06:29.872Z", "files": [ "lib/workos.rb", "lib/workos/admin_portal.rb", @@ -56,8 +56,13 @@ "lib/workos/authorization/check_authorization.rb", "lib/workos/authorization/create_authorization_permission.rb", "lib/workos/authorization/create_authorization_resource.rb", + "lib/workos/authorization/create_group_role_assignment.rb", "lib/workos/authorization/create_organization_role.rb", "lib/workos/authorization/create_role.rb", + "lib/workos/authorization/delete_group_role_assignments_by_criteria.rb", + "lib/workos/authorization/group_role_assignment.rb", + "lib/workos/authorization/group_role_assignment_list.rb", + "lib/workos/authorization/group_role_assignment_resource.rb", "lib/workos/authorization/permission.rb", "lib/workos/authorization/permission_created.rb", "lib/workos/authorization/permission_created_data.rb", @@ -66,6 +71,8 @@ "lib/workos/authorization/permission_updated.rb", "lib/workos/authorization/permission_updated_data.rb", "lib/workos/authorization/remove_role.rb", + "lib/workos/authorization/replace_group_role_assignment_entry.rb", + "lib/workos/authorization/replace_group_role_assignments.rb", "lib/workos/authorization/role.rb", "lib/workos/authorization/role_created.rb", "lib/workos/authorization/role_created_data.rb", @@ -83,6 +90,9 @@ "lib/workos/authorization/user_role_assignment.rb", "lib/workos/authorization/user_role_assignment_resource.rb", "lib/workos/client.rb", + "lib/workos/client_api.rb", + "lib/workos/client_api/client_api_token.rb", + "lib/workos/client_api/client_api_token_response.rb", "lib/workos/connect.rb", "lib/workos/connect/application_credentials_list_item.rb", "lib/workos/connect/connect_application.rb", @@ -249,6 +259,11 @@ "lib/workos/pipes/data_integrations_list_response.rb", "lib/workos/pipes/data_integrations_list_response_data.rb", "lib/workos/pipes/data_integrations_list_response_data_connected_account.rb", + "lib/workos/pipes_provider.rb", + "lib/workos/pipes_provider/configure_data_integration_body.rb", + "lib/workos/pipes_provider/data_integration_configuration_list_response.rb", + "lib/workos/pipes_provider/data_integration_configuration_response.rb", + "lib/workos/pipes_provider/data_integration_credentials.rb", "lib/workos/radar.rb", "lib/workos/radar/radar_list_entry_already_present_response.rb", "lib/workos/radar/radar_standalone_assess_request.rb", @@ -315,6 +330,7 @@ "lib/workos/types/authentication_factors_create_request_type.rb", "lib/workos/types/authentication_radar_risk_detected_data_action.rb", "lib/workos/types/authorization_assignment.rb", + "lib/workos/types/connected_account_auth_method.rb", "lib/workos/types/connected_account_state.rb", "lib/workos/types/connection_activated_data_connection_type.rb", "lib/workos/types/connection_activated_data_state.rb", @@ -334,6 +350,9 @@ "lib/workos/types/create_user_password_hash_type.rb", "lib/workos/types/create_webhook_endpoint_events.rb", "lib/workos/types/data_integration_access_token_response_error.rb", + "lib/workos/types/data_integration_credentials_credentials_type.rb", + "lib/workos/types/data_integrations_list_response_data_auth_methods.rb", + "lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb", "lib/workos/types/data_integrations_list_response_data_connected_account_state.rb", "lib/workos/types/data_integrations_list_response_data_ownership.rb", "lib/workos/types/directory_state.rb", @@ -714,6 +733,10 @@ "rbi/workos/challenge_authentication_factor.rbi", "rbi/workos/check_authorization.rbi", "rbi/workos/client.rbi", + "rbi/workos/client_api.rbi", + "rbi/workos/client_api_token.rbi", + "rbi/workos/client_api_token_response.rbi", + "rbi/workos/configure_data_integration_body.rbi", "rbi/workos/confirm_email_change.rbi", "rbi/workos/connect.rbi", "rbi/workos/connect_application.rbi", @@ -749,6 +772,7 @@ "rbi/workos/create_data_key_response.rbi", "rbi/workos/create_group.rbi", "rbi/workos/create_group_membership.rbi", + "rbi/workos/create_group_role_assignment.rbi", "rbi/workos/create_m2m_application.rbi", "rbi/workos/create_magic_code_and_return.rbi", "rbi/workos/create_oauth_application.rbi", @@ -768,6 +792,9 @@ "rbi/workos/data_integration_access_token_response.rbi", "rbi/workos/data_integration_access_token_response_access_token.rbi", "rbi/workos/data_integration_authorize_url_response.rbi", + "rbi/workos/data_integration_configuration_list_response.rbi", + "rbi/workos/data_integration_configuration_response.rbi", + "rbi/workos/data_integration_credentials.rbi", "rbi/workos/data_integrations_get_data_integration_authorize_url_request.rbi", "rbi/workos/data_integrations_get_user_token_request.rbi", "rbi/workos/data_integrations_list_response.rbi", @@ -775,6 +802,7 @@ "rbi/workos/data_integrations_list_response_data_connected_account.rbi", "rbi/workos/decrypt_request.rbi", "rbi/workos/decrypt_response.rbi", + "rbi/workos/delete_group_role_assignments_by_criteria.rbi", "rbi/workos/delete_object_response.rbi", "rbi/workos/device_authorization_response.rbi", "rbi/workos/device_code_session_authenticate_request.rbi", @@ -871,6 +899,8 @@ "rbi/workos/group_member_added_data.rbi", "rbi/workos/group_member_removed.rbi", "rbi/workos/group_member_removed_data.rbi", + "rbi/workos/group_role_assignment.rbi", + "rbi/workos/group_role_assignment_resource.rbi", "rbi/workos/group_updated.rbi", "rbi/workos/groups.rbi", "rbi/workos/intent_options.rbi", @@ -961,6 +991,7 @@ "rbi/workos/pipes_connected_account_connected.rbi", "rbi/workos/pipes_connected_account_disconnected.rbi", "rbi/workos/pipes_connected_account_reauthorization_needed.rbi", + "rbi/workos/pipes_provider.rbi", "rbi/workos/portal_link_response.rbi", "rbi/workos/profile.rbi", "rbi/workos/radar.rbi", @@ -975,6 +1006,8 @@ "rbi/workos/refresh_token_session_authenticate_request.rbi", "rbi/workos/rekey_request.rbi", "rbi/workos/remove_role.rbi", + "rbi/workos/replace_group_role_assignment_entry.rbi", + "rbi/workos/replace_group_role_assignments.rbi", "rbi/workos/resend_user_invite_options.rbi", "rbi/workos/reset_password_response.rbi", "rbi/workos/revoke_session.rbi", @@ -1083,6 +1116,7 @@ "test/workos/test_api_keys.rb", "test/workos/test_audit_logs.rb", "test/workos/test_authorization.rb", + "test/workos/test_client_api.rb", "test/workos/test_connect.rb", "test/workos/test_directory_sync.rb", "test/workos/test_events.rb", @@ -1094,6 +1128,7 @@ "test/workos/test_organization_membership_service.rb", "test/workos/test_organizations.rb", "test/workos/test_pipes.rb", + "test/workos/test_pipes_provider.rb", "test/workos/test_radar.rb", "test/workos/test_sso.rb", "test/workos/test_user_management.rb", @@ -1126,6 +1161,30 @@ "sdkMethod": "complete_oauth2", "service": "connect" }, + "GET /authorization/groups/{group_id}/role_assignments": { + "sdkMethod": "list_group_role_assignments", + "service": "authorization" + }, + "POST /authorization/groups/{group_id}/role_assignments": { + "sdkMethod": "create_group_role_assignment", + "service": "authorization" + }, + "PUT /authorization/groups/{group_id}/role_assignments": { + "sdkMethod": "update_group_role_assignments", + "service": "authorization" + }, + "DELETE /authorization/groups/{group_id}/role_assignments": { + "sdkMethod": "delete_group_role_assignments", + "service": "authorization" + }, + "GET /authorization/groups/{group_id}/role_assignments/{role_assignment_id}": { + "sdkMethod": "get_group_role_assignment", + "service": "authorization" + }, + "DELETE /authorization/groups/{group_id}/role_assignments/{role_assignment_id}": { + "sdkMethod": "delete_group_role_assignment", + "service": "authorization" + }, "POST /authorization/organization_memberships/{organization_membership_id}/check": { "sdkMethod": "check", "service": "authorization" @@ -1282,6 +1341,10 @@ "sdkMethod": "delete_permission", "service": "authorization" }, + "POST /client/token": { + "sdkMethod": "create_token", + "service": "client_api" + }, "GET /connect/applications": { "sdkMethod": "list_applications", "service": "connect" @@ -1338,8 +1401,8 @@ "sdkMethod": "authorize_data_integration", "service": "pipes" }, - "POST /data-integrations/{slug}/token": { - "sdkMethod": "create_data_integration_token", + "POST /data-integrations/{provider}/token": { + "sdkMethod": "get_access_token", "service": "pipes" }, "GET /directories": { @@ -1458,6 +1521,14 @@ "sdkMethod": "create_organization_api_key", "service": "api_keys" }, + "GET /organizations/{organizationId}/data_integration_configurations": { + "sdkMethod": "list_organization_data_integration_configurations", + "service": "pipes_provider" + }, + "PUT /organizations/{organizationId}/data_integration_configurations/{slug}": { + "sdkMethod": "update_organization_data_integration_configuration", + "service": "pipes_provider" + }, "GET /organizations/{organizationId}/feature-flags": { "sdkMethod": "list_organization_feature_flags", "service": "feature_flags" diff --git a/lib/workos.rb b/lib/workos.rb index 61aa8e25..a231c1e9 100644 --- a/lib/workos.rb +++ b/lib/workos.rb @@ -14,6 +14,7 @@ module WorkOS loader.collapse("#{__dir__}/workos/api_keys") loader.collapse("#{__dir__}/workos/audit_logs") loader.collapse("#{__dir__}/workos/authorization") +loader.collapse("#{__dir__}/workos/client_api") loader.collapse("#{__dir__}/workos/connect") loader.collapse("#{__dir__}/workos/directory_sync") loader.collapse("#{__dir__}/workos/events") @@ -24,6 +25,7 @@ module WorkOS loader.collapse("#{__dir__}/workos/organization_membership") loader.collapse("#{__dir__}/workos/organizations") loader.collapse("#{__dir__}/workos/pipes") +loader.collapse("#{__dir__}/workos/pipes_provider") loader.collapse("#{__dir__}/workos/radar") loader.collapse("#{__dir__}/workos/shared") loader.collapse("#{__dir__}/workos/sso") diff --git a/lib/workos/authorization.rb b/lib/workos/authorization.rb index 983b8e6a..b2c72262 100644 --- a/lib/workos/authorization.rb +++ b/lib/workos/authorization.rb @@ -52,6 +52,186 @@ def initialize(client) @client = client end + # List role assignments for a group + # @param group_id [String] The ID of the group. + # @param before [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. + # @param after [String, nil] An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. + # @param limit [Integer, nil] Upper limit on the number of objects to return, between `1` and `100`. + # @param order [WorkOS::Types::PaginationOrder, nil] Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def list_group_role_assignments( + group_id:, + before: nil, + after: nil, + limit: 10, + order: "desc", + request_options: {} + ) + params = { + "before" => before, + "after" => after, + "limit" => limit, + "order" => order + }.compact + response = @client.request( + method: :get, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments", + auth: true, + params: params, + request_options: request_options + ) + fetch_next = ->(cursor) { + list_group_role_assignments( + group_id: group_id, + before: before, + after: cursor, + limit: limit, + order: order, + request_options: request_options + ) + } + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::GroupRoleAssignment, + filters: {group_id: group_id, before: before, limit: limit, order: order}, + fetch_next: fetch_next + ) + end + + # Assign a role to a group + # @param group_id [String] The ID of the group. + # @param role_slug [String] The slug of the role to assign to the group. + # @param resource_id [String, nil] The ID of the resource. Omit along with the external-id fields to target the organization itself. + # @param resource_external_id [String, nil] The external ID of the resource. + # @param resource_type_slug [String, nil] The resource type slug. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::GroupRoleAssignment] + def create_group_role_assignment( + group_id:, + role_slug:, + resource_id: nil, + resource_external_id: nil, + resource_type_slug: nil, + request_options: {} + ) + body = { + "role_slug" => role_slug, + "resource_id" => resource_id, + "resource_external_id" => resource_external_id, + "resource_type_slug" => resource_type_slug + }.compact + response = @client.request( + method: :post, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::GroupRoleAssignment.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 + + # Replace all role assignments for a group + # @param group_id [String] The ID of the group. + # @param role_assignments [Array] The list of role assignments that should exist for the group. All existing assignments will be replaced. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::Types::ListStruct] + def update_group_role_assignments( + group_id:, + role_assignments:, + request_options: {} + ) + body = { + "role_assignments" => role_assignments + } + response = @client.request( + method: :put, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments", + auth: true, + body: body, + request_options: request_options + ) + WorkOS::Types::ListStruct.from_response( + response, + model: WorkOS::GroupRoleAssignment, + filters: {group_id: group_id, role_assignments: role_assignments} + ) + end + + # Remove group role assignments by criteria + # @param group_id [String] The ID of the group. + # @param role_slug [String] The slug of the role to remove assignments for. + # @param resource_id [String, nil] The ID of the resource. Mutually exclusive with `resource_external_id` and `resource_type_slug`. + # @param resource_external_id [String, nil] The external ID of the resource. + # @param resource_type_slug [String, nil] The resource type slug. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_group_role_assignments( + group_id:, + role_slug:, + resource_id: nil, + resource_external_id: nil, + resource_type_slug: nil, + request_options: {} + ) + body = { + "role_slug" => role_slug, + "resource_id" => resource_id, + "resource_external_id" => resource_external_id, + "resource_type_slug" => resource_type_slug + }.compact + @client.request( + method: :delete, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments", + auth: true, + body: body, + request_options: request_options + ) + nil + end + + # Get a group role assignment + # @param group_id [String] The ID of the group. + # @param role_assignment_id [String] The ID of the group role assignment. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::GroupRoleAssignment] + def get_group_role_assignment( + group_id:, + role_assignment_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}", + auth: true, + request_options: request_options + ) + result = WorkOS::GroupRoleAssignment.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + + # Remove a group role assignment + # @param group_id [String] The ID of the group. + # @param role_assignment_id [String] The ID of the group role assignment to remove. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [void] + def delete_group_role_assignment( + group_id:, + role_assignment_id:, + request_options: {} + ) + @client.request( + method: :delete, + path: "/authorization/groups/#{WorkOS::Util.encode_path(group_id)}/role_assignments/#{WorkOS::Util.encode_path(role_assignment_id)}", + auth: true, + request_options: request_options + ) + nil + end + # Check authorization # @param organization_membership_id [String] The ID of the organization membership to check. # @param permission_slug [String] The slug of the permission to check. diff --git a/lib/workos/authorization/create_group_role_assignment.rb b/lib/workos/authorization/create_group_role_assignment.rb new file mode 100644 index 00000000..ccd08fe9 --- /dev/null +++ b/lib/workos/authorization/create_group_role_assignment.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + CreateGroupRoleAssignment = AssignRole +end diff --git a/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb b/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb new file mode 100644 index 00000000..873c709e --- /dev/null +++ b/lib/workos/authorization/delete_group_role_assignments_by_criteria.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + DeleteGroupRoleAssignmentsByCriteria = AssignRole +end diff --git a/lib/workos/authorization/group_role_assignment.rb b/lib/workos/authorization/group_role_assignment.rb new file mode 100644 index 00000000..315d2fe9 --- /dev/null +++ b/lib/workos/authorization/group_role_assignment.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupRoleAssignment < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + group_id: :group_id, + role: :role, + resource: :resource, + created_at: :created_at, + updated_at: :updated_at + }.freeze + + attr_accessor \ + :object, + :id, + :group_id, + :role, + :resource, + :created_at, + :updated_at + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @group_id = hash[:group_id] + @role = hash[:role] ? WorkOS::SlimRole.new(hash[:role]) : nil + @resource = hash[:resource] ? WorkOS::GroupRoleAssignmentResource.new(hash[:resource]) : nil + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + end + end +end diff --git a/lib/workos/authorization/group_role_assignment_list.rb b/lib/workos/authorization/group_role_assignment_list.rb new file mode 100644 index 00000000..9b3b23ac --- /dev/null +++ b/lib/workos/authorization/group_role_assignment_list.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupRoleAssignmentList < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data: :data, + list_metadata: :list_metadata + }.freeze + + attr_accessor \ + :object, + :data, + :list_metadata + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data = (hash[:data] || []).map { |item| item ? WorkOS::GroupRoleAssignment.new(item) : nil } + @list_metadata = hash[:list_metadata] ? WorkOS::ListMetadata.new(hash[:list_metadata]) : nil + end + end +end diff --git a/lib/workos/authorization/group_role_assignment_resource.rb b/lib/workos/authorization/group_role_assignment_resource.rb new file mode 100644 index 00000000..ec433986 --- /dev/null +++ b/lib/workos/authorization/group_role_assignment_resource.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class GroupRoleAssignmentResource < WorkOS::Types::BaseModel + HASH_ATTRS = { + id: :id, + external_id: :external_id, + resource_type_slug: :resource_type_slug + }.freeze + + attr_accessor \ + :id, + :external_id, + :resource_type_slug + + def initialize(json) + hash = self.class.normalize(json) + @id = hash[:id] + @external_id = hash[:external_id] + @resource_type_slug = hash[:resource_type_slug] + end + end +end diff --git a/lib/workos/authorization/replace_group_role_assignment_entry.rb b/lib/workos/authorization/replace_group_role_assignment_entry.rb new file mode 100644 index 00000000..8472c060 --- /dev/null +++ b/lib/workos/authorization/replace_group_role_assignment_entry.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + ReplaceGroupRoleAssignmentEntry = AssignRole +end diff --git a/lib/workos/authorization/replace_group_role_assignments.rb b/lib/workos/authorization/replace_group_role_assignments.rb new file mode 100644 index 00000000..dc508e20 --- /dev/null +++ b/lib/workos/authorization/replace_group_role_assignments.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ReplaceGroupRoleAssignments < WorkOS::Types::BaseModel + HASH_ATTRS = { + role_assignments: :role_assignments + }.freeze + + attr_accessor :role_assignments + + def initialize(json) + hash = self.class.normalize(json) + @role_assignments = (hash[:role_assignments] || []).map { |item| item ? WorkOS::ReplaceGroupRoleAssignmentEntry.new(item) : nil } + end + end +end diff --git a/lib/workos/authorization/user_role_assignment_resource.rb b/lib/workos/authorization/user_role_assignment_resource.rb index 9128e967..05239b15 100644 --- a/lib/workos/authorization/user_role_assignment_resource.rb +++ b/lib/workos/authorization/user_role_assignment_resource.rb @@ -3,23 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - class UserRoleAssignmentResource < WorkOS::Types::BaseModel - HASH_ATTRS = { - id: :id, - external_id: :external_id, - resource_type_slug: :resource_type_slug - }.freeze - - attr_accessor \ - :id, - :external_id, - :resource_type_slug - - def initialize(json) - hash = self.class.normalize(json) - @id = hash[:id] - @external_id = hash[:external_id] - @resource_type_slug = hash[:resource_type_slug] - end - end + UserRoleAssignmentResource = GroupRoleAssignmentResource end diff --git a/lib/workos/client.rb b/lib/workos/client.rb index 4f8ec79a..36d17f86 100644 --- a/lib/workos/client.rb +++ b/lib/workos/client.rb @@ -16,6 +16,10 @@ def authorization @authorization ||= WorkOS::Authorization.new(self) end + def client_api + @client_api ||= WorkOS::ClientApi.new(self) + end + def sso @sso ||= WorkOS::SSO.new(self) end @@ -48,6 +52,10 @@ def api_keys @api_keys ||= WorkOS::ApiKeys.new(self) end + def pipes_provider + @pipes_provider ||= WorkOS::PipesProvider.new(self) + end + def groups @groups ||= WorkOS::Groups.new(self) end diff --git a/lib/workos/client_api.rb b/lib/workos/client_api.rb new file mode 100644 index 00000000..e70f41c0 --- /dev/null +++ b/lib/workos/client_api.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class ClientApi + def initialize(client) + @client = client + end + + # Generate a Client API token + # @param organization_id [String] The ID of the organization to scope the Client API token to. + # @param user_id [String] The ID of the user to issue the Client API token for. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::ClientApiTokenResponse] + def create_token( + organization_id:, + user_id:, + request_options: {} + ) + body = { + "organization_id" => organization_id, + "user_id" => user_id + } + response = @client.request( + method: :post, + path: "/client/token", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::ClientApiTokenResponse.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/client_api/client_api_token.rb b/lib/workos/client_api/client_api_token.rb new file mode 100644 index 00000000..426c049d --- /dev/null +++ b/lib/workos/client_api/client_api_token.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ClientApiToken < WorkOS::Types::BaseModel + HASH_ATTRS = { + organization_id: :organization_id, + user_id: :user_id + }.freeze + + attr_accessor \ + :organization_id, + :user_id + + def initialize(json) + hash = self.class.normalize(json) + @organization_id = hash[:organization_id] + @user_id = hash[:user_id] + end + end +end diff --git a/lib/workos/client_api/client_api_token_response.rb b/lib/workos/client_api/client_api_token_response.rb new file mode 100644 index 00000000..792d2ae6 --- /dev/null +++ b/lib/workos/client_api/client_api_token_response.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ClientApiTokenResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + token: :token + }.freeze + + attr_accessor :token + + def initialize(json) + hash = self.class.normalize(json) + @token = hash[:token] + end + end +end diff --git a/lib/workos/pipes.rb b/lib/workos/pipes.rb index c2eefb7e..3d02a97f 100644 --- a/lib/workos/pipes.rb +++ b/lib/workos/pipes.rb @@ -42,13 +42,13 @@ def authorize_data_integration( end # Get an access token for a connected account - # @param slug [String] The identifier of the integration. + # @param provider [String] The identifier of the integration. # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier. # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to scope the connection to a specific organization. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) # @return [WorkOS::DataIntegrationAccessTokenResponse] - def create_data_integration_token( - slug:, + def get_access_token( + provider:, user_id:, organization_id: nil, request_options: {} @@ -59,7 +59,7 @@ def create_data_integration_token( }.compact response = @client.request( method: :post, - path: "/data-integrations/#{WorkOS::Util.encode_path(slug)}/token", + path: "/data-integrations/#{WorkOS::Util.encode_path(provider)}/token", auth: true, body: body, request_options: request_options @@ -121,7 +121,7 @@ def delete_user_connected_account( nil end - # List providers + # List providers for a user # @param user_id [String] A [User](https://workos.com/docs/reference/authkit/user) identifier to list providers and connected accounts for. # @param organization_id [String, nil] An [Organization](https://workos.com/docs/reference/organization) identifier. Optional parameter to filter connections for a specific organization. # @param request_options [Hash] (see WorkOS::Types::RequestOptions) diff --git a/lib/workos/pipes/connected_account.rb b/lib/workos/pipes/connected_account.rb index 2e496067..9bbefac1 100644 --- a/lib/workos/pipes/connected_account.rb +++ b/lib/workos/pipes/connected_account.rb @@ -10,6 +10,8 @@ class ConnectedAccount < WorkOS::Types::BaseModel user_id: :user_id, organization_id: :organization_id, scopes: :scopes, + auth_method: :auth_method, + api_key_last_4: :api_key_last_4, state: :state, created_at: :created_at, updated_at: :updated_at @@ -21,6 +23,8 @@ class ConnectedAccount < WorkOS::Types::BaseModel :user_id, :organization_id, :scopes, + :auth_method, + :api_key_last_4, :state, :created_at, :updated_at @@ -32,6 +36,8 @@ def initialize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] @scopes = hash[:scopes] || [] + @auth_method = hash[:auth_method] + @api_key_last_4 = hash[:api_key_last_4] @state = hash[:state] @created_at = hash[:created_at] @updated_at = hash[:updated_at] diff --git a/lib/workos/pipes/data_integrations_list_response_data.rb b/lib/workos/pipes/data_integrations_list_response_data.rb index d84f0a8a..b2ac6128 100644 --- a/lib/workos/pipes/data_integrations_list_response_data.rb +++ b/lib/workos/pipes/data_integrations_list_response_data.rb @@ -13,6 +13,7 @@ class DataIntegrationsListResponseData < WorkOS::Types::BaseModel integration_type: :integration_type, credentials_type: :credentials_type, scopes: :scopes, + auth_methods: :auth_methods, ownership: :ownership, created_at: :created_at, updated_at: :updated_at, @@ -28,6 +29,7 @@ class DataIntegrationsListResponseData < WorkOS::Types::BaseModel :integration_type, :credentials_type, :scopes, + :auth_methods, :ownership, :created_at, :updated_at, @@ -43,6 +45,7 @@ def initialize(json) @integration_type = hash[:integration_type] @credentials_type = hash[:credentials_type] @scopes = hash[:scopes] || [] + @auth_methods = hash[:auth_methods] || [] @ownership = hash[:ownership] @created_at = hash[:created_at] @updated_at = hash[:updated_at] diff --git a/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb b/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb index e1957b5a..e4ad8563 100644 --- a/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb +++ b/lib/workos/pipes/data_integrations_list_response_data_connected_account.rb @@ -10,6 +10,8 @@ class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseMode user_id: :user_id, organization_id: :organization_id, scopes: :scopes, + auth_method: :auth_method, + api_key_last_4: :api_key_last_4, state: :state, created_at: :created_at, updated_at: :updated_at, @@ -25,6 +27,8 @@ class DataIntegrationsListResponseDataConnectedAccount < WorkOS::Types::BaseMode :user_id, :organization_id, :scopes, + :auth_method, + :api_key_last_4, :state, :created_at, :updated_at @@ -43,6 +47,8 @@ def initialize(json) @user_id = hash[:user_id] @organization_id = hash[:organization_id] @scopes = hash[:scopes] || [] + @auth_method = hash[:auth_method] + @api_key_last_4 = hash[:api_key_last_4] @state = hash[:state] @created_at = hash[:created_at] @updated_at = hash[:updated_at] diff --git a/lib/workos/pipes_provider.rb b/lib/workos/pipes_provider.rb new file mode 100644 index 00000000..4bf28dba --- /dev/null +++ b/lib/workos/pipes_provider.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "json" + +module WorkOS + class PipesProvider + def initialize(client) + @client = client + end + + # List providers for an organization + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier to list provider configurations for. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationConfigurationListResponse] + def list_organization_data_integration_configurations( + organization_id:, + request_options: {} + ) + response = @client.request( + method: :get, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations", + auth: true, + request_options: request_options + ) + result = WorkOS::DataIntegrationConfigurationListResponse.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 + + # Configure a provider for an organization + # @param organization_id [String] An [Organization](https://workos.com/docs/reference/organization) identifier to configure the provider for. + # @param slug [String] The slug identifier of the provider to configure (e.g., `github`, `slack`, `notion`). + # @param enabled [Boolean, nil] Whether the provider is enabled for the organization. + # @param scopes [Array, nil] The OAuth scopes to request for the organization. Pass `null` to inherit the provider scopes. + # @param client_id [String, nil] The OAuth client ID of the organization's own application. Must be provided together with `client_secret`, and only for providers whose credentials are supplied by the organization. + # @param client_secret [String, nil] The OAuth client secret of the organization's own application. Must be provided together with `client_id`. + # @param request_options [Hash] (see WorkOS::Types::RequestOptions) + # @return [WorkOS::DataIntegrationConfigurationResponse] + def update_organization_data_integration_configuration( + organization_id:, + slug:, + enabled: nil, + scopes: nil, + client_id: nil, + client_secret: nil, + request_options: {} + ) + body = { + "enabled" => enabled, + "scopes" => scopes, + "client_id" => client_id, + "client_secret" => client_secret + }.compact + response = @client.request( + method: :put, + path: "/organizations/#{WorkOS::Util.encode_path(organization_id)}/data_integration_configurations/#{WorkOS::Util.encode_path(slug)}", + auth: true, + body: body, + request_options: request_options + ) + result = WorkOS::DataIntegrationConfigurationResponse.new(response.body) + result.last_response = WorkOS::Types::ApiResponse.new(http_status: response.code.to_i, http_headers: response.each_header.to_h, request_id: response["x-request-id"]) + result + end + end +end diff --git a/lib/workos/pipes_provider/configure_data_integration_body.rb b/lib/workos/pipes_provider/configure_data_integration_body.rb new file mode 100644 index 00000000..3a59cfc2 --- /dev/null +++ b/lib/workos/pipes_provider/configure_data_integration_body.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class ConfigureDataIntegrationBody < WorkOS::Types::BaseModel + HASH_ATTRS = { + enabled: :enabled, + scopes: :scopes, + client_id: :client_id, + client_secret: :client_secret + }.freeze + + attr_accessor \ + :enabled, + :scopes, + :client_id, + :client_secret + + def initialize(json) + hash = self.class.normalize(json) + @enabled = hash[:enabled] + @scopes = hash[:scopes] || [] + @client_id = hash[:client_id] + @client_secret = hash[:client_secret] + end + end +end diff --git a/lib/workos/pipes_provider/data_integration_configuration_list_response.rb b/lib/workos/pipes_provider/data_integration_configuration_list_response.rb new file mode 100644 index 00000000..9715c6f5 --- /dev/null +++ b/lib/workos/pipes_provider/data_integration_configuration_list_response.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationConfigurationListResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + data: :data + }.freeze + + attr_accessor \ + :object, + :data + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @data = (hash[:data] || []).map { |item| item ? WorkOS::DataIntegrationConfigurationResponse.new(item) : nil } + end + end +end diff --git a/lib/workos/pipes_provider/data_integration_configuration_response.rb b/lib/workos/pipes_provider/data_integration_configuration_response.rb new file mode 100644 index 00000000..bf33bd3c --- /dev/null +++ b/lib/workos/pipes_provider/data_integration_configuration_response.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationConfigurationResponse < WorkOS::Types::BaseModel + HASH_ATTRS = { + object: :object, + id: :id, + organization_id: :organization_id, + slug: :slug, + name: :name, + enabled: :enabled, + scopes: :scopes, + created_at: :created_at, + updated_at: :updated_at, + credentials: :credentials + }.freeze + + attr_accessor \ + :object, + :id, + :organization_id, + :slug, + :name, + :enabled, + :scopes, + :created_at, + :updated_at, + :credentials + + def initialize(json) + hash = self.class.normalize(json) + @object = hash[:object] + @id = hash[:id] + @organization_id = hash[:organization_id] + @slug = hash[:slug] + @name = hash[:name] + @enabled = hash[:enabled] + @scopes = hash[:scopes] || [] + @created_at = hash[:created_at] + @updated_at = hash[:updated_at] + @credentials = hash[:credentials] ? WorkOS::DataIntegrationCredentials.new(hash[:credentials]) : nil + end + end +end diff --git a/lib/workos/pipes_provider/data_integration_credentials.rb b/lib/workos/pipes_provider/data_integration_credentials.rb new file mode 100644 index 00000000..8699d03f --- /dev/null +++ b/lib/workos/pipes_provider/data_integration_credentials.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + class DataIntegrationCredentials < WorkOS::Types::BaseModel + HASH_ATTRS = { + credentials_type: :credentials_type, + has_credentials: :has_credentials, + client_id: :client_id, + client_secret_last_four: :client_secret_last_four, + redirect_uri: :redirect_uri + }.freeze + + attr_accessor \ + :credentials_type, + :has_credentials, + :client_id, + :client_secret_last_four, + :redirect_uri + + def initialize(json) + hash = self.class.normalize(json) + @credentials_type = hash[:credentials_type] + @has_credentials = hash[:has_credentials] + @client_id = hash[:client_id] + @client_secret_last_four = hash[:client_secret_last_four] + @redirect_uri = hash[:redirect_uri] + end + end +end diff --git a/lib/workos/types/connected_account_auth_method.rb b/lib/workos/types/connected_account_auth_method.rb new file mode 100644 index 00000000..54706946 --- /dev/null +++ b/lib/workos/types/connected_account_auth_method.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class ConnectedAccountAuthMethod + OAUTH = "oauth" + API_KEY = "api_key" + ALL = [OAUTH, API_KEY].freeze + end + end +end diff --git a/lib/workos/types/data_integration_access_token_response_error.rb b/lib/workos/types/data_integration_access_token_response_error.rb index c3b9b57c..088a0888 100644 --- a/lib/workos/types/data_integration_access_token_response_error.rb +++ b/lib/workos/types/data_integration_access_token_response_error.rb @@ -5,9 +5,9 @@ module WorkOS module Types class DataIntegrationAccessTokenResponseError - NEEDS_REAUTHORIZATION = "needs_reauthorization" NOT_INSTALLED = "not_installed" - ALL = [NEEDS_REAUTHORIZATION, NOT_INSTALLED].freeze + NEEDS_REAUTHORIZATION = "needs_reauthorization" + ALL = [NOT_INSTALLED, NEEDS_REAUTHORIZATION].freeze end end end diff --git a/lib/workos/types/data_integration_credentials_credentials_type.rb b/lib/workos/types/data_integration_credentials_credentials_type.rb new file mode 100644 index 00000000..fb66a74b --- /dev/null +++ b/lib/workos/types/data_integration_credentials_credentials_type.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + class DataIntegrationCredentialsCredentialsType + SHARED = "shared" + CUSTOM = "custom" + ORGANIZATION = "organization" + ALL = [SHARED, CUSTOM, ORGANIZATION].freeze + end + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_auth_methods.rb b/lib/workos/types/data_integrations_list_response_data_auth_methods.rb new file mode 100644 index 00000000..97b2c0ae --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_auth_methods.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsListResponseDataAuthMethods = ConnectedAccountAuthMethod + end +end diff --git a/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb b/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb new file mode 100644 index 00000000..7bacd5ff --- /dev/null +++ b/lib/workos/types/data_integrations_list_response_data_connected_account_auth_method.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +module WorkOS + module Types + DataIntegrationsListResponseDataConnectedAccountAuthMethod = ConnectedAccountAuthMethod + end +end diff --git a/lib/workos/types/widget_session_token_scopes.rb b/lib/workos/types/widget_session_token_scopes.rb index 996131d8..8235db23 100644 --- a/lib/workos/types/widget_session_token_scopes.rb +++ b/lib/workos/types/widget_session_token_scopes.rb @@ -11,7 +11,8 @@ class WidgetSessionTokenScopes WIDGETS_API_KEYS_MANAGE = "widgets:api-keys:manage" WIDGETS_DSYNC_MANAGE = "widgets:dsync:manage" WIDGETS_AUDIT_LOG_STREAMING_MANAGE = "widgets:audit-log-streaming:manage" - ALL = [WIDGETS_USERS_TABLE_MANAGE, WIDGETS_DOMAIN_VERIFICATION_MANAGE, WIDGETS_SSO_MANAGE, WIDGETS_API_KEYS_MANAGE, WIDGETS_DSYNC_MANAGE, WIDGETS_AUDIT_LOG_STREAMING_MANAGE].freeze + WIDGETS_PIPES_MANAGE = "widgets:pipes:manage" + ALL = [WIDGETS_USERS_TABLE_MANAGE, WIDGETS_DOMAIN_VERIFICATION_MANAGE, WIDGETS_SSO_MANAGE, WIDGETS_API_KEYS_MANAGE, WIDGETS_DSYNC_MANAGE, WIDGETS_AUDIT_LOG_STREAMING_MANAGE, WIDGETS_PIPES_MANAGE].freeze end end end diff --git a/lib/workos/user_management.rb b/lib/workos/user_management.rb index 44de878f..e5dfad96 100644 --- a/lib/workos/user_management.rb +++ b/lib/workos/user_management.rb @@ -45,7 +45,7 @@ def get_jwks( # Authenticate # @param client_id [String] The client ID of the application. - # @param client_secret [String, nil] The client secret of the application. + # @param client_secret [String, nil] The client secret of the application. May be omitted by public clients that authenticate through other means, such as a PKCE `code_verifier`. # @param grant_type [String] # @param code [String, nil] The authorization code received from the redirect. # @param code_verifier [String, nil] The PKCE code verifier used to derive the code challenge passed to the authorization URL. diff --git a/lib/workos/widgets/widget_session_token_response.rb b/lib/workos/widgets/widget_session_token_response.rb index 05c3173a..4ba0bed7 100644 --- a/lib/workos/widgets/widget_session_token_response.rb +++ b/lib/workos/widgets/widget_session_token_response.rb @@ -3,16 +3,5 @@ # This file is auto-generated by oagen. Do not edit. module WorkOS - class WidgetSessionTokenResponse < WorkOS::Types::BaseModel - HASH_ATTRS = { - token: :token - }.freeze - - attr_accessor :token - - def initialize(json) - hash = self.class.normalize(json) - @token = hash[:token] - end - end + WidgetSessionTokenResponse = ClientApiTokenResponse end diff --git a/rbi/workos/authorization.rbi b/rbi/workos/authorization.rbi index 66cf9440..4710589c 100644 --- a/rbi/workos/authorization.rbi +++ b/rbi/workos/authorization.rbi @@ -93,6 +93,69 @@ module WorkOS sig { params(client: WorkOS::BaseClient).void } def initialize(client); end + sig do + params( + group_id: String, + before: T.nilable(String), + after: T.nilable(String), + limit: T.nilable(Integer), + order: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def list_group_role_assignments(group_id:, before:, after:, limit:, order:, request_options:); end + + sig do + params( + group_id: String, + role_slug: String, + resource_id: T.nilable(String), + resource_external_id: T.nilable(String), + resource_type_slug: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::GroupRoleAssignment) + end + def create_group_role_assignment(group_id:, role_slug:, resource_id:, resource_external_id:, resource_type_slug:, request_options:); end + + sig do + params( + group_id: String, + role_assignments: T::Array[WorkOS::ReplaceGroupRoleAssignmentEntry], + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::Types::ListStruct) + end + def update_group_role_assignments(group_id:, role_assignments:, request_options:); end + + sig do + params( + group_id: String, + role_slug: String, + resource_id: T.nilable(String), + resource_external_id: T.nilable(String), + resource_type_slug: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_group_role_assignments(group_id:, role_slug:, resource_id:, resource_external_id:, resource_type_slug:, request_options:); end + + sig do + params( + group_id: String, + role_assignment_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::GroupRoleAssignment) + end + def get_group_role_assignment(group_id:, role_assignment_id:, request_options:); end + + sig do + params( + group_id: String, + role_assignment_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(NilClass) + end + def delete_group_role_assignment(group_id:, role_assignment_id:, request_options:); end + sig do params( organization_membership_id: String, diff --git a/rbi/workos/authorization_code_session_authenticate_request.rbi b/rbi/workos/authorization_code_session_authenticate_request.rbi index bbd4696e..834f0cd8 100644 --- a/rbi/workos/authorization_code_session_authenticate_request.rbi +++ b/rbi/workos/authorization_code_session_authenticate_request.rbi @@ -15,10 +15,10 @@ module WorkOS sig { params(value: String).returns(String) } def client_id=(value); end - sig { returns(String) } + sig { returns(T.nilable(String)) } def client_secret; end - sig { params(value: String).returns(String) } + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def client_secret=(value); end sig { returns(String) } diff --git a/rbi/workos/client.rbi b/rbi/workos/client.rbi index 8d3c58fd..89b45c73 100644 --- a/rbi/workos/client.rbi +++ b/rbi/workos/client.rbi @@ -15,6 +15,9 @@ module WorkOS sig { returns(WorkOS::Authorization) } def authorization; end + sig { returns(WorkOS::ClientApi) } + def client_api; end + sig { returns(WorkOS::SSO) } def sso; end @@ -42,6 +45,9 @@ module WorkOS sig { returns(WorkOS::ApiKeys) } def api_keys; end + sig { returns(WorkOS::PipesProvider) } + def pipes_provider; end + sig { returns(WorkOS::Groups) } def groups; end diff --git a/rbi/workos/client_api.rbi b/rbi/workos/client_api.rbi new file mode 100644 index 00000000..d2fa1d38 --- /dev/null +++ b/rbi/workos/client_api.rbi @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ClientApi + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + user_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::ClientApiTokenResponse) + end + def create_token(organization_id:, user_id:, request_options:); end + + end +end diff --git a/rbi/workos/client_api_token.rbi b/rbi/workos/client_api_token.rbi new file mode 100644 index 00000000..cedfdb4c --- /dev/null +++ b/rbi/workos/client_api_token.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ClientApiToken + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def user_id; end + + sig { params(value: String).returns(String) } + def user_id=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/client_api_token_response.rbi b/rbi/workos/client_api_token_response.rbi new file mode 100644 index 00000000..070764b5 --- /dev/null +++ b/rbi/workos/client_api_token_response.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ClientApiTokenResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def token; end + + sig { params(value: String).returns(String) } + def token=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/configure_data_integration_body.rbi b/rbi/workos/configure_data_integration_body.rbi new file mode 100644 index 00000000..011bb13d --- /dev/null +++ b/rbi/workos/configure_data_integration_body.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ConfigureDataIntegrationBody + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T.nilable(T::Boolean)) } + def enabled; end + + sig { params(value: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) } + def enabled=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(T.nilable(String)) } + def client_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_id=(value); end + + sig { returns(T.nilable(String)) } + def client_secret; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_secret=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/connected_account.rbi b/rbi/workos/connected_account.rbi index ccc12a54..2a184bae 100644 --- a/rbi/workos/connected_account.rbi +++ b/rbi/workos/connected_account.rbi @@ -39,6 +39,18 @@ module WorkOS sig { params(value: T::Array[String]).returns(T::Array[String]) } def scopes=(value); end + sig { returns(T.nilable(String)) } + def auth_method; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def auth_method=(value); end + + sig { returns(T.nilable(String)) } + def api_key_last_4; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def api_key_last_4=(value); end + sig { returns(String) } def state; end diff --git a/rbi/workos/create_group_role_assignment.rbi b/rbi/workos/create_group_role_assignment.rbi new file mode 100644 index 00000000..ea12255d --- /dev/null +++ b/rbi/workos/create_group_role_assignment.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class CreateGroupRoleAssignment + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def role_slug; end + + sig { params(value: String).returns(String) } + def role_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_configuration_list_response.rbi b/rbi/workos/data_integration_configuration_list_response.rbi new file mode 100644 index 00000000..93f3ce1f --- /dev/null +++ b/rbi/workos/data_integration_configuration_list_response.rbi @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationConfigurationListResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(T::Array[WorkOS::DataIntegrationConfigurationResponse]) } + def data; end + + sig { params(value: T::Array[WorkOS::DataIntegrationConfigurationResponse]).returns(T::Array[WorkOS::DataIntegrationConfigurationResponse]) } + def data=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_configuration_response.rbi b/rbi/workos/data_integration_configuration_response.rbi new file mode 100644 index 00000000..567b5ff5 --- /dev/null +++ b/rbi/workos/data_integration_configuration_response.rbi @@ -0,0 +1,78 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationConfigurationResponse + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def object; end + + sig { params(value: String).returns(String) } + def object=(value); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def organization_id; end + + sig { params(value: String).returns(String) } + def organization_id=(value); end + + sig { returns(String) } + def slug; end + + sig { params(value: String).returns(String) } + def slug=(value); end + + sig { returns(String) } + def name; end + + sig { params(value: String).returns(String) } + def name=(value); end + + sig { returns(T::Boolean) } + def enabled; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def enabled=(value); end + + sig { returns(T.nilable(T::Array[String])) } + def scopes; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def scopes=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T.nilable(WorkOS::DataIntegrationCredentials)) } + def credentials; end + + sig { params(value: T.nilable(WorkOS::DataIntegrationCredentials)).returns(T.nilable(WorkOS::DataIntegrationCredentials)) } + def credentials=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integration_credentials.rbi b/rbi/workos/data_integration_credentials.rbi new file mode 100644 index 00000000..4a978fc4 --- /dev/null +++ b/rbi/workos/data_integration_credentials.rbi @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DataIntegrationCredentials + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def credentials_type; end + + sig { params(value: String).returns(String) } + def credentials_type=(value); end + + sig { returns(T::Boolean) } + def has_credentials; end + + sig { params(value: T::Boolean).returns(T::Boolean) } + def has_credentials=(value); end + + sig { returns(T.nilable(String)) } + def client_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_id=(value); end + + sig { returns(T.nilable(String)) } + def client_secret_last_four; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def client_secret_last_four=(value); end + + sig { returns(String) } + def redirect_uri; end + + sig { params(value: String).returns(String) } + def redirect_uri=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/data_integrations_list_response_data.rbi b/rbi/workos/data_integrations_list_response_data.rbi index a796f906..4fd84d0f 100644 --- a/rbi/workos/data_integrations_list_response_data.rbi +++ b/rbi/workos/data_integrations_list_response_data.rbi @@ -57,6 +57,12 @@ module WorkOS sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } def scopes=(value); end + sig { returns(T.nilable(T::Array[String])) } + def auth_methods; end + + sig { params(value: T.nilable(T::Array[String])).returns(T.nilable(T::Array[String])) } + def auth_methods=(value); end + sig { returns(String) } def ownership; end diff --git a/rbi/workos/data_integrations_list_response_data_connected_account.rbi b/rbi/workos/data_integrations_list_response_data_connected_account.rbi index 9799b3b7..93dc06ec 100644 --- a/rbi/workos/data_integrations_list_response_data_connected_account.rbi +++ b/rbi/workos/data_integrations_list_response_data_connected_account.rbi @@ -39,6 +39,18 @@ module WorkOS sig { params(value: T::Array[String]).returns(T::Array[String]) } def scopes=(value); end + sig { returns(T.nilable(String)) } + def auth_method; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def auth_method=(value); end + + sig { returns(T.nilable(String)) } + def api_key_last_4; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def api_key_last_4=(value); end + sig { returns(String) } def state; end diff --git a/rbi/workos/delete_group_role_assignments_by_criteria.rbi b/rbi/workos/delete_group_role_assignments_by_criteria.rbi new file mode 100644 index 00000000..5795e954 --- /dev/null +++ b/rbi/workos/delete_group_role_assignments_by_criteria.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class DeleteGroupRoleAssignmentsByCriteria + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def role_slug; end + + sig { params(value: String).returns(String) } + def role_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_role_assignment.rbi b/rbi/workos/group_role_assignment.rbi new file mode 100644 index 00000000..1d8e524e --- /dev/null +++ b/rbi/workos/group_role_assignment.rbi @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupRoleAssignment + 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 group_id; end + + sig { params(value: String).returns(String) } + def group_id=(value); end + + sig { returns(WorkOS::SlimRole) } + def role; end + + sig { params(value: WorkOS::SlimRole).returns(WorkOS::SlimRole) } + def role=(value); end + + sig { returns(WorkOS::GroupRoleAssignmentResource) } + def resource; end + + sig { params(value: WorkOS::GroupRoleAssignmentResource).returns(WorkOS::GroupRoleAssignmentResource) } + def resource=(value); end + + sig { returns(String) } + def created_at; end + + sig { params(value: String).returns(String) } + def created_at=(value); end + + sig { returns(String) } + def updated_at; end + + sig { params(value: String).returns(String) } + def updated_at=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/group_role_assignment_resource.rbi b/rbi/workos/group_role_assignment_resource.rbi new file mode 100644 index 00000000..5f586498 --- /dev/null +++ b/rbi/workos/group_role_assignment_resource.rbi @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class GroupRoleAssignmentResource + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def id; end + + sig { params(value: String).returns(String) } + def id=(value); end + + sig { returns(String) } + def external_id; end + + sig { params(value: String).returns(String) } + def external_id=(value); end + + sig { returns(String) } + def resource_type_slug; end + + sig { params(value: String).returns(String) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/organization_membership_service.rbi b/rbi/workos/organization_membership_service.rbi index 5cb747e6..1ed9a5c6 100644 --- a/rbi/workos/organization_membership_service.rbi +++ b/rbi/workos/organization_membership_service.rbi @@ -43,7 +43,7 @@ module WorkOS statuses: T.nilable(T::Array[String]), user_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] - ).returns(T::Array[WorkOS::UserOrganizationMembership]) + ).returns(WorkOS::Types::ListStruct) end def list_organization_memberships(before:, after:, limit:, order:, organization_id:, statuses:, user_id:, request_options:); end diff --git a/rbi/workos/pipes.rbi b/rbi/workos/pipes.rbi index 3680c7f1..33e2eab3 100644 --- a/rbi/workos/pipes.rbi +++ b/rbi/workos/pipes.rbi @@ -22,13 +22,13 @@ module WorkOS sig do params( - slug: String, + provider: String, user_id: String, organization_id: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::DataIntegrationAccessTokenResponse) end - def create_data_integration_token(slug:, user_id:, organization_id:, request_options:); end + def get_access_token(provider:, user_id:, organization_id:, request_options:); end sig do params( diff --git a/rbi/workos/pipes_provider.rbi b/rbi/workos/pipes_provider.rbi new file mode 100644 index 00000000..a6dd69d8 --- /dev/null +++ b/rbi/workos/pipes_provider.rbi @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class PipesProvider + sig { params(client: WorkOS::BaseClient).void } + def initialize(client); end + + sig do + params( + organization_id: String, + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationConfigurationListResponse) + end + def list_organization_data_integration_configurations(organization_id:, request_options:); end + + sig do + params( + organization_id: String, + slug: String, + enabled: T.nilable(T::Boolean), + scopes: T.nilable(T::Array[String]), + client_id: T.nilable(String), + client_secret: T.nilable(String), + request_options: T::Hash[Symbol, T.untyped] + ).returns(WorkOS::DataIntegrationConfigurationResponse) + end + def update_organization_data_integration_configuration(organization_id:, slug:, enabled:, scopes:, client_id:, client_secret:, request_options:); end + + end +end diff --git a/rbi/workos/refresh_token_session_authenticate_request.rbi b/rbi/workos/refresh_token_session_authenticate_request.rbi index 596f2a3a..a641f823 100644 --- a/rbi/workos/refresh_token_session_authenticate_request.rbi +++ b/rbi/workos/refresh_token_session_authenticate_request.rbi @@ -15,10 +15,10 @@ module WorkOS sig { params(value: String).returns(String) } def client_id=(value); end - sig { returns(String) } + sig { returns(T.nilable(String)) } def client_secret; end - sig { params(value: String).returns(String) } + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } def client_secret=(value); end sig { returns(String) } diff --git a/rbi/workos/replace_group_role_assignment_entry.rbi b/rbi/workos/replace_group_role_assignment_entry.rbi new file mode 100644 index 00000000..eab3487d --- /dev/null +++ b/rbi/workos/replace_group_role_assignment_entry.rbi @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ReplaceGroupRoleAssignmentEntry + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(String) } + def role_slug; end + + sig { params(value: String).returns(String) } + def role_slug=(value); end + + sig { returns(T.nilable(String)) } + def resource_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_external_id; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_external_id=(value); end + + sig { returns(T.nilable(String)) } + def resource_type_slug; end + + sig { params(value: T.nilable(String)).returns(T.nilable(String)) } + def resource_type_slug=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/replace_group_role_assignments.rbi b/rbi/workos/replace_group_role_assignments.rbi new file mode 100644 index 00000000..17ad557d --- /dev/null +++ b/rbi/workos/replace_group_role_assignments.rbi @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +# typed: strong + +module WorkOS + class ReplaceGroupRoleAssignments + sig { params(json: T.any(String, T::Hash[Symbol, T.untyped])).void } + def initialize(json); end + + sig { returns(T::Array[WorkOS::ReplaceGroupRoleAssignmentEntry]) } + def role_assignments; end + + sig { params(value: T::Array[WorkOS::ReplaceGroupRoleAssignmentEntry]).returns(T::Array[WorkOS::ReplaceGroupRoleAssignmentEntry]) } + def role_assignments=(value); end + + sig { returns(T::Hash[Symbol, T.untyped]) } + def to_h; end + + sig { params(args: T.untyped).returns(String) } + def to_json(*args); end + end +end diff --git a/rbi/workos/user_management.rbi b/rbi/workos/user_management.rbi index 9f176e3a..1ff6cf63 100644 --- a/rbi/workos/user_management.rbi +++ b/rbi/workos/user_management.rbi @@ -48,9 +48,9 @@ module WorkOS sig do params( client_id: String, - client_secret: String, grant_type: String, code: String, + client_secret: T.nilable(String), code_verifier: T.nilable(String), invitation_token: T.nilable(String), ip_address: T.nilable(String), @@ -59,7 +59,7 @@ module WorkOS request_options: T::Hash[Symbol, T.untyped] ).returns(WorkOS::AuthenticateResponse) end - def create_authenticate(client_id:, client_secret:, grant_type:, code:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, request_options:); end + def create_authenticate(client_id:, grant_type:, code:, client_secret:, code_verifier:, invitation_token:, ip_address:, device_id:, user_agent:, request_options:); end sig do params( @@ -252,7 +252,7 @@ module WorkOS organization_id: T.nilable(String), email: T.nilable(String), request_options: T::Hash[Symbol, T.untyped] - ).returns(T::Array[WorkOS::UserInvite]) + ).returns(WorkOS::Types::ListStruct) end def list_invitations(before:, after:, limit:, order:, organization_id:, email:, request_options:); end diff --git a/test/workos/test_authorization.rb b/test/workos/test_authorization.rb index 3f074b6c..2c1cd2a2 100644 --- a/test/workos/test_authorization.rb +++ b/test/workos/test_authorization.rb @@ -11,6 +11,48 @@ def setup @client = WorkOS::Client.new(api_key: "sk_test_123") end + def test_list_group_role_assignments_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.list_group_role_assignments(group_id: "stub") + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_create_group_role_assignment_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.create_group_role_assignment(group_id: "stub", role_slug: "stub") + refute_nil result + end + + def test_update_group_role_assignments_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}) + .to_return(body: '{"data": [], "list_metadata": {}}', status: 200) + result = @client.authorization.update_group_role_assignments(group_id: "stub", role_assignments: [{}]) + assert_kind_of WorkOS::Types::ListStruct, result + end + + def test_delete_group_role_assignments_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_group_role_assignments(group_id: "stub", role_slug: "stub") + assert_nil result + end + + def test_get_group_role_assignment_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.get_group_role_assignment(group_id: "stub", role_assignment_id: "stub") + refute_nil result + end + + def test_delete_group_role_assignment_returns_expected_result + stub_request(:delete, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.authorization.delete_group_role_assignment(group_id: "stub", role_assignment_id: "stub") + assert_nil result + end + def test_check_returns_expected_result stub_request(:post, %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/check(\?|\z)}) .with(body: hash_including("permission_slug" => "stub", "resource_id" => "stub")) @@ -352,6 +394,12 @@ def test_delete_permission_returns_expected_result # Parameterized authentication error tests (one per endpoint). [ + {name: :list_group_role_assignments, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}, args: {group_id: "stub"}}, + {name: :create_group_role_assignment, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}, args: {group_id: "stub", role_slug: "stub"}}, + {name: :update_group_role_assignments, verb: :put, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}, args: {group_id: "stub", role_assignments: [{}]}}, + {name: :delete_group_role_assignments, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}, args: {group_id: "stub", role_slug: "stub"}}, + {name: :get_group_role_assignment, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments/stub(\?|\z)}, args: {group_id: "stub", role_assignment_id: "stub"}}, + {name: :delete_group_role_assignment, verb: :delete, url: %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments/stub(\?|\z)}, args: {group_id: "stub", role_assignment_id: "stub"}}, {name: :check, verb: :post, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/check(\?|\z)}, args: {organization_membership_id: "stub", permission_slug: "stub", resource_target: WorkOS::Authorization::ResourceTargetById.new(resource_id: "stub")}}, {name: :list_resources_for_membership, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources(\?|\z)}, args: {organization_membership_id: "stub", permission_slug: "stub", parent_resource: WorkOS::Authorization::ParentResourceById.new(parent_resource_id: "stub")}}, {name: :list_effective_permissions, verb: :get, url: %r{\Ahttps://api\.workos\.com/authorization/organization_memberships/stub/resources/stub/permissions(\?|\z)}, args: {organization_membership_id: "stub", resource_id: "stub"}}, diff --git a/test/workos/test_client_api.rb b/test/workos/test_client_api.rb new file mode 100644 index 00000000..a50ceb90 --- /dev/null +++ b/test/workos/test_client_api.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class ClientApiTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_create_token_returns_expected_result + stub_request(:post, %r{\Ahttps://api\.workos\.com/client/token(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.client_api.create_token(organization_id: "stub", user_id: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :create_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/client/token(\?|\z)}, args: {organization_id: "stub", user_id: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.client_api.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_model_round_trip.rb b/test/workos/test_model_round_trip.rb index 004281be..a05ca447 100644 --- a/test/workos/test_model_round_trip.rb +++ b/test/workos/test_model_round_trip.rb @@ -298,6 +298,58 @@ def test_check_authorization_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_create_group_role_assignment_round_trip + fixture = { + "role_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::CreateGroupRoleAssignment.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["role_slug"], json[:role_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_replace_group_role_assignment_entry_round_trip + fixture = { + "role_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::ReplaceGroupRoleAssignmentEntry.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["role_slug"], json[:role_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_replace_group_role_assignments_round_trip + fixture = { + "role_assignments" => [] + } + model = WorkOS::ReplaceGroupRoleAssignments.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_delete_group_role_assignments_by_criteria_round_trip + fixture = { + "role_slug" => "stub", + "resource_id" => "stub", + "resource_external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::DeleteGroupRoleAssignmentsByCriteria.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["role_slug"], json[:role_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_assign_role_round_trip fixture = { "role_slug" => "stub", @@ -881,6 +933,19 @@ def test_widget_session_token_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_client_api_token_round_trip + fixture = { + "organization_id" => "stub", + "user_id" => "stub" + } + model = WorkOS::ClientApiToken.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["user_id"], json[:user_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_token_query_round_trip fixture = { "client_id" => "stub", @@ -1489,6 +1554,26 @@ def test_slim_role_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_group_role_assignment_round_trip + fixture = { + "object" => "group_role_assignment", + "id" => "stub", + "group_id" => "stub", + "role" => {}, + "resource" => {}, + "created_at" => "stub", + "updated_at" => "stub" + } + model = WorkOS::GroupRoleAssignment.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["group_id"], json[:group_id] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_user_role_assignment_round_trip fixture = { "object" => "role_assignment", @@ -6241,6 +6326,74 @@ def test_audit_log_configuration_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_data_integration_credentials_round_trip + fixture = { + "credentials_type" => "stub", + "has_credentials" => true, + "client_id" => nil, + "client_secret_last_four" => nil, + "redirect_uri" => "stub" + } + model = WorkOS::DataIntegrationCredentials.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["has_credentials"], json[:has_credentials] + assert_nil json[:client_id] + assert_nil json[:client_secret_last_four] + assert_equal fixture["redirect_uri"], json[:redirect_uri] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integration_configuration_response_round_trip + fixture = { + "object" => "data_integration_configuration", + "id" => "stub", + "organization_id" => "stub", + "slug" => "stub", + "name" => "stub", + "enabled" => true, + "scopes" => nil, + "created_at" => "stub", + "updated_at" => "stub", + "credentials" => {} + } + model = WorkOS::DataIntegrationConfigurationResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["organization_id"], json[:organization_id] + assert_equal fixture["slug"], json[:slug] + assert_equal fixture["name"], json[:name] + assert_equal fixture["enabled"], json[:enabled] + assert_equal fixture["created_at"], json[:created_at] + assert_equal fixture["updated_at"], json[:updated_at] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + + def test_data_integration_configuration_list_response_round_trip + fixture = { + "object" => "list", + "data" => [] + } + model = WorkOS::DataIntegrationConfigurationListResponse.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_configure_data_integration_body_round_trip + fixture = { + "enabled" => true, + "scopes" => nil, + "client_id" => "stub", + "client_secret" => "stub" + } + model = WorkOS::ConfigureDataIntegrationBody.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_data_integration_authorize_url_response_round_trip fixture = { "url" => "stub" @@ -6271,6 +6424,8 @@ def test_connected_account_round_trip "user_id" => nil, "organization_id" => nil, "scopes" => [], + "auth_method" => "stub", + "api_key_last_4" => nil, "state" => "stub", "created_at" => "stub", "updated_at" => "stub" @@ -6674,6 +6829,17 @@ def test_widget_session_token_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_client_api_token_response_round_trip + fixture = { + "token" => "stub" + } + model = WorkOS::ClientApiTokenResponse.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["token"], json[:token] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_sso_authorize_url_response_round_trip fixture = { "url" => "stub" @@ -6880,6 +7046,7 @@ def test_data_integrations_list_response_data_round_trip "integration_type" => "stub", "credentials_type" => "stub", "scopes" => nil, + "auth_methods" => [], "ownership" => "stub", "created_at" => "stub", "updated_at" => "stub", @@ -7121,6 +7288,21 @@ def test_user_role_assignment_resource_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_group_role_assignment_resource_round_trip + fixture = { + "id" => "stub", + "external_id" => "stub", + "resource_type_slug" => "stub" + } + model = WorkOS::GroupRoleAssignmentResource.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["id"], json[:id] + assert_equal fixture["external_id"], json[:external_id] + assert_equal fixture["resource_type_slug"], json[:resource_type_slug] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_authentication_factor_sms_round_trip fixture = { "phone_number" => "stub" @@ -7319,18 +7501,6 @@ def test_data_integrations_get_data_integration_authorize_url_request_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_data_integrations_get_user_token_request_round_trip - fixture = { - "user_id" => "stub", - "organization_id" => "stub" - } - model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json) - json = model.to_h - assert_kind_of Hash, json - assert_equal fixture["user_id"], json[:user_id] - fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } - end - def test_feature_flag_round_trip fixture = { "object" => "feature_flag", @@ -7451,7 +7621,6 @@ def test_authorization_code_session_authenticate_request_round_trip json = model.to_h assert_kind_of Hash, json assert_equal fixture["client_id"], json[:client_id] - assert_equal fixture["client_secret"], json[:client_secret] assert_equal fixture["code"], json[:code] fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end @@ -7493,7 +7662,6 @@ def test_refresh_token_session_authenticate_request_round_trip json = model.to_h assert_kind_of Hash, json assert_equal fixture["client_id"], json[:client_id] - assert_equal fixture["client_secret"], json[:client_secret] assert_equal fixture["refresh_token"], json[:refresh_token] fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } end @@ -7777,6 +7945,18 @@ def test_user_sessions_impersonator_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_data_integrations_get_user_token_request_round_trip + fixture = { + "user_id" => "stub", + "organization_id" => nil + } + model = WorkOS::DataIntegrationsGetUserTokenRequest.new(fixture.to_json) + json = model.to_h + assert_kind_of Hash, json + assert_equal fixture["user_id"], json[:user_id] + fixture.each_key { |k| assert json.key?(k.to_sym) || json.key?(k), "Expected to_h to include key #{k}" } + end + def test_directory_metadata_user_round_trip fixture = { "active" => 1, @@ -7797,6 +7977,8 @@ def test_data_integrations_list_response_data_connected_account_round_trip "user_id" => nil, "organization_id" => nil, "scopes" => [], + "auth_method" => "stub", + "api_key_last_4" => nil, "state" => "stub", "created_at" => "stub", "updated_at" => "stub", diff --git a/test/workos/test_pipes.rb b/test/workos/test_pipes.rb index a085fc40..d49ff6b3 100644 --- a/test/workos/test_pipes.rb +++ b/test/workos/test_pipes.rb @@ -18,10 +18,10 @@ def test_authorize_data_integration_returns_expected_result refute_nil result end - def test_create_data_integration_token_returns_expected_result + def test_get_access_token_returns_expected_result stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}) .to_return(body: "{}", status: 200) - result = @client.pipes.create_data_integration_token(slug: "stub", user_id: "stub") + result = @client.pipes.get_access_token(provider: "stub", user_id: "stub") refute_nil result end @@ -49,7 +49,7 @@ def test_list_user_data_providers_returns_expected_result # Parameterized authentication error tests (one per endpoint). [ {name: :authorize_data_integration, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/authorize(\?|\z)}, args: {slug: "stub", user_id: "stub"}}, - {name: :create_data_integration_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {slug: "stub", user_id: "stub"}}, + {name: :get_access_token, verb: :post, url: %r{\Ahttps://api\.workos\.com/data-integrations/stub/token(\?|\z)}, args: {provider: "stub", user_id: "stub"}}, {name: :get_user_connected_account, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}}, {name: :delete_user_connected_account, verb: :delete, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/connected_accounts/stub(\?|\z)}, args: {user_id: "stub", slug: "stub"}}, {name: :list_user_data_providers, verb: :get, url: %r{\Ahttps://api\.workos\.com/user_management/users/stub/data_providers(\?|\z)}, args: {user_id: "stub"}} diff --git a/test/workos/test_pipes_provider.rb b/test/workos/test_pipes_provider.rb new file mode 100644 index 00000000..2af42859 --- /dev/null +++ b/test/workos/test_pipes_provider.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# This file is auto-generated by oagen. Do not edit. + +require "test_helper" + +class PipesProviderTest < Minitest::Test + include FixtureHelper + + def setup + @client = WorkOS::Client.new(api_key: "sk_test_123") + end + + def test_list_organization_data_integration_configurations_returns_expected_result + stub_request(:get, %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes_provider.list_organization_data_integration_configurations(organization_id: "stub") + refute_nil result + end + + def test_update_organization_data_integration_configuration_returns_expected_result + stub_request(:put, %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations/stub(\?|\z)}) + .to_return(body: "{}", status: 200) + result = @client.pipes_provider.update_organization_data_integration_configuration(organization_id: "stub", slug: "stub") + refute_nil result + end + + # Parameterized authentication error tests (one per endpoint). + [ + {name: :list_organization_data_integration_configurations, verb: :get, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations(\?|\z)}, args: {organization_id: "stub"}}, + {name: :update_organization_data_integration_configuration, verb: :put, url: %r{\Ahttps://api\.workos\.com/organizations/stub/data_integration_configurations/stub(\?|\z)}, args: {organization_id: "stub", slug: "stub"}} + ].each do |spec| + define_method("test_#{spec[:name]}_raises_authentication_error_on_401") do + stub_request(spec[:verb], spec[:url]) + .to_return(body: '{"message": "Unauthorized"}', status: 401) + assert_raises(WorkOS::AuthenticationError) do + @client.pipes_provider.send(spec[:name], **(spec[:args] || {})) + end + end + end +end diff --git a/test/workos/test_user_management.rb b/test/workos/test_user_management.rb index f56fd14e..2b2ae805 100644 --- a/test/workos/test_user_management.rb +++ b/test/workos/test_user_management.rb @@ -21,7 +21,7 @@ def test_get_jwks_returns_expected_result def test_create_authenticate_returns_expected_result stub_request(:post, %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}) .to_return(body: "{}", status: 200) - result = @client.user_management.create_authenticate(client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub") + result = @client.user_management.create_authenticate(client_id: "stub", grant_type: "authorization_code", code: "stub") refute_nil result end @@ -411,7 +411,7 @@ def test_create_user_api_key_returns_expected_result # Parameterized authentication error tests (one per endpoint). [ {name: :get_jwks, verb: :get, url: %r{\Ahttps://api\.workos\.com/sso/jwks/stub(\?|\z)}, args: {client_id: "stub"}}, - {name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", client_secret: "stub", grant_type: "authorization_code", code: "stub"}}, + {name: :create_authenticate, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authenticate(\?|\z)}, args: {client_id: "stub", grant_type: "authorization_code", code: "stub"}}, {name: :create_device, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/authorize/device(\?|\z)}, args: {client_id: "stub"}}, {name: :revoke_session, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/sessions/revoke(\?|\z)}, args: {session_id: "stub"}}, {name: :create_cors_origin, verb: :post, url: %r{\Ahttps://api\.workos\.com/user_management/cors_origins(\?|\z)}, args: {origin: "stub"}},